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

Unga unga888 at yahoo.com
Tue Oct 18 16:28:26 CEST 2011

----- Original Message -----
> From: Michael Niedermayer <michaelni at gmx.at>

>>  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

Step 1: Download/Get a 1080p video.

Step 2: ./tutorial03a video-1080p.mp4

pCodecCtx->width  5: 1920
pCodecCtx->height 5: 1088
sample_aspect_ratio: 1.0000000000
aspect_ratio: 1.7647058964
mode.w: 1366
mode.h: 768
dst_w: 1366
dst_h: 774

See the video height get is 1088 instead 1080, therefore, the calculated aspect_ratio is wrong, therefore, the display height (dst_h) is wrong.

Step 3: Test the video-1080p.mp4 using another tool at your disposal what's it video width and the height.

The issue is, after the avcodec_open() for the video, the original value of AVCodecContext->height get changed.

Isn't there such a issue at your side? I use ffmpeg 0.7.5.


More information about the ffmpeg-devel mailing list