Log in

View Full Version : Fixing Aspect Ratio


BeasTboyz
9th April 2007, 17:18
Hi

I'm having a problem with aspect ratios on the videos I've encoded with meGUI.

I've converted quite a few (75+) high def captures and dvds to matroski video files on my dual core PC with 4:3 aspect ratio screen (1600x1200). I always crop the black borders around video and output dvds at 720x* and hidef at 1280x* and they look great on this computer.

When I moved the files from this PC to my HTPC and attempted to play them (with mplayer) they are squished down, I think due to the natural widescreen aspect of the PC being 1280x720.

Is there a way that I can process these videos so that they appear natural on my HTPC?

Is there a way to salvage the HOURS and HOURS of video processing I've already done by maybe adding black bars or something that won't require reprocessing the entire video?

Thanks

Dirhael
9th April 2007, 21:35
You're using matroska as the container? In that case, you should be able to just open the files in mkvmerge GUI and set the proper aspect ratio for the video track there. No encoding should be required at all :)

graysky
10th April 2007, 01:33
Can you post the mplayer output in here? You could try: mplayer -aspect 4:3

BeasTboyz
11th April 2007, 17:54
Yes, Matroska is the container

Dirhael, I've tried that and it doesn't seem to work, perhaps I am doing something wrong?

graysky, the only output I get is it playing the movie.

graysky
11th April 2007, 20:37
Launch a movie with this command (change it as appropriate for your O/S and path to your movie): mplayer moviename.mkv

If you do that from the commandline/shell, you'll be presented with a bunch of information. Post that here. Also, try my suggestion to use the -aspect x:y switch as a second try if it can't figure out the movie AR.

BeasTboyz
12th April 2007, 19:19
I would like to thank both of you for your help, with your suggestions and a little ingenuity I have solved my problem!

I will illustrate what I did below so that others having the same problem can hopefully solve their problem. If you have any questions, please use the board's e-mail function to drop me a line and I'll help you in any way I can.

1.) I went back to mplayer's site and downloaded the regular mplayer (not the GUI) so that I had mplayer.exe.

2.) I ran a movie with the the windows command function as graysky suggested and it output a fair amount of data, including the aspect ratio and dimension of the video file.

NOTE: The screen I want to display the video on has an aspect ratio of 1.7777777777:1 (1.7~:1) or 1280x720. The video I want to show has an aspect of 1280x688 or roughly (1.86:1). Because the screen was stretching the video out and displaying it with more like a 2.35:1 aspect I figured I could re-mux the video for the equivalent of 4:3 and it would then display perfectly on a 1280x720 screen.

3.) Do a little math and remux the video and audio.

The difference between a 4:3 and 16:9 screen is (4:3)/(16:9)or .75 (75%). So I took the aspect of the video's 1.86:1 and multiplied it by .75 to get a corrected aspect of 1.395:1.

Exact math (maybe this will help you?)
((4/3)/(1280x720)) * (1280/688) = 1.3953488372093023255813953488378

So in mkvmerge I added the audio and video file, selected the video file and selected the "Format specific options" tab and in the "Aspect Ratio:" box I entered the new aspect of 1.395 and started the muxing.

End result: bliss

graysky
12th April 2007, 20:48
Cool, glad it's working for you. Just be sure your AR is correct for all the movies... usually the AR will change movie-to-movie.

BeasTboyz
13th April 2007, 21:04
Cool, glad it's working for you. Just be sure your AR is correct for all the movies... usually the AR will change movie-to-movie.
yepper, i just do the math for each movie I convert, simple - fast process compared to the capture and conversion!

Thanks again

graysky
13th April 2007, 21:17
Your math is a little confusing to me.

DAR = Display aspect ratio = The ratio of length to height of the displayed image (i.e. after any resizing that occurs from an anamorphic encode). All US DVDs use one of two different DARs, either 4:3 (1.333) or 16:9 (1.778).

SAR = source (or movie) aspect ratio = the ratio of length to height of your movie AFTER you crop out the black bars (if any).

If we're talking about anamorphic content here, that is, with a DAR that's NOT 1:1, you can calculate the SAR like this: multiply the height by the DAR to get the anamorphic width. So a 720x480 DVD w/ a 16:9 DAR becomes (480 times 1.778 = 854) or 720x480 --> 854x480.

The SAR is measured by subtracting the black bars in the video content which can be done a number of ways. Take this 1.85:1 movie for example:

I cropped out 6 from the top and 12 from the bottom leaving 480-18=462. Therefore, to calculate the SAR we simply take the 854 divided by the width AFTER YOU CROP OUT THE BLACK BARS. We said the DVD out-of-the-box will play back at 854x480. Since we cropped out 12 lines, the source video is unchanged, just lacking the black bars and is 854x462. The SAR is simply 854/462=1.848 or rounded is 1.85.

Anyway, I believe that is the AR you need to feed to mkvtools when you remux them to get them to display correctly... this is all assuming that you cropped out the black bars from your encodes.