Opened 18 months ago

Last modified 18 months ago

#5479 new defect

h264 re-encoding to flv rtmp protocol "Invalid data found when processing input" "PES packet size mismatch"

Reported by: Sirisian Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I'm testing a streaming device ( specifically this one: http://www.amazon.com/OPR-NH100-Encoder-Broadcast-Recording-replace/dp/B00NIFJYEC ) with the goal of displaying it in the browser (using HLS). Part of that process is taking the seemingly non-standard H264 encoding that the streaming device outputs and re-encoding it with ffmpeg to use with nginx-rtmp. The problem I'm seeing is that after a certain amount of time ffmpeg starts outputting errors and never recovers. I have two test cases. The first is a 720p@30Hz H264 with main profile and level 3.1 and the second is using preset ultrafast.

The failure seems to occur faster, at least in my limited testing, when the fps is less than the set fps of 30. It's almost like there's a circular buffer that's being clobbered by the input stream and ffmpeg just starts reading gibberish. I see errors like "Invalid data found when processing input" and "PES packet size mismatch" as you'll see below. Also I believe the error "non-existing PPS 0 referenced" and suh before the stream starts is normal so you can ignore those. (I think it's just looking for a keyframe before it starts). If you do test I'd recommend limiting the performance to ffmpeg somehow (or using a higher resolution?). I'm using a relatively slow linux device to run this.

I've saved the stream data (9 minutes) and uploaded it for you to see here: http://sirisian.com/randomfiles/h264streamtest.mp4 I used wget so it should be a raw download identical to what ffmpeg is getting. (It plays like a normal mp4 file with 1 second keyframes). It's specifically from a DVD player to the streaming device. The streaming device has the following configuration: http://i.imgur.com/PiBdxbT.png Here is an ffprobe of the h264 stream: http://pastebin.com/sVzbZ9Un

Test Case 1 that fails and doesn't recover after 5 minutes:

ffmpeg Command

ffmpeg -y -re -i http://192.168.1.168/hdmi -keyint_min 30 -x264opts "keyint=30:min-keyint=30:no-scenecut" -filter:v fps=30 -g 30 -r:v 30 -s 1280x720 -b:v 768k -c:v libx264 -pix_fmt yuv420p -profile:v main -level 3.1 -c:a libfdk_aac -ac 2 -ar 48000 -b:a 128k -f flv rtmp://127.0.0.1:1935/live/hdmi;

  built with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
  configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libx264 --enable-nonfree
  libavutil      55. 20.100 / 55. 20.100
  libavcodec     57. 34.100 / 57. 34.100
  libavformat    57. 31.100 / 57. 31.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 41.100 /  6. 41.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100

Output

root@desktop:/tmp/hls/hdmi# ffmpeg -y -re -i http://192.168.1.168/hdmi -keyint_min 30 -x264opts "keyint=30:min-keyint=30:no-scenecut" -filter:v fps=30 -g 30 -r:v 30 -s 1280x720 -b:v 768k -c:v libx264 -pix_fmt yuv420p -profile:v main -level 3.1 -c:a libfdk_aac -ac 2 -ar 48000 -b:a 128k -f flv rtmp://127.0.0.1:1935/live/hdmi;
ffmpeg version N-79266-gcab9661 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
  configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libx264 --enable-nonfree
  libavutil      55. 20.100 / 55. 20.100
  libavcodec     57. 34.100 / 57. 34.100
  libavformat    57. 31.100 / 57. 31.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 41.100 /  6. 41.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
[h264 @ 0xb067f20] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb067f20] decode_slice_header error
[h264 @ 0xb067f20] no frame!
Input #0, mpegts, from 'http://192.168.1.168/hdmi':
  Duration: N/A, start: 4661.077833, bitrate: N/A
  Program 1 
    Stream #0:0[0x44]: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080, 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
    Stream #0:1[0x45]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 130 kb/s
[libx264 @ 0xb0a3f00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0xb0a3f00] profile Main, level 3.1
[libx264 @ 0xb0a3f00] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=30 keyint_min=16 scenecut=0 intra_refresh=0 rc_lookahead=30 rc=abr mbtree=1 bitrate=768 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://127.0.0.1:1935/live/hdmi':
  Metadata:
    encoder         : Lavf57.31.100
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 1280x720, q=-1--1, 768 kb/s, 30 fps, 1k tbn, 30 tbc
    Metadata:
      encoder         : Lavc57.34.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/768000 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (libfdk_aac) ([10][0][0][0] / 0x000A), 48000 Hz, stereo, s16, 128 kb/s
    Metadata:
      encoder         : Lavc57.34.100 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
