Project

General

Profile

Bug #2823

rtsp is not working for webcam

Added by Stephan Ramel over 9 years ago. Updated over 9 years ago.

Status:
Invalid
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2015-05-06
Due date:
% Done:

0%

Estimated time:
Found in version:
3.9.2810
Affected Versions:

Description

Hello,
cos i read that rtsp links are also supported now, i gave it a try.
but when i add e.g. the url rtsp://user:[email protected]:554/live/h264 i always get the error 404.
maybe u can help me please.

2015-05-06 13:00:08.218 mpegts: IPTV - adding mux IP-Cam Veranda in IPTV to scan queue weight 6 flags 4000
2015-05-06 13:00:08.219 mpegts: IP-Cam Veranda in IPTV - add raw service
2015-05-06 13:00:08.219 service: 1: IP-Cam Veranda in IPTV si 0x7fbb32dbc350 weight 0 prio 1 error 0
2015-05-06 13:00:08.219 mpegts: IP-Cam Veranda in IPTV - tuning on IPTV
2015-05-06 13:00:08.221 mpegts: IP-Cam Veranda in IPTV - started
2015-05-06 13:00:08.221 mpegts: IP-Cam Veranda in IPTV - open PID 0012 (18) [20/0x7fbb32fb0940]
2015-05-06 13:00:08.221 mpegts: IP-Cam Veranda in IPTV - open PID tables subscription [0042/0x7fbb200f4fe0]
2015-05-06 13:00:08.221 subscription: 002B: "scan" subscribing to mux "IP-Cam Veranda", weight: 6, adapter: "IPTV", network: "IPTV", service: "Raw PID Subscription"
2015-05-06 13:00:08.223 iptv: invalid error code 404 for 'rtsp://user:[email protected]:554/live/h264'
2015-05-06 13:00:23.001 service: IP-Cam Veranda in IPTV: Status changed to [Graceperiod expired] [Data timeout]
2015-05-06 13:00:23.001 mpegts: IP-Cam Veranda in IPTV - scan no data, failed
2015-05-06 13:00:23.001 subscription: 002B: "scan" unsubscribing
2015-05-06 13:00:23.001 mpegts: IP-Cam Veranda in IPTV - close PID tables subscription [0042/0x7fbb200f4fe0]
2015-05-06 13:00:23.001 mpegts: IP-Cam Veranda in IPTV - stopping mux
2015-05-06 13:00:23.002 mpegts: IP-Cam Veranda in IPTV - close PID 0012 (18) [20/0x7fbb32fb0940]
2015-05-06 13:00:23.002 mpegts: IPTV - removing mux IP-Cam Veranda in IPTV from scan queue
2015-05-06 13:00:23.002 mpegts: IPTV - adding mux IP-Cam Veranda in IPTV to scan queue weight 6 flags 4000
2015-05-06 13:00:23.002 mpegts: IPTV - removing mux IP-Cam Veranda in IPTV from scan queue

thanks & regards


Files

trace.txt (24.2 KB) trace.txt Stephan Ramel, 2015-05-07 10:10
rtsp_connection.log (8.79 KB) rtsp_connection.log Stephan Ramel, 2015-05-07 15:19

History

#1

Updated by Jaroslav Kysela over 9 years ago

Could you show communication with vlc with your device (TCP port 554) ? Use wireshark or tcpdump to grab the TCP stream.

#2

Updated by Jaroslav Kysela over 9 years ago

  • Subject changed from rtsp no working to rtsp is not working for webcam
#3

Updated by Baso dujardin over 9 years ago

Hello,
I have also build the git version including iptv_rtsp support. I works, but after a few secons (~ 20s), the playing freeze and exit.
Here follows the part of log concerning that part : an error 403:

015-05-06 18:30:15.772 [ INFO] mpegts: D17 HD in freebox - tuning on IPTV
2015-05-06 18:30:15.832 [ INFO] subscription: 0001: "HTTP" subscribing on channel "D17 HD", weight: 100, adapter: "IPTV", network: "freebox", mux: "D17 HD", provider: "Harmonic", service: "D17 HD", profile="pass", hostname="192.168.0.101", client="VLC/2.2.0 LibVLC/2.2.0"
2015-05-06 18:30:45.003 [ ERROR] iptv: invalid error code 403 for 'rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=678&flavour=hd'
2015-05-06 18:30:55.897 [WARNING] webui: Stop streaming /stream/channel/0aca1f0179da52d78e2f916e34137b96, timeout waiting for packets
2015-05-06 18:30:55.897 [ INFO] subscription: 0001: "HTTP" unsubscribing from "D17 HD", hostname="192.168.0.101", username="VLC/2.2.0 LibVLC/2.2.0"

