是否有任何方法在Ubuntu中使用MP4Box实现整个视频的自动分割成相等的块,因为我们使用FFMPEG通过指定以下段来获得相同的结果
ffmpeg -i input.mp4 -c copy -map 0 -segment_time 8 -f segment output%03d.mp4
发布于 2015-04-30 09:18:48
对于MP4Box有两个类似的参数。
可以使用wc -c /path/to/file或stat -c %s /path/to/file获取特定文件的文件大小。
-split参数的MP4Box允许您将文件分割成特定的段。
-split time_in_seconds在所需最大持续时间的文件中拆分。
-splits size_in_kilobytes在所需最大大小的文件中拆分。
因此,要将文件分割成15分钟的片段,命令是MP4Box -split 900 filename.mp4
因此,如果您总是希望将视频分割成5部分,按文件大小计算
首先,如上面所述,使用wc或stat获取文件大小,然后将该大小除以5,然后使用MP4Box -splits filesize path/to/file
但是如果你想在一定的时间内分割视频:
使用ffprobe -i some_video -show_entries format=duration -v quiet -of csv="p=0"获取视频的持续时间(秒),
把总长度除以每段要花费多少秒,瞧!使用MP4Box -split amountOfSeconds path/to/file
https://stackoverflow.com/questions/29962043
复制相似问题