[MPlayer-users] How to force a special color space converter during encoding

Daniel Lobo dnlobo at gmail.com
Mon Apr 20 10:54:36 CEST 2009


I managed to force the color space conversions. Using:

mencoder -vc rawbgr24flip -vf scale,format=bgr24,scale input.avi -ovc lavc
-lavcopts vcodec=mpeg4 -nosound -o output.avi

prints:

[swscaler @ 0335CA80]using unscaled bgr24 -> bgr24 special converter

What seems to be good because "mplayer output.avi" prints:

AVI file format detected.
[aviheader] Video stream found, -vid 0
AVI: No audio stream found -> no sound.
VIDEO:  [FMP4]  746x588  24bpp  25.000 fps  267.2 kbps (32.6 kbyte/s)
Clip info:
 Software: MEncoder Sherpya-SVN-r28126-4.2.5
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Audio: no sound
Starting playback...
VDec: vo config request - 746 x 588 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.27:1 - prescaling to correct movie aspect.
VO: [directx] 746x588 => 746x588 Planar YV12


But it seems that mplayer is using yuv mode as final color space. The output
video still have incorrect colors. With incorrect, i mean the same colors
but dull. Avoiding the color space transformations does not seem to help.

I have even tried with a lossless codec (ffv1) with the same results.

The movie I'm trying to encode is a very simple synthetic image (a few
lines, movie created with matlab) with pure saturated rgb colors. When
encoded, the colors are not any more the pure saturated, but a little bit
dull. Do you think that it is a problem with the encoding process or just a
limitation of the codec used (tested mpeg4 and lossless ffv1)?

Something strange: playing the input file with mplayer produces the original
colors or the dull ones depending on the -vo option (the output file always
have the dull colors):

The command: mplayer -vo gl2 input.avi

produces the good colors and prints:

Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 746 x 588 (preferred colorspace: BGR 24-bit)
VDec: using BGR 24-bit as output csp (no 0)
Opening video filter: [flip]
Movie-Aspect is undefined - no prescaling applied.
Opening video filter: [expand]
Expand: -1 x -1, -1 ; -1, osd: 0, aspect: 0.000000, round: 1
VO: [gl2] 746x588 => 746x588 BGR 24-bit
[gl2] You have OpenGL >= 1.2 capable drivers, GOOD (16bpp and BGR is ok!)
[gl2] antialiasing off
[gl2] bilinear linear
Selected video codec: [rawbgr24flip] vfm: raw (RAW BGR24)


But the command: mplayer -vo directx input.avi

produces the dull colors and prints:

Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 746 x 588 (preferred colorspace: BGR 24-bit)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using BGR 24-bit as output csp (no 0)
Opening video filter: [flip]
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 03582020]using unscaled bgr24 -> yuv420p special converter
VO: [directx] 746x588 => 746x588 Planar YV12
Selected video codec: [rawbgr24flip] vfm: raw (RAW BGR24)


So, I'm even more confused about the origin of the dull colors problem.

Thanks you both for your help,

Daniel


On Sat, Apr 18, 2009 at 04:11, RC <cooleyr at gmail.com> wrote:

> On Fri, 17 Apr 2009 14:44:49 +0200
> Daniel Lobo <dnlobo at gmail.com> wrote:
>
> > So my question is if there is a command-line arg to force a bgr24 ->
> > rgb32 special converter during the encoding process
>
> Yes...  Of course then the encoding process will fail miserably, because
> just about every lossy video codec operates in a YUV mode.
>
> >  in order to avoid those unnecessary conversions.
>
> The input needs to be converted.  You can force it to use a different
> chain of conversion steps, such as -vf scale,format=rgb32,scale
>
> The fact that mplayer is converting the color space is a bit unusual.
> xv uses yuv format directly.  What -vo method do you use?
>
>
>
> --
> Don't trust me! I'm wrong!
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
>


More information about the MPlayer-users mailing list