Open MartinPulec opened 4 months ago
Hi, I've looked into it and make some observations and changes.
rtsp://admin:admin@192.168.1.15:554/1
(port number normally a part of the URL - rtp_rx_port specifies video RTP RX port, I don't recall any real use case for that; I've already hidden the option in help)Except that, I've also made couple of further improvements:
The changes are already included in the continuous build. Please let us know if it works now with the proposed RTSP port syntax.
The changes in the continuous build are a big improvement, thank you !
Unfortunately I still can't get rtsp working from this device, but that seems to be more a problem with the device itself. I am going to poke at it more and try to see what's going on.
Just out of interest: is there a verbose switch I can use for UG to see more complete logging?
So I just tried a passthrough from the camera device with ffmpeg to the MediaMTX/Simple RTMP server with similar results.
UG Command Line:
UltraGrid.AppImage --tool uv --control-port 6160 -f V:rs:200:250 -t rtsp://192.168.1.32:8554/stream -c libavcodec:encoder=libaom-av1:usage=realtime:cpu-used=8:safe -P 5005 9000 192.168.1.32
Output:
UltraGrid 1.9+ (master rev ef8c7d4 built Jul 16 2024 11:27:47)
Display device : none
Capture device : rtsp
Audio capture : none
Audio playback : none
MTU : 9000 B
Video compression: libavcodec:encoder=libaom-av1:usage=realtime:cpu-used=8:safe
Audio codec : PCM
Network protocol : UltraGrid RTP
Audio FEC : none
Video FEC : rs:200:250
[rtsp] Using URI rtsp://192.168.1.32:8554/stream
[rtsp] cURL V7.68.0 loaded
[rtsp] RTSP/1.0 501 Not Implemented
[rtsp] CSeq: 3
[rtsp] Server: gortsplib
[rtsp]
Unable to start video capture device rtsp
Unable to open capture device: rtsp
Exit
FFMPEG command (stream copy):
ffmpeg -i rtsp://admin:admin@192.168.1.15:554/1 -c copy -f rtsp rtsp://localhost:8554/stream
VLC is able to open the stream, so it appears that everything is working, however UG is not picking it up.
Adding a slash gives me a slightly different output that's more in line with what attempting a direct connection to the camera device gives:
[rtsp] Using URI rtsp://192.168.1.32:8554/stream/
[rtsp] cURL V7.68.0 loaded
[rtsp] RTSP/1.0 400 Bad Request
[rtsp] CSeq: 2
[rtsp] Server: gortsplib
[rtsp]
[rtsp] [rtsp_teardown] curl_easy_perform(curl) failed: RTSP CSeq mismatch or invalid CSeq (85)
[rtsp error] could not configure rtsp capture properly,
please check your parameters.
Exiting...
Unable to start video capture device rtsp
Unable to open capture device: rtsp
Exit
The RTSP server is outputting only this:
2024/07/17 15:33:33 INF [RTSP] [conn 192.168.1.32:34242] opened
2024/07/17 15:33:33 INF [RTSP] [conn 192.168.1.32:34242] closed: EOF
Obviously even If I could get it working this way, it's not a practical solution as the ffmpeg binary and rtsp server introduces a horrendous latency, but I figured I would try it out to provide more information.
For completeness sake here is the command I used to launch the mediaserver container:
podman run --network=host -p 8554:8554 -p 1935:1935 -p 8888:8888 -p 8889:8889 -p 8890:8890/udp -p 8189:8189/udp bluenviron/mediamtx:latest
Just out of interest: is there a verbose switch I can use for UG to see more complete logging?
Sure, -V
(verbose), -VV
debug, -VVV
(debug2) or --verbose=<level>
. But specifically with rtsp capture module there is not much more logging in "verbose" mode.
Anyways, related to this, I've just added a verbose logging of the options that are being set to see, what exactly does the RTSP/1.0 501 Not Implemented
error cause. It should be rebuilt already in continuous for Linux (and hopefully for other platforms few moments later). Would it be possible to re-run UG now with -V
? I don't need the whole output, several lines between the error 501 would be sufficient.
FFMPEG command (stream copy):
ffmpeg -i rtsp://admin:admin@192.168.1.15:554/1 -c copy -f rtsp rtsp://localhost:8554/stream
Thanks, I'll try tomorrow to see if I am able to reproduce.
Adding a slash gives me a slightly different output that's more in line with what attempting a direct connection to the camera device gives:
I am not expert on RTSP URI syntax but it may be possible, that the slash isn't allowed there.
I hope that I'll be able to give you more info if I am able to to reproduce with FFmpeg. At least I've just noticed a potential problem in the output:
[1721315141.229] [rtsp] Setting CURLOPT_USERNAME to 0x7451f5f7c810
[1721315141.230] [rtsp] Setting CURLOPT_PASSWORD to 0x7451f5f7cdf0
even when user:pass is not provided in URI, which I suppose is not correct.
Great - Here is the output from the new continuous build with the command UltraGrid.AppImage --tool uv --control-port 6160 -f V:rs:200:250 -t rtsp://admin:admin@192.168.1.15/1:decompress -c libavcodec:encoder=libaom-av1:usage=realtime:cpu-used=8:safe -P 5004 -m 9000 192.168.1.32 -VV
UltraGrid 1.9+ (master rev f7dd228 built Jul 18 2024 15:08:14)
Display device : none
Capture device : rtsp
Audio capture : none
Audio playback : none
MTU : 9000 B
Video compression: libavcodec:encoder=libaom-av1:usage=realtime:cpu-used=8:safe
Audio codec : PCM
Network protocol : UltraGrid RTP
Audio FEC : none
Video FEC : rs:200:250
[1721317937.898] [module] Locking lock 0x7ffe213a16b8
[1721317937.898] [module] Unlocking lock 0x7ffe213a16b8
[1721317937.898] [module] Locking lock 0x7ffe213a16b8
[1721317937.898] [module] Unlocking lock 0x7ffe213a16b8
[1721317937.898] [module] Locking lock 0x7ffe213a16b8
[1721317937.898] [module] Unlocking lock 0x7ffe213a16b8
[1721317937.898] [module] Locking lock 0x562fd76e1a70
[1721317937.898] [module] Unlocking lock 0x562fd76e1a70
[1721317937.898] [module] Locking lock 0x562fd76e1a70
[1721317937.898] [module] Unlocking lock 0x562fd76e1a70
[1721317937.898] [module] Locking lock 0x562fd76e1bc0
[1721317937.898] [module] Unlocking lock 0x562fd76e1bc0
[1721317937.898] [module] Locking lock 0x7ffe213a16b8
[1721317937.898] [module] Unlocking lock 0x7ffe213a16b8
[1721317937.898] Display initialized-none
[1721317937.898] [module] Locking lock 0x7ffe213a16b8
[1721317937.898] [module] Unlocking lock 0x7ffe213a16b8
[1721317937.898] [rtsp] Using URI rtsp://admin:admin@192.168.1.15:554/1
[1721317937.900] Found empty UDP port pair 54954/54955
[1721317937.901] Connected IP version 6
Last message repeated 1 times
[1721317937.901] Created database entry 0x6aea69ae (1 sources)
[1721317937.901] Created new RTP session with SSRC 0x6aea69ae.
[1721317937.901] Socket recv buffer size set to 456192 B (requested 228096 B)
[1721317937.901] Socket send buffer size set to 114688 B (requested 57344 B)
[1721317937.901] Added participant 6aea69ae
[1721317937.901] [rtsp] rtp receiver init done
[1721317937.901] [rtsp] selected flags:
[1721317937.901] [rtsp] uri: rtsp://admin:admin@192.168.1.15:554/1
[1721317937.901] [rtsp] port: 54954
[1721317937.901] [rtsp] decompress: 1
[rtsp] cURL V7.68.0 loaded
[1721317937.902] [rtsp] Setting CURLOPT_NOSIGNAL to 1
[1721317937.902] [rtsp] request V1.0
[1721317937.902] [rtsp] Project web site: http://code.google.com/p/rtsprequest/
[1721317937.902] [rtsp] Requires cURL V7.20 or greater
[1721317937.902] [rtsp] Setting CURLOPT_NOSIGNAL to 1
[1721317937.902] [rtsp] Setting CURLOPT_VERBOSE to 1
[1721317937.902] [rtsp] Setting CURLOPT_NOPROGRESS to 1
[1721317937.902] [rtsp] Setting CURLOPT_HEADERDATA to 0x7ffe2139f940
[1721317937.902] [rtsp] Setting CURLOPT_HEADERFUNCTION to 0x7f7462906420
[1721317937.902] [rtsp] Setting CURLOPT_URL to 0x562fd76e21a8
[1721317937.902]
[rtsp] OPTIONS rtsp://admin:admin@192.168.1.15:554/1
[1721317937.902] [rtsp] Setting CURLOPT_RTSP_STREAM_URI to rtsp://admin:admin@192.168.1.15:554/1
[1721317937.902] [rtsp] Setting CURLOPT_USERNAME to 0x7ffe213a0140
[1721317937.902] [rtsp] Setting CURLOPT_PASSWORD to 0x7ffe213a0720
[1721317937.902] [rtsp] Setting CURLOPT_RTSP_REQUEST to 1
* Trying 192.168.1.15:554...
* TCP_NODELAY set
* Connected to 192.168.1.15 (192.168.1.15) port 554 (#0)
* Server auth using Basic with user 'admin'
> OPTIONS rtsp://admin:admin@192.168.1.15:554/1 RTSP/1.0
CSeq: 1
Authorization: Basic YWRtaW46YWRtaW4=
< RTSP/1.0 200 OK
[1721317937.925] [rtsp] RTSP/1.0 200 OK
< CSeq: 1
[1721317937.925] [rtsp] CSeq: 1
< Public: OPTIONS,DESCRIBE,SETUP,TEARDOWN,PLAY,SET_PARAMETER,GET_PARAMETER
[1721317937.925] [rtsp] Public: OPTIONS,DESCRIBE,SETUP,TEARDOWN,PLAY,SET_PARAMETER,GET_PARAMETER
[1721317937.925] [rtsp]
<
* Connection #0 to host 192.168.1.15 left intact
[1721317937.925]
[rtsp] DESCRIBE rtsp://admin:admin@192.168.1.15:554/1
[1721317937.925] [rtsp] Setting CURLOPT_WRITEDATA to 0x562fd75c4530
[1721317937.925] [rtsp] Setting CURLOPT_RTSP_REQUEST to 2
* Found bundle for host 192.168.1.15: 0x562fd7707ce0 [serially]
* Re-using existing connection! (#0) with host 192.168.1.15
* Connected to 192.168.1.15 (192.168.1.15) port 554 (#0)
* Server auth using Basic with user 'admin'
> DESCRIBE rtsp://admin:admin@192.168.1.15:554/1 RTSP/1.0
CSeq: 2
Accept: application/sdp
Authorization: Basic YWRtaW46YWRtaW4=
< RTSP/1.0 200 OK
[1721317937.936] [rtsp] RTSP/1.0 200 OK
< CSeq: 2
[1721317937.936] [rtsp] CSeq: 2
< Content-Type: application/sdp
[1721317937.936] [rtsp] Content-Type: application/sdp
< Cache-Control: must-revalidate
[1721317937.936] [rtsp] Cache-Control: must-revalidate
< Content-Length: 402
[1721317937.936] [rtsp] Content-Length: 402
< Content-Base: rtsp://admin:admin@192.168.1.15:554/1
[1721317937.936] [rtsp] Content-Base: rtsp://admin:admin@192.168.1.15:554/1
[1721317937.936] [rtsp]
<
* Connection #0 to host 192.168.1.15 left intact
[1721317937.936] [rtsp] Setting CURLOPT_WRITEDATA to 0x7f746a5f75c0
[rtsp] SDP:
[rtsp] v=0
[rtsp] o=CameraStreaming 3132335948 1236907222000 IN IP4 192.168.1.15
[rtsp] s=10
[rtsp] c=IN IP4 0.0.0.0
[rtsp] t=0 0
[rtsp] a=control:*
[rtsp] m=video 0 RTP/AVP 26
[rtsp] a=control:trackID=0
[rtsp] a=rtpmap:26 JPEG/90000
[rtsp] a=framesize:26 1920-1080
[rtsp] m=audio 0 RTP/AVP 104
[rtsp] a=control:trackID=1
[rtsp] a=rtpmap:104 MPEG4-GENERIC/48000/2
[rtsp] a=fmtp:104 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1190
[rtsp]
[1721317937.936] [rtsp] TRACK = trackID=0 FOR CODEC =
[1721317937.936] [rtsp] TRACK = trackID=1 FOR CODEC =
0 0
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
Lost: 0
Intervals: 0
Total: 0
ooo: 0 -- -nan
[1721317937.936]
[rtsp] TEARDOWN rtsp://admin:admin@192.168.1.15:554/1
[1721317937.936] [rtsp] Setting CURLOPT_RTSP_REQUEST to 7
* Found bundle for host 192.168.1.15: 0x562fd7707ce0 [serially]
* Re-using existing connection! (#0) with host 192.168.1.15
* Connected to 192.168.1.15 (192.168.1.15) port 554 (#0)
* Server auth using Basic with user 'admin'
> TEARDOWN rtsp://admin:admin@192.168.1.15:554/1 RTSP/1.0
CSeq: 3
Authorization: Basic YWRtaW46YWRtaW4=
< RTSP/1.0 405 Method Not Allowed
[1721317937.938] [rtsp] RTSP/1.0 405 Method Not Allowed
< CSeq: 5
[1721317937.938] [rtsp] CSeq: 5
< Server: Rtsp Server
[1721317937.938] [rtsp] Server: Rtsp Server
< Allow: OPTIONS, DESCRIBE, SETUP, PLAY, TEARDOWN, SET_PARAMETER
[1721317937.938] [rtsp] Allow: OPTIONS, DESCRIBE, SETUP, PLAY, TEARDOWN, SET_PARAMETER
[1721317937.938] [rtsp]
<
* The CSeq of this request 3 did not match the response 0
* Connection #0 to host 192.168.1.15 left intact
[1721317937.938] [rtsp] [rtsp_teardown] curl_easy_perform(curl) failed: RTSP CSeq mismatch or invalid CSeq (85)
[rtsp error] could not configure rtsp capture properly,
please check your parameters.
Exiting...
[1721317937.938] Unable to start video capture device rtsp
[1721317937.938] [module] Locking lock 0x7ffe213a16b8
[1721317937.938] [module] Unlocking lock 0x7ffe213a16b8
[1721317937.938] [module] Locking lock 0x562fd76e20d8
[1721317937.938] [module] Unlocking lock 0x562fd76e20d8
Unable to open capture device: rtsp
[1721317937.938] [module] Locking lock 0x7ffe213a16b8
[1721317937.938] [module] Unlocking lock 0x7ffe213a16b8
[1721317937.938] [module] Locking lock 0x562fd75c5bd8
[1721317937.938] [module] Unlocking lock 0x562fd75c5bd8
[1721317937.938] [module] Locking lock 0x562fd76e1bc0
[1721317937.938] [module] Unlocking lock 0x562fd76e1bc0
[1721317937.938] [module] Locking lock 0x562fd76e1c88
[1721317937.938] [module] Unlocking lock 0x562fd76e1c88
[1721317937.938] [module] Locking lock 0x562fd76e1a70
[1721317937.938] [module] Unlocking lock 0x562fd76e1a70
[1721317937.938] [module] Locking lock 0x562fd76e1bc0
[1721317937.938] [module] Unlocking lock 0x562fd76e1bc0
[1721317937.938] [module] Locking lock 0x562fd76e1a70
[1721317937.938] [module] Unlocking lock 0x562fd76e1a70
[1721317937.938] [module] Locking lock 0x562fd76e1b20
[1721317937.938] [module] Unlocking lock 0x562fd76e1b20
[1721317937.938] [module] Locking lock 0x7ffe213a16b8
[1721317937.938] [module] Unlocking lock 0x7ffe213a16b8
[1721317937.938] [module] Locking lock 0x562fd76e1a70
[1721317937.938] [module] Unlocking lock 0x562fd76e1a70
[1721317937.938] [module] Locking lock 0x7ffe213a16b8
[1721317937.938] [module] Unlocking lock 0x7ffe213a16b8
[1721317937.938] [module] Locking lock 0x562fd76e1fb8
[1721317937.938] [module] Unlocking lock 0x562fd76e1fb8
[1721317937.938] [module] Locking lock 0x7ffe213a16b8
[1721317937.938] [module] Unlocking lock 0x7ffe213a16b8
[1721317937.938] [module] Locking lock 0x562fd75c52a8
[1721317937.938] [module] Unlocking lock 0x562fd75c52a8
[1721317937.938] [module] Locking lock 0x7ffe213a16b8
[1721317937.938] [module] Unlocking lock 0x7ffe213a16b8
[1721317937.938] [module] Locking lock 0x562fd76e1838
[1721317937.938] [module] Unlocking lock 0x562fd76e1838
Exit
[1721317937.962] [module] Locking lock 0x7ffe213a16b8
[1721317937.962] [module] Unlocking lock 0x7ffe213a16b8
Great, thanks for the UltraGrid output.
I think that I can see the current problem now. In your SDP, there is:
[rtsp] m=video 0 RTP/AVP 26
[rtsp] a=control:trackID=0
[rtsp] a=rtpmap:26 JPEG/90000
[rtsp] a=framesize:26 1920-1080
[rtsp] m=audio 0 RTP/AVP 104
[rtsp] a=control:trackID=1
[rtsp] a=rtpmap:104 MPEG4-GENERIC/48000/2
[rtsp] a=fmtp:104 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1190
So the video is MJPEG and audio AAC (not sure if in stream container, like MPEG PES). The current implementation of RTSP client in UltraGrid has currently quite limited set of supported codecs. I think that we can add JPEG with not so much effort. I'll see what about AAC (if it is also important for you), I don't have currently how to test (eg. if I get FFmpeg to produce one).
Great!
Audio isn't strictly speaking necessary for my purposes but I suppose it would be nice-to-have.
Just gave it a try on the recently published 1.9.5, same behavior;
UltraGrid 1.9.5 (tags/v1.9.5 rev 4c4434b built Jul 22 2024 13:07:55)
Display device : none
Capture device : rtsp
Audio capture : none
Audio playback : none
MTU : 9000 B
Video compression: libavcodec:encoder=libaom-av1:usage=realtime:cpu-used=8:safe
Audio codec : PCM
Network protocol : UltraGrid RTP
Audio FEC : none
Video FEC : rs:200:250
[1721658331.106] Found empty UDP port pair 60424/60425
[1721658331.106] Connected IP version 6
Last message repeated 1 times
[1721658331.106] Socket recv buffer size set to 456192 B (requested 228096 B)
[1721658331.106] Socket send buffer size set to 114688 B (requested 57344 B)
[1721658331.106] [rtsp] rtp receiver init done
[1721658331.106] [rtsp] selected flags:
[1721658331.106] [rtsp] uri: rtsp://admin:admin@192.168.1.15/1
[1721658331.106] [rtsp] port: 60424
[1721658331.106] [rtsp] decompress: 1
[rtsp] cURL V7.68.0 loaded
[1721658331.108] [rtsp] request V1.0
[1721658331.108] [rtsp] Project web site: http://code.google.com/p/rtsprequest/
[1721658331.108] [rtsp] Requires cURL V7.20 or greater
[1721658331.108]
[rtsp] OPTIONS rtsp://admin:admin@192.168.1.15/1
[1721658331.126] [rtsp] RTSP/1.0 200 OK
[1721658331.126] [rtsp] CSeq: 1
[1721658331.126] [rtsp] Public: OPTIONS,DESCRIBE,SETUP,TEARDOWN,PLAY,SET_PARAMETER,GET_PARAMETER
[1721658331.126] [rtsp]
[1721658331.126]
[rtsp] DESCRIBE rtsp://admin:admin@192.168.1.15/1
[1721658331.137] [rtsp] RTSP/1.0 200 OK
[1721658331.137] [rtsp] CSeq: 2
[1721658331.137] [rtsp] Content-Type: application/sdp
[1721658331.137] [rtsp] Cache-Control: must-revalidate
[1721658331.137] [rtsp] Content-Length: 402
[1721658331.137] [rtsp] Content-Base: rtsp://admin:admin@192.168.1.15/1
[1721658331.137] [rtsp]
[rtsp] SDP:
[rtsp] v=0
[rtsp] o=CameraStreaming 3132335948 1236907222000 IN IP4 192.168.1.15
[rtsp] s=10
[rtsp] c=IN IP4 0.0.0.0
[rtsp] t=0 0
[rtsp] a=control:*
[rtsp] m=video 0 RTP/AVP 26
[rtsp] a=control:trackID=0
[rtsp] a=rtpmap:26 JPEG/90000
[rtsp] a=framesize:26 1920-1080
[rtsp] m=audio 0 RTP/AVP 104
[rtsp] a=control:trackID=1
[rtsp] a=rtpmap:104 MPEG4-GENERIC/48000/2
[rtsp] a=fmtp:104 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1190
[rtsp]
[1721658331.137] [rtsp] TRACK = trackID=0 FOR CODEC =
[1721658331.137] [rtsp] TRACK = trackID=1 FOR CODEC =
[1721658331.137]
[rtsp] TEARDOWN rtsp://admin:admin@192.168.1.15/1
[1721658331.140] [rtsp] RTSP/1.0 405 Method Not Allowed
[1721658331.140] [rtsp] CSeq: 5
[1721658331.140] [rtsp] Server: Rtsp Server
[1721658331.140] [rtsp] Allow: OPTIONS, DESCRIBE, SETUP, PLAY, TEARDOWN, SET_PARAMETER
[1721658331.140] [rtsp]
[1721658331.140] [rtsp] [rtsp_teardown] curl_easy_perform(curl) failed: RTSP CSeq mismatch or invalid CSeq (85)
[rtsp error] could not configure rtsp capture properly,
please check your parameters.
Exiting...
[1721658331.140] Unable to start video capture device rtsp
Unable to open capture device: rtsp
Exit
Tested again on this morning's continuous build - curl error gone, now the error message says "no usable video stream" as per log below;
UltraGrid 1.9+ (master rev a893667 built Jul 25 2024 14:32:36)
Display device : none
Capture device : rtsp
Audio capture : none
Audio playback : none
MTU : 9000 B
Video compression: libavcodec:encoder=libaom-av1:usage=realtime:cpu-used=8:safe
Audio codec : PCM
Network protocol : UltraGrid RTP
Audio FEC : none
Video FEC : rs:200:250
[1721920942.143] [module] Locking lock 0x7ffdc81b9298
[1721920942.143] [module] Unlocking lock 0x7ffdc81b9298
[1721920942.143] [module] Locking lock 0x7ffdc81b9298
[1721920942.143] [module] Unlocking lock 0x7ffdc81b9298
[1721920942.143] [module] Locking lock 0x7ffdc81b9298
[1721920942.143] [module] Unlocking lock 0x7ffdc81b9298
[1721920942.143] [module] Locking lock 0x5630224ea580
[1721920942.143] [module] Unlocking lock 0x5630224ea580
[1721920942.143] [module] Locking lock 0x5630224ea580
[1721920942.143] [module] Unlocking lock 0x5630224ea580
[1721920942.143] [module] Locking lock 0x5630224ea6d0
[1721920942.143] [module] Unlocking lock 0x5630224ea6d0
[1721920942.143] [module] Locking lock 0x7ffdc81b9298
[1721920942.143] [module] Unlocking lock 0x7ffdc81b9298
[1721920942.143] Display initialized-none
[1721920942.143] [module] Locking lock 0x7ffdc81b9298
[1721920942.143] [module] Unlocking lock 0x7ffdc81b9298
[1721920942.143] [rtsp] Using URI rtsp://admin:admin@192.168.1.15:554/1
[1721920942.145] Found empty UDP port pair 55648/55649
[1721920942.145] Connected IP version 6
Last message repeated 1 times
[1721920942.145] Created database entry 0x51b691a7 (1 sources)
[1721920942.145] Created new RTP session with SSRC 0x51b691a7.
[1721920942.145] Socket recv buffer size set to 456192 B (requested 228096 B)
[1721920942.145] Socket send buffer size set to 114688 B (requested 57344 B)
[1721920942.145] Added participant 51b691a7
[1721920942.145] [rtsp] rtp receiver init done
[1721920942.145] [rtsp] selected flags:
[1721920942.145] [rtsp] uri: rtsp://admin:admin@192.168.1.15:554/1
[1721920942.145] [rtsp] port: 55648
[1721920942.145] [rtsp] decompress: 1
[rtsp] cURL V7.68.0 loaded
[1721920942.147] [rtsp] Setting CURLOPT_NOSIGNAL to 1
[1721920942.147] [rtsp] request V1.0
[1721920942.147] [rtsp] Project web site: http://code.google.com/p/rtsprequest/
[1721920942.147] [rtsp] Requires cURL V7.20 or greater
[1721920942.147] [rtsp] Setting CURLOPT_NOSIGNAL to 1
[1721920942.147] [rtsp] Setting CURLOPT_VERBOSE to 1
[1721920942.147] [rtsp] Setting CURLOPT_NOPROGRESS to 1
[1721920942.147] [rtsp] Setting CURLOPT_HEADERDATA to 0x5630224eacb0
[1721920942.147] [rtsp] Setting CURLOPT_HEADERFUNCTION to 0x7ff073903580
[1721920942.147] [rtsp] Setting CURLOPT_URL to rtsp://admin:admin@192.168.1.15:554/1
[1721920942.147]
[rtsp] OPTIONS rtsp://admin:admin@192.168.1.15:554/1
[1721920942.147] [rtsp] Setting CURLOPT_RTSP_STREAM_URI to rtsp://admin:admin@192.168.1.15:554/1
[1721920942.147] [rtsp] Setting CURLOPT_USERNAME to admin
[1721920942.147] [rtsp] Setting CURLOPT_PASSWORD to admin
[1721920942.147] [rtsp] Setting CURLOPT_RTSP_REQUEST to 1
[1721920942.147] Performing cURL operation(s)
* Trying 192.168.1.15:554...
* TCP_NODELAY set
* Connected to 192.168.1.15 (192.168.1.15) port 554 (#0)
* Server auth using Basic with user 'admin'
> OPTIONS rtsp://admin:admin@192.168.1.15:554/1 RTSP/1.0
CSeq: 1
Authorization: Basic YWRtaW46YWRtaW4=
< RTSP/1.0 200 OK
[1721920942.178] [rtsp] RTSP/1.0 200 OK
< CSeq: 1
[1721920942.178] [rtsp] CSeq: 1
< Public: OPTIONS,DESCRIBE,SETUP,TEARDOWN,PLAY,SET_PARAMETER,GET_PARAMETER
[1721920942.178] [rtsp] Public: OPTIONS,DESCRIBE,SETUP,TEARDOWN,PLAY,SET_PARAMETER,GET_PARAMETER
[1721920942.178] [rtsp]
<
* Connection #0 to host 192.168.1.15 left intact
[1721920942.178]
[rtsp] DESCRIBE rtsp://admin:admin@192.168.1.15:554/1
[1721920942.178] [rtsp] Setting CURLOPT_WRITEDATA to 0x5630223cd530
[1721920942.178] [rtsp] Setting CURLOPT_HEADERFUNCTION to 0x7ff073903690
[1721920942.178] [rtsp] Setting CURLOPT_RTSP_REQUEST to 2
[1721920942.178] Performing cURL operation(s)
* Found bundle for host 192.168.1.15: 0x563022510c70 [serially]
* Re-using existing connection! (#0) with host 192.168.1.15
* Connected to 192.168.1.15 (192.168.1.15) port 554 (#0)
* Server auth using Basic with user 'admin'
> DESCRIBE rtsp://admin:admin@192.168.1.15:554/1 RTSP/1.0
CSeq: 2
Accept: application/sdp
Authorization: Basic YWRtaW46YWRtaW4=
< RTSP/1.0 200 OK
[1721920942.184] [rtsp] RTSP/1.0 200 OK
< CSeq: 2
[1721920942.184] [rtsp] CSeq: 2
< Content-Type: application/sdp
[1721920942.184] [rtsp] Content-Type: application/sdp
< Cache-Control: must-revalidate
[1721920942.184] [rtsp] Cache-Control: must-revalidate
< Content-Length: 402
[1721920942.184] [rtsp] Content-Length: 402
< Content-Base: rtsp://admin:admin@192.168.1.15:554/1
[1721920942.184] [rtsp] Content-Base: rtsp://admin:admin@192.168.1.15:554/1
[1721920942.184] [rtsp] Using base URL from headers: rtsp://admin:admin@192.168.1.15:554//
[1721920942.184] [rtsp]
<
* Connection #0 to host 192.168.1.15 left intact
[1721920942.184] [rtsp] Setting CURLOPT_WRITEDATA to 0x7ff07c9f75c0
[1721920942.184] [rtsp] Setting CURLOPT_HEADERFUNCTION to 0x7ff073903580
[rtsp] SDP:
[rtsp] v=0
[rtsp] o=CameraStreaming 3132335948 1236907222000 IN IP4 192.168.1.15
[rtsp] s=10
[rtsp] c=IN IP4 0.0.0.0
[rtsp] t=0 0
[rtsp] a=control:*
[rtsp] m=video 0 RTP/AVP 26
[rtsp] a=control:trackID=0
[rtsp] a=rtpmap:26 JPEG/90000
[rtsp] a=framesize:26 1920-1080
[rtsp] m=audio 0 RTP/AVP 104
[rtsp] a=control:trackID=1
[rtsp] a=rtpmap:104 MPEG4-GENERIC/48000/2
[rtsp] a=fmtp:104 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1190
[rtsp]
[1721920942.184] [rtsp] Multiple media of same type, using last one...[1721920942.184] [rtsp] AUDIO TRACK = rtsp://admin:admin@192.168.1.15:554//trackID=1 FOR CODEC = MPEG4-GENERIC
[1721920942.184] [rtsp] VIDEO TRACK = rtsp://admin:admin@192.168.1.15:554//trackID=0 FOR CODEC = JPEG
[1721920942.184] [rtsp] No usable/supported video stream found!
0 0
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
Lost: 0
Intervals: 0
Total: 0
ooo: 0 -- -nan
[1721920942.184] Unable to start video capture device rtsp
[1721920942.184] [module] Locking lock 0x7ffdc81b9298
[1721920942.184] [module] Unlocking lock 0x7ffdc81b9298
[1721920942.184] [module] Locking lock 0x5630224eabe8
[1721920942.184] [module] Unlocking lock 0x5630224eabe8
Unable to open capture device: rtsp
Another update:
I was able to get into the device settings and configure it to output an H.264 stream, which DOES work fine via RTSP. However JPEG does not work, nor does H.265.
Thanks for the update, I can confirm that for video only H.264 is currently supported for RTSP. I believe that I'll be able to add JPEG soon (H.265 could be also possible later).
I'll be able to add JPEG soon
JPEG done, it should be already included in the continuous builds. It won't be, however, ported to UltraGrid 1.9.X but to next major version. I'd be glad if you could test - it should decode the JPEG formats specified in RFC 2435, but the format allows also custom types.
Hi Martin,
My apologies for not getting back within a reasonable time on this. I had to adjust my attention to other tasks for a while.
I have just tested the hardware in question with MJPEG compression and I can confirm it's working fine in the continuous build. The first test segfaulted after a small amount of time, but that might have been because I was using -VV, or possibly down to a poor stream from the device - which is not something we can control.
A subsequent test ran for much longer and seemed both lower latency, and more stable than ingesting H264 from the device.
Thank you very much for your attention on this!
The first test segfaulted after a small amount of time, but that might have been because I was using -VV,
Well, this should not happen. Actually especially when using -VV
, because that would indicate there is a bug that is almost certainly in UltraGrid (and can likely occur also without).
or possibly down to a poor stream from the device - which is not something we can control.
Also not a thing that should not happen. If you could provide more information to debug (stacktrace, console output) it will be great.
Apologies to resurrect this old discussion, but I seem to be having some issues here - FFPLAY works fine;
However UltraGrid is giving me some error message:
I did a few searches and found this extremely old StackOverflow post;
https://stackoverflow.com/questions/18525980/rtsp-client-sending-delimited-data-before-session-has-been-completely-set-up
The RTSP server device is a PTZ Optics HD Box camera (PoE) - it might just be that it's putting out a bad stream.
My apologies in advance if this is a poor question, and I have missed something simple.
Originally posted by @Allethrium in https://github.com/CESNET/UltraGrid/discussions/178#discussioncomment-10024003