Re: Split a video file in two by size and merge itback

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Split a video file in two by size and merge itback

Dave Stevens




On Wednesday 16/10/2019 at 6:35 pm, Julien Dotsev  wrote:

> Hi,
> But with usplit command the chunks won't be playable i think. M'i
> right?
>
>
> yes quite likely, what else would you like to preserve with the split?
>
>
> d
>
> On Thu, 17 Oct 2019, 03:26 , <[hidden email]> wrote:
>
>
>>
>>
>>
>>
>>
>> On Wednesday 16/10/2019 at 5:10 pm, Julien Dotsev  wrote:
>>>
>>> Hi,
>>> Is it possible to split a video in two by size and merge it back to
>>> the
>>> original file? Can that merged file be exactly the same as the
>>> original one?
>>>
>>> Julien
>>>
>>>
>>> there's this: https://www.computerhope.com/unix/usplit.htm
>>>
>>>
>>> d
>>> _______________________________________________
>>> ffmpeg-user mailing list
>>> [hidden email]
>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>>
>>> To unsubscribe, visit link above, or email
>>> [hidden email] with subject "unsubscribe".
>>>
>>
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Split a video file in two by size and merge itback

Julien Dotsev
Actually every bit. I want to be able to bring back the original file
unchanged up to every bit. But every chunk playable.

On Thu, 17 Oct 2019, 03:42 , <[hidden email]> wrote:

>
>
>
>
> On Wednesday 16/10/2019 at 6:35 pm, Julien Dotsev  wrote:
> > Hi,
> > But with usplit command the chunks won't be playable i think. M'i
> > right?
> >
> >
> > yes quite likely, what else would you like to preserve with the split?
> >
> >
> > d
> >
> > On Thu, 17 Oct 2019, 03:26 , <[hidden email]> wrote:
> >
> >
> >>
> >>
> >>
> >>
> >>
> >> On Wednesday 16/10/2019 at 5:10 pm, Julien Dotsev  wrote:
> >>>
> >>> Hi,
> >>> Is it possible to split a video in two by size and merge it back to
> >>> the
> >>> original file? Can that merged file be exactly the same as the
> >>> original one?
> >>>
> >>> Julien
> >>>
> >>>
> >>> there's this: https://www.computerhope.com/unix/usplit.htm
> >>>
> >>>
> >>> d
> >>> _______________________________________________
> >>> ffmpeg-user mailing list
> >>> [hidden email]
> >>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >>>
> >>> To unsubscribe, visit link above, or email
> >>> [hidden email] with subject "unsubscribe".
> >>>
> >>
> >> _______________________________________________
> >> ffmpeg-user mailing list
> >> [hidden email]
> >> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >>
> >> To unsubscribe, visit link above, or email
> >> [hidden email] with subject "unsubscribe".
> > _______________________________________________
> > ffmpeg-user mailing list
> > [hidden email]
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> > To unsubscribe, visit link above, or email
> > [hidden email] with subject "unsubscribe".
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Split a video file in two by size and merge itback

Moritz Barsnick
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
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Split a video file in two by size and merge itback

Julien Dotsev
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, <[hidden email]> 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
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Split a video file in two by size and merge itback

Julien Dotsev
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 <[hidden email]> написа:

> 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, <[hidden email]> 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
>> [hidden email]
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
>
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Split a video file in two by size and merge itback

Moritz Barsnick
On Sun, Oct 20, 2019 at 23:40:20 +0200, Julien Dotsev wrote:
> 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?

This means you are actually not splitting (because that can't easily be
done with actual MP4 containers), but remuxing. ffmpeg can't exactly
reconstruct the original container, as explained in my response in the
other thread.

As Carl Eugen worte: Always when describing such as issue, please
remember to show us the actual command line you used, and the command's
complete, uncut console output.

Thanks,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Split a video file in two by size and merge itback

Julien Dotsev
Yes thanks again Moritz. I will do that next time.
Julien

On Mon, 21 Oct 2019, 10:01 Moritz Barsnick, <[hidden email]> wrote:

> On Sun, Oct 20, 2019 at 23:40:20 +0200, Julien Dotsev wrote:
> > 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?
>
> This means you are actually not splitting (because that can't easily be
> done with actual MP4 containers), but remuxing. ffmpeg can't exactly
> reconstruct the original container, as explained in my response in the
> other thread.
>
> As Carl Eugen worte: Always when describing such as issue, please
> remember to show us the actual command line you used, and the command's
> complete, uncut console output.
>
> Thanks,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".