News:

--

Main Menu

Display Ratio Preservation?

Started by Ceyarrecks, February 12, 2022, 02:10:30 AM

Previous topic - Next topic

Ceyarrecks

Excuse me Please:
I am unsure exactly how to phrase nor place this question,
so if I am in error, please move appropriately.

Making use of MakeMKV results in a file with the following specs:


MKV#1=============================
Width                       : 720 pixels
Height                      : 576 pixels
Display aspect ratio        : 16:9
===================================


In using AVIdemux with Video Output of Mpeg4 AVC (x264), MKV Muxer for Output results in a file as follows:


MKV#2=============================
Width                       : 720 pixels
Height                      : 576 pixels
Display aspect ratio        : 5:4
===================================

Exactly which setting(s) need I adjust to PRESERVE the original Display Aspect Ratio?
Thank You for the time taken to reply.
HCA

dosdan

#1
Are you using a recent nightly build of ADM? I tried this with AGM VC++ 2.81 220125 (i.e. 25JAN2022). I used a .VOB from a "Widescreen PAL" DVD I made (720x576, but with non-square PAR, 64:45 or 1.42).

Since ADM's display only uses square display pixels (i.e. PAR 1:1), it looks squashed. But the info from ADM is correct:


=====================================================
Video
=====================================================
Codec 4CC:      MPEG
Image Size:      720 x 576
Aspect Ratio:      PAL 16:9 (64:45)
Frame Rate:      25.000 fps
Average Bitrate:   3383 kbps
Total Duration:      00:38:07.148

=====================================================
Video Codec Extradata
=====================================================
Size:         0

=====================================================
Audio (1 active track)
=====================================================
Codec:         AC3
Channels:      Stereo
Bitrate:      24000 Bps / 192 kbps
Frequency:      48000 Hz
Total Duration:      00:38:06.884

The PAR(64:45) and DAR(16:9) are correct.

I changed the output container to MKV.  Under "Configure", I left "Force aspect ratio" unticked and did a Copy/Copy.

When I reopened this .MKV in ADM the DAR & PAR were correct.

Leaving the output container format as .MKV, I then went into Configure and this time forced an AR of 5:4 to see what would happen when I resaved.

VLC still played the new "5:4" MKV with the correct 16:9 AR and when I reopened it in ADM ADM still had the correct DAR & PAR.

Dan.

eumagga0x2a

1. If the source is interlaced, you must either add a deinterlacing filter (e.g. yadif) as the first filter of the filter chain or check the corresponding checkbox in the configuration of the x264 encoder plugin. A failure to do so actually ruins the video.

2. To ask video players to stretch the picture in order to get the correct aspect ratio, you must enable "force display aspect ratio" and set it to 16:9, additionally you may select the corresponding pixel aspect ratio in output settings of the x264 plugin configuration dialog. However, the latter is often ignored by players while the former almost universally respected. Nevertheless, it is better to set both to matching values.

dosdan

Ah, I see you're re-encoding to AVC.

Under x264, I went into "Configure". Under the "Output 1" tab I selected the 16:9 AR. Under the MKV container "Configure" I tried forcing both 4:3 and 16:9. This time VLC noticed a difference: the 4:3 was squashed and the 16:9 was correct.  VLC also displayed the correct 16:9 AR if I didn't force it in the MKV muxer.

Dan.

Ceyarrecks

Quote from: eumagga0x2a on February 12, 2022, 04:05:26 AM1. If the source is interlaced, you must either add a deinterlacing filter (e.g. yadif) as the first filter of the filter chain or check the corresponding checkbox in the configuration of the x264 encoder plugin. A failure to do so actually ruins the video.

2. To ask video players to stretch the picture in order to get the correct aspect ratio, you must enable "force display aspect ratio" and set it to 16:9, additionally you may select the corresponding pixel aspect ratio in output settings of the x264 plugin configuration dialog. However, the latter is often ignored by players while the former almost universally respected. Nevertheless, it is better to set both to matching values.

