
Originally Posted by
Redsandro
I was trying to figure some stuff out today, but I cannot seem to get frames stored as YUV (like a weird looking TIFF or whatever).
Does anyone know a method of converting a MPEG stream to an image sequence in YUV, exactly as it is inside the MPEG?
ffmpeg can save out a raw YUV stream. I think MEncoder can do it also. Another thing you might try is writing an AVISynth script that just moves each channel (Y, Cb, and Cr) to it's own channel and then saves it out to it's own file. (one file for each channel) I'm pretty sure it can do that but I haven't tryed it myself. Check out the AVISynth Wiki. Someone has probably already done a script for it.
It might also be possible to split out each channel and then transform/combine them all into one big greyscale page. (then you could view it in a normal graphics program) That should work with 4:2:0 since each chroma channel is exactly 1/4 the res of the luma.
But if you are go straight out Lagarith 4:2:0 there is no RGB conversion so I doubt you'll see much difference from one decoder to the next.
UPDATE:
I couldn't stop thinking about this since it's something I wanted to do in the past myself to help visualize YCbCr. So... I went into AviSynth and figured out some code to do it. I'm presenting it below. The code snippit is configured as a DGindex template (What HV20pulldown.exe uses) If you use this code along with vDubMod you can save the output movie as a PNG sequence. It's possible to save a single frame also. Or you can use one of the HV20pulldown.exe output templates and save to a movie. The chroma channels are padded with solid nothing so even though the channels are technically "full" it should still compress pretty well in Lagarith.
Code:
### Lordtangents HV20 pull-up and tile YCbCr template
### v0.1 October 4 2007
###
### Requires: DGDecode.dll, TIVTC.dll
### http://neuron2.net/dgmpgdec/dgmpgdec.html
### http://web.missouri.edu/~kes25c
##### MAIN -- Do not edit unless you really know what you are doing!
v=MPEG2Source("__vid__")
a=MPASource("__aud__")
audiodub(v,a)
tfm(d2v="__vid__")
YUV=tdecimate()
Y=Tweak(YUV, sat=0)
U=UToY(YUV)
V=VToY(YUV)
StackVertical(Y, StackHorizontal(U, V))
YCbCr_tiles.png
xvid avi http://hv20.info/yopu/tiled_YCbCr.avi
png codec mov http://hv20.info/yopu/tiled_YCbCr.mov