Opened 13 years ago

Closed 13 years ago

#498 closed defect (fixed)

Invalid pixel aspect ratio encoding mpeg4

Reported by: Carl Eugen Hoyos Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Reencoding attached sample fails for some resolutions, this is a regression since c8868f28e357e7e6ffe3254d0056b3e8033fe8e5 ("vf_scale: apply the same transform to the aspect during init that is applied per frame")

$ ffmpeg -i PAR1035.avi -s 640x460 -an out.avi
ffmpeg version N-32771-g3039c68, Copyright (c) 2000-2011 the FFmpeg developers
  built on Sep 22 2011 12:35:59 with gcc 4.5.3
  configuration: --cc=/usr/local/gcc-4.5.3/bin/gcc
  libavutil    51. 16. 1 / 51. 16. 1
  libavcodec   53. 16. 0 / 53. 16. 0
  libavformat  53. 12. 0 / 53. 12. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 43. 2 /  2. 43. 2
  libswscale    2.  1. 0 /  2.  1. 0

Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 29.97 (30000/1001)
Input #0, avi, from 'PAR1035.avi':
  Metadata:
    encoder         : Lavf53.4.0
  Duration: 00:04:57.16, start: 0.000000, bitrate: 28 kb/s
    Stream #0.0: Video: mpeg4 (Simple Profile) (DX50 / 0x30355844), yuv420p, 720x406 [SAR 1:1 DAR 360:203], 29.97 fps, 29.97 tbr, 29.97 tbn, 30k tbc
    Stream #0.1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16, 192 kb/s
[buffer @ 0x12ea7c0] w:720 h:406 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[scale @ 0x12cb580] w:720 h:406 fmt:yuv420p -> w:640 h:460 fmt:yuv420p flags:0x4
[mpeg4 @ 0x12c76e0] Invalid pixel aspect ratio 1035/812, limit is 255/255
Output #0, avi, to 'out.avi':
  Metadata:
    encoder         : Lavf53.4.0
    Stream #0.0: Video: mpeg4, yuv420p, 640x460 [SAR 1035:812 DAR 360:203], q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
Stream mapping:
  Stream #0.0 -> #0.0 (mpeg4 -> mpeg4)
Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height

Attachments (1)

PAR1035.avi (100.0 KB ) - added by Carl Eugen Hoyos 13 years ago.

Download all attachments as: .zip

Change History (5)

by Carl Eugen Hoyos, 13 years ago

Attachment: PAR1035.avi added

comment:1 by Michael Niedermayer, 13 years ago

Resolution: fixed
Status: newclosed

comment:2 by Carl Eugen Hoyos, 13 years ago

Resolution: fixed
Status: closedreopened

Still fails with -vf scale:

$ ffmpeg -i PAR1035.avi -vf scale=640:360 out.avi
ffmpeg version N-33240-ga5dfeb6, Copyright (c) 2000-2011 the FFmpeg developers
  built on Oct  3 2011 10:53:02 with gcc 4.5.3
  configuration: --cc='/usr/local/gcc-4.5.3/bin/gcc -m32'
  libavutil    51. 19. 0 / 51. 19. 0
  libavcodec   53. 19. 0 / 53. 19. 0
  libavformat  53. 13. 0 / 53. 13. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 43. 6 /  2. 43. 6
  libswscale    2.  1. 0 /  2.  1. 0

Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 29.97 (30000/1001)
Input #0, avi, from 'PAR1035.avi':
  Metadata:
    encoder         : Lavf53.4.0
  Duration: 00:04:57.16, start: 0.000000, bitrate: 2 kb/s
    Stream #0:0: Video: mpeg4 (Simple Profile) (DX50 / 0x30355844), yuv420p, 720x406 [SAR 1:1 DAR 360:203], 29.97 fps, 29.97 tbr, 29.97 tbn, 30k tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16, 192 kb/s
[buffer @ 0x8cf2220] w:720 h:406 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[scale @ 0x8cef720] w:720 h:406 fmt:yuv420p -> w:640 h:360 fmt:yuv420p flags:0x4
Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt'
[mpeg4 @ 0x8ce5f20] Invalid pixel aspect ratio 405/406, limit is 255/255 reducing
[avi @ 0x8cc8220] Aspect ratio mismatch between encoder and muxer layer
Output #0, avi, to 'out.avi':
  Metadata:
    encoder         : Lavf53.4.0
    Stream #0:0: Video: mpeg4, yuv420p, 640x360 [SAR 254:255 DAR 4064:2295], q=2-31, 200 kb/s, SAR 405:406 DAR 360:203, 90k tbn, 29.97 tbc
    Stream #0:1: Audio: ac3, 48000 Hz, stereo, flt, 128 kb/s
Stream mapping:
  Stream #0.0 -> #0.0 (mpeg4 -> mpeg4)
  Stream #0.1 -> #0.1 (mp3 -> ac3)
Could not write header for output file #0 (incorrect codec parameters ?)

in reply to:  2 comment:3 by Carl Eugen Hoyos, 13 years ago

Replying to cehoyos:

Still fails with -vf scale:

Should have been:
Still fails for a resolution that worked with earlier versions.

comment:4 by Michael Niedermayer, 13 years ago

Resolution: fixed
Status: reopenedclosed

Well thats what i get for guessing :)
should be really fixed this time

Note: See TracTickets for help on using tickets.