Opened 11 years ago

Closed 11 years ago

#3008 closed defect (fixed)

ffmpeg converts video to grayscale if yadif filter used

Reported by: Anatoliy Owned by:
Priority: important Component: avfilter
Version: git-master Keywords: regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no


Summary of the bug: Standard Windows clock video gets converted to grayscale if yadif filter is used
How to reproduce:

% ffmpeg -i orig -s 200x200 -filter:v yadif=deint=interlaced -vcodec flv -ar 22050 -y 0.flv
ffmpeg version 2.0.1
built on 09/24/2013

Without yadif filter or output size params (-s 200x200) everything is OK

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (1)

orig (81.0 KB ) - added by Anatoliy 11 years ago.

Download all attachments as: .zip

Change History (3)

by Anatoliy, 11 years ago

Attachment: orig added

comment:1 by Carl Eugen Hoyos, 11 years ago

Component: FFmpegavfilter
Keywords: regression added; yadif grayscale ffmpeg removed
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Version: 2.0.1git-master

For future tickets: Please always test current git head and please always add the complete, uncut console output.

Several work-arounds exist:

$ ffmpeg -i out format=yuv420p,yadif,scale=200x200 -ar 22050 0.flv

I originally thought that this is a duplicate of ticket #2559 but since this is a regression since 6adf97f, I don't think so.

The scale filter has to be inserted twice because yadif does not support the input pixel format and you generally cannot resize before deinterlacing. For the specific case (input pal8, yadif, resize, output yuv420p), the problem can be fixed imo because the trivial choice works, for other encoders, it would be more difficult to see the right pix_fmt.

$ ffmpeg -loglevel verbose -i fate-suite/cram/skating.avi -vf yadif,scale=200x200 out.flv
ffmpeg version N-56717-gface578 Copyright (c) 2000-2013 the FFmpeg developers
  built on Sep 29 2013 08:41:46 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      52. 46.100 / 52. 46.100
  libavcodec     55. 33.101 / 55. 33.101
  libavformat    55. 18.104 / 55. 18.104
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 88.100 /  3. 88.100
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
[avi @ 0x2809880] parser not found for codec msvideo1, packets or times may be invalid.
    Last message repeated 1 times
Input #0, avi, from 'fate-suite/cram/skating.avi':
  Duration: 00:00:07.50, start: 0.000000, bitrate: 648 kb/s
    Stream #0:0: Video: msvideo1 (CRAM / 0x4D415243), pal8, 160x120, 30 tbr, 30 tbn, 30 tbc
[Parsed_scale_1 @ 0x280d800] w:200 h:200 flags:'0x4' interl:0
[graph 0 input from stream 0:0 @ 0x280ea60] w:160 h:120 pixfmt:pal8 tb:10000/300003 fr:300003/10000 sar:0/1 sws_param:flags=2
[auto-inserted scaler 0 @ 0x27f48a0] w:iw h:ih flags:'0x4' interl:0
[Parsed_yadif_0 @ 0x280d0e0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_yadif_0'
[auto-inserted scaler 0 @ 0x27f48a0] w:160 h:120 fmt:pal8 sar:0/1 -> w:160 h:120 fmt:gray sar:0/1 flags:0x4
[Parsed_scale_1 @ 0x280d800] w:160 h:120 fmt:gray sar:0/1 -> w:200 h:200 fmt:yuv420p sar:0/1 flags:0x4
Output #0, flv, to 'out.flv':
    encoder         : Lavf55.18.104
    Stream #0:0: Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 200x200, q=2-31, 200 kb/s, 1k tbn, 30 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (msvideo1 -> flv)
Press [q] to stop, [?] for help
No more output streams to write to, finishing.
frame=  225 fps=0.0 q=5.7 Lsize=     254kB time=00:00:07.50 bitrate= 276.9kbits/s
video:250kB audio:0kB subtitle:0 global headers:0kB muxing overhead 1.490064%

out.flv is gray because the first inserted scaler uses pix_fmt gray.

comment:2 by Carl Eugen Hoyos, 11 years ago

Resolution: fixed
Status: openclosed

Fixed by Michael in 95666b2, thank you for the report!

Note: See TracTickets for help on using tickets.