[FFmpeg-user] Split a video file in two by size and merge itback

Julien Dotsev j.docev at gmail.com
Mon Oct 21 00:40:20 EEST 2019


Yes, the ts file works exactly as you said. It can be split and every part
is readable. But As I said I want to be able to keep the original file. So
if it is mp4 for example and I converted to mpeg-ts, when I reconvert it
back there is a file size increase. Is there a way to avoid that?

Julien

На чт, 17.10.2019 г. в 13:26 ч. Julien Dotsev <j.docev at gmail.com> написа:

> Hey Moritz,
> That's great advice!
> I will definitely try it.
>
> Thank you very much!
> Julien
>
>
> On Thu, 17 Oct 2019, 12:14 Moritz Barsnick, <barsnick at gmx.net> wrote:
>
>> On Thu, Oct 17, 2019 at 03:44:49 +0200, Julien Dotsev wrote:
>> > Actually every bit. I want to be able to bring back the original file
>> > unchanged up to every bit. But every chunk playable.
>>
>> If you want not only the content (i.e. the stream), but also everything
>> else including the container to be identical, I believe the best
>> (perhaps only) choice is to use MPEG-TS as a container.
>>
>> In theory, you should be able to split MPEG-TS files at arbitrary
>> bytes. I have bad experiences with that, but it works great at packet
>> boarders, meaning your segments need to be exact multiples of 188
>> bytes. This works great for all my players (ffplay, mplayer, mpv, VLC,
>> and my Set Top Box), and the binary splits can of course just be
>> reassembled to create the original file.
>>
>> I often cut my files on Linux with dd:
>>
>> $ dd if=input.ts bs=188 skip=10325 count=11877 of=output.ts
>>
>> but for equally sized files, you would use "split", e.g.:
>>
>> $ split --bytes=$((188 * 11877)) -d input.ts output.ts.
>>
>> Cheers,
>> Moritz
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>
>


More information about the ffmpeg-user mailing list