[FFmpeg-devel] avcodec_open() sets wrong video height

Michael Niedermayer michaelni at gmx.at
Tue Oct 18 15:24:37 CEST 2011


On Tue, Oct 18, 2011 at 05:20:39AM -0700, Unga wrote:
> ----- Original Message -----
> 
> > From: Michael Niedermayer <michaelni at gmx.at>
> > To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> > Cc: 
> > Sent: Tuesday, October 18, 2011 10:38 AM
> > Subject: Re: [FFmpeg-devel] avcodec_open() sets wrong video height
> > 
> > On Mon, Oct 17, 2011 at 08:32:57PM -0700, Unga wrote:
> >>  Hi all
> >> 
> >>  This is ffmpeg 0.7.5.
> >> 
> >> 
> >>  The avcodec_open() sets wrong video height in pCodecCtx (AVCodecContext).
> >> 
> >> 
> >>  printf("pCodecCtx->width  4: %d\n", pCodecCtx->width); 
> > // DEBUG
> >>  printf("pCodecCtx->height 4: %d\n", pCodecCtx->height); 
> > // DEBUG  
> >>    
> >>    // Open codec
> >>    if(avcodec_open(pCodecCtx, pCodec)<0)
> >>      return -1; // Could not open codec
> >>  printf("pCodecCtx->width  5: %d\n", pCodecCtx->width); 
> > // DEBUG
> >>  printf("pCodecCtx->height 5: %d\n", pCodecCtx->height); 
> > // DEBUG  
> >> 
> >> 
> >>  This produces:
> >>  pCodecCtx->width  4: 1920
> >>  pCodecCtx->height 4: 1080
> >> 
> >>  pCodecCtx->width  5: 1920
> >>  pCodecCtx->height 5: 1088
> >> 
> > 
> > most likely 1088 is the actual value of the height of the video stream
> > some containers can override this ...
> > 
> 
> Not sure on this, but dump_format() shows correctly.
> 
> > 
> > 
> >> 
> >>  The full program is attached.
> > 
> > does it behave differently from ffmpeg itself ?
> > 
> 
> I would say yes. When  a mp4 (showing 1088) encoded to webm using ffmpeg, the tutorial03a shows correctly for the webm file as 1080):

Please explain what exactly you do, what you expect and what happens
with enough detail so we could reproduce the issue
I think you simply hit a very well known issue that croping is not
supported but if you belive otherwise we need more information

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

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111018/1dd4052b/attachment.asc>


More information about the ffmpeg-devel mailing list