Hello,<div><br></div><div>im using ffmpeg on iOS to decode a h264 rtsp stream of an ip camera, im connection to the stream via http tunneling and it is working so far but the decoder has different problems with some frames, resulting in bad image quality. Im new to ffmpeg and video decoding in general so i have no guess where the problem might be. I mostly used the iFrameExtractor app as an example to write my own code which is working very well for cameras with mjpeg stream.</div>
<div><br></div><div>I ve heard that normally you have to extract the SPS / PPS of the rtsp frames and send them to the decoder, on the other side some people writing that ffmpeg is extracting them itself. this is the output I'm recieving in xcode:</div>
<div><br></div>[h264 @ 0xba7bc00] sps_id (32) out of range<br><br>[h264 @ 0xba7bc00] sps_id (32) out of range<br><br>[h264 @ 0xba7bc00] sps_id (32) out of range<br><br>[h264 @ 0x9ab5e00] max_analyze_duration 100000 reached at 120000<br>
<br>[h264 @ 0x9ab5e00] decoding for stream 0 failed<br><br>[h264 @ 0x9ab5e00] Estimating duration from bitrate, this may be inaccurate<br><br>[swscaler @ 0x9b2f000] No accelerated colorspace conversion found from yuv420p to rgb24.<br>
<br>[h264 @ 0x9b2e400] sps_id (32) out of range<br><br>[h264 @ 0x9b2e400] sps_id (32) out of range<br><br>[h264 @ 0xba7bc00] sps_id out of range<br><br>[h264 @ 0x9b2e800] sps_id out of range<br><br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br>
<br>[h264 @ 0xba7bc00] non-existing PPS referenced<br><br>[h264 @ 0xba7bc00] non-existing PPS referenced<br><br>[h264 @ 0x9b2e400] Partitioned H.264 support is incomplete<br><br>[h264 @ 0x9b2e400] Partitioned H.264 support is incomplete<br>
<br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br><br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br><br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br><br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br>
<br>[h264 @ 0xba7bc00] non-existing PPS referenced<br><br>[h264 @ 0xba7bc00] non-existing PPS referenced<br><br>[h264 @ 0xba7bc00] sps_id out of range<br><br>[h264 @ 0x9a9a800] sps_id out of range<br><br>[h264 @ 0xba7bc00] chroma_format_idc 32 is illegal<br>
<br>[h264 @ 0x9a9a800] chroma_format_idc 32 is illegal<br><br>[h264 @ 0x9a9a800] chroma_format_idc 32 is illegal<br><br>[h264 @ 0x9b2ec00] Partitioned H.264 support is incomplete<br><br>[h264 @ 0xba7bc00] sps_id out of range<br>
<br>[h264 @ 0x9b2e400] sps_id out of range<br><br>[h264 @ 0xba7bc00] sps_id out of range<br><br>[h264 @ 0x9b2e000] sps_id out of range<br><br>[h264 @ 0xba7bc00] non-existing PPS referenced<br><br>[h264 @ 0xba7bc00] non-existing PPS referenced<br>
<br>[h264 @ 0xba7bc00] non-existing PPS referenced<br><br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br><br>[h264 @ 0xba7bc00] sps_id out of range<br><br>[h264 @ 0x9b2e400] sps_id out of range<br><br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br>
<br>[h264 @ 0xba7bc00] illegal bit depth value (28, 8)<br><br>[h264 @ 0x9b2e000] illegal bit depth value (28, 8)<br><br>[h264 @ 0x9b2e000] illegal bit depth value (28, 8)<br><br>[h264 @ 0xba7bc00] non-existing PPS referenced<br>
<br>[h264 @ 0xba7bc00] non-existing PPS referenced<br><br>[h264 @ 0xba7bc00] non-existing PPS referenced<br><br>[h264 @ 0xba7bc00] illegal bit depth value (8, 50)<br><br>[h264 @ 0x9b2e800] illegal bit depth value (8, 50)<br>
<br>[h264 @ 0x9b2e800] illegal bit depth value (8, 50)<br><br>[h264 @ 0x9b2e800] Partitioned H.264 support is incomplete<br><br>[h264 @ 0xba7bc00] sps_id out of range<br><br>[h264 @ 0x9b2e000] sps_id out of range<br><br>[h264 @ 0xba7bc00] non-existing PPS referenced<br>
<br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br><br>[h264 @ 0xba7bc00] chroma_format_idc 5 is illegal<br><br>[h264 @ 0x9b2e400] chroma_format_idc 5 is illegal<br><br>[h264 @ 0x9b2e400] chroma_format_idc 5 is illegal<br>
<br>[h264 @ 0xba7bc00] sps_id out of range<br><br>[h264 @ 0x9b2e800] sps_id out of range<br><br>[h264 @ 0xba7bc00] sps_id out of range<br><br>[h264 @ 0x9b2e800] sps_id out of range<br><br>[h264 @ 0x9b2e400] Width/height/bit depth/chroma idc changing with threads 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.<br>
<br>[h264 @ 0x9b2e400] decode_slice_header error<br><br>[h264 @ 0x9b2e400] no frame!<br><br>[h264 @ 0x9b2e800] Width/height/bit depth/chroma idc changing with threads 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.<br>
<br>[h264 @ 0x9b2e800] decode_slice_header error<br><br>[h264 @ 0x9b2e800] no frame!<br><br>[h264 @ 0x9b2ec00] Width/height/bit depth/chroma idc changing with threads 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.<br>
<br>[h264 @ 0x9b2ec00] decode_slice_header error<br><br>[h264 @ 0x9b2ec00] no frame!<br><br>[h264 @ 0x9a9a800] Width/height/bit depth/chroma idc changing with threads 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.<br>
<br>[h264 @ 0x9a9a800] decode_slice_header error<br><br>[h264 @ 0x9a9a800] no frame!<br><br>[h264 @ 0x9b2e000] Width/height/bit depth/chroma idc changing with threads 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.<br>
<br>[h264 @ 0x9b2e000] decode_slice_header error<br><br>[h264 @ 0x9b2e000] no frame!<br><br>[h264 @ 0x9b2e400] Width/height/bit depth/chroma idc changing with threads 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.<br>
<br>[h264 @ 0x9b2e400] decode_slice_header error<br><br>[h264 @ 0x9b2e400] no frame!<br><br>[h264 @ 0x9b2e800] Width/height/bit depth/chroma idc changing with threads 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.<br>
<br>[h264 @ 0x9b2e800] decode_slice_header error<br><br>[h264 @ 0x9b2e800] no frame!<br><br>[h264 @ 0x9b2ec00] Width/height/bit depth/chroma idc changing with threads 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.<br>
<br>[h264 @ 0x9b2ec00] decode_slice_header error<br><br>[h264 @ 0x9b2ec00] no frame!<br><br>[h264 @ 0x9a9a800] Width/height/bit depth/chroma idc changing with threads 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.<br>
<br>[h264 @ 0x9a9a800] decode_slice_header error<br><br>[h264 @ 0x9a9a800] no frame!<br><br>[h264 @ 0xba7bc00] illegal aspect ratio<br><br>[h264 @ 0x9b2e000] illegal aspect ratio<br><br>[h264 @ 0x9b2e000] Width/height/bit depth/chroma idc changing with threads 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.<br>
<br>[h264 @ 0x9b2e000] decode_slice_header error<br><br>[h264 @ 0x9b2e000] no frame!<br><br>[h264 @ 0x9b2e400] Width/height/bit depth/chroma idc changing with threads 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.<br>
<br>[h264 @ 0x9b2e400] decode_slice_header error<br><br>[h264 @ 0x9b2e400] no frame!<br><br>[h264 @ 0x9b2e800] Width/height/bit depth/chroma idc changing with threads 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.<br>
<br>[h264 @ 0x9b2e800] decode_slice_header error<br><br>[h264 @ 0x9b2e800] no frame!<br><br>[h264 @ 0x9b2ec00] Width/height/bit depth/chroma idc changing with threads 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.<br>
<br>[h264 @ 0x9b2ec00] decode_slice_header error<br><br>[h264 @ 0x9b2ec00] no frame!<br><br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br><br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br>
<br>[h264 @ 0xba7bc00] non-existing PPS referenced<br><br>[h264 @ 0xba7bc00] non-existing PPS referenced<br><br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br><br>[h264 @ 0xba7bc00] sps_id out of range<br>
<br>[h264 @ 0x9b2e400] sps_id out of range<br><br>[h264 @ 0xba7bc00] sps_id out of range<br><br>[h264 @ 0x9b2ec00] sps_id out of range<br><br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br><br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br>
<br>[h264 @ 0xba7bc00] missing picture in access unit with size 16<br><br>[h264 @ 0x9b2e800] Partitioned H.264 support is incomplete<div><br><div>My ffmpeg build options (i386 simulator):</div><div><br></div>--disable-shared --disable-doc --disable-devices --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-protocols --enable-protocol=http --enable-protocol=rtp --enable-protocol=udp --disable-filters --disable-encoders --disable-decoders --enable-decoder=mjpeg --enable-decoder=h264 --disable-demuxers --enable-demuxer=mjpeg --enable-demuxer=h264 --enable-demuxer=rtsp --disable-demuxer=mov --disable-muxers --disable-parsers --enable-parser=mjpeg --enable-parser=h264 --enable-neon --enable-pthreads --enable-swscale --enable-cross-compile --arch=i386 --target-os=darwin --cpu=i386 --prefix=compiled/i386 --enable-pic --enable-static<div>
<br></div><div>Pseudo code in the app lokks like this:</div><div><br></div>av_register_all();<br><br>avformat_network_init();<br><br>pFormatCtx = avformat_alloc_context();<br><br>avInformat = av_find_input_format("h264");<br>
<br>avformat_open_input(&pFormatCtx, moviePath, avInformat, <span style="font-family:Menlo;font-size:11px">&options</span>)<br><br>avformat_find_stream_info(pFormatCtx, NULL)<br><br>pCodecCtx=pFormatCtx->streams[videoStream]->codec;<br>
<br>pCodec=avcodec_find_decoder(pCodecCtx->codec_id);<br><br>AVDictionary* codecOpts = NULL;<br><br>avcodec_open2(pCodecCtx, pCodec, &codecOpts)</div><div><br></div><div>.....<br><div><br></div><div>Im using the latest git head of ffmpeg and already tested with turned off pthreading in my build configuration but the output is still the same, vlc cant access the http tunnel but the rtsp directly works but not with ffmpeg.</div>
<div><br></div><div>Hope someone can give me a hint</div><div><br></div><div>Best regards,</div><div>Alex</div><div><div><br></div></div></div>