问题原文
原帖链接 · Mike Bohoslavskyi · CC BY-SA 3.0
By default nginx rtmp module records video stream in .flv format if record option is enabled, but I need .mp4
I found that video can be converted to .mp4 when record has finished with exec_record_done callback and ffmpeg
Is there any way to record video in .mp4 format or at least convert it to this format on the fly?
已采纳解答
原帖链接 · Net Runner · CC BY-SA 3.0
As far as I know you can't do it on fly.
On the other hand, you can just resave it in mp4.
You can try to use directly ffmpeg as it supports output https://www.ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-ssegment
Some sort of this, might go:
ffmpeg -i rtsp://admin:[email omitted]:554/ch1-s1 -c copy -map 0 -f segment -segment_time 600 -segment_format mp4 "out%03d.mp4"
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
