[FFmpeg-devel] [PATCH] Add coded_width/height to AVCodecParameters

Michael Niedermayer michael at niedermayer.cc
Sun Apr 3 15:36:24 CEST 2016


On Sun, Apr 03, 2016 at 03:31:59PM +0200, wm4 wrote:
> On Sun, 3 Apr 2016 15:26:02 +0200
> Michael Niedermayer <michael at niedermayer.cc> wrote:
> 
> > On Sun, Apr 03, 2016 at 02:31:06PM +0200, Hendrik Leppkes wrote:
> > > On Sun, Apr 3, 2016 at 2:07 PM, Michael Niedermayer
> > > <michael at niedermayer.cc> wrote:  
> > > > Without this or some other change moving data back and forth corrupts it
> > > > as the cropped & possibly low res resolution modified w/h will be taken
> > > > a the pre lowres resolution
> > > > also without 2 sets theres no place to communicate the cropped dimensions
> > > >
> > > > can be reproduced with
> > > > ./ffplay_g -vlowres 2 tickets/162/avid.avi
> > > >  
> > > 
> > > lowres is supposed to be applied in the decoder, not the demuxer, so I
> > > don't see how this is required here.  
> > 
> > if iam not mistaken (please correct me if iam wrong)
> > 
> > the demuxer runs a decoder, which initializes various AVCodecContext
> > fields these then get copied into AVCodecParameters and back into
> > the users AVCodecContext used for the user appliations decoder
> > 
> > the first decoder will set width & height to the low resolution
> > with lowres, coded_width / height will represent the stored, true
> > width/height
> > the data copied into the AVCodecParameters will have lost the width
> > & height that is stored anywhere but rather contain the lowres
> > variant.
> > 
> > the user app then will initialize its decoder based on coded_width
> > and coded_height which it will find set to 0 so it fallback to the
> > compatibility hack of using width & height which are the lowres
> > values and the decoder will apply the lowres stuff again
> > 
> > above is based on some assumtations i have not verified very step with
> > a debugger
> > 
> > 
> > > AVCodecParameters is supposed to contain container information, not
> > > pre-interpreted info based on some decoding options.  
> > 
> 
> This just shows how broken using decoders in libavformat is by design.
> The output parameters of a decoder have not necessarily anything to do
> with the input codec parameters.
> 

> In any case, not sure why we'd care about an obscure semi-broken
> feature like lowres anyway.

what is broken on lowres in ffmpeg git master ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Modern terrorism, a quick summary: Need oil, start war with country that
has oil, kill hundread thousands in war. Let country fall into chaos,
be surprised about raise of fundamantalists. Drop more bombs, kill more
people, be surprised about them taking revenge and drop even more bombs
and strip your own citizens of their rights and freedoms. to be continued
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160403/e0de2cd2/attachment.sig>


More information about the ffmpeg-devel mailing list