[aac @ 0xb068de0] channel element 0.3 is not allocated51.07 bitrate= 960.3kbits/s speed=0.789x    
Error while decoding stream #0:1: Invalid data found when processing input
[mpegts @ 0xb05a3a0] PES packet size mismatch
[h264 @ 0xb4e8c60] out of range intra chroma pred mode at 25 30
[h264 @ 0xb4e8c60] error while decoding MB 25 30
[h264 @ 0xb4e8c60] concealing 4584 DC, 4584 AC, 4584 MV errors in I frame
[h264 @ 0xb52c6a0] Increasing reorder buffer to 1
[mpegts @ 0xb05a3a0] PES packet size mismatchme=00:03:51.49 bitrate= 960.7kbits/s speed=0.789x    
    Last message repeated 1 times
[aac @ 0xb068de0] Number of bands (59) exceeds limit (46).
Error while decoding stream #0:1: Invalid data found when processing input
[h264 @ 0xb122a00] left block unavailable for requested intra4x4 mode -1 at 0 13
[h264 @ 0xb122a00] error while decoding MB 0 13
[h264 @ 0xb122a00] concealing 6649 DC, 6649 AC, 6649 MV errors in P frame
Multiple frames in a packet from stream 1
[aac @ 0xb068de0] Reserved bit set.
[aac @ 0xb068de0] Prediction is not allowed in AAC-LC.
Error while decoding stream #0:1: Invalid data found when processing input
[mpegts @ 0xb05a3a0] PES packet size mismatchme=00:03:51.89 bitrate= 960.1kbits/s speed=0.789x    
    Last message repeated 1 times
