[FFmpeg-user] Apply format with overlay and -ss in front of inputfile is strange?

Carl Eugen Hoyos cehoyos at ag.or.at
Mon Jul 13 22:51:28 CEST 2015

Nicolas George <george <at> nsup.org> writes:

> Le quintidi 25 messidor, an CCXXIII, Carl Eugen Hoyos a écrit :
> > I can confirm that there may be an issue 
> > but it is not overlay-related:
> > $ ffmpeg -i input -vf 
> > "split[x][z];[x]format=gray[x1];[x1]nullsink" 
> > -strict -2 -vcodec jpeg2000 -ss 1 out1.avi
> > 
> > $ ffmpeg -ss 1 -i input -vf 
> > "split[x][z];[x]format=gray[x1];[x1]nullsink" 
> > -strict -2 -vcodec jpeg2000 out2.avi
> If the issue is that the output is converted to 
> gray too, then this is the expected behaviour.

In the first case (without "seeking") one "stream" 
(this is not the right term I fear) is converted 
the other one is left unchanged.
In the second case (with seeking) both streams 
are converted to gray.

While I understand that the filterchain may not 
be unambiguous, it looks identical in both cases.

Note that the following command produces gray 
output in yuv420p, it appears that two scale 
filters instead of the optimal one filter is 
$ ffmpeg -ss 1 -i input -vf
-strict -2 -vcodec jpeg2000 out2.avi


> For the rare cases where it does matter, for 
> example to be sure to deinterlace before 
> converting, you need to insert the scale filter
> explicitly at the point you want the format 
> conversion.

Which is in front of the format filter iiuc.

> In this particular case, my guess is that 
> libavfilter decided to insert the scale filter 
> before split. Insert explicitly after split 
> and it should work as expected.

It does, yes.

Thank you for the explanation, Carl Eugen

More information about the ffmpeg-user mailing list