I need a lossless directshow codec that has support for grayscale encoding. Could someone help me?
Thanks in advance.![]()
+ Reply to Thread
Results 1 to 26 of 26
-
-
Source format?
Grey scale at what bit depth, raster spec and frame rate?
Codec to what export format?
Compressed or uncompressed?Recommends: Kiva.org - Loans that change lives.
http://www.kiva.org/about -
Frame rate: 30fps
Bit depth: 8-bit (256 grays).
I'm looking for a codec, so compressed please.
I'm not sure what you mean by source format, export format or raster spec. Sorry :/ -
For source format I believe eddv is asking what file type and original codec form (or lossless/lossy dv-avi).
So is it from a video camera (what type - dv-avi, m2t, etc), is it hd or sd, is it from a bluray rip a dvd rip? That sort of thing. As for raster spec that is out of my league and I can't elaborate on that.
Export format will be what you intend to do with the final video. Is it for dvd, bluray, or simply playback on a computer? That will affect all kinds of format decisions.Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
ffdshow includes a lossless JPG codec that will accept 8 bit grayscale (luminance only, Y8) from VirtualDub. It's not clear if it's really working in 8 bit grayscale internally. ffdshow won't output 8 bit grayscale directly -- it will be upsampled to YUY2, YV12, RGB, or some other common format. Similarly, the other codecs (x264 lossless, huffyuv, etc.) accept 8 bit input but may work as YV12 (or other) internally.
Xvid has a grayscale encoding option but I believe it simply "zero out" the color channels before compressing with the usual YV12 subsampling. And again, it won't output 8 bit grayscale.Last edited by jagabo; 31st May 2010 at 09:26.
-
I'm using adobe after effects, and the source is in black-and-white. The final output format will be H.264/AVC, and I'll be using x264 as the encoder. It's intended for streaming on the internet.
Thanks jagabo, I'll have a look at those. To be honest, I don't really need a codec that will encode in pure grayscale, but I'm assuming that there's a better chance that the colours will come out decent. When I tried HuffYUV, the whites came out discoloured. I need something like the Animation codec, which produces perfect results, and has a grayscale option. Unfortunately, I can't decode it using something like AviSynth. -
You can export using x264vfw directly out of AE. New builds allow .mp4 output with wrapper function (instead of limited to AVI). It doesn't support true greyscale encoding
If you have greyscale source, you can use --no-chroma-me in x264 for slight faster encoding
Unfortunately, I can't decode it using something like AviSynth. -
Originally Posted by poisondeathray
Originally Posted by poisondeathray
Originally Posted by poisondeathrayLast edited by roflwaffle; 31st May 2010 at 11:50.
-
I thought it might be the greyscale screwing things up, but I just did a quick test and QTInput() works fine
There is a slight levels difference between using QTInput() vs. FFMpegSource2() . It might have to do with the QT gamma shift bug
What error message did you get with QTInput() ?
I didn't quite understand that. -
Originally Posted by poisondeathrayCode:
Script error: There is no function named "QTInput"
-
RGB source (all 256 shades of gray):
After HuffYUV 2.1.1 in RGB mode:
After HuffYUV in RGB-->YUY2 mode:
Using a tool like CSamp shows there are no pixels where R=G=B isn't true. If you are getting discolorations it is happening elsewhere in your processing. Or whatever version of HuffYUV you have is broken. -
Script error: There is no function named "QTInput"
With me, after using huffyuv and x264, ffffff becomes fdfdfd. The same thing happens when I don't use a codec (uncompressed). After using QT's MPEG-4 and x264, nothing changes. -
Can you describe "weird" a little better ?
If you used default settings, it will do a colorspace conversion to YUY2
Try QTInput("video.mov", color=1) , which will give you RGBA . This output looks the same as the FFMS2 output
Are you using color profiles or working color space profiles in AE? or just defaults?
The problem is AE works in RGBA (4:4:4:4 sampling) color space, and your final format is YV12 (4:2:0) , so there will be a necessary colorspace conversion somewhere in your processing
If you use huffyuv in RGBA mode , and use ConvertToYV12() in your script , the appearance should be very similar. -
It's hard to explain. It's as if it skips frames at the beginning, and then later, everything slows down :/ I've tried your suggestion and many other things.
I think I'm using the defaults. I haven't changed anything at least. I'll try HuffYUV again then... -
The output colorspace for QTInput() will not affect frame skipping or misordering; I would use FFMS2, which indexes your file and is frame accurate.
-
After Effects is most likely running in RGB colorspace. YCbCr (YUY2) keeps luminance separate. Conversion of monochrome YV12(source) to RGB, then processing in After Effects, then conversion back to YV12 has potential for generation of spurious color components (tint). You can simply null out the chroma components to force monochrome.
Recommends: Kiva.org - Loans that change lives.
http://www.kiva.org/about -
How do I actually "null out the chroma components to force monochrome"? Sorry about this.
-
manono provided one option: greyscale() in avisynth . You shouldn't have to do this if your export from AE was done properly.
the actual encoder, x264 and various decoders don't support true monochrome 4:0:0
other encoders, like mainconcept reference, do support 4:0:0 encoding, but the flash decoder isn't compatible with it
I don't see why you are having problems. Maybe you can provide a sample to illustrate
How are you viewing the final result? What renderer? What decoder? What software? Maybe you have a TV/PC levels issue or playback issue. -
I'm using windows media player and the decoder is ffdshow. I don't think it's an issue with my PC, because I took a screenshot and checked the colour. Also, I did a test upload on youtube.
Samples (huffyuv vs huffyuv+x264): http://www.mediafire.com/?dwz02yzlnz3
-
AE and Premiere Pro have HSV/YUV filters Just turn chroma saturation parameters to zero (e.g. S,UV).
Recommends: Kiva.org - Loans that change lives.
http://www.kiva.org/about -
You can't take a screenshot from wmp, the levels will be washed out (it takes in VMR9(renderless) mode)
Youtube adds another level of complexity, but your uploaded samples are nearly identical (except one is RGB32, one is YV12) when decoded properly. These screenshots were taken in AvsP (independent of renderer) , the YV12 video is converted to RGB with Rec.601 Matrix for purposes of the .png screenshot
I think this is a configuration or playback issue on your end -
That's not a discoloration (fdfdfd is still a gray shade), it's a levels issue. RGB uses 256 levels of gray, YUV normally uses 220. So 256 levels have to become 220 when converted to YUV. So with 8 bit YUV samples there is no way for every one of the 256 gray levels in RGB to be retained after a RGB to YUV to RGB conversion (you can see this in my YUY2 sample image). Different programs use slightly different methods to perform the conversions and will give slightly different levels.
https://forum.videohelp.com/threads/296961-TV-Safe-Colors?p=1812482&viewfull=1#post1812482
You can use AviSynth to convert to YUV with 256 gray levels:
ConvertToYUY2(matrix="PC.601")
and then you have to use the same matrix to convert back to RGB with:
ConvertToRGB(matrix="PC.601")
Your TEST.AVI file is encoded by HuffYUV in RGB mode with black=0, white=255. Your TEST.MKV is encoded as YV12 h.264. Black is at Y=16, white at Y=235. This is normally converted to RGB black=0 and white = 255 for display. Your problems are not caused by HuffYUV. They are elsewhere in your processing.Last edited by jagabo; 31st May 2010 at 17:56.
Similar Threads
-
How to encode video from raw RGB (grayscale) to Xvid (color)
By Fixer in forum Video ConversionReplies: 10Last Post: 19th Aug 2011, 09:55 -
convert video with Photo JPEG codec and MS IMA APMCD audio codec
By devil_doll in forum Video ConversionReplies: 3Last Post: 21st Jan 2011, 14:10 -
Convert TO Grayscale Difficulties
By robindean in forum Video ConversionReplies: 3Last Post: 9th Mar 2010, 16:19 -
Is there a way to convert grayscale video to color
By ussmillerco in forum Video ConversionReplies: 9Last Post: 28th Feb 2009, 01:29 -
MPG File with ivivideo Codec-bad picture.Can I change the codec?
By cska133 in forum Software PlayingReplies: 13Last Post: 4th Nov 2008, 09:41