The link plays well in vlc and in the old iptv_rtsp from github.com/Glandos/iptv_rtsp_new.

Any idea?

Thanks for your work for adding this support!

Baso

#4

Updated by Jaroslav Kysela over 9 years ago

Baso dujardin wrote:

Any idea?

Could you try this change?

diff --git a/src/input/mpegts/iptv/iptv_rtsp.c b/src/input/mpegts/iptv/iptv_rtsp.c
index 8424688..3ab2e0c 100644
--- a/src/input/mpegts/iptv/iptv_rtsp.c
+++ b/src/input/mpegts/iptv/iptv_rtsp.c
@@ -48,6 +48,7 @@ iptv_rtsp_alive_cb ( void *aux )
   iptv_mux_t *im = aux;
   rtsp_priv_t *rp = im->im_data;

+  return;
   rtsp_options(rp->hc);
   gtimer_arm(&rp->alive_timer, iptv_rtsp_alive_cb, im, rp->hc->hc_rtp_timeout / 2);
 }
#5

Updated by Baso dujardin over 9 years ago

With this change, play always freezes, but the [ERROR] message is no more displayed.

#6

Updated by Stephan Ramel over 9 years ago

Hello,
attached you find the log of the connection between vlc and my ip camera.

thanks & regards

#7

Updated by Jaroslav Kysela over 9 years ago

Stephan Ramel wrote:

Hello,
attached you find the log of the connection between vlc and my ip camera.

Could you decode the full TCP connection on port 554 ? Wireshark can do that.

#8

Updated by Stephan Ramel over 9 years ago

u mean that? this is the communication on port 554 from vlc to the camera.

#9

Updated by Jaroslav Kysela over 9 years ago

Stephan Ramel wrote:

u mean that? this is the communication on port 554 from vlc to the camera.

No, assuming you're using wireshark. Select any RTSP packet, click right mouse button and select 'Follow TCP stream'. I need this text.

#10

Updated by Stephan Ramel over 9 years ago

ah okay i see...so this:

OPTIONS rtsp://192.168.77.10:554/live/h264 RTSP/1.0
CSeq: 2
User-Agent: LibVLC/2.1.5 (LIVE555 Streaming Media v2014.05.27)

RTSP/1.0 200 OK
CSeq: 2
Keep-Alive: timeout=10, max=1000
Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, SET_PARAMETER, GET_PARAMETER
Connection: Keep-Alive

DESCRIBE rtsp://192.168.77.10:554/live/h264 RTSP/1.0
CSeq: 3
User-Agent: LibVLC/2.1.5 (LIVE555 Streaming Media v2014.05.27)
Accept: application/sdp

RTSP/1.0 401 Unauthorized
CSeq: 3
WWW-Authenticate: Basic realm="Server" 
WWW-Authenticate: Digest realm="Server", nonce="554b72c453e1cffe335093f193887a0cddf5809db9f043cbb2e314afb3a92ba6" 

DESCRIBE rtsp://192.168.77.10:554/live/h264 RTSP/1.0
CSeq: 4
Authorization: Digest username="admin", realm="Server", nonce="554b72c453e1cffe335093f193887a0cddf5809db9f043cbb2e314afb3a92ba6", uri="rtsp://192.168.77.10:554/live/h264", response="ecac034017ef62543099fe5b4fc46695" 
User-Agent: LibVLC/2.1.5 (LIVE555 Streaming Media v2014.05.27)
Accept: application/sdp

RTSP/1.0 200 OK
CSeq: 4
Content-Base: rtsp://192.168.77.10:554/live/h264/
Content-Type: application/sdp
Cache-Control: must-revalidate
x-Accept-Dynamic-Rate: 1
Content-Length: 270

