[FFmpeg-devel] [PATCH] mov auto crop

Michael Niedermayer michaelni
Sun Oct 3 07:54:49 CEST 2010

On Sat, Oct 02, 2010 at 02:13:52PM -0700, Baptiste Coudurier wrote:
> On 10/2/10 2:04 PM, Benjamin Larsson wrote:
> > On 10/02/2010 10:03 PM, Baptiste Coudurier wrote:
> >> On 10/2/10 5:57 AM, Benjamin Larsson wrote:
> >>> On 10/02/2010 04:51 AM, Baptiste Coudurier wrote:
> >>>> Hi guys,
> >>>>
> >>>> $subject.
> >>>>
> >>>> Please keep in mind that this issue has been present for _years_ and
> >>>> nobody dared to fix it. I believe the patch is not so hackish/ugly.
> >>>>
> >>>> I restrict it to codecs not supporting arbitrary resolutions that can be
> >>>> stored in .mov by quicktime.
> >>>>
> >>>> Maybe exporting to "crop", "wxh" is better, I don't know.
> >>>>
> >>>> I plan to add auto-rotate for iphone 3gs files this way as well :)
> >>>>
> >>>
> >>> Jolly good. But would it be possible to move this code to the api and
> >>> just not in the ffmpeg commandline tool? Ie so the users of the api also
> >>> would get these fixes. Other then that I like the idea.
> >>
> >> I'm not sure I understand. You need to crop after decoding, or you mean
> >> cropping in the decoder ?
> >>
> > 
> > Well now you will get cropping with the commandline tool ffmpeg but not
> > when using the API. It would be nice if the API could deliver cropped
> > data. Otherwise everyone who uses the api (mplayer, xbmc, etc) will need
> > to replicate this in their code, if they wanted to support this.
> Well, how would you do it ? Your suggestions implies the cropping would
> be done by the decoder.
> I'm not opposed to the decoder doing it personally , we could do it for
> H.264 as well the latter specifying cropping in the bitstream.

doing it in the decoder has a small issue with direct rendering because the
decoder needs full sized buffers and then only a rectangle of that would be
the actual vissible output. Also we would need a switch to make the decoder
disable croping (some users will want it).

doing it in the decoder also would need the 2 parameters be put in
AVCodecContext as AVStream in inaccessible to the decoder.

Iam not sure currently which way is better (libavfilter or decoder)

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101003/ea48f360/attachment.pgp>

More information about the ffmpeg-devel mailing list