View Full Version : Transcoding
ArielHatotah
5th September 2007, 15:50
Hello everyone!
I have a general question about transcoding from one codec to another.
Suppose I have a MPEG-2 source file (could be DVD also), and I want to transcode it to XviD or x264. And suppose I don't want to lose any quality (or the minimum possible). Of course I don't need to use the same bit rate of the source file, because with the XviD codec or x264 codec (even better), I can use less bit rate and get the same quality, resulting a smaller file size but with the same quality of the source file.
Then my question is: How do I know what bit rate to use for not losing quality at all, and still not using extra bit rate (resulting uselessly bigger file size)?
Thanks in advance.
Sharktooth
5th September 2007, 15:53
you can NEVER get the same quality unless you use a lossless encoder which usually require much more bitrate than the source.
Sagekilla
5th September 2007, 16:07
Only way I know of that consistently gets me near-to-DVD quality at half the file size is using my insane file settings using a constant rate factor (constant quality) of 19 or 20 and the prestige matrix. You could use more sane settings with the same crf value and matrix, only the file size would be bigger.
Like sharktooth said though, you'll be very hard pressed to get a visually perfect representation of the original DVD or MPEG-2 file. Otherwise, if you're alright with the occasional (mostly invisible to me) artifacting or loss detail (very low using a good matrix like prestige) then by all means try out x264.
Sharktooth
5th September 2007, 16:25
IMHO prestige creates too much artifacts expecially in dark smoothed areas.
compare the lower left side of this: http://nwgat.net/woot/files/21/compares/dreams/dreams-prestige.png
and this: http://nwgat.net/woot/files/21/compares/dreams/dreams-avchr.png
... the imperfections of prestige matrix encode are even more visible if you use the zoom, but however on LCD monitors they're easy spottable.
so all i can recommend is to NEVER use the prestige/mgm matrix.
Sagekilla
5th September 2007, 16:28
Interesting indeed... Strange thing is I almost never see those sorts of artifacts in my videos. I've seen those artifacts in a bunch of other screenshots people took with said matrix, but all the ones of my videos I don't really see those types of artifacts.
Edit: This may have something to do with the fact that I'm not working with DVD resolutions and not with high def materials.
ArielHatotah
5th September 2007, 16:31
OK, I understand that I have to use lossless codec for that.
But if I want to lose only minimal quality, then I understand that there's no way to calculate the exact (or closest) bit rate I should use.
So I see that Sagekilla gave his way for doing that. But if I want to encode with XviD, is there any way for encoding with the minimum possible loss of quality?
Sharktooth
5th September 2007, 16:34
instead of using a bitrate constrained encode, use a constant quantizer encode.
encode at Q2 or Q3 and use whatever matrix you prefer.
@Sagekilla: the horizontal lines artifacts are due to the 8x8 structure of prestige matrix: http://i19.tinypic.com/2h5o7wj
ArielHatotah
5th September 2007, 16:54
Thank you, Sharktooth.
But can you explain to me what exactly quantizer is?
Or just give me a link for a guide that explain that. Thanks.
Another thing, when encoding DVD films, I know that there are differences in proper bit rates for each film.
For example, there could be a film of 2 hours that have to be encoded to 2 CDs, otherwise we could see a noticeable loss of quality. And with another film (of 2 hours too), we could encode to one CD, without notice any serious quality loss.
So how do I know what bit rate I need to use for each film for having a decent quality film?
Sagekilla
5th September 2007, 17:04
Like Sharktooth said, if you're not trying to encode for a specific target (2 CD, 1/4th DVD, etc) you're best off using a constant quantizer. With that, the encoder will decide how many bits a movie will need without your input.
As an example, a really high motion movie will end up having a larger file size because the encoder will allocate more bits to allow for "good" quality, whereas in an average or low motion movie, it'll allocate less bits because there's fewer transitions occurring. End result? lower file size, but still constant quality throughout.
Sharktooth
5th September 2007, 17:05
the quantizer represents a sort of level of quantization (http://en.wikipedia.org/wiki/Quantization_(image_processing)). the lower the quantizer the better will be the quality.
about movies and the different bitrate needed to get an acceptable encoding quality, it depends on their compressibility.
a compression test on a small part of the movie (for example 5% of random scenes) will give you an idea in how much you can compress it retaining an acceptable quality.
Terranigma
5th September 2007, 17:14
Prestige lowers quality as well as witnessed here (http://forum.doom9.org/showpost.php?p=1036431&postcount=19).
ArielHatotah
5th September 2007, 18:24
Thank you very much. I will read on Wikipedia about quantization for better understanding.
Sharktooth, What do you mean exactly when saying "compressibility"? How can a film be more compressible than another? Is it because of the quantity of motion in the film as Sagekilla said? Are there another factors?
Anyway, how can I do a compression test?
Thank you...
Sagekilla
5th September 2007, 18:29
Thank you very much. I will read on Wikipedia about quantization for better understanding.
Sharktooth, What do you mean exactly when saying "compressibility"? How can a film be more compressible than another? Is it because of the quantity of motion in the film as Sagekilla said? Are there another factors?
Anyway, how can I do a compression test?
Thank you...
There are a number of factors which can affect how well a movie can compress, some of which include: amount of motion, how clean the source video was (noisy, grainy, blocky vs clean.) There's others, I think, but those are all I can think of off the top of my head.
Sharktooth
5th September 2007, 18:30
Well, read the wikipedia article and you will understand better :)
a compressibility test can be made with Enc (:search:).
ArielHatotah
5th September 2007, 19:49
I don't really know what noisy\grainy\blocky\clean movie is...
But also I don't want to bother you guys. So thank you for that information. Last little request is: Can you give links for articles or guides that explain those things, so I can read them and better understand the whole encoding stuff.
Thanks!!!
Sharktooth, I did search for "Enc". but you gave me very few information. I suppose "Enc" is a software, but the search results give many irrelevant results (like encode, encoding, encoder). Also the use of inverted commas (") doesn't work.
Please help me finding this.
Thank you guys for all your help...
Sharktooth
5th September 2007, 19:54
http://forum.doom9.org/showthread.php?s=&threadid=50714
foxyshadis
6th September 2007, 05:45
There's also a sticky at the top of the Xvid forum going into some detail on the topic.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.