View Full Version : Should I do Anamorphic or 720x400 mkv
peppi_le_piou
10th January 2015, 08:37
I'm moving from avi to mkv so is a new learning experience. Using Handbrake should I make my video 720x400 after cropping or to use Loose anamorphic which resizes to default a 1024x576 (less any cropping), at High Level 4.1
I assume that the program adds a PAR multiplier.
If I go with the lower resolution I guess the widescreen TV will do the upscaling. Will one or the other give better picture quality?
720.horiz will create a file about 900Mb and 1024.horiz is about 1,400Mb.
DarkSpace
10th January 2015, 10:33
Why do you resize the video at all? Matroska doesn't care about your video's resolution, it has a Display Aspect Ratio flag, so you can just leave the video at its original 720x480 resolution (or whatever the resolution may be after cropping off the edges, filtering, or whatever else you choose to apply before encoding). Additionally, if you use e.g. h264 as your video codec, you can write the Pixel Aspect Ratio to the bitstream, so even when the container's AR (Display AR) flag is somehow ignored, the decoder still knows the video's AR (Pixel AR; how to multiply the axes in order to derive the Display AR).
hello_hello
10th January 2015, 17:49
There's a TV player with a built in media player and a Bluray player in this house that ignore aspect ratios for MKVs/MP4s. Maybe Samsung have improved their players these days (mine are 3 or 4 years old) but as a result I resize to square pixels.
Are you sure Handbrake's "loose anamorphic" resizes to 1024x576? I think you'll find that's the display dimensions, not the resolution. Handbrake displays both when using anamorphic encoding. I'm pretty sure "loose anamorphic" would encode at a 720x576 resolution while setting the display dimensions to 1024x576.
By definition, "anamorphic none" is not anamorphic, so it's the option that resizes to square pixels. Only as far as I know, Handbrake won't resize "up". The maximum width would be 720 (so it'd resize to something like 720x400). If that's still that case with the current version, try Vidcoder. It's an alternative Handbrake GUI and I'm sure it defaults to resizing "up" when using the "anamorphic none" option (it'd default to 1024x576). Unless the latest version is different, Handbrake won't resize "up" when resizing to square pixels.
If you resize "up" (1024x576) it'll usually retain more fine detail than resizing "down" (720x400). Having said that, I often resize 16:9 PAL to 960x540 as a compromise. I generally can't see a loss of detail compared to 1024x576 and it keeps the file size down a little. If I was to resize "down" (and the video was 16:9), I'd probably go with 704x396 rather than 720x400 as the former is exactly 16:9. Or 720x404 as it's virtually 16:9. However you do it though, there's no need to stick to mod16 dimensions with x264 encoding.
Which is why if I was going to use anamorphic encoding, I'd probably go with the "anamorphic strict" option. It's the one that doesn't resize. You'd crop if need be, and what remains is encoded "as-is". "Anamorphic loose" can sometimes resize a little. It's the anamorphic option you'd use if you want to stick to certain dimensions, such as mod4, mod8 or mod16 etc.
As an example, if you cropped 4 pixels from the bottom, "anamorphic strict" would encode at 720x572 while setting the display aspect ratio to 1024x572. "Anamorphic loose" might resize back to 720x576 (depending on the modulus setting) and adjust the pixel aspect ratio accordingly so the display aspect ratio is still correct.
Anyway, I've not used Handbrake much, but that's my understanding of it's encoding options. Whether you resize to square pixels or use anamorphic encoding is personal choice, unless you have a player that makes it for you. ;) If you do want to resize to square pixels, "anamorphic none" is the option you want. If Handbrake won't resize "up", try Vidcoder instead.
DarkSpace
10th January 2015, 19:29
There's a TV player with a built in media player and a Bluray player in this house that ignore aspect ratios for MKVs/MP4s. Maybe Samsung have improved their players these days (mine are 3 or 4 years old) but as a result I resize to square pixels.
Wow, that sounds rather broken, but it exists, so there may still be valid reasons to resize the video, after all.
It sounds like hello_hello is more qualified to help you than I am, so I'll leave it at "remember to check whether your playback device honors the Aspect Ratio flag"...
Asmodian
11th January 2015, 01:41
Not resizing at all and using anamorphic offers the best quality, especially for the size, assuming the play back chain respects aspect ratio and has a decent resampler. I would over-crop to mod 4 to maintain mod 4 instead of resizing.
However, as hello_hello described, there are bad players that do not believe in anamorphic but they are getting rarer as old devices are removed from service. Any new device that does not respect anamorphic flags should be returned in my opinion. I have not seen one in the last couple of years but I am sure at least one is still being sold.
Personally I always use anamorphic but I am willing to get a new playback device if necessary. Maintaining as high quality as possible at a smaller size is what video compression is all about, losing quality resizing down to square pixels is bad and so is gaining size without gaining quality by resizing up. ;)
hello_hello
11th January 2015, 11:02
Maintaining as high quality as possible at a smaller size is what video compression is all about, losing quality resizing down to square pixels is bad and so is gaining size without gaining quality by resizing up. ;)
I'll confess I'm a little on the fence when it comes to the last part.
Resizing up using a sharpish resizer tends to errr..... sharpen a little. :) I'm not sure that's a bad thing when it comes to DVD video, or completely convinced it's a good thing, but so far the effect seems positive which gives me some comfort when resizing to square pixels. Even though the player still needs to upscale the video further, if the encoded version is a little sharper it'll probably still look sharper when it's upscaled.
I've really only compared the two using my PC and MPC-HC. There's a Sony Bluray player in this house that's fine with aspect ratios, but it takes so long to switch from one video to another it's hard to make a valid comparison. I can run two instances of MPC-HC on the TV and switch between them nice and easily.
Anyway, here's a couple of sample encodes (http://www.filedropper.com/anamorphicvspline36resize) I made a while back, but they were still on my hard drive (17MB zip file). To me, the "resized to square pixel" version looks better, whether it's running at it's native resolution or upscaled to fullscreen. Normally I'd probably use a little noise filtering though. Sharpened noise isn't nice. Even if you just navigate to the last frame in each sample, it's not hard to tell the resized version is sharper.
The enhanced haloing around the top of the coat stand in the last frames would be an adverse effect, but not a deal-breaker for me. We are talking about DVD quality video, after-all.
I'm not saying sharpening is always a good thing. I recall encoding one DVD by resizing "up" (I think it was Analyse This) and at the time, thinking it looked like it'd already been sharpened, so the "resized up" encode possibly ended up looking too sharpened, but that's somewhat of an exception.
Having said all that, I've no idea what resizer Handbrake uses or how sharp it might be. The difference might also be less for NTSC DVDs, given there'd be less resizing required to get to square pixel dimensions. I'm not sure.
Anyway, I'd be interested in any opinion regarding the samples and why the difference in sharpness is a bad thing. There's no doubt resizing to square pixels has changed the quality, but whether or not it's a gain......
Asmodian
11th January 2015, 23:58
I like the resized version more in your example but it is also 26.6% larger. It is a tricky problem but in my experience; if you use a size where the upscaled version is transparent upscaled tends to look better. If you use a size where only the unresized version looks transparent the unresized tends to look better. Sizes below that I haven't personally tested. :)
Maybe I am over sensitive to compression artifacts and I also only play with a PC so I can do sharp resizing on playback. With x265 I imagine upscaling to retain detail better may help more than with x264 but I have not done any testing.
peppi_le_piou
12th January 2015, 00:57
@DarkSpace. Handbrake anamorphic = none, auto selects 720x400; anamorphic = strict, auto selects Display = 1024x574; anamorphic = loose, auto selects Display = 1027x576; anamorphic = custom, requires a PAR w+h selection, eg 64:45.
My source is 720x576 anamorphic so I did 720x400 which takes 4hrs to encode. The 1024x576 encodes take 8.5hrs. (on my XP machine).
anamorphic = none encode
[23:01:50] + source: 720*576, crop (0/2/0/0): 720*574, scale: 720*400
[23:01:50] + dimensions: 720*400, mod 16
[23:01:50] + encoder: H.264 (x264)
[23:01:50] + h264 profile: high
[23:01:50] + h264 level: 4.1
[23:01:50] + quality: 20.00 (RF)
anamorphic = loose encode
[10:09:43] + source: 720*576, crop (0/2/0/0): 720*574, scale: 720*576
[10:09:43] + loose anamorphic
[10:09:43] + storage dimensions: 720*576, mod 16
[10:09:43] + pixel aspect ratio: 2048 / 1435
[10:09:43] + display dimensions: 1027*576
[10:09:43] + encoder: H.264 (x264)
[10:09:43] + h264 profile: high
[10:09:43] + h264 level: 4.1
[10:09:43] + quality: 20.00 (RF)
@hello_hello. Thanks for clarifying PAR, SAR, DAR. I was putting everything under the banner Resolution. I had a look at VidCoder; it uses the Handbrake engine with other features added but latest releases won't work on XP. As I've been working in avi's I have stuck with XP because some of the video tools that I use don't work on any newer op system. When I get on top of h264 then maybe I'll get onto Windows7.
1/- What is the meaning of the 2048/1435 figure. I know that its value is 1.427 but how do these numbers come about? (this is from the txt file after the Handbrake encode).
2/- My TV is 55"/139cm Full HD 1920x1080 (1080P). So, if my video files are 720x400 or 1024x576, what basically happens when they are played through the TV? How does the picture fill all 1920/1080 screen pixels. Is that what internal upscaling is about?
Warperus
13th January 2015, 11:25
Is that what internal upscaling is about?
I think so.
As for 720*400, it's useful for legacy dvd players that don't support higher resolution (and don't support h264).
hello_hello
13th January 2015, 14:44
@hello_hello. Thanks for clarifying PAR, SAR, DAR. I was putting everything under the banner Resolution.
I had a look and I seem to have remembered a little wrong. For anamorphic encoding Handbrake shows the input resolution (ie 720x576) and the "display size", which is effectively the display aspect ratio.
I thought if the video was cropped, Handbrake displayed the remaining input resolution (for example if you cropped 8 pixels from one side it'd show the resolution as being 712x576 instead of 720x576) but it'd appear it doesn't. It's probably Vidcoder that does. The latest Vidcoder that'll run on XP is apparently either 1.4.25 stable or 1.5.6 beta. I'd imagine they'd be easy to find. Not that it matters much. Naturally Handbrake does account for any cropping when calculating the "display size". Auto-cropping seems to be enabled by default for all Handbrake's presets.
1/- What is the meaning of the 2048/1435 figure. I know that its value is 1.427 but how do these numbers come about? (this is from the txt file after the Handbrake encode).
According to the log file Handbrake auto-cropped 2 pixels from the top (first line from the log you posted), leaving you with a 720x574 resolution.
Had you used "anamorphic strict" it would've been encoded at 720x574 and the "display size" would be 1024x574. The pixel aspect ratio wouldn't have changed (64:45) as there was no resizing.
"Anamorphic loose" with the modulus set to mod16 (as it appears it was), resized back to 720x576 (width and height evenly divisible by 16), therefore to keep the picture from being stretched or squished, the PAR was changed accordingly (2048:1435).
Display Aspect Ratio = Storage Aspect Ratio (resolution) x Pixel Aspect Ratio.
When using anamorphic encoding, resizing on it's own normally doesn't change the DAR. The resolution changes, and therefore so does the pixel aspect ratio. The encoder GUI should take care of the pixel aspect ratio calculations for you (as Handbrake does).
Cropping on it's own changes both the resolution and the DAR (part of the picture is removed) while the pixel aspect ratio stays the same.
Unless you adjust the resizing manually, anamorphic loose with a modulus of 2 should effectively give you the same result as anamorphic strict, although it seems for some reason Handbrake doesn't always calculate the display size the same way. I'm not sure if it sets it differently when encoding.
For example anamorphic strict with 4 pixels cropped from one side shows a "display size" of 1018x576. Change to anamorphic loose with a modulus of 2 and the "display size" is 1025x580. They're the same display aspect ratio though (rounded to the nearest pixel).
I recall reading Handbrake tries to be a bit clever and assumes an exact 16:9 (or 4:3) input aspect ratio (it'd use the generic pixel aspect ratios (http://forum.doom9.org/showthread.php?p=1058927#post1058927)) until the cropping exceeds a certain amount, then it switches to an ITU pixel aspect ratio. The idea being if the whole 720 width is picture, it's more likely to be "generic" but if the picture area is only around 704 pixels wide, the pixel aspect ratio is more likely to be ITU.
So I asked Google, and the info I found (https://trac.handbrake.fr/wiki/AnamorphicGuide#itu) seems to confirm that's the case, although maybe only when using "anamorphic loose" for some reason (the info there says it uses the mpeg4 pixel aspect ratios, but they're virtually the same as ITU). If that's the way it works, the change in pixel aspect ratio as you crop doesn't seem to be reflected in the "display size" calculation. Maybe the info is old and incorrect, or maybe the display size calculation doesn't take it into account. I've no idea. If you decide to test it, please post back. I might give it a try myself later on.
(There's info on that page explaining why mod16 encoding is the best idea and anything else is the work of the devil, but that's not really relevant these days. You can use whatever mod you like with x264 and compression suffers very little.)
2/- My TV is 55"/139cm Full HD 1920x1080 (1080P). So, if my video files are 720x400 or 1024x576, what basically happens when they are played through the TV? How does the picture fill all 1920/1080 screen pixels. Is that what internal upscaling is about?
If you're using an external media player (Bluray player, for example) it'd connect to the TV at a particular resolution. Mine's set to always connect at 1080p, therefore the player always does the up-scaling. For anything else (connecting at a lower resolution or using a TV's built in media player) the TV would need to do it internally.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.