Truncated file with ffmpeg but resulting output is x2 bigger!?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Truncated file with ffmpeg but resulting output is x2 bigger!?

FFmpeg-users mailing list
People,

I truncated a 14s file with:

   ffmpeg -i 20201016_055828.mp4 -t 00:00:09 -async 1 cut.mp4

and although about 35% of the frames were removed, the resulting mp4 was
double the size - why is this?  I did a before and after mediainfo
comparison - see here:

   http://pricom.com.au/Diff.html

and the only things that jump out at me are:

   Format settings                          : CABAC / 4 Ref Frames
   Format settings, Reference frames        : 4 frame

ie changed from 1 to 4 . . but is that the explanation?

I am using:

   ffmpeg-4.2.4-1.fc31.x86_64

Thanks,

Phil.
--
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  [hidden email]
_______________________________________________
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: Truncated file with ffmpeg but resulting output is x2 bigger!?

Moritz Barsnick
On Fri, Oct 16, 2020 at 20:26:16 +1100, FFmpeg user discussions wrote:
> I truncated a 14s file with:
>
>    ffmpeg -i 20201016_055828.mp4 -t 00:00:09 -async 1 cut.mp4
>
> and although about 35% of the frames were removed, the resulting mp4 was
> double the size - why is this?

You are reencoding the streams inside the file. ffmpeg's default
encoding parameters apparently result in streams with more bandwidth.
You can fine-tune the encoding parameters, of course.

Re-encoding is not a good idea, as it always loses quality. If you just
want to "clip", be sure to use the "copy" codec:

$ ffmpeg -i 20201016_055828.mp4 -t 00:00:09 -c copy cut.mp4

(Note that cutting without re-encoding may or may not be exact. Feel
free to test first though.)

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: Truncated file with ffmpeg but resulting output is x2 bigger!?

FFmpeg-users mailing list
In reply to this post by FFmpeg-users mailing list
Moritz,


On Fri Oct 16 13:51:11 EEST 2020, FFmpeg user discussions wrote:

> On Fri, Oct 16, 2020 at 20:26:16 +1100, FFmpeg user discussions wrote:
>> People,
>>
>> I truncated a 14s file with:
>>
>>   ffmpeg -i 20201016_055828.mp4 -t 00:00:09 -async 1 cut.mp4
>>
>> and although about 35% of the frames were removed, the resulting mp4
>> was double the size - why is this?  I did a before and after mediainfo
>> comparison - see here:
>>
>>   http://pricom.com.au/Diff.html
>>
>> and the only things that jump out at me are:
>>
>>   Format settings                          : CABAC / 4 Ref Frames
>>   Format settings, Reference frames        : 4 frame
>>
>> ie changed from 1 to 4 . . but is that the explanation?
>>
>> I am using:
>>
>>   ffmpeg-4.2.4-1.fc31.x86_64
>>
>> Thanks,
>>
>> Phil.
>
> You are reencoding the streams inside the file. ffmpeg's default
> encoding parameters apparently result in streams with more bandwidth.
> You can fine-tune the encoding parameters, of course.
>
> Re-encoding is not a good idea, as it always loses quality. If you just
> want to "clip", be sure to use the "copy" codec:
>
> $ ffmpeg -i 20201016_055828.mp4 -t 00:00:09 -c copy cut.mp4
>
> (Note that cutting without re-encoding may or may not be exact. Feel
> free to test first though.)


Ah! . . of course . .

Thanks!

Phil.
--
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  [hidden email]
_______________________________________________
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".