Opened 3 years ago

Last modified 3 years ago

#9107 reopened enhancement

ffmpeg can't use RTSP/TCP but OpenRTSP does

Reported by: Andre Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: rtsp, tcp
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I am using a ipcamera (China cheap ones) with ffmpeg to stream rtsp and save in files. I have manage to make ffmpeg work using rtsp/udp. Unfortunatelly it cannot connect using rtsp/tcp. Algouth by the logs bellow the rtsp server answered that unicast can be used in setup. Also I managed to make it work rtsp/tcp using the http://www.live555.com/openRTSP software.
How to reproduce:

% ffmpeg -rtsp_transport tcp -v 9 -loglevel 99 -i rtsp://admin:gig1684A@192.168.0.105:554/onvif1 output.mp4
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built-in anaconda but also tested on linux, armabi compiled by source same errors

All the rest of the logging messages:

built with gcc 10.2.1 (GCC) 20200726
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100

Splitting the commandline.
Reading option '-rtsp_transport' ... matched as AVOption 'rtsp_transport' with argument 'tcp'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-i' ... matched as input url with argument 'rtsp://admin:gig1684A@192.168.0.105:554/onvif1'.
Reading option 'outvideo.mkv' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://admin:gig1684A@192.168.0.105:554/onvif1.
Successfully parsed a group of options.
Opening an input file: rtsp://admin:gig1684A@192.168.0.105:554/onvif1.
Probing rtsp score:100 size:0
[tcp @ 000002ad275168c0] No default whitelist set
[tcp @ 000002ad275168c0] Original list of addresses:
[tcp @ 000002ad275168c0] Address 192.168.0.105 port 554
[tcp @ 000002ad275168c0] Interleaved list of addresses:
[tcp @ 000002ad275168c0] Address 192.168.0.105 port 554
[tcp @ 000002ad275168c0] Starting connection attempt to 192.168.0.105 port 554
[tcp @ 000002ad275168c0] Successfully connected to 192.168.0.105 port 554
[rtsp @ 000002ad27515940] Sending:
OPTIONS rtsp://192.168.0.105:554/onvif1 RTSP/1.0
CSeq: 1
User-Agent: Lavf58.45.100

--
[rtsp @ 000002ad27515940] ret=1 c=52 [R]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=50 [P]
[rtsp @ 000002ad27515940] ret=1 c=2f /
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=2e .
[rtsp @ 000002ad27515940] ret=1 c=30 [0]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=32 [2]
[rtsp @ 000002ad27515940] ret=1 c=30 [0]

Last message repeated 1 times

