Log in

View Full Version : MP4Box PASP support


chaynik
15th September 2008, 13:48
Has anyone had success using the PASP atom support in the newest MP4Box builds to properly display non-square pixel content in QuickTime? As per this thread: http://forum.doom9.org/showthread.php?t=131095 (I tried to reply to it, but was unable to.)

I am using the following line in build 19 of MP4Box 0.4.5-DEV:

MP4Box.exe -add movie.mp4#video -par 1=10:11 -add movie.mp4#audio output.mp4

The muxed output displays properly as 4:3 in VLC and Media Player Classic, but fails to do so in QuickTime.

Thanks in advance!

chaynik
17th September 2008, 15:48
bump :)

SeeMoreDigital
17th September 2008, 16:02
As far as I'm aware, MP4box can't be configured to set PASP "container level" signalling. It can't even detect/read PASP signalling.

That said, MP4muxer (http://forum.doom9.org/showthread.php?t=138445) (which uses mp4creator/mpeg4ip) can set PASP "container level" signalling.


Cheers

Ritsuka
17th September 2008, 16:39
No, mp4muxer does not add a pasp atom.

SeeMoreDigital
17th September 2008, 16:58
No, mp4muxer does not add a pasp atom.PASP atom or not.... I'm able to confirm that MP4muxer is able to alter/set the transformation "visual settings" that QuickTime player is able to detect.

EDIT: Here's a link to some samples: -

http://rapidshare.com/files/146065618/AVC_with_CLS.zip.html


Cheers

Ritsuka
17th September 2008, 20:32
They play fine because there is no par saved in the h.264 stream. Try another one with a par in the h.264 vui, and open it in iTunes or QuickTime (and enable the "clean aperture" from the properties window).

HandBrake 0.9.1 used the same methods that mp4muxer uses for anamorphic (transformation matrix), and now all these mp4 produced with it are broken in iTunes, and probably will in QuickTime someday.

SeeMoreDigital
17th September 2008, 20:53
They play fine because there is no par saved in the h.264 stream. Try another one with a par in the h.264 vui, and open it in iTunes or QuickTime (and enable the "clean aperture" from the properties window).I generate QuickTime compliant encodes containing both CLS (Container Level Signalling) and SLS (Stream Level Signalling) for my clients all the time.... They work just fine!


Cheers

Drachir
18th September 2008, 10:19
The "transformation matrix" used by MP4muxer has nothing to do with container level signaling of PAR or SAR, this is don via PASP box/atom.


ISO/IEC 144496-12_2005:AMD1_2007
The pixel aspect ratio and clean aperture of the video may be specified using the ‘pasp’ and ‘clap’ sample
entry boxes, respectively. These are both optional; if present, they over-ride the declarations (if any) in
structures specific to the video codec, which structures should be examined if these boxes are absent.


The "transformation matrix" is an additional way to manipulate the video stream. A correct player behavior is to first look for PAR or SAR, and scale the video accordingly. After this is done, the changes by the "transformation matrix" have to be applied.

The "transformation matrix" isn't used in all ISO base media file format (ISO/IEC 14496-12) based formats. It is used in MOV(ftyp "QT ") and M4V(ftyp "M4V "), as far as I know.

ISO/IEC 14496-12_2005
Matrix values which occur in the headers specify a transformation of video images for presentation. Not all
derived specifications use matrices; if they are not used, they shall be set to the identity matrix, If a matrix is
used, the point (p,q) is transformed into (p', q') using the matrix as follows:


In the MP4 file format(ISO/IEC 14496-14) the "transformation matrix" isn't used. In the MP4 file format the same could be done via BIFS.

ISO/IEC 14496-14_2003
Composition
In MPEG-4 both visual and aural composition are done using the BIFS system. Therefore structures marked as “template” in the ISO Base Media Format which pertain to composition, including fields such as matrices, layers, graphics modes (and their opcolors), volumes, and balance values, from the MovieHeaderBox and TrackHeaderBox, are all set to their default values in the file format. These fields do not define visual or audio composition in MPEG-4; in MPEG-4, the BIFS system defines the composition.


If your goal is playback in QuickTime or other Apple players use MOV or M4V. If you use the "transformation matrix" remove PAR or SAR information to avoid trouble with future players.

If you want to use MP4 use the PASP box, and make sure you have a proper MP4 file with IOD and BIFS and OD track.
If you don't like BIFS & Object Descriptor Framework you don't really want to use the MP4 file format, use 3GP, MOV or M4V instead.

chaynik
18th September 2008, 12:11
As far as I'm aware, MP4box can't be configured to set PASP "container level" signalling. It can't even detect/read PASP signalling.
I was going by what cyril said in this thread (http://forum.doom9.org/showthread.php?t=125552)
Just a quick message to inform you that the PixelAspectRatioBox (pasp) was implemented in MP4Box and is now interporable with Quicktime 7.3 (not with older versions)
I assumed he was one of the mp4box developers..

I was finally successful in using the PAR flag in mp4box to achieve correct DAR in QuickTime, as per this thread. (http://forum.doom9.org/showthread.php?p=1185360)

But unfortunately, and I quote myself from the other thread, my mp4box muxes are still not fully compatible with QT, I believe this is a well known issue (data size is reported as 0 and passthrough fails). So how do i combine the PAR compatibility of mp4box with the data size/pass thru compatibility of mp4muxer? In a perfect world, both would work... :)

Btw, I am well aware of the transformation matrix mp4muxer uses to allow QT to resize the video to the correct DAR on playback, however the QT-based software I am generating my mp4 encodes for ignores this matrix and seems to only comply with the PAR/SAR signaling.

Perhaps the next version of mp4muxer can implement PAR signaling as well? That would be great!

anger98
15th August 2011, 07:24
Here is a handy calculator to fix the aspect ratio of an image with the PAR using MP4Box
http://tools.rodrigopolo.com/mp4box_aspect_fix/