【发布时间】:2017-11-17 06:43:08
【问题描述】:
我想录制视频会议。我可以从视频会议服务器接收 rtp 媒体。我想为实时流输出分段的 mp4 文件格式。那么,如何使用 Bento4 以编程方式编写一个碎片化的 mp4 文件呢?
【问题讨论】:
我想录制视频会议。我可以从视频会议服务器接收 rtp 媒体。我想为实时流输出分段的 mp4 文件格式。那么,如何使用 Bento4 以编程方式编写一个碎片化的 mp4 文件呢?
【问题讨论】:
MP4Box 支持 DASH。我提供以下简单示例:
MP4Box -dash 4000 -frag 4000 -rap -segment-name test_input.mp4
'-dash 4000' to segment the input mp4 file into 4000ms chunks
'-frag 4000' since frag = dash, actually segments are not fragmented further.
'-rap' to enforce each segment to start random access points, i.e. at keyframes. In such case the segment duration may differ from 4000ms depending on distribution of key frames.
'-segment-name' to specify the pattern of segments names. So in this case, the segments will be named like this: test_1.m4s, test_2.m4s, ...
【讨论】: