View Full Version : Imagesource, YV12
ajp_anton
11th May 2013, 13:47
Can I make Imagesource output jpg images as YV12? They are encoded as 4:2:0 anyway, and I'd like to avoid the unnecessary conversion to RGB and then back.
Wilbert
11th May 2013, 15:09
Can I make Imagesource output jpg images as YV12? They are encoded as 4:2:0 anyway, and I'd like to avoid the unnecessary conversion to RGB and then back.
No you can't. Colorspaces as CMYK or YCbCr are not supported in DevIL. Perhaps i will add it to Immaavs one day.
ajp_anton
11th May 2013, 21:01
Is there any other way to get these images untouched into Avisynth?
Directshowsource works, but returns RGB. But even if that can be fixed, DSS doesn't feel very efficient. I need to load a large number of images, and reload the script frequently to see what every new piece of code does.
Hi,
Perhaps converting jpg file in one-frame avi file. Use command line tool jpegtoavi from mjpeg-tools or any other tool. After that read it with avisource, provided that you have any mjpeg codec (ffdshow, picvideo, ...)
Good luck
Reel.Deel
12th May 2013, 00:32
Is there any other way to get these images untouched into Avisynth?
FFImageSource (http://ffmpegsource.googlecode.com/svn/trunk/doc/ffms2-avisynth.html) opens up jpegs in their native colorspace.
ajp_anton
12th May 2013, 04:17
FFImageSource (http://ffmpegsource.googlecode.com/svn/trunk/doc/ffms2-avisynth.html) opens up jpegs in their native colorspace.It doesn't by default. It outputs RGB32 unless I set colorspace="yv12". Does that really output it "natively" or does it just convert the RGB into YV12? It feels a bit too forced.
It also doesn't support YV24 for 4:4:4 jpg's (though those are rare).
Reel.Deel
12th May 2013, 18:03
It doesn't by default. It outputs RGB32 unless I set colorspace="yv12".
That's odd, for me it outputs the correct colorspace by default.
Does that really output it "natively" or does it just convert the RGB into YV12? It feels a bit too forced.
The documentation suggest that it is indeed the native colorspace.
string colorspace = ""
Convert the output from whatever it was to the given colorspace, which can be one of YV12, YUY2, RGB24 or RGB32. Setting this to an empty string (the default) means keeping the same colorspace as the input.
It also doesn't support YV24 for 4:4:4 jpg's (though those are rare).
Yes, I forgot to mention that.
AVIL already mentioned something like this but you can use JPEG2YUV from MJPEGTools and then import it using RawSource. The only downsides to doing this is that is a little more tedious and JPEG2YUV has mod16 restrictions. Also by default it rescales YUV color values from 0-255 to 16-235. That can be easily corrected.
A longer route is using VSImageReader (http://forum.doom9.org/showthread.php?t=166088) for VapourSynth. The documentation assures (https://github.com/chikuzen/vsimagereader#about-supported-format) that there is no unnecessary colorspace conversions going on. To process the image in AviSynth simply load the VapourSynth script (vpy) using AviSource.
That's all the methods I know about.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.