Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1080 closed enhancement (fixed)

Pixel format autoselection does not work correctly with -vf format

Reported by: cehoyos Owned by:
Priority: minor Component: ffmpeg
Version: git-master Keywords:
Cc: onemda@gmail.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: yes

Description

(bug 252 by Alex Converse)
If the format video filter is used, ffmpeg's pixel format auto selection does not work as expected:

$ ./ffmpeg -i tests/lena.pnm -pix_fmt yuv422p -vcodec mpeg2video -qscale 2 out.mpg
$ ./ffmpeg -i out.mpg -vf format=yuv420p -vcodec mpeg2video out2.mpg
ffmpeg version N-38811-ga04a97b Copyright (c) 2000-2012 the FFmpeg developers
  built on Mar 15 2012 14:40:16 with gcc 4.3.2
  configuration: --cc=/usr/local/gcc-4.3.2/bin/gcc --enable-gpl
  libavutil      51. 42.100 / 51. 42.100
  libavcodec     54. 10.100 / 54. 10.100
  libavformat    54.  2.100 / 54.  2.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 64.101 /  2. 64.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  7.100 /  0.  7.100
  libpostproc    52.  0.100 / 52.  0.100
[mpeg @ 0x8eb8aa0] Format mpeg detected only with low score of 25, misdetection possible!
Input #0, mpeg, from 'out.mpg':
  Duration: N/A, start: 0.500000, bitrate: N/A
    Stream #0:0[0x1e0]: Video: mpeg2video (4:2:2), yuv422p, 256x256 [SAR 1:1 DAR 1:1], 104857 kb/s, 25 tbr, 90k tbn, 50 tbc
[buffer @ 0x8ed1720] w:256 h:256 pixfmt:yuv422p tb:1/1000000 sar:1/1 sws_param:
[buffersink @ 0x8ec02c0] auto-inserting filter 'auto-inserted scale 0' between the filter 'Parsed_format_0' and the filter 'out'
[format @ 0x8ec0720] auto-inserting filter 'auto-inserted scale 1' between the filter 'src' and the filter 'Parsed_format_0'
[scale @ 0x8eb3060] w:256 h:256 fmt:yuv422p -> w:256 h:256 fmt:yuv420p flags:0x4
[scale @ 0x8ec0560] w:256 h:256 fmt:yuv420p -> w:256 h:256 fmt:yuv422p flags:0x4
[mpeg @ 0x8ebf300] VBV buffer size not set, muxing may fail
Output #0, mpeg, to 'out2.mpg':
  Metadata:
    encoder         : Lavf54.2.100
    Stream #0:0: Video: mpeg2video, yuv422p, 256x256 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> mpeg2video)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=3.8 Lsize=      12kB time=00:00:00.04 bitrate=2457.6kbits/s
video:11kB audio:0kB global headers:0kB muxing overhead 8.092892%

ffmpeg chooses yuv422p for out2.mpg although yuv420p was requested on the command line.

Change History (2)

comment:1 Changed 7 years ago by richardpl

  • Analyzed by developer set
  • Cc onemda@gmail.com added
  • Resolution set to invalid
  • Status changed from new to closed

Video filters have nothing to do with pixel format of output.

comment:2 Changed 7 years ago by cehoyos

  • Resolution changed from invalid to fixed

I don't know if this was fixed in ffmpeg.c or libavfilter, but the problem is not reproducible anymore.

Note: See TracTickets for help on using tickets.