VideoHelp Forum
+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. hi, when I try to incapsulate this 1012x572 raw file:
    https://www.dropbox.com/s/wzfzhihmnl5ylzz/title_t00_track1_%5Beng%5D.mpg.264?dl=0

    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?
    Last edited by maudit; 20th Jan 2022 at 11:21.
    Quote Quote  
  2. Not sure if I understand your problem, but:
    The source picture is after cropping 712x572, not 1012x572. Same as the encoded .264.
    In mkvtoolnix: Set aspect Ratio 16/9 in the dropdown box.
    Quote Quote  
  3. Originally Posted by maudit View Post
    hi, when I try to incapsulate this 1012x572 raw file:
    https://www.dropbox.com/s/wzfzhihmnl5ylzz/title_t00_track1_%5Beng%5D.mpg.264?dl=0

    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?



    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

    mkvtoolnix

    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)

    double check
    23/13 * 44/44 = 1012/572
    Quote Quote  
  4. Originally Posted by Sharc View Post
    Not sure if I understand your problem, but:
    The source picture is after cropping 712x572, not 1012x572. Same as the encoded .264.
    In mkvtoolnix: Set aspect Ratio 16/9 in the dropdown box.
    the problem is that the correct resolution is 1012 but when I encapsulate the 264 file into the mkv,
    the horiz res become 1013.

    I didn't understand what/where is the dropdown box.
    Quote Quote  
  5. Originally Posted by poisondeathray View Post
    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

    mkvtoolnix

    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)

    double check
    23/13 * 44/44 = 1012/572

    Apart the SAR calculation,
    I'm completely lost, can't figure out what that means.
    Quote Quote  
  6. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by maudit View Post
    how do I fix it?
    Video resolution is 712x572 and it's still same after remux to mkv.

    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.
    Quote Quote  
  7. 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
    Quote Quote  
  8. thx @hello_hello,
    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.

    thanks
    Quote Quote  
  9. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by maudit View Post
    To correct the resolution from 1013 to 1012
    But correct is 1013.
    1012 is less correct.
    Quote Quote  
  10. Originally Posted by VoodooFX View Post
    Originally Posted by maudit View Post
    To correct the resolution from 1013 to 1012
    But correct is 1013.
    1012 is less correct.

    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 16:12.
    Quote Quote  
  11. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Once again, 1012x572 is not resolution, it's aspect ratio, mod2 doesn't matter here.
    Quote Quote  
  12. Originally Posted by VoodooFX View Post
    Once again, 1012x572 is not resolution, it's aspect ratio, mod2 doesn't matter here.
    ok voodoo and other people, I re-read the thread again and you convinced me.
    calculations are correct, I'll use the 1013 horizontal res.
    thx
    Quote Quote  
  13. maudit,

    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).
    https://forum.doom9.org/showthread.php?p=1058927#post1058927

    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).
    Last edited by hello_hello; 23rd Jan 2022 at 23:03.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!