Search code examples
linuxbashffmpegflvmencoder

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


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.


Solution

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