Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#13218 closed Bug Report - General (fixed)

Problems decoding some H264 tansport streams

Reported by: dag@… Owned by: Peter Bennett
Priority: major Milestone: 30.0
Component: 3rd Party - FFMPEG Version: Unspecified
Severity: medium Keywords: decoding error
Cc: Ticket locked: no

Description

Tride to upgrade to 0.29-fixes on my frontend and found that some of the previous HD recordings did not play any more. They did play well earlier with master from october. Also tried with master and the same thing.

The log will show: 2018-02-07 20:40:59.544649 I Clearing OpenGL painter cache. 2018-02-07 20:40:59.940045 I VDPAU: Created 2 output surfaces. 2018-02-07 20:40:59.940125 I VDPAU: Created VDPAU render device 1920x1080 2018-02-07 20:40:59.997879 N Player(0): Forcing decode extra audio option on (Video method requires it). 2018-02-07 20:41:00.005147 I AFD: codec AC3 has 0 channels 2018-02-07 20:41:00.006502 I AFD: Opened codec 0x7fbe7c036500, id(AC3) type(Audio) 2018-02-07 20:41:00.007201 I AFD: Opened codec 0x7fbe7c026ca0, id(H264) type(Video) 2018-02-07 20:41:00.007227 W Enabling buffering optimisations for low bitrate stream. 2018-02-07 20:41:00.014932 E AFD: Unknown decoding error 2018-02-07 20:41:00.015938 E AFD: Unknown decoding error 2018-02-07 20:41:00.017832 E AFD: Unknown decoding error 2018-02-07 20:41:00.018638 E AFD: Unknown decoding error 2018-02-07 20:41:00.019488 E AFD: Unknown decoding error

And just keep repeating that error.

I cut out 10 seconds of the start of this recording and will attach it to this ticket.

To me it seems like there is a bug introduced in ffmpeg, but I am not sure.

Attachments (1)

short_sample.ts (2.0 MB) - added by dag@… 6 years ago.
Sample that newer ffmpeg will not decode

Download all attachments as: .zip

Change History (16)

Changed 6 years ago by dag@…

Attachment: short_sample.ts added

Sample that newer ffmpeg will not decode

comment:1 Changed 6 years ago by dag@…

The version that still works is:

v29-pre-518-g8f1ab54

comment:2 Changed 6 years ago by dag@…

And please excuse me. Tried the short sample with "mythffmpeg -i short_sample.ts out.avi" and this actually decoded into an avi file. Doing it on the whole recording will create a 0 sized file and fail though. Stderr shows:

% mythffmpeg -i 1025_20180119175900.ts /data/out.avi 
ffmpeg version v29.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.1 (GCC) 20160406 (Red Hat 5.3.1-6)
  configuration: --disable-vaapi --enable-libxvid --enable-libx264 --enable-libx265 --enable-libvpx --enable-sdl2 --enable-libmp3lame --enable-libzvbi
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.100 / 57. 64.100
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] SPS unavailable in decode_picture_timing
[h264 @ 0xa736e0] non-existing PPS 0 referenced
[h264 @ 0xa736e0] decode_slice_header error
[h264 @ 0xa736e0] no frame!
[mpegts @ 0xa6fac0] PES packet size mismatch
[mpegts @ 0xa6fac0] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0xa6fac0] Could not find codec parameters for stream 1 (Audio: ac3, 0 channels): unspecified sample format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0xa6fac0] Could not find codec parameters for stream 2 (Audio: ac3, 0 channels): unspecified sample format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from '1025_20180119175900.ts':
  Duration: N/A, bitrate: N/A
    Stream #0:0[0x13a]: Video: h264, none, 90k tbn
    Stream #0:1[0x366](eng): Audio: ac3, 0 channels
    Stream #0:2[0x369](dut): Audio: ac3, 0 channels
    Stream #0:3[0xc37](fin): Subtitle: dvb_subtitle
    Stream #0:4[0x13ec](fin): Subtitle: dvb_teletext
Output #0, avi, to '/data/out.avi':
Output file #0 does not contain any stream

Ths file is too big to attach to the ticket though.

comment:3 Changed 6 years ago by dag@…

Had to test the strange size thing:

  • If I cut less than 46MB from the beginning of the file there will be an out.avi
  • If the cut size is bigger there will be no file and the result from above comment

Weird...

comment:4 Changed 6 years ago by dag@…

Tried the same file with ffmpeg version 3.3.6 and that decoded without problems.

Put the first 50MB of the failing file on dropbox with the link : https://www.dropbox.com/s/ntwkb1l83xuzacn/sample.ts?dl=0

comment:5 Changed 6 years ago by Peter Bennett

I get a segmentation fault playing the file with master but it plays with fixes-29. Please let me know the current version of mythfrontend you are using.

comment:6 Changed 6 years ago by dag@…

