VideoHelp Forum




+ Reply to Thread
Results 1 to 18 of 18
  1. Urban Achiever HisDudeness's Avatar
    Join Date
    Jan 2013
    Location
    Melzo, Milan (Italy)
    Search Comp PM
    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!
    Last edited by HisDudeness; 30th Jan 2013 at 16:07. Reason: Typo
    The Dude minds.
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Have you tried convert anything?

    It's probably not worth to shrink them any further...if you haven't xvids with very high bitrates.
    Quote Quote  
  3. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    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) are true. Ac3 audio will lose some magic as well.
    Last edited by sanlyn; 25th Mar 2014 at 06:04.
    Quote Quote  
  4. Urban Achiever HisDudeness's Avatar
    Join Date
    Jan 2013
    Location
    Melzo, Milan (Italy)
    Search Comp PM
    Originally Posted by Baldrick View Post
    Have you tried convert anything?

    It's probably not worth to shrink them any further...if you haven't xvids with very high bitrates.
    Actually, I have XviDs of more than 1 GB... one of them, for example, has got a video bitrate of 2091 kbps. Is it not worth it anyway?

    Originally Posted by sanlyn View Post
    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.
    Nope, what I was trying to say is I've heard H.264, being a newer, better and improved codec, can achieve somehow comparable quality at lower bitrates. So, I can't obviously have "better" quality, as I'm starting from a precise file and I can't magically create data from scratch, but I can keep what I have using less space. This conclusion is starting from the probably wrong idea that:

    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.
    Quote Quote  
  5. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    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.
    Quote Quote  
  6. Urban Achiever HisDudeness's Avatar
    Join Date
    Jan 2013
    Location
    Melzo, Milan (Italy)
    Search Comp PM
    Originally Posted by Baldrick View Post
    It's correct. If you convert from same source.
    Do you mean encoding with H.264 from the original source the XviD was taken from? Does directly re-encoding the already-encoded-once avi file have no meaning at all?
    The Dude minds.
    Quote Quote  
  7. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    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.
    Quote Quote  
  8. Urban Achiever HisDudeness's Avatar
    Join Date
    Jan 2013
    Location
    Melzo, Milan (Italy)
    Search Comp PM
    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: Typo
    The Dude minds.
    Quote Quote  
  9. 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.
    Quote Quote  
  10. Urban Achiever HisDudeness's Avatar
    Join Date
    Jan 2013
    Location
    Melzo, Milan (Italy)
    Search Comp PM
    Originally Posted by jagabo View Post
    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.
    What you are saying is a 1Mbps x264 encoded from DVD is obviously not the same thing as a 1Mbps x264 encoded from a 2Mbps XviD encoded from a DVD. But a doubt I now have after your post is: will the second encode (1Mbps x264 from 2Mbps XviD from DVD) be any better than a 1Mbps XviD ripped from DVD? Will it be so much worse than the first encode (1Mbps x264 from DVD)?

    Originally Posted by jagabo View Post
    Placebo is a waste of time. Slow or veryslow is as far as you ever really need to go.
    I'll keep that in mind. What I didn't understand is: what does encoding speed affect here? I believe it isn't size, as I decide the bitrate. Is it quality? Is a 1Mbps veryslow encode visually better than a fast one?

    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.
    Quote Quote  
  11. Originally Posted by HisDudeness View Post
    But a doubt I now have after your post is: will the second encode (1Mbps x264 from 2Mbps XviD from DVD) be any better than a 1Mbps XviD ripped from DVD? Will it be so much worse than the first encode (1Mbps x264 from DVD)?
    Both of those questions are hard to answer because it will depend on the particular video and how much bitrate it needs.

    Originally Posted by HisDudeness View Post
    What I didn't understand is: what does encoding speed affect here? I believe it isn't size, as I decide the bitrate. Is it quality?
    Yes. Since you are specifying the bitrate (and hence the file size) the encoding settings effect the quality. It's impossible to judge very small differences in quality. But if you use CRF (constant quality) encoding you can easily see the difference in file size. The slower presets will give smaller files. What you'll find is that as you go from slow, to veryslow, to placebo encoding times get much longer, but the file size decreases by very little. So, if the difference between slow and placebo is a 1 percent decrease in file size, that means you would have to use 1 percent more bitrate at slow to get the same quality as placebo. But you really can't see quality differences that small. All you've done is double or triple your encoding time for something you can't see.
    Quote Quote  
  12. Urban Achiever HisDudeness's Avatar
    Join Date
    Jan 2013
    Location
    Melzo, Milan (Italy)
    Search Comp PM
    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 added
    The Dude minds.
    Quote Quote  
  13. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    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.
    Last edited by sanlyn; 25th Mar 2014 at 06:04.
    Quote Quote  
  14. Urban Achiever HisDudeness's Avatar
    Join Date
    Jan 2013
    Location
    Melzo, Milan (Italy)
    Search Comp PM
    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.
    Quote Quote  
  15. 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.
    Quote Quote  
  16. Urban Achiever HisDudeness's Avatar
    Join Date
    Jan 2013
    Location
    Melzo, Milan (Italy)
    Search Comp PM
    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 forgotten
    The Dude minds.
    Quote Quote  
  17. Urban Achiever HisDudeness's Avatar
    Join Date
    Jan 2013
    Location
    Melzo, Milan (Italy)
    Search Comp PM
    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.
    Quote Quote  
  18. Originally Posted by HisDudeness View Post
    x264 [warning]: --psnr used with psy on: results will be invalid!
    x264 [warning]: --tune psnr should be used if attempting to benchmark psnr!
    I can't answer the questions about Handbrake's command line interface. But the psnr warning is informing you that psnr reports may not accurately reflect visual quality when using psy optimizations.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!