Why is video aspect off?

MKV playback, recompression, remuxing, codec packs, players, howtos, etc.
Post Reply
kimski
Posts: 3
Joined: Wed Nov 19, 2014 6:18 pm

Why is video aspect off?

Post by kimski »

My resulting files are squished horizontally but audio and vertical sizing is fine.
ndjamena
Posts: 830
Joined: Mon Jan 07, 2013 12:23 am

Re: Why is video aspect off?

Post by ndjamena »

A DVD?

MakeMKV takes the aspect ratio from the stream, not the DVD IFO files, and sometimes the stream headers are wrong. You'll need to extract the MPEG2 track using MKVCleaver or gMKVExtractGUI, run it through Restream to change the AR elements in the stream headers then mux the new video track back into the file.

The Matroska Container has a header element you could change to set the AR but certain players ignore it or at least do silly things when the container and stream headers don't agree.
kimski
Posts: 3
Joined: Wed Nov 19, 2014 6:18 pm

Re: Why is video aspect off?

Post by kimski »

I didn't have this issue with WinX DVD Platinum. Is this a limitation of MakeMKV? If I have to do those extra steps I guess I'll just buy the WinX product which allows me to record at specific time increments. I was hoping to find a free app to do this since I only have 3 family DVDs to convert.
Woodstock
Posts: 10332
Joined: Sun Jul 24, 2011 11:21 pm

Re: Why is video aspect off?

Post by Woodstock »

How are you viewing the files? As mentioned, some players have weird ideas of where to get aspect ratio information.

VLC (videolan.org) is usually pretty good about displaying properly. Handbrake (handbrake.fr) reads the stream itself when deciding how to operate on files it's encoding.
kimski
Posts: 3
Joined: Wed Nov 19, 2014 6:18 pm

Re: Why is video aspect off?

Post by kimski »

I use VLC for all my videos.
Winebum
Posts: 8
Joined: Sun May 31, 2015 4:26 pm

Re: Why is video aspect off?

Post by Winebum »

