Hi everyone! I'm new to this forum. Hope you'll forgive me if I say something unbearably stupid from time to time, but I'm no expert in video encoding.
The question is this: I have a bunch of old movies encoded in XviD (or similar aged codecs). Given the fact that H.264 AVC can give the same quality in less space (or, at least, that's what I've heard), I'm willing to convert them via HandBrake.
Now, I have this simple matter: less space means lower bitrate, in the end with AVC I should achieve similar quality with lower bitrate. The problem is: how much?
Obviously, starting from an already ripped video, if I re-encode it with too much quality I can't get more information, I'm just wasting space. So, there must be some sort of bitrate border before whom I'm wasting bites and after that I'm worsening quality. Is there a fixed quantity? I mean, something like "you can achieve similar quality with AVC with half bitrate as XviD". If it's not a fixed quantity, what does it depend on? Is it a simple matter?
Extra question: while we are at it, is it a good idea to re-encode audio too (from original MP3/AC3 to AAC)? In case of positive answer, the same problem as before apply: how lower can I get an AAC's bitrate compared to an MP3 one? I guess AC3 is better left as AC3.
Thanks everyone, have a good day!
+ Reply to Thread
Results 1 to 18 of 18
Thread: XviD to AVC with HandBrake
Last edited by HisDudeness; 30th Jan 2013 at 16:07. Reason: TypoThe Dude minds.
Have you tried convert anything?
It's probably not worth to shrink them any further...if you haven't xvids with very high bitrates.
I think the O.P.'s idea is that "converting" from XVid to h264 will (a) keep "same quality", and (b) somehow have "better" quality. This arises from the myth that XVid, h264, MPEG2, etc., are like simple ZIP compressors. Then there's (c): smaller is always better.
From XVid to h264 is not a "conversion". It's a re-encode. Neither (a) nor (b) nor (c) is true. Ac3 audio will lose some magic as well.
Last edited by sanlyn; 30th Jan 2013 at 21:05.Our inventions are wont to be pretty toys, which distract our attention from serious things. They are but improved means to an unimproved end. -- Henry David Thoreau
1. At the same bitrate, encoding in H.264 (from a DVD or a BD) can give better results than XviD and, as a consequence
2. To get almost the same result, you can use a lower bitrate with H.264 than XviD's one
Is this wrong? Because if it is, then there's nothing to discuss about here, and I'm just keeping my movies in avi encoded with XviD, tail between my legs. As for the conversion/re-encoding mistake, I already warned I'm a newbie and I was gonna say some blasphemy...The Dude minds.
It's correct. If you convert from same source.
You have to decide if it's worth to shrink the 2MBits xvids even further. Try for example with a quantizer setting of 20 and see how big it gets or use 2-pass 1Mbit bitrate.
I wouldn't do it though.
The Dude minds.
Well, it has some meaning to reconvert again. But you will lose more quality than reconverting from the original.
Last edited by Baldrick; 31st Jan 2013 at 07:00.
First of all, thank you for the patience you're following me with.
If you want, I'd ask you first of all how would you use HandBrakeCLI to make an mkv out of a standard SD DVD movie, AND, just in a second moment, if it is a good idea to apply the same options to an already-encoded XviD avi (my laptop has got no optical drive, -un-luckily). How about this? What do you think should be modified and why?
HandBrackeCLI -v -i #inputdirectory -o output.mkv -e x264 -x264-profile placebo -x264-tune film -x -b 1000 -2 -a1 -E copy:ac3
(I was planning on keeping the audio as is if it's an AC3, or re-encoding it as AAC if it is an MP3; is that a good idea? Can I lower the bitrate a tiny little bit without quality loss going from MP3 to AAC?)
Last edited by HisDudeness; 31st Jan 2013 at 05:34. Reason: TypoThe Dude minds.
Every time you encode a video with a lossy codec you get some loss of quality. This is true of both audio and video. h.264 can achieve better compression than Xvid when both are starting with the same source. But in this case you are recompressing and already compressed Xvid file. So you will have all the quality loss of the Xvid encode, plus some more quality loss from x264 compression. The issue is whether the loss of quality, in exchange for a smaller file, is acceptable to you.
Placebo is a waste of time. Slow or veryslow is as far as you ever really need to go.
I now just made my first try with the biggest XviD I have: a 2.0 GB 2091 Kbps (video only) avi. Ripping it with the options I put above, I get a 1.1 GB mkv, and I can barely see any difference at all. Maybe keeping the audio as is it's a waste of space (it's a 5.1 448 Kbps AC3), as now it is big 31% of the whole file, but with a nice Home Theater system, which I don't have right now but I may in the future (or I may see a movie at some friend's house with one), the differences between that and a mono 128 Kbps MP3 are obviously huge.The Dude minds.
Another thing you made me think about is: every movie needs a different bitrate to achieve a certain "quality" (which is a subjective and volatile concept), depending primarily on the frequency at which the pixels change and how much do they change (hence, brightness, color and camera/subjects movement), and is hard to understand which bitrate a movie actually needs.
When you select a certain fixed quality, do HandBrake decide on its own the bitrate the movie needs to get that quality level? How much is the algorithm it uses to accomplish that reliable? Will it use a constant bitrate, once it has determined the optimal one, or will it be variable, changing it depending on how much is the scene "heavy"?
In a few words, do you find a better idea using an average bitrate, or a fixed quality? Which bitrate/quality level do you find to be the best compromise between visual fidelity to the original and size (both from SD and 720/1080p)?
Last edited by HisDudeness; 31st Jan 2013 at 13:21. Reason: Small part addedThe Dude minds.
This discussion has been illuminating, but is going nowhere into Hypothetics Land. If you're convinced that there is no quality change (or the change is impossible to detect), and you want to know which bitrate is suitable for which video, then encode the video and see for yourself. Without a sample of what you're working with, all that anyone can do here is generalize. I suggest you post a sample of what you're working with. To say that your results look "good" to you is meaningless; we know nothing about the source nor the results.
Our inventions are wont to be pretty toys, which distract our attention from serious things. They are but improved means to an unimproved end. -- Henry David Thoreau
But as for the VBR vs quality question, what do you recommend? And, in a complete indicative way, which quality setting you do recommend for SD, 720p and 1080p? I'm not requiring an opinion with absolute pretensions, just in a mean general way what do you think about those standards, for an average movie, not to get files of more than 15 GBs; I'm gonna modify that on my own to suit each specific movie.The Dude minds.
CRF encoding uses whatever bitrate is necessary at each frame to deliver the quality you specify. The final result is a variable bitrate video. If you encode a video at say, CRF=18 and it turns out at 2000 kbps, then go back and make a 2-pass encoding with an average bitrate of 2000 kbps, the two videos will be nearly identical. With 2-pass encoding you know what the size will be but you don't know the quality. With CRF encoding you know what the quality will be but you don't know the size.
Encode a short sample video at different CRF values. Say, 12, 15, 18, 21, 24, 27. Examine the results and decide what's acceptable to you. Then you can use that value for all your encoding. I usually use 18 (with elevated aq-strength if the video is noisy). The toughest places for x264 (and most other encoders) are dark noisy parts of the video. That's where detail gets lost first. And you start seeing posterization artifacts.
Thanks to everyone for the answers. I've come to my final decisions: I'll use my old desktop PC just to make mds/mdf out of my DVDs, so that I can encode them in my optical drive-less notebook with Linux and the hardware I'm confident with. Just one more question, it's an HandBrakeCLI specific question, but I've read the command explanation and I'm still not sure I'm doing right.
Let's say I mount my DVD image in my pc, and I get a virtual drive with my DVD in it. I have the VIDEO_TS folder with all the vobs and so on. What command should I address to rip my movie, let's say, with a bitrate of 2000 kbps? My principal doubt is the DVD obviously contains extra things such as menu and bonus content. Will giving HandBrake standard instructions make it process the movie only?
I'll write what I'd do, if you can correct eventual mistakes andsuggest me additional options to make it the best way I'll owe you more than one. Another specific detail: my first DVD has got two audio tracks: the first is a Portuguese one which I want to skip, the second the original Italian one I want to keep, maintaining it un-encoded (it's an AC3).
HandBrakeCLI -v -i VIDEO_TS -o output.mkv -e x264 -x264-profile slow -x264-tune film -b 2000 -2 -a2 -E copy:ac3
Last edited by HisDudeness; 7th Feb 2013 at 04:42. Reason: Detail forgottenThe Dude minds.
No one? I swear, this is the last matter, then I'll quit bothering you. What about anamorphic? Filters? I also get this warnings:
x264 [warning]: --psnr used with psy on: results will be invalid!
x264 [warning]: --tune psnr should be used if attempting to benchmark psnr!The Dude minds.