[FFmpeg-user] Cutting out part of a video does not work

Cecil Westerhof Cecil at decebal.nl
Sat Mar 27 06:53:56 EET 2021

Peter White <peter.white at posteo.net> writes:

> On Fri, Mar 26, 2021 at 07:02:13PM +0100, Cecil Westerhof via ffmpeg-user wrote:
>> Carl Zwanzig <cpz at tuunq.com> writes:
>> > On 3/26/2021 9:28 AM, Cecil Westerhof via ffmpeg-user wrote:
>> >> There is only one problem. The video is 7:21 long, but both mpv and
>> >> vlc think it is 7:30 long.
>> >
>> > IME, the metadata length often lies. When you say it's 7:21, is that
>> > exactly how long it plays for or how long it ought to be?
>> I almost never have this. (If I remember well, only with videos
>> created with ffmpeg. Sometimes it started on a negative timestamp
>> instead of 00:00:00.)
>> Looking at the -to you would expect 7:22, but when I just play it, it
>> ends at 7:21.
> You can try using -to as an input option as well. I am not sure, but I
> seem to remember having similar problems once. Also, have a look at -t
> for defining the length of the file as opposed to cutting on time code.

That is what I did first. Then I got 1:34:19 (or something like it).
So even worse.

> Plus, from your original post it looks like there is some additional
> "data" stream in there, which might get copied. Sometime ffmpeg needs to
> wait for that to finish or an opportune position to stop. Maybe that is
> the culprit here. Have a look into the -map option, i.e. -map V -map a
> should only give you video and audio but drop everything else.

I will look into that.

>> >> ffprobe version 4.1.6-1~deb10u1 Copyright (c) 2007-2020 the FFmpeg developers
>> >
>> > That's an older version, even though it wouldn't help on this, it's
>> > always best to check with as current as you can get.
>> I am using Debian (stable). That always uses older versions.
>> I could look if there is a newer version in backports.
> You can compile it yourself as well. It is not that difficult. Might
> need to hunt down some libraries, but that is basically just looking at
> the error messages of configure and finding the appropriate packages.
> Also, config.log and apt-file can help a great deal.

I will look into that also.

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

More information about the ffmpeg-user mailing list