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

Peter White peter.white at posteo.net
Sat Mar 27 18:46:08 EET 2021

On Sat, Mar 27, 2021 at 05:18:18PM +0100, Bo Berglund wrote:
> On Sat, 27 Mar 2021 10:06:03 +0100, Peter White <peter.white at posteo.net> wrote:
> >> But it all looks the same with the time incrementing at exactly 5 seconds...
> >
> >Looks like someone took extra care to have a static keyframe interval.
> >One can do that. With default codec options x264 won't produce such
> >output though.
> >
> The source is using a youtube URL for the streaming video and I use either
> youtube-dl or ffmpeg directly to get it in my scripts.
> Is the fact that the times are so exact indication of recoding by Youtube, or is
> the source like that?

I believe this has to do with multi-bitrate streaming. I have recently
read some guidelines about preparing videos for that. One recommendation
is to use rather small GOP (group of pictures) sizes, thus small
keyframe intervals. Some go as far as recommending static GOP sizes.
>From my understanding it is not a hard requirement. Like cutting, one
can only switch to a different stream, from 720p to 1080p, on a
keyframe, hence above recommendation for short intervals.

> I really have no idea how Youtube video streaming works, I just use YouTube if
> that is the source...
> And I have never published any video on Youtube so I don't know the process.

Then you need not bother with keyframe intervals. Let the codec make the
decisions, which gives a rather good tradeoff between seekability
(keyframe interval) and size. The more unnecessary keyframes there are,
maybe even at fixed intervals, the more wasteful is the result, as in
bigger than necessary.


More information about the ffmpeg-user mailing list