Anamorphic video in QuickTime

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
hawkman
Veteran User
Posts: 609
Joined: Sat Feb 17, 2007 9:46 pm

Anamorphic video in QuickTime

Post by hawkman »

I just wanted to point out that it's perfectly possible to play "anamorphic" video in QuickTime - so long as you don't mind the video being in a .mov container.

QuickTime Pro allows you to set the display resolution in the movie properties - for instance, stretch your 720x424 widescreen movie to 1024x424, or shrink it to 720x298. Then save as a .mov.

Whichever you choose, QT will use the full vertical resolution when you play in fullscreen, but now with the correct aspect ratio.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: Anamorphic video in QuickTime

Post by jbrjake »

hawkman wrote:I just wanted to point out that it's perfectly possible to play "anamorphic" video in QuickTime - so long as you don't mind the video being in a .mov container.
Right. That's setting a transformation matrix at the container level. QT won't acknowledge SAR/PAR values in a video track, though, which is what we're doing right now..

Maurj has what you're discussing already implemented in the svn. QuickTime anamorphic playback is ready to go for beta 2.
hawkman
Veteran User
Posts: 609
Joined: Sat Feb 17, 2007 9:46 pm

Re: Anamorphic video in QuickTime

Post by hawkman »

jbrjake wrote:Right. That's setting a transformation matrix at the container level.
Ja, understood.
jbrjake wrote:Maurj has what you're discussing already implemented in the svn. QuickTime anamorphic playback is ready to go for beta 2.
And that's good news!
whimpers
Experienced
Posts: 79
Joined: Mon Feb 19, 2007 1:03 pm

Post by whimpers »

You can also use the free program QT Sync to change the aspect ratio and save as a .mov file (for those who don't want to pay the extra cash for QuickTime Pro).
sdm
Bright Spark User
Posts: 194
Joined: Mon Feb 19, 2007 4:53 pm

Re: Anamorphic video in QuickTime

Post by sdm »

jbrjake wrote:
hawkman wrote:I just wanted to point out that it's perfectly possible to play "anamorphic" video in QuickTime - so long as you don't mind the video being in a .mov container.
Right. That's setting a transformation matrix at the container level. QT won't acknowledge SAR/PAR values in a video track, though, which is what we're doing right now..

Maurj has what you're discussing already implemented in the svn. QuickTime anamorphic playback is ready to go for beta 2.
I just wanted to note that the .MKV container allows anamorphic video, and the MatroskaQT component that imports .MKV recognizes the flag and displays correctly. I don't know if this is helpful.
--aside: the next version of Perian should import .mkv files without any additional components

Also, instead of saving a self contained .MOV after changing the display size/shape, you can save a reference movie, and add that to iTunes/Frontrow and leave your original untouched. Don't forget to add chapters to the Ref Movie using Metadata Hootenany. Thats what I've been doing anyways.

Is the container in beta 2 a .MOV? or is QT recoginzing PAR in a .AVI or whatever?

When is MediaFork beta 2 set for release?

Thanks,
--sdm.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: Anamorphic video in QuickTime

Post by jbrjake »

sdm wrote:I just wanted to note that the .MKV container allows anamorphic video, and the MatroskaQT component that imports .MKV recognizes the flag and displays correctly. I don't know if this is helpful.
Unless you're familiar enough with EBML and libmatroska to implement a muxer for us...no, not very helpful. Don't get me wrong, I love .mkv, use it for all my encodes, and strongly desire support for it in MediaFork...but we need someone capable of accomplishing it =(
sdm wrote:Is the container in beta 2 a .MOV? or is QT recoginzing PAR in a .AVI or whatever?

When is MediaFork beta 2 set for release?
The container in beta2 remains .mp4, with a .mov atom patched in for QuickTime support. QT still doesn't recognize PAR...the atom applies a transformation matrix, similar to setting the DAR in an .mkv.

We don't have a release date set for beta 2. We've got a lot of exciting new features implemented and ready to go. However, we have only fixed one or two bugs. IMO, it'd be unfair of us to release a new beta until we've significantly improved stability.
sdm
Bright Spark User
Posts: 194
Joined: Mon Feb 19, 2007 4:53 pm

Re: Anamorphic video in QuickTime

Post by sdm »

jbrjake wrote: Unless you're familiar enough with EBML and libmatroska to implement a muxer for us...no, not very helpful.
Sorry, I'm not familiar with the inner workings of this stuff.

I'm curious (and you seem like you would know the answer), if I open a 16x9 720x480 .MKV in QT, and it displays it at 853x480 like it should, then save as a self-contained .MOV, this resulting .MOV opens and plays at 853x480 for ever after, even though QT knows the file is really 720x480.
Is QT understanding PAR or has the MKV QT component implemented a "transformation matrix" as you called it?

Not sure what DAR is, or SAR. Can you explain?
jbrjake wrote: The container in beta2 remains .mp4, with a .mov atom patched in for QuickTime support. QT still doesn't recognize PAR...the atom applies a transformation matrix, similar to setting the DAR in an .mkv.
I've been using .AVI containers for the AC3 passthrough. Will this atom also be in the .AVI container (in case you can't tell, I have no idea what an atom is)

Thanks for your help.
--sdm.
maurj
Enlightened
Posts: 148
Joined: Thu Jan 11, 2007 5:31 pm

Post by maurj »

Hi SDM,

"Atoms" are the building blocks of QuickTime's MOV file format. MOV was used as the basis for the ISO international-standard MP4 file format, and so to all intents and purposes, the MOV file format is a superset of MP4. An MP4 is a MOV (kind of), pretty much.

QuickTime stores its anamorphic info in a part of the MP4/MOV file which isn't strictly part of the MP4 standard. But if you set it there, then QuickTime applications (including QuickTime Player, iTunes, or Front Row) will read it anyway. This is what I've done for beta2 of MediaFork :)
maurj
Enlightened
Posts: 148
Joined: Thu Jan 11, 2007 5:31 pm

