How to split flv file by size using FFmpeg or mencoder or smth else?

爱⌒轻易说出口 提交于 2020-01-11 11:53:08

问题


I need to split an flv file into chunks of the known size on linux server. For example my original file is 9Mb and the chunk size is 4Mb. So I should get 3 parts - 4Mb, 4Mb and 1 Mb.

Seems that FFmpeg can split only by time.

Mencoder can start by time (-ss TIME) and finish by size ( -endpos SIZE MB). But if start second of the first chunk is obviously 0, then how can I get start second for next chunks?

Do you have any suggestions?

Thanks in advance.


回答1:


calculate ~time (sec) of every block & use -ss X -t X+avg_block_time for split video




回答2:


There is a commandline utility which does just that: http://mpgtx.sourceforge.net/

mpgtx -3 movie.mpg -b mysplit

will split the movie into 3 chunks with the names mysplit-1.mpg, mysplit-2.mpg, mysplit-3.mpg

That said, I seem to have trouble with the audio when I use this - but I don't know if you'd have that problem too.



来源:https://stackoverflow.com/questions/1045430/how-to-split-flv-file-by-size-using-ffmpeg-or-mencoder-or-smth-else

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!