Hi guys my 1st post.
Would any of you know how to convert YUY2 to YV12 format.
Currently I have a byte array which contains YUY2 data.
The resolution should be 704x576.
The byte array is of size - 811008. Should 704x576 not be 45504.
Is there any code samples or an algorithm to do this?
Many thanks...
Al.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 9 of 9
Thread
-
-
I think you meant to type 405504 but YUY2 is two bytes per pixel. 704*576*2 = 811008.
YUY2 to YV12 is pretty simple. You should be able to figure it out from information at fourcc.org:
http://fourcc.org/yuv.php
Be sure to take into account interlacing if your output will be interlaced YV12. -
Ok so if I have these YUY2 bytes - YUYV YUYV
If I convert them to YV12 bytes should I have YYYYVU? -
Not exactly. YV12 is a planar format. You'll end up with three arrays, one of Y at the full resolution, followed by one of the V at half (both dimensions) resolution, and one of the U at half resolution.
four YUY2 pixels (2x2 array):
Code:Y(0,0) U(0,0) Y(0,1) V(0,0) Y(1,0) U(1,0) Y(1,1) V(1,0)
Code:Y(0,0) Y(0,1) Y(1,0) Y(1,1) (V(0,0) + V(1,0)) / 2 (U(0,0) + U(1,0)) / 2
http://avisynth.org/mediawiki/Sampling -
Would I be correct in assuming that after the conversion using the above resolution of 704*576 I will have these array sizes
Y - 405504 bytes
V - 101376 bytes
U - 101376 bytes -
Afternoon allyli2007,
Some time ago, I did some demonstrations** of the layout and posted some raw yuv
images of those that I engineered into the tool. It was designed only to spit out the yuv
images in binary format. And to open or import them in video editor like AVIsynth required
one of their plugins. It was this method that I used to test our my tool's success not to
mention, my understanding and correct coding, etc.
I also wrote a tiny calculator to help me understand the Luma/Chroma placement, but at
some point, I bOrked it and haven't found the energy to fix it. Maybe I should. Hmm.. I
remember starting out with just a simple calculation (resoution based) and got the chroma
size, and then the chroma playcement, and then.. Well, maybe later. Anyway.
Here's an example of something that I posted two years ago from the last response I made
on the subject (before other things bogged me down and I went onto other things) here.
** The point I'm making with the image you see below is to help suggest an
idea for you to visualize the layout using a guide. This helped me to understand what I
was learning.
Explanation of the illustration-- The partial (though crude) image you see below is a basic
representation of how the YUY2 layout can look. And in this pictured view, I had
incorporated Color Coded Cells, Numerical Position, and the Color Values used. Its
purpose was to aid in the actual format and look, and it helped me to verify my
progress. I had a i420 and YV12 pic too, but I can't seem to find it, though those
two never did make it to my last post on that thread. I was so close to releasing a
utility (that spits out the layout like the one below) but my personal life got the
better of me.
-vhelp 4291
Similar Threads
-
WMV File with YUY2 Raw Video Format
By toreachdeepak in forum Video ConversionReplies: 3Last Post: 24th Feb 2011, 10:43 -
Capturing YUY2 or YV12 interlaced?
By rmdeboer82 in forum CapturingReplies: 5Last Post: 15th Dec 2010, 10:10 -
Help with captured AVI: Vdub / HCenc / RGB / YUY2 / YV12
By Rinsin in forum Video ConversionReplies: 2Last Post: 13th May 2009, 19:57 -
Converting raw DV format into a quicktime or MPEG format
By Maiden in forum Camcorders (DV/HDV/AVCHD/HD)Replies: 80Last Post: 27th Apr 2009, 21:00 -
What is Native DV(PAL) colorspace? YV12 or YUY2
By Josip in forum Newbie / General discussionsReplies: 7Last Post: 14th Nov 2008, 00:25