Post by maurj »

Just realised I didn't quite answer your question about AVI. The only MediaFork file format which currently supports the passthru of AC3 is the AVI container (we don't stick AC3 in MP4, as QuickTime doesn't play AC3 by default). We are storing the anamorphic settings in the AVI, so any players which support anamorphic settings in an AVI should support this. I think this includes VLC and MPlayer.
sdm
Bright Spark User
Posts: 194
Joined: Mon Feb 19, 2007 4:53 pm

Post by sdm »

thanks maurj.

So if I intend to stick with .AVI as output from MediaFork (so I can have the AC3 audio), I'll need to manually transform the shape if I want to view it in QT apps.

The reason I want AC3 passed through is because using VLC I can send the audio to my (old) audio reciever which decodes it in full 5.1 surround sound.

The reason I also want it to appear correct in QT is because I tag everything in iTunes and use Front Row for a front end for now.
(I'm hoping for a decent front end that can either use VLC or pass audio to my reciever in the same way as VLC)

-- sdm.
maurj
Enlightened
Posts: 148
Joined: Thu Jan 11, 2007 5:31 pm

Post by maurj »

sdm: Yes, you will need to manually transform the shape when opened in QT apps. QuickTime can read the anamorphic settings from mp4 files, but not from avi. And sadly you won't be able to save the avi with the QT anamorphic settings in place.

I completely see why you're leaving the AC3 in for VLC to pass straight to your audio receiver. Unfortunately, you won't be able to play them in Front Row, unless you're using Front Row to fire off VLC for actual playback.
sdm
Bright Spark User
Posts: 194
Joined: Mon Feb 19, 2007 4:53 pm

Post by sdm »

Just to clarify/recap, MediaFork's AVI(h264+AC3) will play as-is in QT/iTunes/Front Row provided you have the AC3 QT component.
The audio is downmixed to stereo (which my reciever decodes it as Dolby ProLogic (simulated surround sound)).
The video plays squished (if you use anamorphic PAR) until you manually transform. The file cannot be re-saved as .AVI, rather .MOV (self contained or reference).

If you playback the .AVI in VLC everything is good - including 5.1 sound.

Thanks maurj for your responses and your work on the project.

-sdm.
mcka
Posts: 3
Joined: Mon Apr 16, 2007 5:37 am

Post by mcka »

Hi maurj!
maurj wrote:"Atoms" are the building blocks of QuickTime's MOV file format. MOV was used as the basis for the ISO international-standard MP4 file format, and so to all intents and purposes, the MOV file format is a superset of MP4. An MP4 is a MOV (kind of), pretty much.

QuickTime stores its anamorphic info in a part of the MP4/MOV file which isn't strictly part of the MP4 standard. But if you set it there, then QuickTime applications (including QuickTime Player, iTunes, or Front Row) will read it anyway. This is what I've done for beta2 of MediaFork :)
Can you tell me where I can find more details about that topic? I've searched several hours now, but I cannot find any details about that.

Where have you found that information?

I only found that:
http://developer.apple.com/documentatio ... ion_1.html

Is "reserved3" a special atom from .mov? How does its content look like?

Is it a point translation operation or a scaling operation?

best regads
mcka
maurj
Enlightened
Posts: 148
Joined: Thu Jan 11, 2007 5:31 pm

Post by maurj »

Hi mcka,

I couldn't find much on the Apple site, but this post on the mpeg4ip SourceForge forum pointed me in the right direction for my libmp4 patch:

http://sourceforge.net/forum/message.php?msg_id=2059542

The matrix's position in the track header atom is described in more detail here (search this page for "Matrix structure"):

http://developer.apple.com/documentatio ... H204-33299

An updated version of the libmp4v2 patch I created for Handbrake has been submitted to the mpeg4ip project (home to libmp4v2), and is in their latest CVS versions (but not yet released).

- maurj.
mcka
Posts: 3
Joined: Mon Apr 16, 2007 5:37 am

Post by mcka »

Hi maurj!

Thank you very much for your answer, maurj!
maurj wrote:I couldn't find much on the Apple site, but this post on the mpeg4ip SourceForge forum pointed me in the right direction for my libmp4 patch:

http://sourceforge.net/forum/message.php?msg_id=2059542
That's quite old ;-)
The matrix's position in the track header atom is described in more detail here (search this page for "Matrix structure"):

http://developer.apple.com/documentatio ... H204-33299
Since Quicktime 7.1 there is a new pasp atom. Have you heard of that?
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

There are some details about pasp and pixel aspect ratio but I think this is for the .mov format, isn't it?
http://www.devworld.apple.com./document ... index.html

There is now a struct TrackEncodedPixelsDimensions and a constant kQTSettingsPixelAspectRatio = 'pasp'.

There should be a problem with resizing when using the transformation matrix?

And I found that, but it's also much older:
http://developer.apple.com/quicktime/ic ... .html#pasp

An updated version of the libmp4v2 patch I created for Handbrake has been submitted to the mpeg4ip project (home to libmp4v2), and is in their latest CVS versions (but not yet released).
I'll have a look at it, thanks a lot!

If I understand it correct, the followig patch implements the PAR-Matrix in handbrake: http://handbrake.m0k.org/trac/changeset/353

right?

best regards
mcka
Post Reply