[aac @ 0xb068de0] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0xb068de0] Remapped id too large
[aac @ 0xb068de0]  is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0xb068de0] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Error while decoding stream #0:1: Not yet implemented in FFmpeg, patches welcome
[h264 @ 0xb122a00] P sub_mb_type 13 out of range at 89 32
[h264 @ 0xb122a00] error while decoding MB 89 32
[h264 @ 0xb122a00] concealing 4280 DC, 4280 AC, 4280 MV errors in P frame
[mpegts @ 0xb05a3a0] PES packet size mismatch
[aac @ 0xb068de0] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0xb068de0] decode_pce: Input buffer exhausted before END element found
Error while decoding stream #0:1: Operation not permitted
[mpegts @ 0xb05a3a0] PES packet size mismatch
[h264 @ 0xb09a1c0] P sub_mb_type 21 out of range at 46 16
[h264 @ 0xb09a1c0] error while decoding MB 46 16
[h264 @ 0xb09a1c0] concealing 6243 DC, 6243 AC, 6243 MV errors in P frame
[aac @ 0xb068de0] channel element 2.4 is not allocated
Error while decoding stream #0:1: Invalid data found when processing input
[mpegts @ 0xb05a3a0] PES packet size mismatchme=00:03:52.60 bitrate= 961.3kbits/s speed=0.788x    
[aac @ 0xb068de0] Input buffer exhausted before END element found
Error while decoding stream #0:1: Invalid data found when processing input
[mpegts @ 0xb05a3a0] PES packet size mismatch
[aac @ 0xb068de0] channel element 3.13 is not allocated
Error while decoding stream #0:1: Invalid data found when processing input
[h264 @ 0xb4e8c60] P sub_mb_type 14 out of range at 54 25
[h264 @ 0xb4e8c60] error while decoding MB 54 25
[h264 @ 0xb4e8c60] concealing 5155 DC, 5155 AC, 5155 MV errors in P frame
[mpegts @ 0xb05a3a0] PES packet size mismatch
[aac @ 0xb068de0] Number of bands (50) exceeds limit (46).
Error while decoding stream #0:1: Invalid data found when processing input
[mpegts @ 0xb05a3a0] PES packet size mismatch
[aac @ 0xb068de0] Prediction is not allowed in AAC-LC.
Error while decoding stream #0:1: Invalid data found when processing input
[h264 @ 0xb1def40] negative number of zero coeffs at 113 12
[h264 @ 0xb1def40] error while decoding MB 113 12
[h264 @ 0xb1def40] concealing 6656 DC, 6656 AC, 6656 MV errors in P frame
[flv @ 0xb0ce520] Failed to update header with correct duration.ate= 961.1kbits/s speed=0.788x    
[flv @ 0xb0ce520] Failed to update header with correct filesize.
frame= 6965 fps= 23 q=-1.0 Lsize=   27604kB time=00:03:53.27 bitrate= 969.4kbits/s speed=0.785x    
video:23652kB audio:3635kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.163453%
[libx264 @ 0xb0a3f00] frame I:233   Avg QP:22.85  size: 19888
[libx264 @ 0xb0a3f00] frame P:4231  Avg QP:27.29  size:  3926
[libx264 @ 0xb0a3f00] frame B:2501  Avg QP:28.69  size:  1189
[libx264 @ 0xb0a3f00] consecutive B-frames: 45.5% 16.3% 10.4% 27.7%
[libx264 @ 0xb0a3f00] mb I  I16..4: 67.8%  0.0% 32.2%
[libx264 @ 0xb0a3f00] mb P  I16..4:  9.2%  0.0%  2.0%  P16..4: 19.7%  2.7%  1.0%  0.0%  0.0%    skip:65.5%
[libx264 @ 0xb0a3f00] mb B  I16..4:  0.1%  0.0%  0.1%  B16..8: 22.4%  0.8%  0.1%  direct: 0.2%  skip:76.4%  L0:37.0% L1:61.8% BI: 1.2%
[libx264 @ 0xb0a3f00] final ratefactor: 29.26
[libx264 @ 0xb0a3f00] coded y,uvDC,uvAC intra: 18.1% 35.7% 7.7% inter: 1.7% 4.1% 0.0%
[libx264 @ 0xb0a3f00] i16 v,h,dc,p: 52% 22% 10% 16%
[libx264 @ 0xb0a3f00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 18% 24%  6%  6%  6%  5%  5%  3%
[libx264 @ 0xb0a3f00] i8c dc,h,v,p: 65% 16% 16%  3%
[libx264 @ 0xb0a3f00] Weighted P-Frames: Y:1.0% UV:0.5%
[libx264 @ 0xb0a3f00] ref P L0: 70.8% 12.4% 11.7%  5.0%  0.1%
[libx264 @ 0xb0a3f00] ref B L0: 92.3%  6.6%  1.1%
[libx264 @ 0xb0a3f00] ref B L1: 96.3%  3.7%
[libx264 @ 0xb0a3f00] kb/s:834.52
Exiting normally, received signal 2.

NOTE: I pressed ctrl+c to kill ffmpeg at the line reading:

[h264 @ 0xb1def40] concealing 6656 DC, 6656 AC, 6656 MV errors in P frame

This was to stop the output.

Test Case 2 that fails and doesn't recover after 2 hours:

ffmpeg Command

ffmpeg -y -re -i http://192.168.1.168/hdmi -keyint_min 30 -x264opts "keyint=30:min-keyint=30:no-scenecut" -filter:v fps=30 -g 30 -r:v 30 -s 1280x720 -b:v 768k -c:v libx264 -pix_fmt yuv420p -profile:v main -level 3.1 -c:a libfdk_aac -ac 2 -ar 48000 -b:a 128k -preset ultrafast -f flv rtmp://127.0.0.1:1935/live/hdmi;

ffmpeg version N-79266-gcab9661 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
  configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libx264 --enable-nonfree
  libavutil      55. 20.100 / 55. 20.100
  libavcodec     57. 34.100 / 57. 34.100
  libavformat    57. 31.100 / 57. 31.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 41.100 /  6. 41.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100

Output

root@desktop:/tmp/hls/hdmi# ffmpeg -y -re -i http://192.168.1.168/hdmi -keyint_min 30 -x264opts "keyint=30:min-keyint=30:no-scenecut" -filter:v fps=30 -g 30 -r:v 30 -s 1280x720 -b:v 768k -c:v libx264 -pix_fmt yuv420p -profile:v main -level 3.1 -c:a libfdk_aac -ac 2 -ar 48000 -b:a 128k -preset ultrafast -f flv rtmp://127.0.0.1:1935/live/hdmi;
ffmpeg version N-79266-gcab9661 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
  configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libx264 --enable-nonfree
  libavutil      55. 20.100 / 55. 20.100
  libavcodec     57. 34.100 / 57. 34.100
  libavformat    57. 31.100 / 57. 31.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 41.100 /  6. 41.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
[h264 @ 0xb0d8f00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0xb0d8f00] decode_slice_header error
[h264 @ 0xb0d8f00] no frame!
Input #0, mpegts, from 'http://192.168.1.168/hdmi':
  Duration: N/A, start: 5431.643078, bitrate: N/A
  Program 1 
    Stream #0:0[0x44]: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080, 29.97 tbr, 90k tbn, 180k tbc
    Stream #0:1[0x45]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 130 kb/s
[libx264 @ 0xb4941c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0xb4941c0] profile Constrained Baseline, level 3.1
[libx264 @ 0xb4941c0] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=30 keyint_min=16 scenecut=0 intra_refresh=0 rc=abr mbtree=0 bitrate=768 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, flv, to 'rtmp://127.0.0.1:1935/live/hdmi':
  Metadata:
    encoder         : Lavf57.31.100
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 1280x720, q=-1--1, 768 kb/s, 30 fps, 1k tbn, 30 tbc
    Metadata:
      encoder         : Lavc57.34.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/768000 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (libfdk_aac) ([10][0][0][0] / 0x000A), 48000 Hz, stereo, s16, 128 kb/s
    Metadata:
      encoder         : Lavc57.34.100 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
[mpegts @ 0xb0cb3e0] PES packet size mismatchime=01:15:51.28 bitrate= 915.5kbits/s speed=   1x    
[aac @ 0xb10a280] TNS filter order 18 is greater than maximum 12.
Error while decoding stream #0:1: Invalid data found when processing input
[mpegts @ 0xb0cb3e0] PES packet size mismatch
[aac @ 0xb10a280] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0xb10a280] Inconsistent channel configuration.
[aac @ 0xb10a280] get_buffer() failed
Error while decoding stream #0:1: Invalid argument
[h264 @ 0xb5210e0] negative number of zero coeffs at 46 21
[h264 @ 0xb5210e0] error while decoding MB 46 21
[h264 @ 0xb5210e0] concealing 5643 DC, 5643 AC, 5643 MV errors in P frame
[mpegts @ 0xb0cb3e0] PES packet size mismatchime=01:26:52.14 bitrate= 914.4kbits/s speed=0.996x    
[aac @ 0xb10a280] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0xb10a280] decode_pce: Input buffer exhausted before END element found
Error while decoding stream #0:1: Operation not permitted
[mpegts @ 0xb0cb3e0] PES packet size mismatch
[aac @ 0xb10a280] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0xb10a280] Inconsistent channel configuration.
[aac @ 0xb10a280] get_buffer() failed
Error while decoding stream #0:1: Invalid argument
[h264 @ 0xb103f60] concealing 1274 DC, 1274 AC, 1274 MV errors in P frame
[flv @ 0xb0d9dc0] Failed to update header with correct duration.rate= 921.5kbits/s speed=0.995x    
[flv @ 0xb0d9dc0] Failed to update header with correct filesize.
frame=228146 fps= 30 q=-1.0 Lsize=  855557kB time=02:06:46.00 bitrate= 921.5kbits/s speed=0.995x    
video:726400kB audio:118784kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.227235%
[libx264 @ 0xb4941c0] frame I:7605  Avg QP:31.99  size: 31138
[libx264 @ 0xb4941c0] frame P:220541 Avg QP:35.07  size:  2299
[libx264 @ 0xb4941c0] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0xb4941c0] mb P  I16..4:  4.9%  0.0%  0.0%  P16..4: 11.8%  0.0%  0.0%  0.0%  0.0%    skip:83.3%
[libx264 @ 0xb4941c0] final ratefactor: 35.08
[libx264 @ 0xb4941c0] coded y,uvDC,uvAC intra: 19.8% 23.8% 7.0% inter: 2.4% 1.9% 0.0%
[libx264 @ 0xb4941c0] i16 v,h,dc,p: 45% 29% 14% 12%
[libx264 @ 0xb4941c0] i8c dc,h,v,p: 59% 20% 16%  5%
[libx264 @ 0xb4941c0] kb/s:782.48
Exiting normally, received signal 2.