"ruins" as in becomes unviewable? garbled? blurred? snowy? pixelated beyond recognition?
might I understand your definition of the term "ruins"?

also, i think i might not have been clear in my initial post, allow me to rephrase below:

original video:
Width                       : 720 pixels
Height                      : 576 pixels
Display aspect ratio        : 16:9


above video run through AVIdemux v276 with Video Output of Mpeg4 AVC (x264), MKV Muxer for Output:
(all internal settings remain at default/unchanged)

Width                       : 720 pixels
Height                      : 576 pixels
Display aspect ratio        : 5:4

notice the difference in numbers? from 16:9 to 5:4.

I would ask for the settings one needs to adjust within AVIdemux to PRESERVE the original video's aspect ratio.


eumagga0x2a

Ruined in the sense as combing artifacts in moving parts of the picture become less correctable (or entirely uncorrectable when filters are applied to the picture) by deinterlacer at a later stage, e.g. during playback. There are a lot of examples on YouTube showing this mistake.

All other infos already provided. There is no automatic propagation of pixel aspect ratio from demuxers all the way down the chain to muxers in Avidemux, but some codecs like MPEG-2 carry the necessary info in the video stream already, which some players honor and some don't.

alexstorm

#6
The Original Video is technically 5:4 (720/576 = 1.25 and 5/4 = 1.25) and it has metadata in the video to tell video players to stretch it back as 16:9.

You can reset the video playback to force the 5:4 original video to play again as 16:9 by adding forced playback in a couple different ways with AVIdemux... but be aware that this forced resizing only works with video players.  It does not work for videos playing online in media servers or on social media, unless the video site checks the forced playback ratio and copies the video resizing it for playback.

This is frustratingly confusing.  Let me approach it another way.

===
UK PAL DVD content can take squished videos and force it to playback in 16:9.  The video on the disc is 720 x 546 (5:4) and the DVD player stretches it to 16:9 and outputs the signal to the TV.

If you grab the original content from this PAL DVD, it will be copied as 720x576 and some programs will read the metadata that it has inside the video that it is tagged to play in widescreen TV's as 16:9.

However, since you pulled out the video to a file and are trying to play it with a player or edit it.  The player may see the metadata tag that says, play this as 16:9 or it may not see this data.  If you have converted it to a H.264 video file, the tags inside to tell the player to stretch the video would be removed.  Now the video is it's real format, that it was all the time at 5:4.

So, what do you want to do with the video?  AVIdemux can put back the forced playback at 16:9 if you use h.265.  I believe it is not an option and does not work with many h.264 video codec. Only Mpeg4 AVC (x264) will work.  But before doing that, you need to answer the question where are you going to use this video.  Do you really want to keep it in the wrong format of 5:4 which is squished and hope that everyone playing it back will have a player that can read inside h.265 copy that there is a metadata tag that says, "hey stretch out and play this video in 16:9"?  I think it's a bad choice.  Some end use of this video can easily be a phone player or online in a web site and that person will not see the video properly in 16:9 becuase the metadata command to stretch it is ignored in their setup or on the website.

You are converting it anyway, why not resize it to the correct 16:9 size it should be 1024 by 576?  This stretches out the pixels left and right and re-encodes 1024 pixels for each row of 720 pixels.  Now you can have any video codec h.264, h.265, V9 etc that will always play back correctly on any player on any hardware and on any website.

I have an online info page with calculators that show how to do both options.  There are two ways to turn on the force stretch metadata that only works with h.265 and a third party player but will fail to resize on a web site.  Or you can force resize the pixels to the correct end size and have a video that plays back on everything. 

Have a look at: https://www.producerelease.com/blu-ray/parcalc.htm

There are 3 interactive calculators that help solve the different options and illustrated screen grabs to step through to keep your aspect ratio how you want it.  The hidden extra power of this webpage is it solves not being able to sleep, by just reading the first 2 pages.  Ha!

Hope that helps.