Opened 17 months ago

Last modified 16 months ago

#9614 new defect

RTSP client with MPEG-TS streams fails

Reported by: firmman Owned by:
Priority: important Component: avformat
Version: git-master Keywords: rtsp, mpegts
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by firmman)

Summary of the bug:

When connecting to a RTSP server with sessions exported as MPEG-TS, the ffmpeg tool fails to analyze the substreams (pids) and it exits.

The same stream reading from the same source using a different transport protocol (HTTP for example) instead of RTSP is readed correctly by the ffmpeg tool.

And when the RTSP session encapsulates the same stream but as PES (demuxed video+audio), the ffmpeg then it works fine as well.

How to reproduce:

This fails (connection to RTSP with MPEG-TS encapsulation):

% ffmpeg -loglevel debug -rtsp_transport tcp -i rtsp://192.168.1.99:8554/test-mpegts -c copy -f null -

Output

ffmpeg version 2022-01-24-git-0a83ecbf48-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --e
nable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enab
le-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable
-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-m
ediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --ena
ble-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulka
n --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --
enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --en
able-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromapr
int
  libavutil      57. 18.100 / 57. 18.100
  libavcodec     59. 20.100 / 59. 20.100
  libavformat    59. 17.101 / 59. 17.101
  libavdevice    59.  5.100 / 59.  5.100
  libavfilter     8. 26.101 /  8. 26.101
  libswscale      6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
  libpostproc    56.  4.100 / 56.  4.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-rtsp_transport' ... matched as AVOption 'rtsp_transport' with argument 'tcp'.
Reading option '-i' ... matched as input url with argument 'rtsp://192.168.1.99:8554/test-mpegts'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'null'.
Reading option '-' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://192.168.1.99:8554/test-mpegts.
Successfully parsed a group of options.
Opening an input file: rtsp://192.168.1.99:8554/test-mpegts.
[tcp @ 000002b41c30d700] No default whitelist set
[tcp @ 000002b41c30d700] Original list of addresses:
[tcp @ 000002b41c30d700] Address 192.168.1.99 port 8554
[tcp @ 000002b41c30d700] Interleaved list of addresses:
[tcp @ 000002b41c30d700] Address 192.168.1.99 port 8554
[tcp @ 000002b41c30d700] Starting connection attempt to 192.168.1.99 port 8554
[tcp @ 000002b41c30d700] Successfully connected to 192.168.1.99 port 8554
[rtsp @ 000002b41c30ce40] SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=Stream
c=IN IP4 0.0.0.0
t=0 0
m=video 0 RTP/AVP 33
a=rtpmap:33 MP2T/90000
a=control:trackID=0

[rtsp @ 000002b41c30ce40] setting jitter buffer size to 0
[rtsp @ 000002b41c30ce40] hello state=0
[rtsp @ 000002b41c30ce40] stream=0 stream_type=0 pid=166 prog_reg_desc=
[rtsp @ 000002b41c30ce40] stream=1 stream_type=0 pid=167 prog_reg_desc=
[rtsp @ 000002b41c30ce40] stream=2 stream_type=0 pid=168 prog_reg_desc=
[rtsp @ 000002b41c30ce40] stream=3 stream_type=0 pid=164 prog_reg_desc=

This works OK (connection to the same server with HTTP and MPEG-TS encapsulation):

% ffmpeg -loglevel debug -i http://192.168.1.99:8554/test-mpegts -c copy -f null -

Output

ffmpeg version 2022-01-24-git-0a83ecbf48-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --e
nable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enab
le-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable
-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-m
ediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --ena
ble-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulka
n --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --
enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --en
able-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromapr
int
  libavutil      57. 18.100 / 57. 18.100
  libavcodec     59. 20.100 / 59. 20.100
  libavformat    59. 17.101 / 59. 17.101
  libavdevice    59.  5.100 / 59.  5.100
  libavfilter     8. 26.101 /  8. 26.101
  libswscale      6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
  libpostproc    56.  4.100 / 56.  4.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument 'http://192.168.1.99:8554/test-mpegts'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'null'.
