mcka
7th May 2007, 14:57
Hi!
I know that many people here don't like the "crap from Apple", but I'd like to create MP4/x264 files, that also work with Quicktime (Apple TV...), which supports AVC main profile. The only problem is anamorphic encoding. If I create a mp4 file with an anamorphic video-stream using x264.exe and mp4box (MeGUI), Quicktime does not use the correct PAR/DAR.
There is a way to store the PAR in a MP4-container, to make Quicktime understand it. People from Handbrake have implemented it in their development-version (http://handbrake.m0k.org/trac/changeset/353): By adding an atom with a transformation matrix for the PAR to the mp4 container (AFAIK in moov.trak.tkhd.reserved3), Quicktime shows the video correctly (thread in the handbrake forum (http://handbrake.m0k.org/forum/viewtopic.php?p=7512#7141)).
The patch was based on the following information:
http://sourceforge.net/forum/message.php?msg_id=2059542
http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap2/chapter_3_section_3.html#//apple_ref/doc/uid/TP40000939-CH204-33299
Handbrake uses mpeg4ipv2, there is also an updated patch for that:
http://mpeg4ip.cvs.sourceforge.net/mpeg4ip/mpeg4ip/lib/mp4v2/atom_tkhd.cpp?r1=1.4&r2=1.5
I have looked at the source of NicMP4Box (http://nic.dnsalias.com/NicMP4Box_src.zip), which was very interesting, but does something different (it adds an uuid atom by patching mp4box). Looking at the source of MP4Box, there is a GF_TrackHeaderBox struct with a property reserved3 (u16).
Perhaps there is an easier way since Quicktime 7.1, without such a transformation matrix:
New features of QuickTime 7.1 include
[...]
* Support for 'pasp' and 'clap' Image Description extentions supporting aperture mode.
[...]
from: http://developer.apple.com/quicktime/whatsnew.htm
Apple provides some details, about 'pasp' or 'pixel aspect ratio', but I have no idea how to use it with mp4box or something similar:
http://www.devworld.apple.com./documentation/QuickTime/Reference/QT7-1_Update_Reference/index.html
Something else I've found about 'pasp' (but it seems to be older, not sure if it has something to do with 'pasp' mentioned above):
http://developer.apple.com/quicktime/icefloe/dispatch019.html#pasp
I'm new to mp4box, so I'm not sure how to implement the transformation marix or perhaps pasp into it. But looking at the patch for Handbrake, it should not be very complicated. Does someone have an idea for a patch, similar to NicMP4Box?
Or can the pasp setting be changed without patching anything?
best regards
mcka
I know that many people here don't like the "crap from Apple", but I'd like to create MP4/x264 files, that also work with Quicktime (Apple TV...), which supports AVC main profile. The only problem is anamorphic encoding. If I create a mp4 file with an anamorphic video-stream using x264.exe and mp4box (MeGUI), Quicktime does not use the correct PAR/DAR.
There is a way to store the PAR in a MP4-container, to make Quicktime understand it. People from Handbrake have implemented it in their development-version (http://handbrake.m0k.org/trac/changeset/353): By adding an atom with a transformation matrix for the PAR to the mp4 container (AFAIK in moov.trak.tkhd.reserved3), Quicktime shows the video correctly (thread in the handbrake forum (http://handbrake.m0k.org/forum/viewtopic.php?p=7512#7141)).
The patch was based on the following information:
http://sourceforge.net/forum/message.php?msg_id=2059542
http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap2/chapter_3_section_3.html#//apple_ref/doc/uid/TP40000939-CH204-33299
Handbrake uses mpeg4ipv2, there is also an updated patch for that:
http://mpeg4ip.cvs.sourceforge.net/mpeg4ip/mpeg4ip/lib/mp4v2/atom_tkhd.cpp?r1=1.4&r2=1.5
I have looked at the source of NicMP4Box (http://nic.dnsalias.com/NicMP4Box_src.zip), which was very interesting, but does something different (it adds an uuid atom by patching mp4box). Looking at the source of MP4Box, there is a GF_TrackHeaderBox struct with a property reserved3 (u16).
Perhaps there is an easier way since Quicktime 7.1, without such a transformation matrix:
New features of QuickTime 7.1 include
[...]
* Support for 'pasp' and 'clap' Image Description extentions supporting aperture mode.
[...]
from: http://developer.apple.com/quicktime/whatsnew.htm
Apple provides some details, about 'pasp' or 'pixel aspect ratio', but I have no idea how to use it with mp4box or something similar:
http://www.devworld.apple.com./documentation/QuickTime/Reference/QT7-1_Update_Reference/index.html
Something else I've found about 'pasp' (but it seems to be older, not sure if it has something to do with 'pasp' mentioned above):
http://developer.apple.com/quicktime/icefloe/dispatch019.html#pasp
I'm new to mp4box, so I'm not sure how to implement the transformation marix or perhaps pasp into it. But looking at the patch for Handbrake, it should not be very complicated. Does someone have an idea for a patch, similar to NicMP4Box?
Or can the pasp setting be changed without patching anything?
best regards
mcka