[FFmpeg-user] Problem decoding h264 on newer versions of ffmpeg

Hernan Gips gipsh at nubicam.com
Wed Nov 21 17:30:34 EET 2018


Hi Guys,

I'm having problems decoding  and playing  a RAW h264 video file,
on older versions of ffmpeg (2.5.1)  I'm able to decode the video
correctly,
but with newer versions like 3.4.4  it can't decode.

Are you aware of any change in the h264 decoding that may be generating
this behavior?
I have compared some code from libavcodec and it seem a lot of work was
made on the decoder.

I can provide an example video file if needed.

For example, on ffmpeg 2.5.1 work's  well:

onosendai:~/workspace/playground/ffmpeg$ ./ffmpeg-2.5.1/ffplay -v debug
./video-H264-1
ffplay version 2.5.1 Copyright (c) 2003-2014 the FFmpeg developers
  built on Nov 21 2018 10:25:40 with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
  configuration: --disable-doc --disable-podpages --disable-txtpages
--disable-manpages --disable-htmlpages --enable-ffplay --enable-gpl
--enable-nonfree
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[h264 @ 0x7fdd14007d80] Format h264 probed with size=2048 and score=51
[h264 @ 0x7fdd14007d80] Before avformat_find_stream_info() pos: 0 bytes
read:32768 seeks:0
[h264 @ 0x7fdd14000fa0] time_scale/num_units_in_tick invalid or unsupported
(0/5625)
[h264 @ 0x7fdd14000fa0] sps_id 0 out of range
[h264 @ 0x7fdd14000fa0] time_scale/num_units_in_tick invalid or unsupported
(0/5625)
[h264 @ 0x7fdd14000fa0] SPS decoding failure, trying again with the
complete NAL
[h264 @ 0x7fdd14000fa0] time_scale/num_units_in_tick invalid or unsupported
(0/5625)
[h264 @ 0x7fdd14000fa0] sps_id 0 out of range
[h264 @ 0x7fdd14007d80] max_analyze_duration 5000000 reached at 5000000
microseconds
[h264 @ 0x7fdd14007d80] After avformat_find_stream_info() pos: 346112 bytes
read:360448 seeks:0 frames:77
Input #0, h264, from './video-H264-1':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 77, 1/1200000: Video: h264 (Main), yuv420p(left),
1280x720, 1/30, 15 fps, 15 tbr, 1200k tbn, 30 tbc
detected 4 logical cores
[h264 @ 0x7fdd140a9340] time_scale/num_units_in_tick invalid or unsupported
(0/5625)
[h264 @ 0x7fdd140a9340] SPS decoding failure, trying again with the
complete NAL
[h264 @ 0x7fdd140a9340] time_scale/num_units_in_tick invalid or unsupported
(0/5625)
[h264 @ 0x7fdd140a9340] sps_id 0 out of range
[h264 @ 0x7fdd140a9340] time_scale/num_units_in_tick invalid or unsupported
(0/5625)
[h264 @ 0x7fdd140a9340] SPS decoding failure, trying again with the
complete NAL
[h264 @ 0x7fdd140a9340] time_scale/num_units_in_tick invalid or unsupported
(0/5625)
Video frame changed from size:0x0 format:none serial:-1 to size:1280x720
format:yuv420p serial:1
[ffplay_buffer @ 0x7fdd0c1c11c0] Setting 'video_size' to value '1280x720'
[ffplay_buffer @ 0x7fdd0c1c11c0] Setting 'pix_fmt' to value '0'
[ffplay_buffer @ 0x7fdd0c1c11c0] Setting 'time_base' to value '1/1200000'
[ffplay_buffer @ 0x7fdd0c1c11c0] Setting 'pixel_aspect' to value '0/1'
[ffplay_buffer @ 0x7fdd0c1c11c0] Setting 'frame_rate' to value '30/2'
[ffplay_buffer @ 0x7fdd0c1c11c0] w:1280 h:720 pixfmt:yuv420p tb:1/1200000
fr:30/2 sar:0/1 sws_param:
[ffplay_crop @ 0x7fdd0c1c1ca0] Setting 'out_w' to value 'floor(in_w/2)*2'
[ffplay_crop @ 0x7fdd0c1c1ca0] Setting 'out_h' to value 'floor(in_h/2)*2'
[AVFilterGraph @ 0x7fdd0c1c08a0] query_formats: 3 queried, 2 merged, 0
already done, 0 delayed
[ffplay_crop @ 0x7fdd0c1c1ca0] w:1280 h:720 sar:0/1 -> w:1280 h:720 sar:0/1
[AVIOContext @ 0x7fdd1400bbc0] Statistics: 360448 bytes read, 0 seeks