[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=4f [O]
[rtsp @ 000002ad27515940] ret=1 c=4b [K]
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='RTSP/1.0 200 OK'
[rtsp @ 000002ad27515940] ret=1 c=43 [C]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=71 [q]
[rtsp @ 000002ad27515940] ret=1 c=3a [:]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='CSeq: 1'
[rtsp @ 000002ad27515940] ret=1 c=50 [P]
[rtsp @ 000002ad27515940] ret=1 c=75 [u]
[rtsp @ 000002ad27515940] ret=1 c=62 [b]
[rtsp @ 000002ad27515940] ret=1 c=6c [l]
[rtsp @ 000002ad27515940] ret=1 c=69 [i]
[rtsp @ 000002ad27515940] ret=1 c=63 [c]
[rtsp @ 000002ad27515940] ret=1 c=3a [:]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=4f [O]
[rtsp @ 000002ad27515940] ret=1 c=50 [P]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=49 [I]
[rtsp @ 000002ad27515940] ret=1 c=4f [O]
[rtsp @ 000002ad27515940] ret=1 c=4e [N]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=2c [,]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=44 [D]
[rtsp @ 000002ad27515940] ret=1 c=45 [E]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=43 [C]
[rtsp @ 000002ad27515940] ret=1 c=52 [R]
[rtsp @ 000002ad27515940] ret=1 c=49 [I]
[rtsp @ 000002ad27515940] ret=1 c=42 [B]
[rtsp @ 000002ad27515940] ret=1 c=45 [E]
[rtsp @ 000002ad27515940] ret=1 c=2c [,]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=45 [E]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=55 [U]
[rtsp @ 000002ad27515940] ret=1 c=50 [P]
[rtsp @ 000002ad27515940] ret=1 c=2c [,]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=45 [E]
[rtsp @ 000002ad27515940] ret=1 c=41 [A]
[rtsp @ 000002ad27515940] ret=1 c=52 [R]
[rtsp @ 000002ad27515940] ret=1 c=44 [D]
[rtsp @ 000002ad27515940] ret=1 c=4f [O]
[rtsp @ 000002ad27515940] ret=1 c=57 [W]
[rtsp @ 000002ad27515940] ret=1 c=4e [N]
[rtsp @ 000002ad27515940] ret=1 c=2c [,]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=50 [P]
[rtsp @ 000002ad27515940] ret=1 c=4c [L]
[rtsp @ 000002ad27515940] ret=1 c=41 [A]
[rtsp @ 000002ad27515940] ret=1 c=59 [Y]
[rtsp @ 000002ad27515940] ret=1 c=2c [,]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=50 [P]
[rtsp @ 000002ad27515940] ret=1 c=41 [A]
[rtsp @ 000002ad27515940] ret=1 c=55 [U]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=45 [E]
[rtsp @ 000002ad27515940] ret=1 c=2c [,]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=47 [G]
[rtsp @ 000002ad27515940] ret=1 c=45 [E]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=5f [_]
[rtsp @ 000002ad27515940] ret=1 c=50 [P]
[rtsp @ 000002ad27515940] ret=1 c=41 [A]
[rtsp @ 000002ad27515940] ret=1 c=52 [R]
[rtsp @ 000002ad27515940] ret=1 c=41 [A]
[rtsp @ 000002ad27515940] ret=1 c=4d [M]
[rtsp @ 000002ad27515940] ret=1 c=45 [E]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=45 [E]
[rtsp @ 000002ad27515940] ret=1 c=52 [R]
[rtsp @ 000002ad27515940] ret=1 c=2c [,]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=45 [E]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=5f [_]
[rtsp @ 000002ad27515940] ret=1 c=50 [P]
[rtsp @ 000002ad27515940] ret=1 c=41 [A]
[rtsp @ 000002ad27515940] ret=1 c=52 [R]
[rtsp @ 000002ad27515940] ret=1 c=41 [A]
[rtsp @ 000002ad27515940] ret=1 c=4d [M]
[rtsp @ 000002ad27515940] ret=1 c=45 [E]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=45 [E]
[rtsp @ 000002ad27515940] ret=1 c=52 [R]
[rtsp @ 000002ad27515940] ret=1 c=2c [,]
[rtsp @ 000002ad27515940] ret=1 c=55 [U]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=45 [E]
[rtsp @ 000002ad27515940] ret=1 c=52 [R]
[rtsp @ 000002ad27515940] ret=1 c=5f [_]
[rtsp @ 000002ad27515940] ret=1 c=43 [C]
[rtsp @ 000002ad27515940] ret=1 c=4d [M]
[rtsp @ 000002ad27515940] ret=1 c=44 [D]
[rtsp @ 000002ad27515940] ret=1 c=5f [_]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=45 [E]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER,USER_CMD_SET'
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line=
[rtsp @ 000002ad27515940] Sending:
DESCRIBE rtsp://192.168.0.105:554/onvif1 RTSP/1.0
Accept: application/sdp
CSeq: 2
User-Agent: Lavf58.45.100

--
[rtsp @ 000002ad27515940] ret=1 c=52 [R]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=50 [P]
[rtsp @ 000002ad27515940] ret=1 c=2f /
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=2e .
[rtsp @ 000002ad27515940] ret=1 c=30 [0]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=34 [4]
[rtsp @ 000002ad27515940] ret=1 c=30 [0]
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=55 [U]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=61 [a]
[rtsp @ 000002ad27515940] ret=1 c=75 [u]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=68 [h]
[rtsp @ 000002ad27515940] ret=1 c=6f [o]
[rtsp @ 000002ad27515940] ret=1 c=72 [r]
[rtsp @ 000002ad27515940] ret=1 c=69 [i]
[rtsp @ 000002ad27515940] ret=1 c=7a [z]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=64 [d]
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='RTSP/1.0 401 Unauthorized'
[rtsp @ 000002ad27515940] ret=1 c=43 [C]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=71 [q]
[rtsp @ 000002ad27515940] ret=1 c=3a [:]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=32 [2]
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='CSeq: 2'
[rtsp @ 000002ad27515940] ret=1 c=57 [W]

Last message repeated 2 times

[rtsp @ 000002ad27515940] ret=1 c=2d [-]
[rtsp @ 000002ad27515940] ret=1 c=41 [A]
[rtsp @ 000002ad27515940] ret=1 c=75 [u]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=68 [h]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=69 [i]
[rtsp @ 000002ad27515940] ret=1 c=63 [c]
[rtsp @ 000002ad27515940] ret=1 c=61 [a]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=3a [:]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=44 [D]
[rtsp @ 000002ad27515940] ret=1 c=69 [i]
[rtsp @ 000002ad27515940] ret=1 c=67 [g]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=73 [s]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=72 [r]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=61 [a]
[rtsp @ 000002ad27515940] ret=1 c=6c [l]
[rtsp @ 000002ad27515940] ret=1 c=6d [m]
[rtsp @ 000002ad27515940] ret=1 c=3d [=]
[rtsp @ 000002ad27515940] ret=1 c=22 ["]
[rtsp @ 000002ad27515940] ret=1 c=48 [H]
[rtsp @ 000002ad27515940] ret=1 c=49 [I]
[rtsp @ 000002ad27515940] ret=1 c=69 [i]
[rtsp @ 000002ad27515940] ret=1 c=70 [p]
[rtsp @ 000002ad27515940] ret=1 c=43 [C]
[rtsp @ 000002ad27515940] ret=1 c=61 [a]
[rtsp @ 000002ad27515940] ret=1 c=6d [m]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=72 [r]
[rtsp @ 000002ad27515940] ret=1 c=61 [a]
[rtsp @ 000002ad27515940] ret=1 c=22 ["]
[rtsp @ 000002ad27515940] ret=1 c=2c [,]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=6f [o]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=63 [c]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=3d [=]
[rtsp @ 000002ad27515940] ret=1 c=22 ["]
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=37 [7]
[rtsp @ 000002ad27515940] ret=1 c=31 [1]

Last message repeated 1 times

[rtsp @ 000002ad27515940] ret=1 c=32 [2]
[rtsp @ 000002ad27515940] ret=1 c=61 [a]
[rtsp @ 000002ad27515940] ret=1 c=38 [8]
[rtsp @ 000002ad27515940] ret=1 c=64 [d]
[rtsp @ 000002ad27515940] ret=1 c=36 [6]

Last message repeated 1 times

[rtsp @ 000002ad27515940] ret=1 c=63 [c]
[rtsp @ 000002ad27515940] ret=1 c=36 [6]
[rtsp @ 000002ad27515940] ret=1 c=35 [5]
[rtsp @ 000002ad27515940] ret=1 c=36 [6]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=66 [f]
[rtsp @ 000002ad27515940] ret=1 c=62 [b]
[rtsp @ 000002ad27515940] ret=1 c=64 [d]

Last message repeated 1 times

[rtsp @ 000002ad27515940] ret=1 c=30 [0]
[rtsp @ 000002ad27515940] ret=1 c=66 [f]
[rtsp @ 000002ad27515940] ret=1 c=32 [2]
[rtsp @ 000002ad27515940] ret=1 c=33 [3]
[rtsp @ 000002ad27515940] ret=1 c=30 [0]
[rtsp @ 000002ad27515940] ret=1 c=32 [2]
[rtsp @ 000002ad27515940] ret=1 c=37 [7]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=39 [9]
[rtsp @ 000002ad27515940] ret=1 c=34 [4]
[rtsp @ 000002ad27515940] ret=1 c=61 [a]
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=33 [3]
[rtsp @ 000002ad27515940] ret=1 c=22 ["]
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='WWW-Authenticate: Digest realm="HIipCamera",nonce="17112a8d66c656efbdd0f23027e94a13"'
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line=
[rtsp @ 000002ad27515940] Sending:
DESCRIBE rtsp://192.168.0.105:554/onvif1 RTSP/1.0
Accept: application/sdp
CSeq: 3
User-Agent: Lavf58.45.100
Authorization: Digest username="admin", realm="HIipCamera", nonce="17112a8d66c656efbdd0f23027e94a13", uri="rtsp://192.168.0.105:554/onvif1", response="3b29b4cc18c782d66ddb0f7205bba5c6"

--
[rtsp @ 000002ad27515940] ret=1 c=52 [R]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=50 [P]
[rtsp @ 000002ad27515940] ret=1 c=2f /
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=2e .
[rtsp @ 000002ad27515940] ret=1 c=30 [0]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=32 [2]
[rtsp @ 000002ad27515940] ret=1 c=30 [0]

Last message repeated 1 times

[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=4f [O]
[rtsp @ 000002ad27515940] ret=1 c=4b [K]
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='RTSP/1.0 200 OK'
[rtsp @ 000002ad27515940] ret=1 c=43 [C]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=71 [q]
[rtsp @ 000002ad27515940] ret=1 c=3a [:]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=33 [3]
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='CSeq: 3'
[rtsp @ 000002ad27515940] ret=1 c=43 [C]
[rtsp @ 000002ad27515940] ret=1 c=6f [o]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=2d [-]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=79 [y]
[rtsp @ 000002ad27515940] ret=1 c=70 [p]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=3a [:]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=61 [a]
[rtsp @ 000002ad27515940] ret=1 c=70 [p]

Last message repeated 1 times

[rtsp @ 000002ad27515940] ret=1 c=6c [l]
[rtsp @ 000002ad27515940] ret=1 c=69 [i]
[rtsp @ 000002ad27515940] ret=1 c=63 [c]
[rtsp @ 000002ad27515940] ret=1 c=61 [a]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=69 [i]
[rtsp @ 000002ad27515940] ret=1 c=6f [o]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=2f /
[rtsp @ 000002ad27515940] ret=1 c=73 [s]
[rtsp @ 000002ad27515940] ret=1 c=64 [d]
[rtsp @ 000002ad27515940] ret=1 c=70 [p]
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='Content-Type: application/sdp'
[rtsp @ 000002ad27515940] ret=1 c=43 [C]
[rtsp @ 000002ad27515940] ret=1 c=6f [o]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=2d [-]
[rtsp @ 000002ad27515940] ret=1 c=4c [L]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=67 [g]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=68 [h]
[rtsp @ 000002ad27515940] ret=1 c=3a [:]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=34 [4]
[rtsp @ 000002ad27515940] ret=1 c=32 [2]

Last message repeated 1 times

]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='Content-Length: 422'
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line=
[rtsp @ 000002ad27515940] SDP:
v=0
o=- 1421069297525233 1 IN IP4 192.168.0.105
s=H.265 Video, RtspServer_0.0.0.2
t=0 0
a=tool:RtspServer_0.0.0.2
a=type:broadcast
a=control:*
a=range:npt=0-
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:500
a=rtpmap:96 H265/90000
a=fmtp:96 packetization-mode=1;profile-level-id=42001F;sprop-parameter-sets=Z0IAH5WoFAFuQA==,aM48gA==
a=control:track1
m=audio 0 RTP/AVP 8
a=control:track2
a=rtpmap:8 PCMA/8000

[rtsp @ 000002ad27515940] sdp: v='0'
[rtsp @ 000002ad27515940] sdp: o='- 1421069297525233 1 IN IP4 192.168.0.105'
[rtsp @ 000002ad27515940] sdp: s='H.265 Video, RtspServer_0.0.0.2'
[rtsp @ 000002ad27515940] sdp: t='0 0'
[rtsp @ 000002ad27515940] sdp: a='tool:RtspServer_0.0.0.2'
[rtsp @ 000002ad27515940] sdp: a='type:broadcast'
[rtsp @ 000002ad27515940] sdp: a='control:*'
[rtsp @ 000002ad27515940] sdp: a='range:npt=0-'
Failed to parse interval end specification
[rtsp @ 000002ad27515940] sdp: m='video 0 RTP/AVP 96'
[rtsp @ 000002ad27515940] sdp: c='IN IP4 0.0.0.0'
[rtsp @ 000002ad27515940] sdp: b='AS:500'
[rtsp @ 000002ad27515940] sdp: a='rtpmap:96 H265/90000'
[rtsp @ 000002ad27515940] video codec set to: hevc
[rtsp @ 000002ad27515940] sdp: a='fmtp:96 packetization-mode=1;profile-level-id=42001F;sprop-parameter-sets=Z0IAH5WoFAFuQA==,aM48gA=='
[rtsp @ 000002ad27515940] sdp: a='control:track1'
[rtsp @ 000002ad27515940] sdp: m='audio 0 RTP/AVP 8'
[rtsp @ 000002ad27515940] sdp: a='control:track2'
[rtsp @ 000002ad27515940] sdp: a='rtpmap:8 PCMA/8000'
[rtsp @ 000002ad27515940] audio codec set to: pcm_alaw
[rtsp @ 000002ad27515940] audio samplerate set to: 8000
[rtsp @ 000002ad27515940] audio channels set to: 1
[rtsp @ 000002ad27515940] Sending:
SETUP rtsp://192.168.0.105:554/onvif1/track1 RTSP/1.0
Transport: RTP/AVP/TCP;unicast;interleaved=0-1
CSeq: 4
User-Agent: Lavf58.45.100
Authorization: Digest username="admin", realm="HIipCamera", nonce="17112a8d66c656efbdd0f23027e94a13", uri="rtsp://192.168.0.105:554/onvif1/track1", response="ec1a3913798f59686f73bb9cda761114"

--
[rtsp @ 000002ad27515940] ret=1 c=52 [R]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=50 [P]
[rtsp @ 000002ad27515940] ret=1 c=2f /
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=2e .
[rtsp @ 000002ad27515940] ret=1 c=30 [0]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=32 [2]
[rtsp @ 000002ad27515940] ret=1 c=30 [0]

Last message repeated 1 times

[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=4f [O]
[rtsp @ 000002ad27515940] ret=1 c=4b [K]
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='RTSP/1.0 200 OK'
[rtsp @ 000002ad27515940] ret=1 c=43 [C]
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=71 [q]
[rtsp @ 000002ad27515940] ret=1 c=3a [:]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=34 [4]
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='CSeq: 4'
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=72 [r]
[rtsp @ 000002ad27515940] ret=1 c=61 [a]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=73 [s]
[rtsp @ 000002ad27515940] ret=1 c=70 [p]
[rtsp @ 000002ad27515940] ret=1 c=6f [o]
[rtsp @ 000002ad27515940] ret=1 c=72 [r]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=3a [:]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=52 [R]
[rtsp @ 000002ad27515940] ret=1 c=54 [T]
[rtsp @ 000002ad27515940] ret=1 c=50 [P]
[rtsp @ 000002ad27515940] ret=1 c=2f /
[rtsp @ 000002ad27515940] ret=1 c=41 [A]
[rtsp @ 000002ad27515940] ret=1 c=56 [V]
[rtsp @ 000002ad27515940] ret=1 c=50 [P]
[rtsp @ 000002ad27515940] ret=1 c=3b [;]
[rtsp @ 000002ad27515940] ret=1 c=75 [u]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=69 [i]
[rtsp @ 000002ad27515940] ret=1 c=63 [c]
[rtsp @ 000002ad27515940] ret=1 c=61 [a]
[rtsp @ 000002ad27515940] ret=1 c=73 [s]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=3b [;]
[rtsp @ 000002ad27515940] ret=1 c=64 [d]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=73 [s]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=69 [i]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=61 [a]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=69 [i]
[rtsp @ 000002ad27515940] ret=1 c=6f [o]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=3d [=]
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=39 [9]
[rtsp @ 000002ad27515940] ret=1 c=32 [2]
[rtsp @ 000002ad27515940] ret=1 c=2e .
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=36 [6]
[rtsp @ 000002ad27515940] ret=1 c=38 [8]
[rtsp @ 000002ad27515940] ret=1 c=2e .
[rtsp @ 000002ad27515940] ret=1 c=30 [0]
[rtsp @ 000002ad27515940] ret=1 c=2e .
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=30 [0]
[rtsp @ 000002ad27515940] ret=1 c=36 [6]
[rtsp @ 000002ad27515940] ret=1 c=3b [;]
[rtsp @ 000002ad27515940] ret=1 c=73 [s]
[rtsp @ 000002ad27515940] ret=1 c=6f [o]
[rtsp @ 000002ad27515940] ret=1 c=75 [u]
[rtsp @ 000002ad27515940] ret=1 c=72 [r]
[rtsp @ 000002ad27515940] ret=1 c=63 [c]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=3d [=]
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=39 [9]
[rtsp @ 000002ad27515940] ret=1 c=32 [2]
[rtsp @ 000002ad27515940] ret=1 c=2e .
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=36 [6]
[rtsp @ 000002ad27515940] ret=1 c=38 [8]
[rtsp @ 000002ad27515940] ret=1 c=2e .
[rtsp @ 000002ad27515940] ret=1 c=30 [0]
[rtsp @ 000002ad27515940] ret=1 c=2e .
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=30 [0]
[rtsp @ 000002ad27515940] ret=1 c=35 [5]
[rtsp @ 000002ad27515940] ret=1 c=3b [;]
[rtsp @ 000002ad27515940] ret=1 c=69 [i]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=72 [r]
[rtsp @ 000002ad27515940] ret=1 c=6c [l]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=61 [a]
[rtsp @ 000002ad27515940] ret=1 c=76 [v]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=64 [d]
[rtsp @ 000002ad27515940] ret=1 c=3d [=]
[rtsp @ 000002ad27515940] ret=1 c=30 [0]
[rtsp @ 000002ad27515940] ret=1 c=2d [-]
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='Transport: RTP/AVP;unicast;destination=192.168.0.106;source=192.168.0.105;interleaved=0-1'
[rtsp @ 000002ad27515940] ret=1 c=53 [S]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=73 [s]

Last message repeated 1 times

[rtsp @ 000002ad27515940] ret=1 c=69 [i]
[rtsp @ 000002ad27515940] ret=1 c=6f [o]
[rtsp @ 000002ad27515940] ret=1 c=6e [n]
[rtsp @ 000002ad27515940] ret=1 c=3a [:]
[rtsp @ 000002ad27515940] ret=1 c=20 [ ]
[rtsp @ 000002ad27515940] ret=1 c=35 [5]
[rtsp @ 000002ad27515940] ret=1 c=36 [6]
[rtsp @ 000002ad27515940] ret=1 c=62 [b]
[rtsp @ 000002ad27515940] ret=1 c=31 [1]
[rtsp @ 000002ad27515940] ret=1 c=38 [8]
[rtsp @ 000002ad27515940] ret=1 c=32 [2]
[rtsp @ 000002ad27515940] ret=1 c=63 [c]
[rtsp @ 000002ad27515940] ret=1 c=36 [6]
[rtsp @ 000002ad27515940] ret=1 c=3b [;]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=69 [i]
[rtsp @ 000002ad27515940] ret=1 c=6d [m]
[rtsp @ 000002ad27515940] ret=1 c=65 [e]
[rtsp @ 000002ad27515940] ret=1 c=6f [o]
[rtsp @ 000002ad27515940] ret=1 c=75 [u]
[rtsp @ 000002ad27515940] ret=1 c=74 [t]
[rtsp @ 000002ad27515940] ret=1 c=3d [=]
[rtsp @ 000002ad27515940] ret=1 c=36 [6]
[rtsp @ 000002ad27515940] ret=1 c=30 [0]
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line='Session: 56b182c6;timeout=60'
]rtsp @ 000002ad27515940] ret=1 c=0d [
[rtsp @ 000002ad27515940] ret=1 c=0a [
]
[rtsp @ 000002ad27515940] line=
[rtsp @ 000002ad27515940] Nonmatching transport in server reply
rtsp://admin:gig1684A@192.168.0.105:554/onvif1: Invalid data found when processing input

Change History (6)

comment:1 by Carl Eugen Hoyos, 3 years ago

Keywords: tcp openRTSP removed
Priority: importantnormal

Please test current FFmpeg git head.

comment:2 by Andre, 3 years ago

Component: undeterminedavformat
Keywords: tcp added

comment:3 by Andriy Gelman, 3 years ago

Looks that the server is actually responding that it's using UDP.

To use TCP it would need to reply with something like:
Transport: RTP/AVP/TCP;interleaved=0-1

But the reply is:
'Transport: RTP/AVP;unicast;destination=192.168.0.106;source=192.168.0.105;

which is interpreted as UDP:
https://tools.ietf.org/html/rfc2326#section-12.39

comment:4 by Andriy Gelman, 3 years ago

Resolution: invalid
Status: newclosed

will close the ticket because current behavior is correct.

comment:5 by Andre, 3 years ago

Resolution: invalid
Status: closedreopened

Well I understand your point more or less.

I openned this https://stackoverflow.com/q/66280861/1207193 on SO. I managed to solve it by modifying ffmpeg/libavformat/rtsp.c replacing:

if (!av_strcasecmp(lower_transport, "TCP"))
    th->lower_transport = RTSP_LOWER_TRANSPORT_TCP;
else
    th->lower_transport = RTSP_LOWER_TRANSPORT_UDP;

by

if (!av_strcasecmp(lower_transport, "TCP") || !av_strcasecmp(lower_transport, ""))
    th->lower_transport = RTSP_LOWER_TRANSPORT_TCP;
else
    th->lower_transport = RTSP_LOWER_TRANSPORT_UDP;

I insertd || !av_strcasecmp(lower_transport, "") in the code. Making it assume that the transport is RTSP_LOWER_TRANSPORT_TCP when lower_transport is ommited. This works for me but I wouldn't suggest it as a fix.

I think would be nice make FFMPEG more forgiving to RTSP servers (not very RTSP compliant). Altough I don't know if it would be a accepted behavior for FFMPEG team due its current views or approachs.

In that scenario a better solution would be consider the case of a missing lower transport on a rtsp server answer. Then compare with the client-sent request to define whether the lower transport was ommitted. And try to connect with it.

I hope I did not take much of your time guys.
Thank you very much!

comment:6 by Andre, 3 years ago

Type: defectenhancement
Note: See TracTickets for help on using tickets.