[FFmpeg-trac] #3008(avfilter:open): ffmpeg converts video to grayscale if yadif filter used
FFmpeg
trac at avcodec.org
Sun Sep 29 09:25:49 CEST 2013
#3008: ffmpeg converts video to grayscale if yadif filter used
------------------------------------+------------------------------------
Reporter: tborisow | Owner:
Type: defect | Status: open
Priority: important | Component: avfilter
Version: git-master | Resolution:
Keywords: regression | Blocked By:
Blocking: | Reproduced by developer: 1
Analyzed by developer: 0 |
------------------------------------+------------------------------------
Changes (by cehoyos):
* status: new => open
* reproduced: 0 => 1
* component: FFmpeg => avfilter
* priority: normal => important
* version: 2.0.1 => git-master
* keywords: yadif grayscale ffmpeg => regression
Comment:
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':
Metadata:
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.
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/3008#comment:1>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list