VideoHelp Forum
+ Reply to Thread
Results 1 to 29 of 29
Thread
  1. Member
    Join Date
    Mar 2009
    Location
    singapore
    Search Comp PM
    I'm using winff video converter to convert avi to avi by using 2pass mode.If i want exact output or as close as possible should i add average bitrate or max bitrate in bps or would it choose by it self if i leave it blank?
    Quote Quote  
  2. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    If the encoder is good at what it does, putting an average bitrate into a two-pass encode should get you the right file size, and be as close as a single pass constant bitrate encode. Maximum and minimum settings are there to help constrain the peaks so you don't get spikes ir deep troughs, however the closer the minumim or maximum are set to the average, the lest value you get from VBR encoding.
    Read my blog here.
    Quote Quote  
  3. Member
    Join Date
    Jun 2010
    Location
    Out there
    Search PM
    This where I still need some learning. So many methods out there, should I also look for specific target size or let the encoder determine the output size by performing its job.

    VBR, CBR or Constant Quantization ? FFmeg is used by most applications, but for HD sources which method is better for converting to DVD.
    Quote Quote  
  4. Member
    Join Date
    Mar 2009
    Location
    singapore
    Search Comp PM
    Hey i wanna know if would automatically choose bitrate or not if i only check 2pass and leave blank on bitrate .thanks!!
    Quote Quote  
  5. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    For DVD you have a finite amount of space that you have to fit into. Use a bitrate calculator to work out, based on your running time and disc size (SL vs DL), what your bitrate will be. If it is less than around 7600 kbps then I would suggest 2 pass VBR, using the calculated bitrate as the average, with a max of 9200 kbps

    If you are encoding for DVD then I would suggest you look at AVStoDVD. It uses HCEnc for encoding (I prefer it over ffmpeg by a long way) and will take all the headaches out of calculating bitrates because it will do all this for you.
    Read my blog here.
    Quote Quote  
  6. Originally Posted by cowboyup910 View Post
    VBR, CBR or Constant Quantization ? FFmeg is used by most applications, but for HD sources which method is better for converting to DVD.
    CBR: contant bitrate. The encoder uses the same bitrate for all scenes. Scenes that don't really need all that bit rate will get too much (wasting bitrate), scenes that need more won't get it (reducing their quality). File size = bitrate * running time.

    VBR (2 pass): variable bitrate. The encoder first examines the video to determine which scenes need more bitrate and which don't need much. During the second pass it allocates bitrate to each scene. Those that need more bitrate get more bitrate, those that need less bitrate get less. Overall, the average bitrate comes out to the average you specified (and hence a known file size -- file size = average bitrate * running time).

    Constant Quantizer: constant quality. Each frame (more or less) gets whatever bitrate it needs to maintain the quality you specify. The lower the quantizer the higher the quality. You don't know what the final average bitrate will be, and hence, you don't know the final file size.

    You only want to use CBR if your target playback device only supports CBR. Or when you want a quick encode and don't mind wasting bitrate (for example when putting less than 1 hour on a DVD you can just encode at ~9000 kbps).

    You use 2-pass VBR when you need a specific file size. Like when putting 2 hours of video on a single layer DVD. This will maximize quality for that file size.

    You use Constant Quantizer encoding when you don't particularly care about file size, you just want a particular quality.
    Last edited by jagabo; 17th Sep 2010 at 09:12.
    Quote Quote  
  7. Hi Jagabo

    That's a really concise but useful way to explain it! Just a quick question... Constant Quantizer... if I have a source video that's already been converted downwards from a bluray rip (say an average length movie to a size of around 5gb) is there anyway of working out what the constant quantizer level for that file was?
    Quote Quote  
  8. Member
    Join Date
    Jun 2010
    Location
    Out there
    Search PM
    Thanks Jagabo for the explanation!

    Looks like Constant Quantizer is a good method for me, but finding an application that follows this method is hard.

    When ripping a DVD, Handbrake allows you to use the constant quality method. The quality comes VERY close to the original file and is somewhere between 800-1500MB file size.

    For me, I don't particularly care about file size or encoding time, quality is more important. I think more application should allow for constant quality.
    Quote Quote  
  9. Originally Posted by cowboyup910 View Post
    I think more application should allow for constant quality.
    And I think most of the ones with which I'm familiar already do.
    Quote Quote  
  10. Jagabo & Manano, can I ask a bit more abut constant quantizer....

    When you say constant quality, is that quality the same equality across all video files (I understand why each file could vary massively in size depending on bit rate needed to meet a specific quality) or is the quantizer amount only relative to the quality of each individual movie?

    What I mean is, if you encoded three separate files, say Matrix, Darjeeling and La Haine (I tried to think of three different video/action types), and you set the quantizer to 23, as long as the quality was already there in the original source would they all have the same quality?

    I have a load of blu-ray (720p) rips that are between 4gb and 8gb each that I want to re-encode to smaller files without losing too much noticeable quality and I'm struggling to settle on a decent standard setting. Ideally I'd like them all to be around 3gb on average. I've mostly been trying numerous vbr 2-pass settings, from 3000 upwards and get varying results, although all usually pretty good. I've also tried a few constant quantizer conversions over the last few days - prince of Persia gave a file of around 4gb on CQ23 whilst Iron Man 2 gave a file of 2.1gb, which surprised me somewhat! I thought both would be a larger file given that they're action.

    What is also confusing me is that when I download HD (720p) US TV shows the files are all 1gb for a 40-45 minute show. They generally look very good on my 42" TV, suggesting that around 1gb per 40 mins is a good calculator. However, there is still some variation in quality of those (Burn Notice is usually a poorer quality to say CSI, Lost) and i presume they use a final file size setting when encoding.

    I guess that the way to go is CQ, but I need to determine what level of CQ is acceptable to me for use on a 42" TV, and I think that's where I'm struggling now!

    Is there an program that can scan a file and tell you what quantizer setting it would be equivalent to? Mediainfo just tends to show the average bit rate (and I'm not sure how accurate it is in determining the average).

    And apologies for jumping on the thread OP!
    Quote Quote  
  11. Member
    Join Date
    Jun 2010
    Location
    Out there
    Search PM
    Originally Posted by manono View Post
    Originally Posted by cowboyup910 View Post
    I think more applications should allow for constant quality.
    And I think most of the ones with which I'm familiar already do.
    Can you name one that goes from a Video file to DVD, not from DVD to AVI/MKV

    Sorry to the OP, I dumped all over his thread.
    Quote Quote  
  12. Originally Posted by cowboyup910 View Post
    Can you name one that goes from a Video file to DVD, not from DVD to AVI/MKV
    What, MPEG-2 encoders that allow you to encode using a CQ mode? CCE and HCEnc, for two.
    Quote Quote  
  13. Originally Posted by Emanef View Post
    When you say constant quality, is that quality the same equality across all video files...?
    Of course not. It's constant relative to the quality of the source file. To think otherwise implies you think the quality might actually improve when starting with a lousy source.

    Bitrate Viewer can give you the average quant for MPEG-2 video (sort of), DRF Analyzer for Xvid/DivX, but I don't think there's any such app (yet) for other codecs. So, as for reencoding your already reencoded MKVs (or whatever they are) files to make them smaller, you don't really know the average quant used for the downloaded source, how much it's already been compressed from the TV cap (which has itself already been reencoded) or the Blu-Ray source, so it's kind of a crapshoot as far as trying to figure out what setting you should use for your reencoding.
    Quote Quote  
  14. Originally Posted by Emanef View Post
    I've also tried a few constant quantizer conversions over the last few days - prince of Persia gave a file of around 4gb on CQ23 whilst Iron Man 2 gave a file of 2.1gb, which surprised me somewhat! I thought both would be a larger file given that they're action.
    Many things effect the bitrate requirement. The amount of noise in the video has a very large effect -- more noise needs more bitrate. The bigger the frame size the more bitrate you need. The higher the frame rate the more bitrate you need. Things like smoke, fog, strobe lights, sunlight reflecting off of waves, shaky camera work, etc all require more bitrate.

    Originally Posted by Emanef View Post
    Is there an program that can scan a file and tell you what quantizer setting it would be equivalent to?
    This is relatively useless information unless you are going to use the same codec, the same settings, etc.
    Quote Quote  
  15. Ah, ok, thanks guys. So I guess it's a case of trying each file at a few different settings and decide the minimum I'm happy with for each.

    The reason I asked if there was anything that could scan a file and tell you what quantizer was used was because it might make it easier to then work out what one to try it on to make it smaller; ie if a file was done on CQ21 you'd know what the quality of it was by watching it and that by then trying CQ23 will give a smaller file but possibly with not much loss in quality of the orginal, if that makes sense.
    Last edited by Emanef; 23rd Sep 2010 at 11:04.
    Quote Quote  
  16. With CQ numbers like 23 it sound like you are using x264. Xvid or Divx with CQ=23 would look horrendous!
    Quote Quote  
  17. Yes, sorry! Should have mentioned I'm using x264! Thought I had!
    Quote Quote  
  18. CRF works better (smaller file size, better quality) than CQP in x264. I usually use CRF=20.
    Quote Quote  
  19. CRF?! I usually use Xvid4PSP, btw (as it's the one that's least likely to crash on my pcs!)
    Quote Quote  
  20. I believe "Constant Quality" is CRF in Xvid4PSP. "Constant Quantizer" is CQP.
    Quote Quote  
  21. Originally Posted by jagabo View Post
    CRF works better (smaller file size, better quality) than CQP in x264. I usually use CRF=20.
    What size TV do you watch those back on, just out of interest?

    I've tried converting a few at different CRF settings to test, and they are reducing the file size somewhat. I'm going to do a few with different movies so I can copy them over to my Popcorn to compare them.

    I've done Reservoir Dogs from a file that is 4.37gb and has an average rate of 5671Kbps. At CRF 19 it gave me a file of 1.98gb at 2172Kbps, at CRF 20 it gave me 1.71gb at 1789Kbps and at CRF 21 I got 1.49gb at 1473Kbps.

    All of these are quite lower than I expected to be able to get. If they play back well I'll be pretty pleased with any of those reductions in file size.

    I also tried a Stepbrothers file that is 5.72gb at 7385Kbps. At CRF 20 it gave me a 2.1gb file at 2472Kbps and at CRF 18 I ended up with a 3.33gb file at an ave bit rate of 4136Kbps.

    I think I now need to establish what CRF is acceptable for me for playing back on a 42" screen.

    When you say you usually use CRF 20, why is that? Presumaby the quality at that setting is relative to the quality and complexity of the movie? Or does it give a similar result across all files (assuming they all started at a higher quality) and it's the file size and bit rate that varies?

    Also, how does the quality of CRF affect different resolutions of video, ie dvd settings, 720 and 1080? I know a rip from a dvd will never compare to a blu-ray, but does it keep a certain quality within the given comparable resolution within that file (I think I mean that if you took a looked at say a 200x200 sample of a dvd rip would it be of a similar quality to a 200x200 sample of a 1080 rip in so far as the sharpness of what was in that segment?)

    I've been using XVid4PSP 6 Daily (quite a, er, busy interface, I must say!) on my laptop which does have a CRF setting. My desktop still has version 5, so the settings I've assumed is CRF is the constant quality one.

    Had a read of this as well which made things a little clearer on CRF - http://trac.handbrake.fr/wiki/CRFGuide
    Last edited by Emanef; 26th Sep 2010 at 09:03.
    Quote Quote  
  22. Originally Posted by Emanef View Post
    I think I now need to establish what CRF is acceptable for me for playing back on a 42" screen.
    Yes. I'm watching on a 46" LCD, from about 10 feet away.

    Originally Posted by Emanef View Post
    When you say you usually use CRF 20, why is that?
    Just because I decided that gave a good compromise of size vs quality. MPEG 2 DVD videos get significantly smaller and the visual quality isn't too noticeably degraded at normal playback speeds. I also keep the original frame size and use PAR/DAR flags for the aspect ratio.

    Originally Posted by Emanef View Post
    Presumaby the quality at that setting is relative to the quality and complexity of the movie? Or does it give a similar result across all files (assuming they all started at a higher quality) and it's the file size and bit rate that varies?
    With constant quality encoding the quality (relative to the source) is always the same. The resulting file size varies depending on the nature of the video.

    Originally Posted by Emanef View Post
    Also, how does the quality of CRF affect different resolutions of video, ie dvd settings, 720 and 1080?
    The quality is the same (again, relative to the source). The bigger frame size (other things being equal) will result in a bigger file.

    Originally Posted by Emanef View Post
    I know a rip from a dvd will never compare to a blu-ray, but does it keep a certain quality within the given comparable resolution within that file (I think I mean that if you took a looked at say a 200x200 sample of a dvd rip would it be of a similar quality to a 200x200 sample of a 1080 rip in so far as the sharpness of what was in that segment?)
    Yes.

    With lossy encoding you have basically two choices:

    1) Constant quality encoding where you know what the quality of the result will be but you don't know the final file size.

    2) Bitrate based encoding where you know what the final file size will be but you don't know the quality.
    Quote Quote  
  23. Thanks for that jagabo! That's really helpful, really appreciate your time! I've spent ages re-encoding files into various sizes but have struggled to settle on any settings. At least I feel like I'm getting there now!
    Quote Quote  
  24. Interesting... I've done two more over night. Evil Dead, which was 8000Kbps and about 6gb in size and Kung Fu Hustle, which was about 6Gb and about 6500Kbps. Using the CRF20 setting Evil Dead only shrunk to 4gb and 6500Kbps ave, whereas Kung Fu Hustle shrunk to 2gb at CRF18 setting!

    From this I presume that even though the quality of Evil Dead is poor, the fact that it's old and grainy video means a lot more data is needed for it, compared to Hustle, which looks great but is very clean and modern so needs much less data to keep quality?
    Quote Quote  
  25. High compression codecs get most of their compression by only encoding the changes from frame to frame. Anything that causes more changes between frames makes it much harder for the codecs. Film grain and broadcast static are some of the worst offenders.
    Last edited by jagabo; 27th Sep 2010 at 12:21.
    Quote Quote  
  26. Ah ok. So for those ones will I get a better balance by setting an aimed filesize or bit rate and not rely on CFR?
    Quote Quote  
  27. Originally Posted by Emanef View Post
    Ah ok. So for those ones will I get a better balance by setting an aimed filesize or bit rate and not rely on CFR?
    If you make a CRF encoding at it comes out to a particular file size, then perform a 2-pass VBR encoding for that same frame size, the two files will look nearly identical. If you want a particular frame size use 2-pass VBR bitrate based encoding. If you want a particular quality use single pass CRF encoding.
    Quote Quote  
  28. Member
    Join Date
    Dec 2004
    Location
    U.S.
    Search Comp PM
    Originally Posted by guns1inger View Post
    If the encoder is good at what it does, putting an average bitrate into a two-pass encode should get you the right file size, and be as close as a single pass constant bitrate encode. Maximum and minimum settings are there to help constrain the peaks so you don't get spikes ir deep troughs, however the closer the minumim or maximum are set to the average, the lest value you get from VBR encoding.

    I used quantizer 3 in single pass mode for the first two minutes' worth and for the first eleven minutes' worth of a movie that I want to convert using ffmpeg vcodec=mpeg4

    MediaInfo reported avg 246 kbit/s for the two min clip and avg 396 kbit/s for the eleven minute clip.

    My conclusion is that if I use a sample size (of the movie) that is too short in length, the average bitrate for that clip might not be close enough to the optimal bitrate that I should use in two pass mode.

    Is there a way of determining the average bitrate I should use in two pass mode without resorting to encoding the entire movie using quantizer 3, analyzing the encoded file with MediaInfo to arrive at the value for the average bitrate, and then encoding the entire movie all over again this time using two pass mode ?
    Quote Quote  
  29. Originally Posted by Matt_ View Post
    Is there a way of determining the average bitrate I should use in two pass mode without resorting to encoding the entire movie using quantizer 3, analyzing the encoded file with MediaInfo to arrive at the value for the average bitrate, and then encoding the entire movie all over again this time using two pass mode ?
    Xvid performs a Target Quantizer 2 encoding during the first pass and saves the size of each frame in the stats file. Normally it discards the actual video during this pass (just passing black frames to the output video) . If you disable the Discard First Pass option it will save the TQ2 video. You could then analyze that file for the average bitrate and use a 40 percent lower bitrate* for the second pass.

    But the only reason to do this would be to make sure your video conforms to the bitrate peak limit of a particular profile. Otherwise, a TQ3 encoding of a video and a 2-pass encoding of the same video at the same bitrate will look pretty much the same.

    * I just ran a comparison with a handful of videos: TQ3 encodings had 30 to 45 percent lower bitrates than TQ2 encoding of the same video. Also, the first pass of a 2-pass encoding uses lower motion search settings. That increases bitrate by about 5 percent. So I'd try using a bitrate about 40 percent lower than the first pass of the 2-pass encode. This won't be as accurate as encoding the entire video at TQ3 then performing a 2-pass encode at the same bitrate. But it should still be better than using the same bitrate for all videos because you read somewhere that N kbps was "best", or encoding all your videos to 718 MB because 10 years ago everyone wanted their videos to fit on a CD.
    Last edited by jagabo; 11th Nov 2011 at 08:58.
    Quote Quote  



Similar Threads

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