[Ffmpeg-devel] [BUG] DV in QuickTime - Aspect Ratio

Brian Brice bbrice
Wed Mar 14 22:51:11 CET 2007


herve.flores wrote:
> 
> Le 14 mars 07 ? 11:51, Baptiste Coudurier a ?crit :
> 
>> Hi
>>
>> herve.flores wrote:
>>>
>>> Le 14 mars 07 ? 01:36, Baptiste Coudurier a ?crit :
>>>
>>>> Hi
>>>>
>>>> Roman Shaposhnik wrote:
>>>>> On Mon, 2007-03-05 at 17:38 -0600, Brian Brice wrote:
>>>>>> Hello,
>>>>>>
>>>>>> I have encoded clips with the DV video codec with having the 
>>>>>> QuickTime
>>>>>> container.  These clips were to have 16:9 aspect ratio.  Having 
>>>>>> ffmpeg
>>>>>> read these clips back in does not maintain the aspect ratio.
>>>>>>
>>>>>> avctx->sample_aspect_ratio always comes back as {0,1}.  Nothing in 
>>>>>> the
>>>>>> QuickTime demux OR DV decoder sets the aspect ratio.
>>>>>
>>>>>   Of course that would be a QT problem because it seems that we have
>>>>> a container format not capable of signaling aspect ratio. But then
>>>>> again, now that we have SAR generation being part of the DV codec,
>>>>> I have no problem with making SAR recognition being part of the codec
>>>>> as well.
>>>>>
>>>>>   Anybody thinks its a bad idea ? Anybody thinks that CODECs should
>>>>> not set avctx->sample_aspect_ratio ?
>>>>>
>>>>
>>>> I know mov has specific atoms to declare pixel aspect ratio (pasp), and
>>>> clean aperture (clap),
>>>
>>> beware of the aperture bit, it's a very stange thing (introduce in QT7
>>> and not recognize with earlier versions)
>>
>> Can you please quote the specs ?
> 
> I just have that (not very interesting because I note strange behaviors, 
> depends of the origin of the source, its mask layer, its display size, etc)
> <http://developer.apple.com/documentation/QuickTime/Conceptual/QT7-1_Update_Guide/Content/2NewFeaturesChangesa.html> 
> 
> 
> 
>>>> my guess is that mov muxer should set them
>>>> correctly, I'll fix what needs to be fixed, just supply a dv 16:9
>>>> sample, or a way to generate one with ffmpeg.
>>>
>>> ffmpeg -i input -aspect 16:9 -target pal-dv output.dv
>>>
>>
>> I think bug reported here is about DV in quicktime, not DIF.
> 
> oups!
> then a second pass:
> ffmpeg -i output.dv -vcodec copy -aspect 16:9 -an output.dv.mov
> 
> => display in QTPlayer : 720*576px
> 
> QT's infos:
>     QTMovieApertureModeAttribute = clas;
>     QTMovieHasApertureModeDimensionsAttribute = 0;
> 
> if you set aperture mode to "clean"
> and mode dimensions to "1"
> then your .mov will be display as 16:9 with QTplayer > v7
> 
> PS: the output (.mov) from ffmpeg is "simple", the aperture bit "clean" 
> does its job (=display an anamorphous file in square mode)
> but with files generated by other softs (iMovie for example, which 
> generate a very complicated .mov), it doesn't work every time :-(
> so I don't trust the aperture mode...
> 
> bye
> 

I'm not quite sure if all of this is needed for QuickTime?  The aspect
ratio is stored in the DV frame properly, it's just going the path of
demuxing MOV and decoding DV, nothing fills in sample_aspect_ratio.  The
AVI demux does fill in the sample_aspect_ratio only because it uses the
a context of the DV demux (which is what fills in the aspect ratio
properly).

Using the command that herve posted would create a video that the
QuickTime player recognizes as 16:9, but ffmpeg reading does not.


-- 
Brian Brice




More information about the ffmpeg-devel mailing list