View Full Version : Huffyuv: video size changes depending on which editor i use
lollol
8th January 2009, 13:10
I made a analog capture using the Huffyuv codec (in virtualdub), and i used YUY2 to capture (i read everywhere that is the best for capture).
It was a capture of 1 minute, and it used 500MB. This is not a problem, as i knew that Huffyuv takes ~30 GB/hour.
But when i open this clip in different editors, and save again in Huffyuv, the size increases.
Avidemux: size increases to 622 MB
VirtualDub: size increases to 834 MB
Adobe Premiere: size increase to 834 MB
TMPGEnc: size does NOT change
It seems that only TMPGEnc does not change the size of the video. Can someone tell me why the file gets larger in those other applications? I have a feeling it might have something to do with color spaces, but afaik Premiere doesnt offer any option to save the video in a predefined color space.
From 500 > 834 MB may not seem to be a big increase, but it actually if for a 1 minute clip. I have to capture hours of analog material, and i cant afford it to be larger than ~30 GB/hour.
FlimsyFeet
8th January 2009, 13:55
If you open a YUY2 file in VirtualDub, it'll be converted to RGB32 (unless you have the "fast recompress" option enabled), so when you save out again to huffyuv, assuming you're not just doing a direct stream copy, it'll be larger.
qyot27
8th January 2009, 15:36
If you open a YUY2 file in VirtualDub, it'll be converted to RGB32 (unless you have the "fast recompress" option enabled), so when you save out again to huffyuv, assuming you're not just doing a direct stream copy, it'll be larger.
As well, Premiere's 'Recompress' option (dunno what it is in Pro, I use 6.5) does the same thing by converting the output to RGB24, or RGB32. It cuts down on the likelihood of HuffYUV screwing up on export and producing garbage frames.
Avidemux could be processing it differently as well. The initial capture could have been using Median prediction, but Avidemux might be using Left prediction. I came across this before, and it does make a size difference. If you were using ffdshow's VFW interface as the capture codec rather than HuffYUV 2.1.1 (that's possible, right?), then the initial capture might have also been using the adaptive huffman tables option, and Avidemux isn't.
lollol
8th January 2009, 19:44
If you open a YUY2 file in VirtualDub, it'll be converted to RGB32 (unless you have the "fast recompress" option enabled), so when you save out again to huffyuv, assuming you're not just doing a direct stream copy, it'll be larger.
Indeed, when i choose 'Fast Recompress' mode, i indeed get a file which is the same size. The log also says:Dub: Fast reccompress mode started with format: YUY2
As well, Premiere's 'Recompress' option (dunno what it is in Pro, I use 6.5) does the same thing by converting the output to RGB24, or RGB32. It cuts down on the likelihood of HuffYUV screwing up on export and producing garbage frames.
Avidemux could be processing it differently as well. The initial capture could have been using Median prediction, but Avidemux might be using Left prediction. I came across this before, and it does make a size difference. If you were using ffdshow's VFW interface as the capture codec rather than HuffYUV 2.1.1 (that's possible, right?), then the initial capture might have also been using the adaptive huffman tables option, and Avidemux isn't.Is there anyway i can force Avidemux to choose for median prediction? And i am aware of the ffdshow codec, but i didnt use it. I went for Huffyuv 2.1.1.
So it seem my suspicion of color spaces was right. Isnt there any way Premiere CS4 can work with YUY2? As i said earlier, using RBG would be unpractical for me because of the huge file size.
-edit-
Read more about it, and it seems that there is no way Premiere can work in YUY2. In fact, it seems that most video editing programs work in RGB. From what ive read on multiple sites, every color conversion will cause a quality decrease, and that after approx. 2 conversion, the quality will start getting noticeable.
But i couldnt find how i can solve this problem, i.e. how to edit video without color space conversion. Is there someone who can tell me more about that?
qyot27
9th January 2009, 16:58
Is there anyway i can force Avidemux to choose for median prediction?
I don't know, honestly. It uses lavc to do the compression (and I know lavc can do it, since mencoder, ffmpeg, and ffdshow's VFW all use it as well and they're all capable of selecting the prediction mode), but the configuration dialog doesn't want to come up, or there isn't one for Huffyuv. I would suggest inquiring more directly in the VirtualDub/Avidemux section here. I barely use Avidemux, so I'm not sure how to get that set up correctly.
lollol
11th January 2009, 17:46
Indeed, i just noticed that Avidemux also has a option for "Huffyuv (lavc)", and when i choose that, i get the same size as my source. But the downside of this is, that its the same as the ffdshow encoder, with the same disadvantages....
Avidemux could be processing it differently as well. The initial capture could have been using Median prediction, but Avidemux might be using Left prediction. I came across this before, and it does make a size difference. If you were using ffdshow's VFW interface as the capture codec rather than HuffYUV 2.1.1 (that's possible, right?), then the initial capture might have also been using the adaptive huffman tables option, and Avidemux isn't.Assuming that Avidemux does use the median prediction, would that result in a quality decrease?
qyot27
12th January 2009, 06:09
Indeed, i just noticed that Avidemux also has a option for "Huffyuv (lavc)", and when i choose that, i get the same size as my source. But the downside of this is, that its the same as the ffdshow encoder, with the same disadvantages.Assuming that Avidemux does use the median prediction, would that result in a quality decrease?
What 'same disadvantages' are you talking about with ffdshow's encoder?
In any case, the prediction modes have to do with the accuracy of the math, not the quality of the image - all of them are still lossless (unless you had a colorspace conversion thrown in there somewhere), just a question of a tighter fit. A while back I'd asked about the differences between prediction modes - granted, for ffvhuff, but it would apply to the standard version as well - and the answer was that it was similar to the modes PNG has. PNG is always lossless, just as HuffYUV always is, it's just a 'More Compression/Less Compression' issue, weighted against 'Less Speed/More Speed' (when compressing, dunno about decoding), respectively, rather than 'Less Quality/More Quality'.
lollol
13th January 2009, 14:17
Hmm, so i now will have to choose between a larger file size and lavc Huffyuv.
The disadvantages im talking about is that the lavc Huffyuv encoded video needs ffdshow to decode. As a result of that, it doesnt work well in applications like Premiere.
Dark Shikari
13th January 2009, 14:24
Hmm, so i now will have to choose between a larger file size and lavc Huffyuv.
The disadvantages im talking about is that the lavc Huffyuv encoded video needs ffdshow to decode. As a result of that, it doesnt work well in applications like Premiere.You can enable FFVHUFF in FFDshow's Video for Windows options, in which case it should work just as well as regular HuffYUV...
lollol
13th January 2009, 14:42
What i meant to say is, i can import the video into Premiere (because im using the VfW codec), and it does work. But it doesnt work as good as the "normal" Huffyuv. The already (imho) unstable Premiere, gets even more problems with the lavc Huffyuv:
- Crashes even more
- The preview in Premiere has a horrible a/v unsync
- Enormous lag in preview
- etc etc
Obviously, part of this problem has to do with Premiere itself, because the lavc codec does work well in virtualdub. But because of these issues i prefer to work with the regular Huffyuv (in Premiere)
qyot27
13th January 2009, 19:03
ffdshow can encode video that's compliant with the stock HuffYUV 2.1.1 - you just can't use YV12 or the adaptive huffman tables option.
That said, I've had no problems with using ffdshow as the decoder for HuffYUV itself - at least on my comp I get better HuffYUV decoding speed from ffdshow, even in Premiere. Of course, to edit HuffYUV well while using Premiere, you'd be better off using RGB24 instead of YUY2, in which case I've not seen a big difference whatsoever between the two.
With the preview thing, the only piece of advice I can give is to not use HuffYUV as a preview codec at all - switch that setting to MJPEG or something before trying to use preview. I stopped using Premiere's preview option years ago, and switched to just exporting and testing the encode outside of the program.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.