Printable Version of Topic
Click here to view this topic in its original format
Unofficial VirtualDub Support Forums > Codec Discussion > Question About Xvid At Quant 1?


Posted by: rjisinspired Oct 9 2009, 03:25 AM
I was thinking, but was always feeling skeptical about doing it, would saving in Xvid with a Quant factor of 1 and with keyframes set to 1 be an ok alternative to, say, saving in huffyuv compression? I say this because the movies I tend to produce go over 4GB and I typically make many sets of these files when making progressive revisions - such as:

One folder for the DV versions, captures. One folder for the edits/cuts and another for using filters on. It is easy for me to get into say 80+ GBs of video when working for one video and backing them up onto DVD would require quite a bit of DVDs.

How much loss would there be if saving the files to Xvid at quant 1 and keyframes set to 1? I'm guessing there would be little if any quality loss though this would still be a lossy compression. I'm also thinking since I use the curves filter for editing things such as lightness and such in some portions of the video I can use smart renderring for the second video versions than do the edits and cuts in a separate, set version, which would only require direct stream copy so as to not lose much quality when getting to the third resaves/versions.

I hope I'm not too confusing on this?

For example: The DVs would be saved as Xvid as stated above. The second saving after curves with smart renderring and than the third saving with direct stream copy after cutting/editing. Cutting would be done as the last step in processing.

In my mind there could be some headroom and little quality loss from resaving when being in the curves and smart renderring stage since only the parts where filters would be applied would get recompressed and there would be no degradation from using direct stream copying after doing any cuts needed?

Roughly a 60 minute video encoded in Xvid is about 1.3 or 1.6GBs at quant 1 and keyframes 1 if I remember correctly?



Posted by: rjisinspired Oct 9 2009, 03:37 AM
Then I was thinking that if there was something I missed in the final Xvid video file, I could resave it to uncompressed, do the work that needs to be done on it then resave it as Xvid at the above stated setting with no real loss. Seem plausible?

Posted by: stephanV Oct 9 2009, 06:06 AM
~3500 kbps seems rather low for XviD q1, but all depends on your resolution and framerate ofcourse.

The only person who can really answer these kind of questions is you. Huffyuv is not normally used as a format for back-up, but as a format for intermediate processing. XviD at the settings your propose is not really suited for back-up either. Usually you make a standard DVD (or Blu-Ray nowadays I guess) for those purposes, or when you feel comfortable with the more PC bound formats you'd use something like DivX or XviD with MP3 in AVI or x264 with AAC or Vorbis in MP4 or MKV.

Spreading movies out over multiple DVDs doesn't seem like a good idea in any case to me. I'm not sure for what purpose you are storing the movies though.

QUOTE
Then I was thinking that if there was something I missed in the final Xvid video file, I could resave it to uncompressed, do the work that needs to be done on it then resave it as Xvid at the above stated setting with no real loss. Seem plausible?

That's rather pointless, there is no reason why you can't save directly to XviD.

Posted by: rjisinspired Oct 9 2009, 06:54 AM
I always thought that resaving Xvid to an uncompressed format, though nothing gained from it, would hold the data integrity of the Xvid's video quality and then saving back to Xvid from the worked on uncompressed file would still have the maintained data integrity as the first Xvid file. As if nothing was lost, though nothing gained.

If anyone is confused. I have read many times that resaving from Xvid to Xvid can cause loss but going from Xvid to say huffyyuv retains the data integrity of the Xvid file. After working on the huffyuv version then saving back to Xvid and still have the same quality as the first Xvid file.

Unless things don't really work this way and I'm making it harder than it should be?


Posted by: stephanV Oct 9 2009, 07:08 AM
Unfortunately things don't work that way. Encoding to XviD will always give a loss.

Posted by: Jam One Oct 9 2009, 01:56 PM
...Yes, the "lossy" formats are called "lossy" for the reason...
XviD, DivX, MJPEG, MPEG - all use Discrete Cosine Transform function which is "not reversible" mathematically. You just can not restore all the data you compressed, it's not possible, alas.

Posted by: rjisinspired Oct 9 2009, 05:53 PM
Yep. Nothing gained though I thought by doing the save to uncompressed then back to Xvid after reedit work that the quality would maintain or lessen to a point of not being as noticable if one was careful with encoding settings.

I thought about making screenshots for anyone else who might be confused. Sometimes I try to explain and it can turn to soup. Can't do this now since I'm at my girlfriend's place and her computer is circa 1998 and many times loses it. It's an old P2, 350 mghrtz, 128 ram, 4 GB hard drive running windows ME. The only browser I can use with little trouble is Opera, IE barfs everything and ends up at times blue screening.

Stephan - I have used huffyuv for backing up and archiving for shorter clips, sometimes have used mjpeg. If I am understanding you; you mentioned that DVD and blue-ray is used for true backups? If I recall DVD mpeg2 can go as high as 8000kbps with encoding though places I have read recommend some form of uncompressed AVI for archiving purposes. I'm a bit confused here in to what i should be backing up with?

Xvid can go as high as 10000kbps though I haven't tried that high of a setting yet and to me that seems like overkill. I would have to look at the bitrate for what a DV capture file would be then set the Xvid bitrate to match it. I think my problem was setting the quant and not the target bitrate for a higher bitrate to match the original DV file?

Jam one - isn't that what jpeg uses?

Posted by: Jam One Oct 9 2009, 07:00 PM
QUOTE
Jam one - isn't that what jpeg uses?

Yes, that's right, exactly.

...I could thought of trying TARGA image sequences with RLE compression for your purposes...
The resulting size is smaller than RGB24.avi and the whole load of quality stays in place.
But the sound is to be stored separately then.

Posted by: stephanV Oct 9 2009, 08:38 PM
QUOTE (rjisinspired @ Oct 9 2009, 07:53 PM)
Stephan - I have used huffyuv for backing up and archiving for shorter clips, sometimes have used mjpeg. If I am understanding you; you mentioned that DVD and blue-ray is used for true backups? If I recall DVD mpeg2 can go as high as 8000kbps with encoding though places I have read recommend some form of uncompressed AVI for archiving purposes. I'm a bit confused here in to what i should be backing up with?

It depends a little what the purpose of the archiving is, but if you ever would like to watch the video DVD is quite normal.

Uncompressed standard definition video has about a data rate of 125 mbps (with 4:2:0 sampling), so if we are really generous and give huffyuv a 1:3 compression ratio that will mean you will have about 17 GB of video per hour. For backing stuff up on DVDs this is rather impractical.

With most video editing I do, I come to a product that's finished and then I create a DVD or DivX avi out of it (depending on the audience). All source and intermediate files get deleted after this stage. If you are uncertain you might want to edit the video in the future this might not be the right thing for you.

Posted by: rjisinspired Oct 9 2009, 09:56 PM
Jam one - Using targa in AVI you mean? Why couldn't the sound be stored in the AVI along with a targa imported sequence? Does anyone use targa as a still format image? I will look into this more.

Stephan - I always have this itching to keep the uncompressed files due to in case they may need further work. I may need to rethink this though and choose something else to use.

Posted by: Jam One Oct 10 2009, 01:12 AM
TARGA as an image sequence. Frame by frame. "Kinda slide-show".

...Why not BMP - I'm not sure, maybe because of Mac compatibility... But production studios use TARGA.

(But they use uncompressed TARGA. But it's ~1 Megabyte per image of NTSC => ~30 Megabytes per NTSC-second. Compressed TARGA is much more "HDD friendly", to say so =)))

Powered by Invision Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)