but with ffmpeg-3.4.5 does not work:

onosendai:~/workspace/playground/ffmpeg$ ./ffmpeg-3.4.5/ffplay -v debug
./video-H264-1
ffplay version 3.4.5 Copyright (c) 2003-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
  configuration: --disable-doc --disable-podpages --disable-txtpages
--disable-manpages --disable-htmlpages --enable-ffplay --enable-gpl
--enable-nonfree
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Initialized opengl renderer.
[NULL @ 0x7f9cec000b80] Opening './video-H264-1' for reading
[file @ 0x7f9cec001640] Setting default whitelist 'file,crypto'
[h264 @ 0x7f9cec000b80] Format h264 probed with size=2048 and score=51
[h264 @ 0x7f9cec000b80] Before avformat_find_stream_info() pos: 0 bytes
read:32768 seeks:0 nb_streams:1
[h264 @ 0x7f9cec001e00] time_scale/num_units_in_tick invalid or unsupported
(0/5625)
[h264 @ 0x7f9cec001e00] Overread VUI by 8 bits
[h264 @ 0x7f9cec001e00] sps_id 0 out of range
[AVBSFContext @ 0x7f9cec0098e0] nal_unit_type: 7, nal_ref_idc: 3
[AVBSFContext @ 0x7f9cec0098e0] nal_unit_type: 8, nal_ref_idc: 3
[AVBSFContext @ 0x7f9cec0098e0] nal_unit_type: 7, nal_ref_idc: 3
[AVBSFContext @ 0x7f9cec0098e0] nal_unit_type: 8, nal_ref_idc: 3
[AVBSFContext @ 0x7f9cec0098e0] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x7f9cec001e00] nal_unit_type: 7, nal_ref_idc: 3 0B f=0/0
[h264 @ 0x7f9cec001e00] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x7f9cec001e00] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x7f9cec001e00] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x7f9cec001e00] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x7f9cec001e00] time_scale/num_units_in_tick invalid or unsupported
(0/5625)
[h264 @ 0x7f9cec001e00] Overread VUI by 8 bits
[h264 @ 0x7f9cec001e00] SPS decoding failure, trying again with the
complete NAL
[h264 @ 0x7f9cec001e00] time_scale/num_units_in_tick invalid or unsupported
(0/5625)
[h264 @ 0x7f9cec001e00] Overread VUI by 8 bits
[h264 @ 0x7f9cec001e00] time_scale/num_units_in_tick invalid or unsupported
(0/5625)
[h264 @ 0x7f9cec001e00] Overread VUI by 8 bits
[h264 @ 0x7f9cec001e00] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 0x7f9cec001e00] nal_unit_type: 7, nal_ref_idc: 3 0B f=0/0
[h264 @ 0x7f9cec001e00] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x7f9cec001e00] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x7f9cec001e00] nal_unit_type: 1, nal_ref_idc: 2
    Last message repeated 2 times
[h264 @ 0x7f9cec001e00] nal_unit_type: 1, nal_ref_idc: 2 0B f=0/0
    Last message repeated 1 times
[h264 @ 0x7f9cec000b80] max_analyze_duration 5000000 reached at 5000000
microseconds st:0
[h264 @ 0x7f9cec000b80] After avformat_find_stream_info() pos: 346112 bytes
read:360448 seeks:0 frames:77
Input #0, h264, from './video-H264-1':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 77, 1/1200000: Video: h264 (Main), 1 reference frame,
yuv420p(progressive, left), 1280x720, 0/1, 15 fps, 15 tbr, 1200k tbn, 30 tbc
detected 4 logical cores
[h264 @ 0x7f9cec007000] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x7f9cec007000] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x7f9cec007000] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x7f9cec007000] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x7f9cec007000] time_scale/num_units_in_tick invalid or unsupported
(0/5625)
[h264 @ 0x7f9cec007000] Overread VUI by 8 bits
Failed to open file './video-H264-1' or configure filtergraph
[AVIOContext @ 0x7f9cec0099e0] Statistics: 360448 bytes read, 0 seeks


Thanks!


-- 
HG

<hernan.gips at intraway.com>


More information about the ffmpeg-user mailing list