I have the same issue as 'kimski' - a couple DVD sets (Foyle's War, for example), create an MKV file that appears as a 4:3 aspect ratio when played on Kodi (v15rc) or PowerDVD (v15). It's supposed to be a 16:9 AR. I understand what 'ndjamena' is saying, but was hoping for an easier solution. Does one exist?
Cheers,
Jeff
ndjamena
Posts: 830
Joined: Mon Jan 07, 2013 12:23 am

Re: Why is video aspect off?

Post by ndjamena »

It's not as simple as pointing a program at the file and it changes a flag in the header. MPEG2 aspect ratio information is scattered through the entire stream. You'd have to read through the entire file to change it properly. (which I assume is why DVD keeps that info in the IFO file rather than relying on the stream.)

Ripping programs aren't exactly a money making enterprise. Most of the "free" programs are actually kind of basic and only have a limited set of capabilities. Added together they can beat almost any paid program at any particular task, but you need to use the right program for the right job and that means taking things stage by stage.

A program to change MPEG2 AR headers would need to be able to read though every container capable of holding MPEG2 data and if changing the data involves changing the size of the file it would need to be able to recreate the file at the other end as well.

Someone would actually have to sit down and write that program, and really, is it worth their effort?

Restream exists, my main problem with it isn't that it can't remux an MKV, it's that it's GUI only and doesn't support command line. If I could be bothered I'd like to write a command line version of the tool... but a full de/remuxer, just for this?

FFMPEG doesn't change AR flags, and a lot of programs are based on that, so unless FFMPEG/LibAV/MKVToolNix change their code or there's another more obscure program out there (that I'd like to know about) restream is the best we've got.
Winebum
Posts: 8
Joined: Sun May 31, 2015 4:26 pm

Re: Why is video aspect off?

Post by Winebum »

'ndjamena', thank you for the thoughtful response. Not what I was hoping for, [sigh] but understandable... and logical. In my cursory research today, I note that there is a mixed acceptance of the technique (MKVCleaver or gMKVExtractGUI, followed by Restream). The main concern is proper video/audio syncing during the remux process. Do you believe this remains the best combination of programs? And if so, are there any nuances and/or techniques you can share from your experience? Personally, I am in very new territory with regard to MKV disassembly/reassembly and would appreciate any insight/steps/techniques you can share. Thanks in advance.
Cheers,
Jeff
ndjamena
Posts: 830
Joined: Mon Jan 07, 2013 12:23 am

Re: Why is video aspect off?

Post by ndjamena »

Unlike MKVMerge MakeMKV does NOT allow "gaps" inside an MKV, so that shouldn't be a sync issue.

I have had a few DVD rips that came with a delay, but it's easy enough to add that back in during remux.

Other than that, some times the frame rate in the video headers are a tad off. I haven't had that on a DVD but I live in PAL territory so it's unlikely to be an issue for me even if the problem does exist in the DVD realm. Even so, it's easy enough to explicitly set the frame rate with MKVMerge during remux.

But normally it's just a matter of extracting the video using MKVExtract, running it through restream, then replacing the new video with the old using MKVMerge.

I don't know of any other way to do it at all. If you find one, especially a better one, please tell me.
Winebum
Posts: 8
Joined: Sun May 31, 2015 4:26 pm

Re: Why is video aspect off?

Post by Winebum »

Many THANKS to ‘ndjamena’ for providing the basic steps to fix errant aspect ratio settings in MKV files as they are ripped from DVDs. Being retired from engineering, I have a tendency to put things in orderly steps and procedures. And, I hate the thought of others bumbling along, repeating the same trial-and-error steps that I have just completed. So here is the step-by-step procedure for correcting improper aspect ratios in MKV files. Please note… These steps only correct aspect ratio issues with MKV files. The programs used have far more editing capability, but that was not the purpose of this thread. And again, huge THANKS to ‘ndjamena’ for taking some time to provide some starting points.

I used the following programs:
MKVExtractGUI v2.2.2.9
ReStream v0.9.0
MKVToolNix GUI v8.1.0
These are easily found through a simple Internet search.
All MKV testing was performed with:
Kodi v15rc2
PowerDVD v15
Audio sync and chapter retention were verified.

01) Using MKVExtractGUI-2, open the MKV file.

02) Define the output directory and ensure all components are check-marked.

03) To retain chapter information, ensure the 'Chapters format' is set to XML.

04) Click the 'Extract' button. Note: The resulting video file will be in MPG format. There will be other files extracted, too. You will need them for the final reassembly.

05) Using ReStream, open the 'extracted' MPG file. Note that the file extension may not match what ReStream is looking for. In that case, use the "All files (*.*)" selection for file type and select the extracted MPG file. Or you can simply drag-and-drop the extracted MPG file in the input field.

06) Once the MPG file is open in ReStream, select the desired Aspect [Ratio], which is located directly under the 'MPEG-2-source' entry line.

07) Select the destination directory and file name for the revised file.

08) Click the 'Write!' button. Note: The resulting file saved will be in MPG format, but with the revised aspect ratio.

09) Using MKVToolNIX GUI, open the revised MPG file created in step 8 and the associated audio file(s) created in step 4. For this step, ignore the XML file.

10) Define the output file directory and file name.

11) Select the 'Output' tab. In the RH column, input the chapter file list that was extracted in step 4. Note: The program is looking for an XML format.

12) Click the 'Start muxing' button.

13) When complete, the resulting MKV file should play in the aspect ratio desired and have the same chapter set points as the original MKV file. The intermediately created files may be deleted as desired.

Cheers,
Jeff
Krawk
Posts: 276
Joined: Thu Jul 02, 2015 12:10 am

Re: Why is video aspect off?

Post by Krawk »

Often times this issue is because the MKV file has the video data, but the actual IFO file on the disc tells the player the display a specific width.

When you play the disc in a regular player the IFO file tells the player to display the image a 854 pixels wide. Even though the display output is only 720 pixels wide, this causes the output to be scaled correctly.

I use MKVToolnix, edit the headers, search for DisplayWidth there somewhere and set it to 854, hit ctrl-s to save the file and boom. It still might be identified as a 4:3 in most programs but it does display correctly.
Post Reply