[FFmpeg-user] Better way to cut parts out of a long video?

Cecil Westerhof Cecil at decebal.nl
Mon Jun 13 18:39:51 EEST 2022

Rob Hallam <ffmpeg at roberthallam.com> writes:

> On Mon, 13 Jun 2022 at 11:26, Cecil Westerhof via ffmpeg-user
> <ffmpeg-user at ffmpeg.org> wrote:
>> That could very seldom work, but is certainly not a general solution.
>> In the past I was told to do it like this because it was faster. Then
>> I got problems with the output and was told how iframes work.
> What problems, exactly? Do they still occur with modern versions of
> ffmpeg, and with the inputs and outputs you are using?

It seems not anymore. All three files are correct and the chance that
they where all three on an iframe is quite small. So I think problem
solved. :-D
The sizes are a bit different, but I do not see any difference.

I am now using this function:
    function doConvert {
        echo "Convert $1 to $2"
        time nice -n 19 ionice -c3 \
          ffmpeg -y -ss $3 -i $1 -to $(($4 - $3)) \
                 -vcodec libx264 -crf 26          \
                 -acodec libmp3lame -qscale:a 9   \
                 -preset veryfast $2

And it takes about 1/20 of the time. I am happy.

Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

More information about the ffmpeg-user mailing list