VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. Whenever I have an mp4 file with the wrong aspect ratio, I use mkvtoolnix to create a new file with the correct AR. This has always worked beautifully until today. After processing the mp4 file, mkvtoolnix had an error message: “The AVC video track is missing the 'CTTS' atom for frame timecode offsets. However, AVC/h.264 allows frames to have more than the traditional one (for P frames) or two (for B frames) references to other frames. The timecodes for such frames will be out-of-order, and the 'CTTS' atom is needed for getting the timecodes right. As it is missing the timecodes for this track might be wrong. You should watch the resulting file and make sure that it looks like you expected it to.”

    I'm sure I've had similar warnings before where the new file was OK. Not today – the new mkv file still plays 16:9 despite me specifying 4:3. What I find particularly odd is that mediainfo shows the file as 4:3 which is what I want but that's not how it plays...

    I read that YAMB might help so I've installed it (v1.6). Nowhere in the GUI can I see an option for changing the AR. Thinking it might be the mp4box part of YAMB that I need, I installed 'MyMP4Box GUI' but, again, I don't see an option for AR changing.

    Can anyone suggest why my mkvtoolnix file still plays 16:9 despite it reading 4:3 with mediainfo?

    And can someone please instruct me on how to change an mp4(AVC) file's AR using either YAMB or MyMP4Box GUI?

    Many thanks for all help offered.
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    In Mymp4boxgui add the mp4, under the tab Mux right click on the video track and choose PAR and 4:3 or try 1:1. Click Save as and last Mux.

    Click image for larger version

Name:	mymp4boxpar.png
Views:	956
Size:	40.6 KB
ID:	33669
    Quote Quote  
  3. Hi Baldrick. Many thanks for that, I'd never have sussed that 'right click' on my own.

    Sadly, none of the PAR options do the job. '4:3 NTSC' brings the picture in a little but it's still closer to 16:9. I can only imagine there's a stubborn gremlin in the source file preventing the AR being changed.

    I've found a fix, though. Although I wanted to avoid re-encoding, that's what I've done (using avidemux set to x264). Putting the resultant file through mkvtoolnix gives me a 4:3 file. (I tried the same trick with MyMP4Box but it wouldn't work.)

    Thanks again.

    PS: Could I have used avidemux to change the AR at the same time I was converting? I don't think so...
    Last edited by pooksahib; 15th Sep 2015 at 07:11. Reason: PS added
    Quote Quote  
  4. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Did you try use copy mode in avidemux? Under the video dropdown. To avoid reconversion.
    Quote Quote  
  5. Your source is likely square pixel (PAR=1:1). Set a Custom PAR: 3:4 to force 4:3 DAR.
    Quote Quote  
  6. Baldrick - no I didn't but it doesn't matter now.
    jagabo - excellent, thank you. So why should 3:4 work when the entire world would call the resulting picture 4:3? Very odd. But thank you again, I'm chuffed.
    Quote Quote  
  7. Originally Posted by pooksahib View Post
    So why should 3:4 work when the entire world would call the resulting picture 4:3?
    Because you're setting the pixel aspect ratio (the shape of individual pixels*) not the display aspect ratio (the shape of the final displayed picture). The relationship between DAR, PAR and FAR:

    Code:
    DAR = FAR * PAR
    
    DAR = display aspect ratio, the final shape of the displayed picture
    FAR = frame aspect ratio, the frame dimensions
    PAR = pixel aspect ratio, the shape of individual pixels.
    If your source is say 1280x720 (16:9 frame aspect ratio) with square pixels (1:1 PAR)

    Code:
    DAR = FAR * PAR
    DAR = 1280 / 720 * 1 / 1
    DAR = 1.777...
    DAR = 16/9
    If you want to force it to 4:3 DAR:

    Code:
    DAR = FAR * PAR
    DAR / FAR = PAR
    4 / 3 / (1280 / 720) = PAR
    4 / 3 * 720 / 1280 = PAR
    0.75 = PAR
    3:4 = PAR

    * In theory pixels are points with no dimensions. What you are really setting isn't the shape of the pixels but the spacing between them (horizontally and vertically). So modern codecs refer to the SAR (sampling aspect ratio) not PAR to be more technically correct. In realty, when pixels are instantiated (displayed) they take on a shape. They aren't displayed as a bunch of dots with blank space in between.
    Quote Quote  
  8. That's very helpful. Thanks a lot.
    Quote Quote  
  9. So note that My MP4Box GUI's "4:3 NTSC" setting is saying "use the PAR of 4:3 NTSC" -- which is 8:9 or 10:11 depending on whether you're using a 720x480 frame or a 704x480 frame.
    Quote Quote  
  10. Originally Posted by pooksahib View Post
    After processing the mp4 file, mkvtoolnix had an error message: “The AVC video track is missing the 'CTTS' atom for frame timecode offsets. However, AVC/h.264 allows frames to have more than the traditional one (for P frames) or two (for B frames) references to other frames. The timecodes for such frames will be out-of-order, and the 'CTTS' atom is needed for getting the timecodes right. As it is missing the timecodes for this track might be wrong. You should watch the resulting file and make sure that it looks like you expected it to.”
    That warning can usually be ignored and is probably unrelated to the problem.

    Originally Posted by pooksahib View Post
    Can anyone suggest why my mkvtoolnix file still plays 16:9 despite it reading 4:3 with mediainfo?
    Does MediaInfo show two different aspect ratios? ("Display aspect ratio" and "Original display aspect ratio")
    Basically, in such an mkv file there can be two different aspect ratios stored. One in the mkv container and one in the AVC bitstream. It depends on the player on which info it uses. Mkvtoolnix does not change AVC bitstream info to e.g. "16/9", only the container info. If your player prefers the AVC bitstream info this means you will have problems if you try to change in mkvtoolnix. One thing mkvtoolnix can do, though, is removing the AVC bitstream info completely. Add the following command for that: "--engage remove_bitstream_ar_info"

    Ideally, you already set the correct aspect ratio when encoding. Mkvtoolnix will then copy that info to the container as well and both agree and will thus work in any player, not matter what the player prefers to read.
    Quote Quote  
  11. Just the one AR, if I recall. I've deleted the file now that I have a proper one via MyMP4Box. Thanks for the info, though.
    Quote Quote  



Similar Threads

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