Problem with h264 decoding while mpegts playback

Hey guys,

I have the following problem. I am trying to play mpegts udp streams with h264 encoded video on my raspberry pi 2 which I send to it using ffmpeg on my computer.
If I start the playback only the audio (aac) works and osmc shows a arbitrarily coloured picture. After a few seconds it freezes completely (which means audio and gui stop working, too).
If I encode the video of the stream as mpeg4 everything works fine. If I play it with h264 on an other computer everything is fine, too.
The confusing thing is that I am using tvheadend client with my raspberry pi 2 since 1 year and these hdtv streams (AFAIK h264, too right?) and everything works fine.
Could it be possible that in my case osmc does not use hardware decoding? Is it possible to force it to do that?

Thanks for helping me :slightly_smiling:
Kevin

To get a better understanding of the problem you are experiencing we need more information from you. Please see How to submit a useful support request - General - OSMC for advice on how to help us.

Ok I try to explain better:

The stream is sent via ffmpeg. The container is mpegts. The video encoder is x264. If I use mpeg4 as encoder it works fine. Other computers receive the content without problems.

It start the reception of the stream with an *.strm file.

The problem is that OSMC freezes like shown below.

I uploaded my logs here: http://paste.osmc.io/ukiqixolaw
Because of the frozen GUI I was not able to take a screenshot, so I took a photo and uploaded it to the end of this message.

Thanks for the fast reply. If you need any further information please let me know.

Does vcgencmd codec_enabled MPG2 confirm it’s enabled?

Yes it does. But I did not use mpg2 in this stream.

20:55:35 2302.575439 T:1425011744   DEBUG: Open - avformat_find_stream_info starting
20:55:35 2302.652832 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] non-existing PPS 0 referenced
20:55:35 2302.653564 T:1425011744   ERROR: Previous line repeats 1 times.
20:55:35 2302.653564 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] decode_slice_header error
20:55:35 2302.653809 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] no frame!
20:55:35 2302.654053 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] non-existing PPS 0 referenced
20:55:35 2302.654541 T:1425011744   ERROR: Previous line repeats 1 times.
20:55:35 2302.654541 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] decode_slice_header error
20:55:35 2302.654785 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] no frame!
20:55:35 2302.654785 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] non-existing PPS 0 referenced
20:55:35 2302.655518 T:1425011744   ERROR: Previous line repeats 1 times.
20:55:35 2302.655518 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] decode_slice_header error
20:55:35 2302.655518 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] no frame!
20:55:35 2302.655762 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] non-existing PPS 0 referenced
20:55:35 2302.656250 T:1425011744   ERROR: Previous line repeats 1 times.
20:55:35 2302.656494 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] decode_slice_header error
20:55:35 2302.656494 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] no frame!
20:55:35 2302.656738 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] non-existing PPS 0 referenced
20:55:35 2302.657227 T:1425011744   ERROR: Previous line repeats 1 times.
20:55:35 2302.657227 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] decode_slice_header error
20:55:35 2302.657471 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] no frame!
20:55:35 2302.657715 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] non-existing PPS 0 referenced
20:55:35 2302.658203 T:1425011744   ERROR: Previous line repeats 1 times.
20:55:35 2302.658203 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] decode_slice_header error
20:55:35 2302.658203 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] no frame!
20:55:35 2302.658447 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] non-existing PPS 0 referenced
20:55:35 2302.658936 T:1425011744   ERROR: Previous line repeats 1 times.
20:55:35 2302.658936 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] decode_slice_header error
20:55:35 2302.659180 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] no frame!
20:55:35 2302.659424 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] non-existing PPS 0 referenced
20:55:35 2302.659668 T:1425011744   ERROR: Previous line repeats 1 times.
20:55:35 2302.659912 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] decode_slice_header error
20:55:35 2302.659912 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] no frame!
20:55:35 2302.660156 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] non-existing PPS 0 referenced
20:55:35 2302.660645 T:1425011744   ERROR: Previous line repeats 1 times.
20:55:35 2302.660889 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] decode_slice_header error
20:55:35 2302.660889 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] no frame!
20:55:35 2302.661133 T:1425011744   ERROR: ffmpeg[54EFF420]: [h264] non-existing PPS 0 referenced
20:55:35 2302.661621 T:1425011744   ERROR: Previous line repeats 1 times.

Thanks again for your reply. I read your link and tried to workaround it with increasing the keyframe rate to one per second but the behaviour is still the same. The gui still freezes.