v=0
o=- 1 1 IN IP4 127.0.0.1
s=RTSP server
c=IN IP4 0.0.0.0
t=0 0
a=control:*
a=range:npt=now-
m=video 0 RTP/AVP 97
a=rtpmap:97 H264/90000
a=fmtp:97 packetization-mode=1;profile-level-id=420028;sprop-parameter-sets=Z0IAKOkAoAQMgA==,aM4xUg==;
a=control:track1
SETUP rtsp://192.168.77.10:554/live/h264/track1 RTSP/1.0
CSeq: 5
Authorization: Digest username="admin", realm="Server", nonce="554b72c453e1cffe335093f193887a0cddf5809db9f043cbb2e314afb3a92ba6", uri="rtsp://192.168.77.10:554/live/h264/", response="df5814e0348db0cee3d8177f321dc74b" 
User-Agent: LibVLC/2.1.5 (LIVE555 Streaming Media v2014.05.27)
Transport: RTP/AVP;unicast;client_port=60244-60245

RTSP/1.0 200 OK
CSeq: 5
Transport: RTP/AVP;unicast;client_port=60244-60245;server_port=57252-57253
x-dynamic-rate: 1
Session: F21DC3B68DA2A3DB9B41351B9416EB

PLAY rtsp://192.168.77.10:554/live/h264/ RTSP/1.0
CSeq: 6
Authorization: Digest username="admin", realm="Server", nonce="554b72c453e1cffe335093f193887a0cddf5809db9f043cbb2e314afb3a92ba6", uri="rtsp://192.168.77.10:554/live/h264/", response="070f8a6d15fc4a3d77ed972ae701c303" 
User-Agent: LibVLC/2.1.5 (LIVE555 Streaming Media v2014.05.27)
Session: F21DC3B68DA2A3DB9B41351B9416EB
Range: npt=0.000-

RTSP/1.0 200 OK
CSeq: 6
Session: F21DC3B68DA2A3DB9B41351B9416EB
Range: npt=now-
RTP-Info: url=rtsp://192.168.77.10:554/live/h264//track1;seq=12322;rtptime=2811901528

GET_PARAMETER rtsp://192.168.77.10:554/live/h264/ RTSP/1.0
CSeq: 7
Authorization: Digest username="admin", realm="Server", nonce="554b72c453e1cffe335093f193887a0cddf5809db9f043cbb2e314afb3a92ba6", uri="rtsp://192.168.77.10:554/live/h264/", response="af0a5f7b8fee71600e754ce497f0f00e" 
User-Agent: LibVLC/2.1.5 (LIVE555 Streaming Media v2014.05.27)
Session: F21DC3B68DA2A3DB9B41351B9416EB

RTSP/1.0 200 OK
CSeq: 7
Session: F21DC3B68DA2A3DB9B41351B9416EB

TEARDOWN rtsp://192.168.77.10:554/live/h264/ RTSP/1.0
CSeq: 8
Authorization: Digest username="admin", realm="Server", nonce="554b72c453e1cffe335093f193887a0cddf5809db9f043cbb2e314afb3a92ba6", uri="rtsp://192.168.77.10:554/live/h264/", response="232c13090557179650cd33df1bb1891c" 
User-Agent: LibVLC/2.1.5 (LIVE555 Streaming Media v2014.05.27)
Session: F21DC3B68DA2A3DB9B41351B9416EB

RTSP/1.0 200 OK
CSeq: 8
Session: F21DC3B68DA2A3DB9B41351B9416EB
#11

Updated by Jaroslav Kysela over 9 years ago

Baso dujardin wrote:

With this change, play always freezes, but the [ERROR] message is no more displayed.

Then something is missing. Perhaps, your source expects a RTPC feedback which is not implemented.

#12

Updated by Jaroslav Kysela over 9 years ago

Stephan Ramel wrote:

ah okay i see...so this:

Thanks.

m=video 0 RTP/AVP 97
a=rtpmap:97 H264/90000

This format is not supported by TVH. Only RTP format 33 (MP2T) is supported. I think that webcams sends only raw H264/PCM streams usually without any multiplexing. Use pipe:// and ffmpeg to convert the input stream to the MPEG-TS stream.

#13

Updated by Jaroslav Kysela over 9 years ago

  • Status changed from New to Invalid

Jaroslav Kysela wrote:

Baso dujardin wrote:

With this change, play always freezes, but the [ERROR] message is no more displayed.

Then something is missing. Perhaps, your source expects a RTPC feedback which is not implemented.

OK. I created https://github.com/tvheadend/tvheadend/pull/644 . Hopefully, Glandos can help to add the proper RTCP support.

Closing this bug for now - follow the pull request.

#14

Updated by Stephan Ramel over 9 years ago

okay i see...thank you. :-)

Also available in: Atom PDF