I am using Minimyth2 frontends and have tried with two different ones of them, both fails.

  • The first is marked 29-fixes and has a version number 29-8.15.4.r80
  • The second is marked master and has a version number master-8.15.5.r439

The r<nnn> should be referring to the mythtv version. Does it make sense to you?

Here a link to the download page which has a Changelog:

http://members.upcpoczta.pl/p.oniszczuk36/Minimyth2/Download.html

comment:7 Changed 6 years ago by Peter Bennett

The way to get the version is by running mythfrontend --version at a command line. Paste the full output in the ticket.

comment:8 Changed 6 years ago by dag@…

Ok, Thanks for the HOWTO! Needs a bunch of reboots :-) But here we go:

  • Working
MythTV Version : v29-pre-518-g8f1ab54
MythTV Branch : master
Network Protocol : 91
Library API : 29.20170212-1
QT Version : 5.4.1
Options compiled in:
 linux release use_hidesyms using_alsa using_oss using_backend using_bindings_python using_dvb using_firewire using_frontend using_vbox using_hdpvr using_ivtv using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_lirc using_mheg using_opengl using_opengl_video using_opengl_themepainter using_qtwebkit using_qtscript using_taglib using_v4l2 using_x11 using_xrandr using_bindings_python using_freetype2 using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2
  • Not working:
MythTV Version : v29.0-80-gb3aa4b5
MythTV Branch : 29
Network Protocol : 91
Library API : 29.20170212-1
QT Version : 5.4.1
Options compiled in:
 linux release use_hidesyms using_alsa using_oss using_backend using_bindings_python using_dvb using_firewire using_frontend using_vbox using_hdpvr using_ivtv using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_lirc using_mheg using_opengl using_opengl_video using_opengl_themepainter using_qtwebkit using_qtscript using_taglib using_v4l2 using_x11 using_xrandr using_bindings_python using_freetype2 using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2
  • And also not working:
MythTV Version : v30-Pre-439-gb3fe5d4
MythTV Branch : master
Network Protocol : 91
Library API : 30.20180128-1
QT Version : 5.4.1
Options compiled in:
 linux release use_hidesyms using_alsa using_oss using_backend using_bindings_python using_dvb using_firewire using_frontend using_vbox using_hdpvr using_ivtv using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_lirc using_mheg using_opengl using_opengl_video using_opengl_themepainter using_qtwebkit using_qtscript using_taglib using_v4l2 using_x11 using_xrandr using_bindings_python using_freetype2 using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2

comment:9 Changed 6 years ago by Peter Bennett

Milestone: needs_triage30.0
Status: newaccepted

My testing shows that it works with the latest V29, which is V29.1, but not if using vaapi. It fails in V30-pre (master).

There is a change of resolution detected in the file and the code to handle that is not working in v30-pre. I will work on fixing this.

Note that the vaapi code currently cannot handle changes in resolution so this will fail in all versions if you have vaapi selected. Instead of vaapi select one of the opengl profiles if you have changes of resolution in your recordings.

I do not see the "unknown decoding error" messages. When it fails with vaapi I see a different message. When it fails on V30 I see a segmentation fault.

comment:10 Changed 6 years ago by dag@…

The tests were done on a system running VDPAU.

comment:11 Changed 6 years ago by Peter Bennett

I can make a simple fix that allows this file to play correctly, but I would like another example to test with. The file you uploaded shows a change from 640x480 to 1920x1080 right near the beginning, before we have even seen any 640x480. Perhaps the previous program was 640x480 and it recorded a small amount, less than a second, of that program before the resolution change.

I would like to test a file where there is a resolution change with more of the prior resolution, for example 15 seconds of 640x480 and then change to 1920x1080. DO you have any files like that or can you record one?

comment:12 Changed 6 years ago by dag@…

I would have to look for others as I only check that partcular series my wife wanted to watch and I guess they all have a similar transition. Poses some problem with family though as it involves booting the non working version :-) Is there a tool that could be used to look for these kind of files directly from my recordings?

comment:13 Changed 6 years ago by Peter Bennett <pbennett@…>

Resolution: fixed
Status: acceptedclosed

In c9857a93f9bcfa2dfad39b0891f7f759a372504f/mythtv:

ffmpeg: Fix handling of stream changes and errors

If a stream cannot be decoded with hardware assist,
then try switching to software decoding.

If a stream cannot be software decoded, display an
error message to the user and stop playback.

Remove stream-change hacks for h264 that are no
longer necessary and are now causing a failure.

Fixes #13211
Fixes #13217
Fixes #13218
Fixes #13223

comment:14 Changed 6 years ago by Peter Bennett

Owner: changed from Peter Bennett to Peter Bennett

comment:15 Changed 4 years ago by Mark Kendall

This is still a problem. See #13557 for details - which has a sample from the same channel.

Note: See TracTickets for help on using tickets.