[MPlayer-users] Screenshot color wrong

The Wanderer wanderer at fastmail.fm
Fri Sep 4 03:29:48 EEST 2020


On 2020-09-03 at 10:16, polyphem at gmail.com wrote:

> After some further testing it seems like not the magic but the 
> messing-up is done here:
> 
> [swscaler @ 00000000025fbdc0]bicubic scaler, from yuv420p to rgb24 using 
> MMXEXT
> [swscaler @ 00000000025fbdc0]using unscaled yuv420p -> rgb24 special 
> converter
> 
> When I leave the -vf screenshot out, those two lines are not in the output
> 
> "mplayer.exe test.mp4" results in (cut output):
> Starting playback...
> Movie-Aspect is 0.74:1 - prescaling to correct movie aspect.
> VO: [direct3d] 1014x1376 => 1014x1376 Planar YV12
> 
> 
> "mplayer.exe -vf screenshot test.mp4" results in (cut output):
> Starting playback...
> Movie-Aspect is 0.74:1 - prescaling to correct movie aspect.
> [swscaler @ 0000000001f4bdc0]bicubic scaler, from yuv420p to rgb24 using 
> MMXEXT
> [swscaler @ 0000000001f4bdc0]using unscaled yuv420p -> rgb24 special 
> converter
> VO: [direct3d] 1014x1376 => 1014x1376 Planar YV12
> 
> 
> For both output on the screen looks good, only the colors in the 
> screenshot are red-shifted.
> 
> It seems as if the screenshot filter automatically triggers the scale 
> filter too, which performs an unwanted "YUV<−>RGB colorspace conversion".
> 
> Is there a possibility to switch this conversion/scaling off? Could not 
> find anything in docs or on the net.

I doubt it.

My guess is that the automatic insertion of this filter is the way in
which the "screenshot" filter is able to "accept[] an arbitrary
colorspace", as described in its entry in the man page: if the input
isn't already in the correct form for what the filter can handle
internally (i.e., apparently, rgb24), "screenshot" will automatically
call "scale" to convert it into that format.

That said, as far as I'm aware the result of that automatic scaling is
supposed to be visually identical to the input. If it's not, then unless
something else in your environment is causing the effective difference
(e.g. by handling the different colorspace differently - display color
profiles, maybe?), I'd expect that to be considered a bug.

What I'd suggest to try, in pursuit of a possible workaround, would be
manually inserting '-vf format=rgb24,scale=-1:-1' (which appears to
perform the same no-size-change-involved conversion) into your playback
command, and if that produces the same color shift, play around with
other options to see if you can find a combination that leaves the end
result after the scale filter looking how you want.

If you can manage that, then replacing the 'format=rgb24,scale=-1:-1'
with 'screenshot' should I think produce screenshots that match what you
saw with the explicit scale filter command.

I can't really test it myself, since on a random sample MP4 I happen to
have lying around, the screenshots match identically with the result of
playing the video normally and pausing at the same point.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20200903/b56556eb/attachment.sig>


More information about the MPlayer-users mailing list