[MPlayer-users] yv12 output format for wmv7 ?

Louis Tsui louis at eea188.ee.ust.hk
Tue Apr 9 07:31:02 CEST 2002


On Mon, Apr 08, 2002 at 10:54:15AM +0200, Arpi wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Hi,
> 
> > When I use transcode to convert WMV (wmv7) file to VCD, I found that
> > yv12 output format is supported by avifile library.
> > 
> > eea188:~/video/download> tcdecode -i AVSEQ03.WMV -x af6video -y yv12 > /dev/
> > null
> > (af6_decore.cpp) input video size: 320x240
> > (af6_decore.cpp) input: YVU 4:2:0 planar data
> > 
> > If this true, is there any reason that mplayer does not support yv12
> > output for wmv7 codec?
> 
> the win32 dlls don't support yv12, or the yv12 support is very
> buggy/unstable. the main problem is that yv12 is planar, but the win32
> codec interface was designed for single plane video frames.
> (no way to specify 2nd and 3rd plane pointers)
> 
> the only working yv12 win32 codec is indeo5ds.
> 
> afaik transcode _converts_ every yuv formats to yv12.

When I read the source code of af6_decore.cpp, the above output
indicate that the avifile library is able to output yv12 format for
wmv7 codec. Avifile said GetCapabilities() is used to determine
internal capabilities of decoder unless it also includes the format
by conversion.

The following is copied from af6_decore.cpp which uses
GetCapabilities() and gives above message.

Best regards,
Louis

      /* now check decoder capabilities */
      IVideoDecoder::CAPS caps = vrs->GetDecoder()->GetCapabilities();
      codec_error=0;
      switch (ipipe->format) {
      case TC_CODEC_RGB:
        do_yuv = 0;
        fprintf(stderr, "(%s) input: RGB\n", __FILE__);
        buffer_size = plane_size * 3;
        break;
        
      case TC_CODEC_YV12:
        do_yuv = 1;
        // Decide on AVI target format
        // see http://www.webartz.com/fourcc/fccyuv.htm

        // YUV 4:2:0 planar formats are supported directly:
        // YV12 = Y plane + V subplane + U subplane
        if(caps & IVideoDecoder::CAP_YV12) {
          fcc=fccYV12;
          fprintf(stderr, "(%s) input: YVU 4:2:0 planar data\n", __FILE__);
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          buffer_size = (plane_size * 3)/2;
        } 
        // I420 = IYUV = Y plane + U subplane + V subplane
        else if(caps & (IVideoDecoder::CAP_I420|IVideoDecoder::CAP_IYUV)) {
          fcc=fccI420;
          fprintf(stderr, "(%s) input: YUV 4:2:0 planar data\n", __FILE__);
          buffer_size = (plane_size * 3)/2;
        } 
    
        // YUV 4:2:2 packed formats are supported via conversion:
        // YUY2 = Y0 U0 Y1 V0  Y2 U2 Y3 V2  ...
        else if(caps & IVideoDecoder::CAP_YUY2) {
          fcc=fccYUY2;
          fprintf(stderr, "(%s) input: YUYV 4:2:2 packed data\n", __FILE__);
          unpack=1;
          lumi_first=1;
        }




More information about the MPlayer-users mailing list