Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

播放相机视频(H.265) #79

Open
zhujiarun opened this issue Sep 2, 2021 · 0 comments
Open

播放相机视频(H.265) #79

zhujiarun opened this issue Sep 2, 2021 · 0 comments

Comments

@zhujiarun
Copy link

相机视频格式调成了H.265,并且将rtsp转成http(rtsp->rtmp->http)。然后就放不出视频。下面是我写的代码,不知道哪里出问题了
这是自己创建的rtmp的name
rtspLoad:是一个uuid
let rtmpName = rtmp://${this.nginxIp}:1935/cloubox_07/${rtspLoad};
然后用fluent-ffmpeg启动ffmpeg
//启动ffmpeg
startFfmpeg(camera_rtsp, rtmpName) {
try {
return new Promise((resolve, reject) => {
let command = ffmpeg();
command.input(camera_rtsp);
command.inputOptions("-stimeout 5000000");
command.inputOptions("-rtsp_transport tcp");
command.outputOptions("-max_muxing_queue_size 1024");
command.audioCodec('aac');
command.videoCodec("copy");
command.on("start", () => {});
command.on("codecData", () => {resolve(1);});
command.on("error", (err) => {reject(err); });
command.on('end', (stdout, stderr) => { });
command.format("flv");
command.save(rtmpName);
});
} catch (error) {
Logger.error("start ffmpeg failed!!!!",new Error(error));
}
}
最后用上方的rtspLoad构建一个http
httpName = http://${this.nginxIp}:${key}/stream?port=1935&app=cloubox_07&stream=${rtspLoad};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant