Log in

View Full Version : x264cli can't open YV12 in avi ?


DarkZell666
15th April 2006, 09:19
I've taken a xvid clip and recoded it into helix YV12 and stored in .avi (with vdubmod).

I fed that avi file into x264 and it said :
avis [error] : unsupported input format yv12

cmdline : x264 -B 700 -o sample.mp4 sample.avi
(nothing abnormal here I believe ? oO)

I only tried yv12 because x264 couldn't read the original xvid avi file either ...

Apart from an avs script what is x264cli supposed to eat ? ;)
I'll try demuxing the yv12 raw stream in a second but this is pretty wierd :/

ChronoCross
15th April 2006, 16:41
it's supposed to take raw yv12 files. avi makes it different so x264 can't read it.

You should use avisynth

squid_80
15th April 2006, 17:56
it's supposed to take raw yv12 files. avi makes it different so x264 can't read it.
Not true. If it is indeed yv12 in avi, x264 wouldn't know the difference between it and an avisynth script.

akupenguin
16th April 2006, 00:25
fourcc is case sensitive.
x264 understands 'YV12', not 'yv12'.

Sergey A. Sablin
16th April 2006, 11:45
fourcc is case sensitive.
x264 understands 'YV12', not 'yv12'.
BTW - it is much safe to compare BITMAPINFOHEADER::biCompression to YV12 instead of using AVISTREAMINFO::fccHandler, cause frequently in AVI files fccHandler is equal to DIB while biCompression is indeed YV12.

DarkZell666
17th April 2006, 10:39
Well, I used avisynth to get it to work in a couple of minutes, I needed that clip to help that other guy with his x264cli-mp4 dump.

About the case-sensitive business : god knows why helix's yv12/i420 codec writes yv12 instead of YV12 ... using Nic's fourCC changer could have solved the problem then ?

2nd : When I tried inputing raw YV12 (extracted from the .avi with the latest YAMB) and giving x264 the 640x352 resolution, the colors came out borked (Will Smiths' face was purple oO) 640 and 352 are mod-16 so what on earth is going on ? :p

sade
17th April 2006, 12:32
Can you post a screenshot? Maybe the u and v planes were swapped because x264 wants i420 instead of yv12?

DarkZell666
17th April 2006, 18:32
EDIT : Well, dunno what wierd version of Helix's codec my GF had on her computer : the codec was a unique "Helix YV12 / I420 YUV Codec", and not the 2 separate ones I found on mine (Helix YV12 YUV Codec" and "Helix I420 YUV Codec"). That lead me to believe YV12 and I420 were the same ...

Indeed x264 wants I420 colorspace, and b0rks the colors on YV12. But x264 will only take YV12 in avi (useless if colors are b0rked), not I420 in avi. It will take both raw YV12 and I420.

What x264 did with the I420 sample :
http://tpechoc.free.fr/grabI420_ffdshow.png

What x264 did with the YV12 sample :
http://tpechoc.free.fr/grabYV12_ffdshow.png

If this behavior is not normal ... ffdshow is the only other cause :)
Note : I couldn't get CoreAVC to decode the 2 encoded samples ... oO
Get them here and tell me :
http://tpechoc.free.fr/sampleI420.mp4
http://tpechoc.free.fr/sampleYV12.mp4

I used a dead-simple cmdline : x264 -B 700 -o sampleXXXX.mp4 sample.XXXX 512x384

foxyshadis
17th April 2006, 19:56
For whatever reason, something on her system is treating YV12 as I420 and I420 as YV12... I wonder if it's on the encode (to helix) or decode side. Weird, but changing the 4ccs should do it, or making an avisynth with SwapUV. You know, you just inspired me to watch a show with SwapUV, that looks trippy. xD

DarkZell666
17th April 2006, 20:14
You know, you just inspired me to watch a show with SwapUV, that looks trippy. xD
Fancy having your favorite hero look like an alien huh ? :D

Well actually I redid this 2nd lot of encodes on my laptop =)
Without looking at the fourCC, how can I distinguish an I420 file from a YV12 one ? I also see that ffdshow has so many options concerning colorspaces ... how many of those checkboxes should I check ? :cool: