大网数据广告活动
服务器运维问答

How to save stream in mp4 format?

· 52CE 我爱测

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…

问题原文

原帖链接 · 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"

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-02-10)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。