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

when ffmpeg Event use 'end' cannot be monitor rtsp URL,only the fs local video file end stream event? #1315

Open
fengjiewen1997 opened this issue Dec 16, 2024 · 1 comment

Comments

@fengjiewen1997
Copy link

const ffmpegCommand = ffmpeg(url)
.addInputOption("-rtsp_transport", "tcp")
.addInputOption("-analyzeduration", "50000", "-max_delay", "500000")
.addInputOption("-fflags", "nobuffer")
.addInputOption("-flags", "low_delay")
.on("start", () => {
console.log("Stream started.");
logger.info("Stream started.");
})
.on("codecData", (data) => {
console.log("Stream codecData:", data);
logger.info(Stream codecData: ${JSON.stringify(data)});
})
.on("stderr", (stderrLine) => {
console.error("FFmpeg stderr:", stderrLine);
logger.error(FFmpeg stderr: ${stderrLine});
// setTimeout(()=>{
// stream.end();
// },33000)
})
.on("error", (err) => {
console.error("An error occurred:", err.message);
logger.error(An error occurred: ${err.message});
stream.end();
})
.on("end", (stdout, stderr) => {
console.log("Stream ended.",stdout);
logger.info("Stream ended.");
stream.end();
})
.outputFormat("flv")
.videoCodec("copy") // 这里使用 copy 以支持原始编码(H264 或 H265)
.noAudio()
// .withDuration(33)
.pipe(stream, { end: true })

When I want to transcode an rtsp playback stream address, I cannot listen for the end event, only the fs local video file end stream event

@fengjiewen1997
Copy link
Author

ffmpeg(url) url is rtsp://xxxxxx./?starttime=20241216T103616Z&endtime=20241216T103646Z is not listen on 'end' stream,only listen the fs local video file?

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