hi, when I try to incapsulate this 1012x572 raw file:
into an mkv with mkvtoolnix, the result become 1013x572.
h.264: Video: MPEG4 Video (H264) 712x572 (11392:6435) 25fps [V: h264 high L4.1, yuv420p, 712x572]
mkv:...Video: MPEG4 Video (H264) 712x572 (1013:572) 25fps [V: h264 high L4.1, yuv420p, 712x572 [default]]
Source: Video: MPEG2 Video 720x576 (16:9) 25fps [V: mpeg2 main, yuv420p, 720x576]
the source is a PAL DVD 16:9 ITU OFF, crop(4, 2, -4, -2)
I used MeGUI and x264 Force SAR 64:45
how do I fix it?
+ Reply to Thread
Results 1 to 13 of 13
Last edited by maudit; 20th Jan 2022 at 10:21.
What do you want to display as ? 1012x572 in "square pixels"?
DAR = FAR * SAR
1012/572 = 712/572 * SAR
SAR = 1012/712, which reduces to 253/178
ffmpeg -i title_t00_track1_[eng].mpg.264 -bsf:v h264_metadata=sample_aspect_ratio=253/178 -c:v copy bsf253_178.264
ffplay -i bsf253_178.mkv
Stream #0:0: Video: h264 (High), yuv420p(progressive), 712x572 [SAR 253:178 DAR 23:13], 25 fps, 25 tbr, 1k tbn (default)
23/13 * 44/44 = 1012/572
mkvtoolnix added DAR, and it's rounded to least distortion, what is 1013 instead of 1012. [11392:6435 *572 = 1012.622222222222]
So it's "fixed" already.
Last edited by VoodooFX; 20th Jan 2022 at 11:52.
If SAR 64:45 is the correct SAR, which I assume it is.
712 x 64 /45 = 1012.6222
572 x 11392 / 6435 = 1012.6222
So somewhere along the way the MKV DAR has been rounded. Nothing to worry about though.
Did this come from MPC-HC?
MPEG4 Video (H264) 712x572 (1013:572) 25fps [V: h264 high L4.1, yuv420p, 712x572 [default]]
I'd have to check, but I think MPC-HC rounds the DAR to whole pixel dimensions (1013:572), but maybe not for RAW streams. I'd have to check.
To find out, open the MKVToolNix "MKV Header Editor", and then the MKV in question. Expand the video stream section and check the contents of the following elements.
Video Pixel Width
Video Pixel Height
Video Display Width
Video Display Height
you solved my problem.
yes that line came from mpc-hc.
probably is exactly like you said:
"I think MPC-HC rounds the DAR to whole pixel dimensions (1013:572), but maybe not for RAW streams. I'd have to check."
To correct the resolution from 1013 to 1012,
I opened the mkv into the toolnix header editor and I changed the "Video Display Width" value from 1013 to 1012 and saved.
now mpc-hc plays the mkv at a 1012 res.
ok you're right, surely it is, but let's assume that I prefer to have at least a MOD2 res, cause I hate odd numbers.
..is not completely clear to me what SAR to use in the x264 settings..
I tried with the MeGUI anamorphic SAR calculator overriding the x264 settings:
global MeGUI_darx = 11392
global MeGUI_dary = 6435
and the result is the same compared to when I used the sar 64:45 taken from this table down below:
anyway, thanks you all for all the info.
DVD Aspect FrameSize SAR ITU
PAL 4:3 720 x 576 12:11 ITU ON
PAL 4:3 720 x 576 16:15 ITU OFF
PAL 16:9 720 x 576 16:11 ITU ON
PAL 16:9 720 x 576 64:45 ITU OFF
Last edited by maudit; 22nd Jan 2022 at 15:12.
Once again, 1012x572 is not resolution, it's aspect ratio, mod2 doesn't matter here.
The "ITU" aspect ratios in your table aren't what you get from MeGUI's anamorphic encoding, as they're mpeg4 SARs, not ITU, although for some resolutions MeGUI will change an ITU SAR to mpeg4 (Bluray standard definition encoding), or it's the x264 encoder changing them, I can't remember.
The SAR possibilities are listed here (referred to as PARs).
Once upon a time most/all GUI's used the "almost exact" ITU SARs, but as far as I know all currently maintained GUIs have switched to the mpeg4 equivalents instead. Except for MeGUI. It still uses the almost exact ITU DARs in the script creator.
For other readers, there's info in your other thread on how to add mpeg4 DARs to MeGUI (like 16:9 and 4:3, the mpeg4 equivalents are 20:11 and 15:11 for both PAL and NTSC).