NOTE: I pressed ctrl+c to kill ffmpeg at the line reading:

[h264 @ 0xb103f60] concealing 1274 DC, 1274 AC, 1274 MV errors in P frame

This was to stop the output.

If you need any more information just ask.

Change History (2)

comment:1 in reply to: ↑ description ; follow-up: Changed 18 months ago by cehoyos

Replying to Sirisian:

I've saved the stream data (9 minutes) and uploaded it for you to see here: http://sirisian.com/randomfiles/h264streamtest.mp4

Does this file allow to reproduce your issue?

comment:2 in reply to: ↑ 1 Changed 18 months ago by Sirisian

Replying to cehoyos:

Replying to Sirisian:

I've saved the stream data (9 minutes) and uploaded it for you to see here: http://sirisian.com/randomfiles/h264streamtest.mp4

Does this file allow to reproduce your issue?

That's a good question. It does not. I just tried and under even extreme stress where it was reading at 13 fps it didn't fail. I tested again with the network stream and it failed after 7 minutes. I also checked and the machine isn't running out of memory before it fails (2 GB free of 4 GBs).

That said I found something interesting. ffmpeg spikes in memory usage going from a constant 12.5% (500 MiB) the whole time it's running smoothly to 14.7% (588 MiB) within a second right before it fails (or after, very hard to tell) and continues to rise. Seems to be something that can only be reproduced from a network stream.

This could make it hard to reproduce unless one of the devs has an H264 network stream to use or can mimic one with my file and a slow device. I'd be willing to test ideas.

Note: See TracTickets for help on using tickets.