I looked in my logs again:

21:34:16 60.042870 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] non-existing PPS 0 referenced 21:34:16 60.043808 T:1610609696 ERROR: Previous line repeats 1 times. 21:34:16 60.043888 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] decode_slice_header error 21:34:16 60.043972 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] no frame! 21:34:16 60.044090 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] non-existing PPS 0 referenced 21:34:16 60.044415 T:1610609696 ERROR: Previous line repeats 1 times. 21:34:16 60.044495 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] decode_slice_header error 21:34:16 60.044575 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] no frame! 21:34:16 60.044716 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] non-existing PPS 0 referenced 21:34:16 60.044975 T:1610609696 ERROR: Previous line repeats 1 times. 21:34:16 60.045029 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] decode_slice_header error 21:34:16 60.045097 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] no frame! 21:34:16 60.045227 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] non-existing PPS 0 referenced 21:34:16 60.045513 T:1610609696 ERROR: Previous line repeats 1 times. 21:34:16 60.045567 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] decode_slice_header error 21:34:16 60.045639 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] no frame! 21:34:16 60.045757 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] non-existing PPS 0 referenced 21:34:16 60.046001 T:1610609696 ERROR: Previous line repeats 1 times. 21:34:16 60.046047 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] decode_slice_header error 21:34:16 60.046116 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] no frame! 21:34:16 60.046234 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] non-existing PPS 0 referenced 21:34:16 60.046482 T:1610609696 ERROR: Previous line repeats 1 times. 21:34:16 60.046528 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] decode_slice_header error 21:34:16 60.046600 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] no frame! 21:34:16 60.046700 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] non-existing PPS 0 referenced 21:34:16 60.046944 T:1610609696 ERROR: Previous line repeats 1 times. 21:34:16 60.046989 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] decode_slice_header error 21:34:16 60.047058 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] no frame! 21:34:16 60.047836 T:1957978672 DEBUG: ------ Window Init (DialogBusy.xml) ------ 21:34:17 60.430603 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] non-existing PPS 0 referenced 21:34:17 60.433147 T:1610609696 ERROR: Previous line repeats 1 times. 21:34:17 60.433285 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] decode_slice_header error 21:34:17 60.433369 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] no frame! 21:34:17 60.756283 T:1713370144 DEBUG: webserver: request received for /jsonrpc?Player.GetActivePlayers 21:34:17 60.868568 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] corrupted macroblock 15 49 (total_coeff=-1) 21:34:17 60.868813 T:1610609696 ERROR: ffmpeg[5FFFF420]: [h264] error while decoding MB 15 49 21:34:17 60.876144 T:1610609696 INFO: ffmpeg[5FFFF420]: [h264] concealing 1819 DC, 1819 AC, 1819 MV errors in I frame 21:34:17 61.017033 T:1957978672 DEBUG: ------ Window Deinit (DialogKaiToast.xml) ------ 21:34:18 61.383423 T:1610609696 DEBUG: Open - av_find_stream_info finished 21:34:18 61.383621 T:1610609696 INFO: ffmpeg[5FFFF420]: Input #0, mpegts, from 'udp://0.0.0.0:8888/': 21:34:18 61.383751 T:1610609696 INFO: ffmpeg[5FFFF420]: Duration: N/A, start: 130.978956, bitrate: N/A 21:34:18 61.383823 T:1610609696 INFO: ffmpeg[5FFFF420]: Program 1 21:34:18 61.383892 T:1610609696 INFO: ffmpeg[5FFFF420]: Metadata: 21:34:18 61.383976 T:1610609696 INFO: ffmpeg[5FFFF420]: service_name : Service01 21:34:18 61.384060 T:1610609696 INFO: ffmpeg[5FFFF420]: service_provider: FFmpeg 21:34:18 61.384377 T:1610609696 INFO: ffmpeg[5FFFF420]: Stream #0:0[0x100]: Video: h264 (High 4:2:2) ([27][0][0][0] / 0x001B), yuv422p, 1680x1050, 20 fps, 20 tbr, 90k tbn, 40 tbc 21:34:18 61.384583 T:1610609696 INFO: ffmpeg[5FFFF420]: Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 4 kb/s

Now the amount of failures is smaller. So I think that the failures are not the problem and the decoder only produces errors until the first keyframe is received.
What I don’t understand is why the srceen and the gui freeze and why the video doesn’t work.
Here are the complete logs again: http://paste.osmc.io/buroliraxu