Simple question; I'm converting most of my DVDs to digital files, and I don't understand why when I see source showing "720 x 480", and I have "Keep Aspect Ratio" checked, the size on every movie changes; primarily the height changes from movie to movie. Is this cropping detecting that the movie height isn't really 480?
I'm encoding for Plex with a Roku client, and I want good quality, but trying to keep size sort-of reasonable.
+ Reply to Thread
Results 1 to 29 of 29
The video is resized to the DVDs display aspect ratio and with cropping of black borders. So the Pixel Aspect Ratio will be around 4:3, 16:9 or 2:35:1.
You can also keep it as 720x480 for all movies with just 16:9 or 4:3 Display Aspect Ratio flags. But not all video players supports it.
Read 'What is a dvd' on the left of this screen.
All US dvds have a SAR of 720*480. But the Display Aspect Ratio, which is what you are keeping when you check that box is different. A pure 4:3 video could be 720*540 whereas a 16:9 video will have even less height pixels.
The automatic cropping will remove any black bars etc which will in turn change the height and/or width of the video. Often the remaining dimensions will differ according to the amount of cropping.
DVDs don't use square pixels. A 16:9 NTSC DVD has a resolution of 720x480 but displays using the equivalent square pixel resolution of 853x480. (853/480 = 16/9)
If you select "anamorphic none" and "keep aspect ratio" is checked, HandBrake will resize the DVD to square pixel dimensions for you, then encode it. However instead of taking the 720x480 DVD and resizing to 853x480, it keeps the original width and reduces the height instead, giving you roughly 720x404. If you decide to resize the video further by adjusting the width, HandBrake will automatically adjust the height. The lower the value you specify in "Modulus" the more accurately Handbrake can resize the DVD. Because the "anamorphic none" option resizes the DVD to square pixels by reducing the height you can lose a little of the resolution. Many people resize to 854x480 instead, but HandBrake won't let you do that.
The anamorphic "strict" option doesn't resize the DVD at all. It encodes it at 720x480 (or whatever is left after cropping) and the player resizes the video on playback just as it would the original DVD. This should give you better quality, but not all devices will resize the video correctly on playback. Anamorphic "loose" is much like anamorphic "scrict" except it may resize the video a little. The explanation for why it exists would take a bit of typing..... personally I'd use anamorphic strict if your player displays the encoded video correctly, and anamorphic none with the modulus set to 2 if it doesn't.
Or Try VidCoder, It's an alternative HandBrake GUI. It'll let you resize "up" to 853x480 for better quality (although the file sizes will be larger. Ideally you'd take the original height (480), then subtract the top and bottom cropping. For example if you cropped 40 pixels from the top and 40 from the bottom the new height would be 400. Then you'd adjust the width. Vidcoder will adjust the output dimensions it displays as you do. When the output height equals 400, that'd be the ideal resizing.
Thanks for the clarifications. As handbrake doesn't show any details on the cropping when you set it to automatic, I was just left wondering why the pixel height was changing when I checked the "keep aspect ratio" box. I'm not dissatisfied at all with handbrake, only looking to understand what it's doing as much as possible.
I've been following the "Rokoding" guide http://roku.yt1300.com/ to encode for Plex+Roku. At this point my only question is why it seems like DVDs end up hardly any smaller than blu-rays. I do scale my blu-rays down to 720p, with constant quality and RF 23, whereas I'm using constant quality/RF19 on DVDs, but I'd think that with more pixes the blu-rays would end up a lot larger, but they only seem to be ~30% larger. I'm going to try encoding the same movie from a DVD and a blu-ray and see what a direct comparison looks like.
No of pixels have nothing to do with video size. Size = run length * bitrate. So if your Blu-rays have more bit-rate (to allow for more pixels) then the size will be bigger.
Unless I'm completely crazy, pixels would directly correlate to the bitrate. More pixels = more information, and of course it's all being crunched through a very sophisticated compression algorithm, which means that the amount of change, and the compressibility has a lot to do with the ending bitrate, but if you have more information to start with, you're likely to end up with more information after compression. Also note- I'm using constant quality, rather than 2-pass and a target bitrate. I assume that the bitrate varies during the stream; I would assume that more action and more change from frame to frame would create a spike in bitrate compared to a relatively static shot. Now, this is based on understanding of general computing principals rather than intimate understanding of video codec internals, so if I've got anything wrong, please feel free to correct my misunderstandings.
It may seem counterintuitive initially, but as DB83 says size=run length*bitrate. It's the only truth. It's kind of a mantra around here. Repeat it and be enlightened.
And yes, assuming variable bitrate encoding, your internal logic here is correct:
I assume that the bitrate varies during the stream; I would assume that more action and more change from frame to frame would create a spike in bitrate compared to a relatively static shot.
Last edited by smrpix; 7th Jan 2013 at 19:01.
Hmm. Is bitrate always fixed in video files? Also, what are the determining factors for bitrate? As I said before, I am using constant quality rather than 2-pass. 2-pass allows me to specify a target bitrate, does constant quality create a variable bitrate, or auto-figure a bitrate?
I saw an encode of Iron Sky where the quality was generally quite good, but early on when the videowas showing a moon lander cruising across the face of the moon, and the shot was also panning across the face of the moon, the video looked like it was dropping frames. My guess is that someone specified a target bitrate, and the rate of change during that pan shot with lots of little details moving was too much to encode at the bitrate, so it ended up dropping a lot of the intermediate infor. Is that a fair guess about what was going on?
I'm curious about how I go about avoiding that- I was hoping that I wouldn't have to worry about that using constant quality. Any tips are appreciated.
Last edited by ikarius; 7th Jan 2013 at 19:04.
Also, what are the determining factors for bitrate?
...does constant quality create a variable bitrate...
Okay, cool. So, I'm not completely off base, most of my educated guesses were in the right ballpark. The lack of difference probably comes down to using constant quality of 19 for DVD and 23 for BD, which means it's working much harder to compress the blu-rays. I'll do some more experimentation to see how far I can push up the CQ scale for DVDs without seriously degrading them.
Yep, the Rokoding site suggested those CQ settings, with a lower compression setting for DVDs, without explaining why they recommend it. I imagine it comes down to not wanting to further degrade the DVD picture, as it's only 480p to begin with. I'll experiment more, now that y'all have helped me understand what's going on a bit better. Cheers!
If it's 16:9 I'd resize it to 854x480, which is 16:9, but you can use any 16:9 resizing. 832x468, 704x396 etc. They're all 16:9. For 4:3 I'd resize to 640x480. To resize that way using Handbrake, it's the "anamorphic none" option.
DVDs aren't 16:9 or 4:3. They get resized to 16:9 or 4:3 on playback. You can use anamorphic encoding and encode the DVDs "as-is", but it relies on the player resizing to the correct aspect ratio (not always the case for MKV and MP4 when it comes to hardware players). The alternative is to resize to square pixels and the correct aspect ratio before encoding, then the player doesn't have to get it right.
film is NOT 720*480
even TV is not 720*480
a wide screen Movie, might 2.21:1 aspect ratio
and display on TV at 840*3xx pixels
the width will be stored in a compressed frame width at 720*480 with black padding top and bottom
and then shown on the TV in the original 840 width by 480 height with black padding top and bottom as part of the 480 height
the dvd player or the TV will up scale that to 1280*720 or 1960*1080 depending on your tv resolution (1280*768 is common on PC displays
when you convert, handbrake expands the frame with to the displayed width not the compressed stored width (if it used the stored width your picture would look squished in when playing)
and then crops off the black padding top and bottom saving the video in the original frame size as close as possible
Wizard, thank you... but that didn't really answer my question
it answered it exactly
you know what a ZIP file is, it is compressed to take up less space, you down load a zip then unpack it to use it
wide screen video stored on a DVD is stored is squeezed horizontal, its NOT a 740 wide video frame
it is an 840*xxx frame, stored in a 740 pixels wide , it is compressed
the height is padded to 480 and then the whole frame is squeezed/compressed to 740 wide
the unpacking to correct width is done when it is displayed
when you convert with handbrake or any other video software, it creates new UN-compressed UNpadded display sized frames
height does not gain more pixels vertically, check you file with media info, but width does
but it may Display larger on your PC screen, because the padding has been removed and the video can use more of the vertical space of your PC display when using vlc or other 'player'
Last edited by theewizard; 21st May 2016 at 02:01.
x264 encoder and output MP4. I think even newer Apple devices still have a limit for soundtrack audio of stereo AAC with a maximum bitrate of 160kbps.
Handbrake will automatically take care of the cropping and resizing to square pixels if you use "anamorphic none" and I think there's a checkbox for automatic resizing.... for older versions of Handbrake at least. Software players shouldn't have problems with anamorphic MKV/MP4 but some hardware players won't display it correctly, so I'd use "anamorphic none" and let Handbrake resize.
After cropping any black around the edges you mightn't be left with an output that's exactly 4:3. Sometimes it's a little wider, sometimes more narrow. I prefer to keep the aspect ratio to a minimum of 4:3, preferably exactly 4:3 (it's an OCD thing) and sometimes you need to manually crop a few extra pixels of picture to make it 4:3 again, rather than simply squish it to 4:3.
Have a play with this resize calculator. YodaResizeCalculator
When you open a video with Handbrake it'll automatically crop the cud and it displays the amount of cropping.
Open the calculator, select NTSC 4:3 as the source, resize to 640x480 and add the cropping Handbrake displays. The calculator will display the amount of aspect error. Increase the cropping for either the sides or top and bottom until the calculator displays a source aspect ratio as close to 1.333333 as possible. Adjust Handbrake's cropping and resizing to match.
That's only if you're fairly fussy. Handbrake calculates the resizing too but it doesn't show you the amount of aspect error and it won't adjust the cropping to always output the same aspect ratio..... if you'd prefer to.
For Handbrake, the cropping needs to be in multiples of two. Leave the "Use ITU-R BT.601 coefficients" option checked in the calculator. That mat cause it to calculate the resizing a little differently to Handbrake. It's a long story but believe it or not the official resizing for 4:3 DVDs is actually a little wider than 4:3. It's about 1.367:1 rather than 1.333:1. When the crud is cropped from the sides you're usually left with something close to 4:3. The "Use ITU" option in the calculator I linked to will probably be more technically correct for 4:3 DVDs, but even if you don't end up using it for setting up encodes, have a play with it. It might make understanding DVD aspect ratios and resizing a little easier. It's not all that hard once you get your head around it.
I never said anything about widescreen. My DVDs are standard def, 4:3 720x480. I want to convert those DVDs to MP4 with Handbrake and create files that will be sold as downloadable video products on the web. All I'm asking is what the best frame size, anamorphic, and modulus settings should be set to for best preservation of quality. Once I know that, I can play with the bitrate or quality. Just trying to get a good starting point.
I got the calculator, I selected NTSC 4:3, selected MOD 4 according to jagabo, here's a screenshot attached. I don't know what it's telling me?
There is a disagreement between the DVD (MPEG 2) spec and the ITU spec (the international standard used when digitizing analog video sources). The DVD spec says the entire 720x480 frame comprises the 4:3 image. But the ITU spec says the 4:3 image is captured in a ~704x480 frame, usually with 8 pixels of extra capture at the left and right edges in case the cap is slightly off center. So in a 720x480 ITU capture the full frame represents something slightly wider (~2 percent) than 4:3. That's what Yoda's calculator is telling you.
Mostly though, you'd be cropping away some crud when encoding. Handbrake will display it's automatic cropping in the same way as the calculator so you can copy the cropping it displays. I'm just making stuff up here as each DVD will be different, but lets imagine Handbrake auto-cropped 14 pixels from the left, 16 from the right and 4 from the bottom. You could copy that cropping to the calculator like this and resize to 640x480.
After cropping it's showing you the source aspect ratio is 1.3196 and you're still resizing to 1.3333 so there's an aspect error of 1%. That's quite small (I'm fairly OCD about resizing but as long as any aspect error is less than 1% I'm happy). If you were to crop an extra 2 pixels top and bottom, which removes a tiny little bit of picture, the aspect error is reduced to 0.18%.
Also increasing the cropping by 2 pixels on the left will get even closer to a zero aspect error.
Generally you'd want to increase the copping as reducing it would probably leave a small amount of black border uncropped. That's up to you though. When you're happy, copy the new cropping to Handbrake and make sure it resizes the same way. Don't worry too much about the width or height fields turning red. That's just to let you know when you start to resize "up" rather than resize "down".
As I said, none of that's completely necessary. Handbrake will automatically crop and resize while distorting the picture as little as possible, but for the example above you'd probably end up with an output aspect ratio of 1.31 and a resolution of 628x476. The calculator makes it easier to adjust the cropping to output the same resolution each time while distorting the picture as little as possible, assuming that's what you'd prefer. I do, but that's just me.
Last edited by hello_hello; 21st May 2016 at 14:05.
too the OP
NO theatrical movie DVD is a 4:3 aspect, (unless it is very old) it might be letter boxed inside a 4:3 frame, but it was not filmed that way
are your dvds all old TV shows or old movies from the 40's
how about a screen shot of one of these dvds,
This stuff is way over my head, I don't understand it. I appreciate all your detailed explanations. I just wish I understood.
After reading all of this, I still don't know what to do in handbrake. This isn't so mission critical that every last pixel matters. I just wanted to know the best (in general) settings for converting my DVDs to MP4 regarding frame size, anamorphic and modulus.
To resize to square pixels, use "anamorphic none". If you resize either the width or height, Handbrake will resize the other one automatically (the old version had a "keep aspect ratio" checkbox next to the resizing but I think the new version does it without the checkbox). A modulus of 2 (width and height evenly divisible by 2) will give you the most accurate possible resizing. A modulus of 4 (width and height evenly divisible by 4) might resize a little less accurately, but it should be 100% player compatible.
For a 4:3 DVD I don't know what resizing Handbrake will default to. I'd resize to 640x480, or as close as you can, depending on the aspect ratio after cropping.
Handbrake's auto-cropping should be enabled by default.
Enable the Decomb filter (set it to "default"). Disable any other filters.
For the output frame rate I'd select "same as source" and "constant frame rate".
For x264 encoding pick a quality (start with CRF18 if you want a fairly "transparent" encode), and the slowest x264 speed preset you can stand. The default of "medium" is fine.
That's about it. Start with Handbrake's high profile preset, adjust the necessary settings and save them as a new preset. I think by default Handbrake includes any AC3 audio "as-is" and also includes a re-encoded AAC stereo version for Apple-friendliness. That's probably not a bad idea for you.
If you want to use anamorphic encoding all of the above applies except I'd select "anamorphic strict" in your case. There's no resizing to worry about for "anamorphic strict". Handbrake just crops and encodes and sets the correct aspect ratio. Resizing is disabled.