Log in

View Full Version : [SOLVED] VC-1 Aspect Ratio vs.Libav/FFmpeg


Midzuki
12th August 2011, 05:22
Offenders:

ffdshow r3919
LAV Video 0.31
MPCVideoDec.ax 1.5.2.3337
Mplayer r33574
ffplay N-31653-gfaa3381


Problem:

If you have a VC-1 clip with non-square pixels, there may be difficulties for the decoders and players listed above. Let's say you create a VC-1 stream at 720x540, and set its PAR to 4:3 (so the video will be displayed at 960x540); ffdshow's libavcodec resizes the image to something slightly greater than 16:9 :eek: BUT, if the video includes information about "Display Width" and "Display Height", then both ffdshow and LAV Video make MPC crash :mad:

ffplay.exe does the following:


ffplay version N-31653-gfaa3381,
Copyright (c) 2003-2011 the FFmpeg developers
built on Jul 28 2011 01:57:12 with gcc 4.6.1

configuration:

<SNIP>

libavutil 51. 11. 0 / 51. 11. 0
libavcodec 53. 9. 0 / 53. 9. 0
libavformat 53. 6. 0 / 53. 6. 0
libavdevice 53. 2. 0 / 53. 2. 0
libavfilter 2. 27. 3 / 2. 27. 3
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0

[matroska,webm @ 01EBC760] Estimating duration from bitrate,
this may be inaccurate

Input #0, matroska,webm, from 'zz-ms-sekond.mkv':
Duration: 00:00:10.00, start: 0.000000, bitrate: N/A
Stream #0.0: Video: vc1 (Advanced), yuv420p, 960x540 [PAR 1:1 DAR
16:9], PAR 4:3 DAR 64:27,
25 fps, 25 tbr, 1k tbn, 25 tbc (default)
[vc1 @ 024823C0] Bits overconsumption: 59625 > 59600B sq= 0B f=0/0
[vc1 @ 024823C0] concealing 1331 DC, 1331 AC, 1331 MV errors
1313117818.22 A-V: 0.000 s:0.0 aq= 0KB vq= 47KB sq= 0B f=0/0


As for Mplayer and MPCVideoDec.ax, they don't crash, but they do screw the image anyway:


MPlayer Sherpya-SVN-r33574-4.2.5 (C) 2000-2011 MPlayer Team
163 audio & 367 video codecs

Playing zz-ms-sekond.mkv.
libavformat file format detected.
[matroska,webm @ 0029bc10] Estimating duration from bitrate, this may
be inaccurate
[lavf] stream 0: video (vc1), -vid 0
VIDEO: [WVC1] 960x540 0bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
Load subtitles in ./
======================================================================
====
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Unsupported PixelFormat 61
Unsupported PixelFormat 53
Unsupported PixelFormat 61
Unsupported PixelFormat 53
Selected video codec: [ffvc1] vfm: ffmpeg (FFmpeg WVC1)
======================================================================
====
Audio: no sound
Starting playback...
Movie-Aspect is 2.37:1 - prescaling to correct movie aspect.
VO: [directx] 960x540 => 1280x540 Planar YV12
[vc1 @ 01239f34]concealing 510 DC, 510 AC, 510 MV errors
[vc1 @ 01239f34]concealing 510 DC, 510 AC, 510 MV errors
[vc1 @ 01239f34]concealing 510 DC, 510 AC, 510 MV errors
[vc1 @ 01239f34]concealing 510 DC, 510 AC, 510 MV errors
[vc1 @ 01239f34]concealing 510 DC, 510 AC, 510 MV errors
[vc1 @ 01239f34]concealing 510 DC, 510 AC, 510 MV errors
[vc1 @ 01239f34]concealing 510 DC, 510 AC, 510 MV errors
[vc1 @ 01239f34]concealing 510 DC, 510 AC, 510 MV errors
[vc1 @ 01239f34]concealing 510 DC, 510 AC, 510 MV errors
[vc1 @ 01239f34]concealing 510 DC, 510 AC, 510 MV errors
...

...

...

Exiting... (Quit)


vc1-samples.7z @ https://skydrive.live.com/?cid=5acf098e0ebae8d5&sc=documents&uc=1&id=5ACF098E0EBAE8D5%21126

Reimar
13th August 2011, 11:00
Crash should be because of bug in FFmpeg VC-1 decoder, I sent a patch: http://ffmpeg.org/pipermail/ffmpeg-devel/2011-August/113852.html.
Concerning PAR, FFmpeg says the PAR is set to 3:2, not 4:3, I think it is parsing the custom PAR incorrectly: http://ffmpeg.org/pipermail/ffmpeg-devel/2011-August/113854.html

Midzuki
14th August 2011, 19:23
@ Reimar: Many thanks for the attention :thanks: :thanks: :thanks:

Now, all I can do is just wait for duly-updated builds of Mplayer, ffdshow, and MPC-HC. :)

Midzuki
16th August 2011, 20:18
To whom this may interest :) , the ArcSoft VC-1 decoder also presents aspect-ratio issues :( Like "ffdshow+wmv9", it converts the 16:9 flag to 18:9 ( = 2:1) :mad: OTOH, my 960x408 (1:1) encode of Sintel is "wisely" scaled to 16:9, because "broadcasting and Blu-Ray are all that matters" :rolleyes:

Reimar
16th August 2011, 22:15
Well, FFmpeg is now updated and MPlayer should thus be working fine.
Other projects will probably follow "somewhen".

Midzuki
19th August 2011, 06:18
Well, FFmpeg is now updated and MPlayer should thus be working fine.

Other projects will probably follow "somewhen".

Very true. On the one hand, MPCVideoDec.ax 1.5.3.3677 is working as it should *THUMBS UP*

OTOH, in ffdshow r3972 (from xvidvideo.ru), the dämn design flaw has not been fixed yet -.-

Midzuki
28th August 2011, 08:52
Now, ...

ffdshow (r3976 and r3978) == OK

ffplay N-32071-g276f43b == OK

MPCVideoDec.ax == OK

LAV Video 0.33 == OK

As for Mplayer, the only problem is find an up-to-date Windows build :( I know, there exists the so-called
"Mplayer-WW", but it's not "the real thing" :(