[FFmpeg-user] Decoder flag "gray" seem to not work

Andrey Utkin andrey.krieger.utkin at gmail.com
Tue Feb 18 13:21:08 CET 2014

I think this has problems with decoding:

 $ ffmpeg -flags gray  -i ~/test.ts -filter:v format=pix_fmts=gray
-vcodec libx264  /tmp/gray.ts -y
ffmpeg version N-60377-g3f1416b Copyright (c) 2000-2014 the FFmpeg developers
  built on Feb 18 2014 13:51:28 with gcc 4.7.3 (Gentoo 4.7.3-r1 p1.4, pie-0.5.5)
  configuration: --enable-gpl --enable-libx264
--enable-encoder=libx264 --disable-stripping --enable-debug
--extra-cflags='-O0 -g -ggdb' --enable-libvpx --enable-x11grab
--enable-libfreetype --enable-filter=drawtext --enable-gray
  libavutil      52. 63.100 / 52. 63.100
  libavcodec     55. 49.101 / 55. 49.101
  libavformat    55. 30.100 / 55. 30.100
  libavdevice    55.  7.100 / 55.  7.100
  libavfilter     4.  1.102 /  4.  1.102
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mpegts, from '/home/krieger/test.ts':
  Duration: 00:01:05.34, start: 1.456778, bitrate: 239 kb/s
  Program 1
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (High 4:4:4 Predictive)
([27][0][0][0] / 0x001B), yuv444p, 320x240 [SAR 1:1 DAR 4:3], 25 fps,
25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101]: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz,
stereo, fltp, 34 kb/s
    Stream #0:2[0x102]: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz,
mono, fltp, 42 kb/s
    Stream #0:3[0x103]: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz,
mono, fltp, 37 kb/s
[swscaler @ 0x3416400] deprecated pixel format used, make sure you did
set range correctly
No pixel format specified, yuvj444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x342c5e0] using SAR=1/1
[libx264 @ 0x342c5e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x342c5e0] profile High 4:4:4 Predictive, level 1.3, 4:4:4 8-bit
Output #0, mpegts, to '/tmp/gray.ts':
    encoder         : Lavf55.30.100
    Stream #0:0: Video: h264 (libx264), yuvj444p, 320x240 [SAR 1:1 DAR
4:3], q=-1--1, 90k tbn, 25 tbc
    Stream #0:1: Audio: mp2, 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (aac -> mp2)
Press [q] to stop, [?] for help
Segmentation fault (core dumped)
14:19krieger at acer /usr/local/src/ffmpeg
 $ gdb ./ffmpeg core
GNU gdb (Gentoo 7.5.1 p2) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
Reading symbols from /usr/local/src/ffmpeg/ffmpeg...done.
[New LWP 30189]
[New LWP 30190]
[New LWP 30180]
[New LWP 30179]
[New LWP 30182]
[New LWP 30181]
[New LWP 30184]
[New LWP 30183]
[New LWP 30185]
[New LWP 30178]
[New LWP 30186]
[New LWP 30187]
[New LWP 30188]
[New LWP 30191]

warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/local/src/ffmpeg/ffmpeg -flags gray -i
/home/krieger/test.ts -filter:v for'.
Program terminated with signal 11, Segmentation fault.
#0  ff_h264_biweight_16_ssse3.nextrow () at libavcodec/x86/h264_weight.asm:283
283         movh       m0, [r0]
(gdb) bt
#0  ff_h264_biweight_16_ssse3.nextrow () at libavcodec/x86/h264_weight.asm:283
#1  0x0000000000725d73 in mc_part_weighted (chroma_weight_avg=0xc65790
<ff_h264_biweight_16_ssse3>, chroma_weight_op=0x7fd3a006dea0,
    y_offset=<optimized out>, x_offset=<optimized out>, dest_cr=0xac
<Address 0xac out of bounds>,
    dest_cb=0xf <Address 0xf out of bounds>, dest_y=0x7fd3a00943c0
    chroma_idc=3, pixel_shift=0, list1=<optimized out>,
list0=<optimized out>, luma_weight_avg=0xc65790
    luma_weight_op=0x7fd3a006dea0, chroma_put=<optimized out>,
qpix_put=0x3a2e908, delta=0, height=16, square=1, n=<optimized out>,
    h=0x3a2e7a0) at libavcodec/h264.c:1125
#2  mc_part_444_complex (h=0x3a2e7a0, n=-1610005568, square=1,
height=16, delta=0, dest_y=<optimized out>,
    dest_cb=0xf <Address 0xf out of bounds>, dest_cr=0xac <Address
0xac out of bounds>, x_offset=0, y_offset=0, qpix_put=0x3a2e908,
    qpix_avg=0x3a2eb08, weight_op=0x3a2e7b8, weight_avg=0x3a2e7d8,
list0=4096, list1=16384, chroma_avg=<optimized out>,
    chroma_put=<optimized out>) at libavcodec/h264_mc_template.c:51
#3  0x000000000072c890 in hl_motion_444_complex (weight_avg=0x3a2e7d8,
weight_op=0x3a2e7b8, qpix_avg=0x3a2eb08, qpix_put=0x3a2e908,
    dest_cr=0xac <Address 0xac out of bounds>, dest_cb=0xf <Address
0xf out of bounds>,
"STUWWXZ\\]^abdeggcddeeeeeeeeeefghjkjiggfefeeedddd", h=0x3a2e7a0,
chroma_put=<optimized out>,
    chroma_avg=<optimized out>) at libavcodec/h264_mc_template.c:80
#4  hl_decode_mb_444_complex (h=h at entry=0x3a2e7a0) at
#5  0x0000000000738f32 in ff_h264_hl_decode_mb (h=0x3a2e7a0) at
#6  decode_slice (avctx=<optimized out>, arg=arg at entry=0x7fd3a8acbdf8)
at libavcodec/h264.c:4550
#7  0x0000000000739464 in execute_decode_slices (h=h at entry=0x3a2e7a0,
context_count=1) at libavcodec/h264.c:4703
#8  0x00000000007414cc in decode_nal_units (parse_extradata=0,
buf_size=117, buf=0x345f9d0 "", h=0x3a2e7a0) at libavcodec/h264.c:5081
#9  h264_decode_frame (avctx=0x3a9cf00, data=0x3a9d360,
got_frame=0x3a9caf8, avpkt=<optimized out>) at libavcodec/h264.c:5222
#10 0x00000000009a7f1d in frame_worker_thread (arg=0x3a9c980) at
#11 0x00007fd3b0010f3a in start_thread () from /lib64/libpthread.so.0
#12 0x00007fd3aecfec0d in clone () from /lib64/libc.so.6

is there another supposed way to use this feature? or is this a bug?
Also ffplay -flags gray crashes with something related to libX11 and xcb.
Andrey Utkin

More information about the ffmpeg-user mailing list