Reading option '-' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url http://192.168.1.99:8554/test-mpegts.
Successfully parsed a group of options.
Opening an input file: http://192.168.1.99:8554/test-mpegts.
[NULL @ 0000015605d4cdc0] Opening 'http://192.168.1.99:8554/test-mpegts' for reading
[http @ 0000015605d4d280] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy,data'
[tcp @ 0000015605d4d3c0] Original list of addresses:
[tcp @ 0000015605d4d3c0] Address 192.168.1.99 port 8554
[tcp @ 0000015605d4d3c0] Interleaved list of addresses:
[tcp @ 0000015605d4d3c0] Address 192.168.1.99 port 8554
[tcp @ 0000015605d4d3c0] Starting connection attempt to 192.168.1.99 port 8554
[tcp @ 0000015605d4d3c0] Successfully connected to 192.168.1.99 port 8554
[http @ 0000015605d4d280] request: GET /test-mpegts HTTP/1.1
User-Agent: Lavf/59.17.101
Accept: */*
Range: bytes=0-
Connection: close
Host: 192.168.1.99:8554
Icy-MetaData: 1


[mpegts @ 0000015605d4cdc0] Format mpegts probed with size=2048 and score=50
[mpegts @ 0000015605d4cdc0] stream=1 stream_type=6 pid=120 prog_reg_desc=
[mpegts @ 0000015605d4cdc0] stream=2 stream_type=1b pid=164 prog_reg_desc=
[mpegts @ 0000015605d4cdc0] stream=3 stream_type=3 pid=166 prog_reg_desc=
[mpegts @ 0000015605d4cdc0] stream=4 stream_type=3 pid=167 prog_reg_desc=
[mpegts @ 0000015605d4cdc0] stream=5 stream_type=3 pid=168 prog_reg_desc=
[mpegts @ 0000015605d4cdc0] stream=6 stream_type=5 pid=389 prog_reg_desc=
[mpegts @ 0000015605d4cdc0] Before avformat_find_stream_info() pos: 0 bytes read:373300 seeks:0 nb_streams:7
[mpegts @ 0000015605d4cdc0] parser not found for codec none, packets or times may be invalid.
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[h264 @ 0000015605d54780] non-existing PPS 0 referenced
[h264 @ 0000015605d54780] decode_slice_header error
[h264 @ 0000015605d54780] no frame!
[extract_extradata @ 0000015605d35f80] nal_unit_type: 9(AUD), nal_ref_idc: 0
[extract_extradata @ 0000015605d35f80] nal_unit_type: 7(SPS), nal_ref_idc: 3
[extract_extradata @ 0000015605d35f80] nal_unit_type: 8(PPS), nal_ref_idc: 3
[extract_extradata @ 0000015605d35f80] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0000015605d54780] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000015605d54780] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0000015605d54780] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0000015605d54780] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0000015605d54780] Format yuv420p chosen by get_format().
[h264 @ 0000015605d54780] Reinit context to 1920x1088, pix_fmt: yuv420p
[mpegts @ 0000015605d4cdc0] max_analyze_duration 7000000 reached at 7008000 microseconds st:5
[mpegts @ 0000015605d4cdc0] Could not find codec parameters for stream 6 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[mpegts @ 0000015605d4cdc0] After avformat_find_stream_info() pos: 4592652 bytes read:4600736 seeks:0 frames:1252
Input #0, mpegts, from 'http://192.168.1.99:8554/test-mpegts':
  Duration: N/A, start: 529.356556, bitrate: N/A
  Program 1011
    Metadata:
      service_name    : betevé HD
      service_provider: betevé HD
  Stream #0:1[0x120](cat), 0, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
  Stream #0:2[0x164], 352, 1/90000: Video: h264 (Main), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(top first, left), 1920x1080 (1920x1088) [SAR 1:1 DAR
 16:9], 0/1, 25 fps, 50 tbr, 90k tbn
  Stream #0:3[0x166](spa), 294, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
  Stream #0:4[0x167](qaa), 294, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 128 kb/s
  Stream #0:5[0x168](spa), 294, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 96 kb/s (visual impaired) (descriptions)
  Stream #0:6[0x389], 0, 1/90000: Unknown: none ([5][0][0][0] / 0x0005)
  No Program
  Stream #0:0[0x12], 18, 1/90000: Data: epg, 0/1
Successfully opened the file.
Parsing a group of options: output url -.
Applying option c (codec name) with argument copy.
Applying option f (force format) with argument null.
Successfully parsed a group of options.
Opening an output file: -.
Successfully opened the file.
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf59.17.101
  Stream #0:0, 0, 1/90000: Video: h264 (Main), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(top first, left), 1920x1080 (0x0) [SAR 1:1 DAR 16:9], 0/1, q=
2-31, 25 fps, 50 tbr, 90k tbn
  Stream #0:1(spa), 0, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
Stream mapping:
  Stream #0:2 -> #0:0 (copy)
  Stream #0:3 -> #0:1 (copy)
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:1 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:1 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:1 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 79 times
frame=  409 fps=256 q=-1.0 size=N/A time=00:00:09.72 bitrate=N/A speed=6.09x

[q] command received. Exiting.

frame=  417 fps=237 q=-1.0 Lsize=N/A time=00:00:09.88 bitrate=N/A speed=5.62x
video:4520kB audio:206kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (http://192.168.1.99:8554/test-mpegts):
  Input stream #0:0 (data): 18 packets read (5510 bytes);
  Input stream #0:1 (subtitle): 0 packets read (0 bytes);
  Input stream #0:2 (video): 434 packets read (4802573 bytes);
  Input stream #0:3 (audio): 366 packets read (210816 bytes);
  Input stream #0:4 (audio): 294 packets read (112896 bytes);
  Input stream #0:5 (audio): 295 packets read (84960 bytes);
  Input stream #0:6 ((null)): 0 packets read (0 bytes);
  Total: 1407 packets (5216755 bytes) demuxed
Output file #0 (pipe:):
  Output stream #0:0 (video): 417 packets muxed (4628801 bytes);
  Output stream #0:1 (audio): 366 packets muxed (210816 bytes);
  Total: 783 packets (4839617 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0000015605d4fe40] Statistics: 5695588 bytes read, 0 seeks

This works OK too (connection to RTSP with demuxed encapsulation):

% ffmpeg -loglevel debug -rtsp_transport tcp -i rtsp://192.168.1.99:8554/test-demux -c copy -f null -

Output

ffmpeg version 2022-01-24-git-0a83ecbf48-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --e
nable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enab
le-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable
-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-m
ediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --ena
ble-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulka
n --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --
enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --en
able-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromapr
int
  libavutil      57. 18.100 / 57. 18.100
  libavcodec     59. 20.100 / 59. 20.100
  libavformat    59. 17.101 / 59. 17.101
  libavdevice    59.  5.100 / 59.  5.100
  libavfilter     8. 26.101 /  8. 26.101
  libswscale      6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
  libpostproc    56.  4.100 / 56.  4.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-rtsp_transport' ... matched as AVOption 'rtsp_transport' with argument 'tcp'.
Reading option '-i' ... matched as input url with argument 'rtsp://192.168.1.99:8554/test-demux'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'null'.
Reading option '-' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://192.168.1.99:8554/test-demux.
Successfully parsed a group of options.
Opening an input file: rtsp://192.168.1.99:8554/test-demux.
[tcp @ 0000019879ccd700] No default whitelist set
[tcp @ 0000019879ccd700] Original list of addresses:
[tcp @ 0000019879ccd700] Address 192.168.1.99 port 8554
[tcp @ 0000019879ccd700] Interleaved list of addresses:
[tcp @ 0000019879ccd700] Address 192.168.1.99 port 8554
[tcp @ 0000019879ccd700] Starting connection attempt to 192.168.1.99 port 8554
[tcp @ 0000019879ccd700] Successfully connected to 192.168.1.99 port 8554
[rtsp @ 0000019879ccce40] SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=Stream
c=IN IP4 0.0.0.0
t=0 0
m=video 0 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z01AKJJSgPAIj7wEQAAAAwBAAAAMo8WLZYA=,aP48gAA=; profile-level-id=4D4028
a=control:trackID=0
m=audio 0 RTP/AVP 97
b=AS:128
a=rtpmap:97 MPEG4-GENERIC/48000/2
a=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=119056E500
a=control:trackID=1

[rtsp @ 0000019879ccce40] video codec set to: h264
[rtsp @ 0000019879ccce40] RTP Packetization Mode: 1
[rtsp @ 0000019879ccce40] Extradata set to 0000019879cd1e80 (size: 39)
[rtsp @ 0000019879ccce40] RTP Profile IDC: 4d Profile IOP: 40 Level: 28
[rtsp @ 0000019879ccce40] audio codec set to: aac
[rtsp @ 0000019879ccce40] audio samplerate set to: 48000
[rtsp @ 0000019879ccce40] audio channels set to: 2
[rtsp @ 0000019879ccce40] setting jitter buffer size to 0
    Last message repeated 1 times
[rtsp @ 0000019879ccce40] hello state=0
[h264 @ 0000019879cd1880] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0000019879cd1880] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0000019879cd1880] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0000019879cd1880] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0000019879cd1880] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0000019879cd1880] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0000019879cd1880] Format yuv420p chosen by get_format().
[h264 @ 0000019879cd1880] Reinit context to 1920x1088, pix_fmt: yuv420p
[h264 @ 0000019879cd1880] Frame num gap 3 -1
[h264 @ 0000019879cd1880] Frame num gap 3 0
[h264 @ 0000019879cd1880] Frame num gap 3 1
[h264 @ 0000019879cd1880] reference picture missing during reorder
[h264 @ 0000019879cd1880] Missing reference picture, default is 2147483647
[rtsp @ 0000019879ccce40] first_dts -38482 not matching first dts NOPTS (pts NOPTS, duration 1800) in the queue
[rtsp @ 0000019879ccce40] Non-increasing DTS in stream 0: packet 3 with DTS -38482, packet 4 with DTS -42082
[rtsp @ 0000019879ccce40] Non-increasing DTS in stream 0: packet 11 with DTS -22282, packet 12 with DTS -27682
[rtsp @ 0000019879ccce40] Non-increasing DTS in stream 0: packet 19 with DTS -7882, packet 20 with DTS -13282
[rtsp @ 0000019879ccce40] All info found
Input #0, rtsp, from 'rtsp://192.168.1.99:8554/test-demux':
  Metadata:
    title           : Stream
  Duration: N/A, start: -0.463583, bitrate: N/A
  Stream #0:0, 27, 1/90000: Video: h264 (Main), 1 reference frame, yuv420p(top first, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 0/1, 25 fps, 50 tbr, 90k
tbn
  Stream #0:1, 26, 1/48000: Audio: aac (LC), 48000 Hz, stereo, fltp
Successfully opened the file.
Parsing a group of options: output url -.
Applying option c (codec name) with argument copy.
Applying option f (force format) with argument null.
Successfully parsed a group of options.
Opening an output file: -.
Successfully opened the file.
Output #0, null, to 'pipe:':
  Metadata:
    title           : Stream
    encoder         : Lavf59.17.101
  Stream #0:0, 0, 1/90000: Video: h264 (Main), 1 reference frame, yuv420p(top first, left), 1920x1080 (0x0) [SAR 1:1 DAR 16:9], 0/1, q=2-31, 25 fps, 50 tbr, 90k
 tbn
  Stream #0:1, 0, 1/48000: Audio: aac (LC), 48000 Hz, stereo, fltp
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:1 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:1 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 92 times
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 58 times
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 15 times
[null @ 0000019879d95e00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 163440 >= 158040


[q] command received. Exiting.

frame=    7 fps=5.1 q=-1.0 Lsize=N/A time=00:00:01.89 bitrate=N/A speed=1.38x
video:154kB audio:30kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (rtsp://192.168.1.99:8554/test-demux):
  Input stream #0:0 (video): 93 packets read (981487 bytes);
  Input stream #0:1 (audio): 89 packets read (30380 bytes);
  Total: 182 packets (1011867 bytes) demuxed
Output file #0 (pipe:):
  Output stream #0:0 (video): 7 packets muxed (157934 bytes);
  Output stream #0:1 (audio): 89 packets muxed (30380 bytes);
  Total: 96 packets (188314 bytes) muxed
0 frames successfully decoded, 0 decoding errors

Please fix this bug.
Thank you

Change History (4)

comment:1 by firmman, 17 months ago

Description: modified (diff)

comment:2 by firmman, 17 months ago

Description: modified (diff)

comment:3 by firmman, 16 months ago

Component: undeterminedavformat
Priority: normalimportant

comment:4 by firmman, 16 months ago

Hi,

I want to know if someone will check this bug. It's very annoying that the RTSP reading will fail without any error message. And it's more annoying that ffmpeg not supports the MPEG-TS format.

Thank you!

Note: See TracTickets for help on using tickets.