【发布时间】:2021-02-07 13:22:02
【问题描述】:
我正在尝试将 MP3 文件转换为片段的 MP4,如下所示:
ffmpeg -i input.mp3 -strict experimental -acodec aac -b:a 256k -f mp4 \
-movflags faststart+frag_keyframe+empty_moov+separate_moof output.mp4
但是,使用Bento4 我可以看到只有一个 巨型mdat 对象,而不是一系列对象:
[ftyp] size=8+24
major_brand = isom
minor_version = 200
compatible_brand = isom
compatible_brand = iso2
compatible_brand = iso6
compatible_brand = mp41
[moov] size=8+701
...
[moof] size=8+62364
...
[mdat] size=8+5794679
[mfra] size=8+59
[tfra] size=12+31, version=1
track_ID = 1
length_size_of_traf_num = 0
length_size_of_trun_num = 0
length_size_of_sample_num = 0
[mfro] size=12+4
mfra_size = 67
我想我想要的是这样的:
(source)
但我似乎无法从 ffmpeg 获得此信息。
我发现了一些其他选项here 喜欢
$ ffmpeg -h muxer=ismv
...
-frag_duration <int> E.... Maximum fragment duration
-min_frag_duration <int> E.... Minimum fragment duration
-frag_size <int> E.... Maximum fragment size
但是玩弄这些并没有改变输出。
如何创建特定 sice 的片段,例如每次约 5 秒?
【问题讨论】: