djwackey / dorsvr

Go RTSP Streaming Server
GNU Lesser General Public License v2.1
340 stars 94 forks source link

Nothing to play from RTSP server #25

Open j1elo opened 5 years ago

j1elo commented 5 years ago

RTSP server doesn't work with VLC or GStreamer players; full detailed information follows:

Environment

$ lsb_release -d
Description:    Linux Mint 18.3 Sylvia
# (This is same as Ubuntu 16.04 Xenial)

$ vlc --version
VLC media player 2.2.2 Weatherwax (revision 2.2.2-0-g6259d80)
VLC version 2.2.2 Weatherwax (2.2.2-0-g6259d80)
Compiled by buildd on lgw01-09.buildd (Aug  8 2017 18:59:52)
Compiler: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

$ gst-launch-1.0 --version
gst-launch-1.0 version 1.8.3
GStreamer 1.8.3

With VLC

TERMINAL 1

# In case the required tools are not installed
sudo apt-get update
sudo apt-get install ffmpeg vlc

go get github.com/djwackey/dorsvr
cd "${GOPATH}/bin"

ffmpeg -i ~/Some_Video.mp4 -c:v h264 -c:a mp3 ./H264_MP3.ts

$ ./dorsvr
We use port 80 for optional RTSP-over-HTTP tunneling, or for HTTP live streaming (for indexed Transport Stream files only).
This server's URL: rtsp://192.168.1.19:8554/<filename>.

# (Launch the player on Terminal 2 ...)

2018/11/16 19:56:56 [I] Received 130 new bytes of request data.
2018/11/16 19:56:56 [I] Received a complete OPTIONS request:
OPTIONS rtsp://192.168.1.19:8554/H264_MP3.ts RTSP/1.0
CSeq: 2
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)

2018/11/16 19:56:56 [I] send response:
RTSP/1.0 200 OK
CSeq: 2
Date: 2018-11-16 19:56:56.813855307 +0100 CET
Public: [OPTIONS DESCRIBE SETUP TEARDOWN PLAY PAUSE RECORD GET_PARAMETER SET_PARAMETER]

2018/11/16 19:56:56 [I] Received 156 new bytes of request data.
2018/11/16 19:56:56 [I] Received a complete DESCRIBE request:
DESCRIBE rtsp://192.168.1.19:8554/H264_MP3.ts RTSP/1.0
CSeq: 3
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Accept: application/sdp

2018/11/16 19:56:56 [I] send response:
RTSP/1.0 200 OK
CSeq: 3
Date: 2018-11-16 19:56:56.814263358 +0100 CET
Content-Base: rtsp://192.168.1.19:8554/H264_MP3.ts/
Content-Type: application/sdp
Content-Length: 383

v=0
o=- 1542394616814064 1 IN IP4 192.168.1.19
s=MPEG Transport Stream, streamed by the Dor Media Server
i=H264_MP3.ts
t=0 0
a=tool:Dor Streaming Media v1.0.0.3
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:MPEG Transport Stream, streamed by the Dor Media Server
a=x-qt-text-inf:H264_MP3.ts
m=data 0 RTP/AVP 33
c=IN IP4 0.0.0.0
b=AS:500
a=control:track1

2018/11/16 19:56:56 [I] default: EOF
2018/11/16 19:56:56 [I] disconnected the connection[192.168.1.19:43266].
2018/11/16 19:56:56 [I] Received 325 new bytes of request data.
2018/11/16 19:56:56 [I] Received a complete OPTIONS request:
OPTIONS rtsp://192.168.1.19:8554 RTSP/1.0
CSeq: 1
User-Agent: RealMedia Player Version 6.0.9.1235 (linux-2.0-libc6-i386-gcc2.95)
ClientChallenge: 9e26d33f2984236010ef6253fb1887f7
PlayerStarttime: [28/03/2003:22:50:23 00:00]
CompanyID: KnKV4M4I/B2FjJ1TToLycw==
GUID: 00000000-0000-0000-0000-000000000000
RegionData: 0

2018/11/16 19:56:56 [I] send response:
RTSP/1.0 200 OK
CSeq: 1
Date: 2018-11-16 19:56:56.815203618 +0100 CET
Public: [OPTIONS DESCRIBE SETUP TEARDOWN PLAY PAUSE RECORD GET_PARAMETER SET_PARAMETER]

2018/11/16 19:56:56 [I] Received 53 new bytes of request data.
2018/11/16 19:56:56 [I] Received a complete ClientID: request:
ClientID: Linux_2.4_6.0.9.1235_play32_RN01_EN_586

2018/11/16 19:56:56 [I] send response:
RTSP/1.0 405 Method Not Allowed
CSeq: 
Date: 2018-11-16 19:56:56.815276157 +0100 CET
Allow: [OPTIONS DESCRIBE SETUP TEARDOWN PLAY PAUSE RECORD GET_PARAMETER SET_PARAMETER]

2018/11/16 19:56:56 [I] default: read tcp 192.168.1.19:8554->192.168.1.19:43268: read: connection reset by peer
2018/11/16 19:56:56 [I] default: EOF
2018/11/16 19:56:56 [I] disconnected the connection[192.168.1.19:43268].

TERMINAL 2

$ cvlc "rtsp://192.168.1.19:8554/H264_MP3.ts"
VLC media player 2.2.2 Weatherwax (revision 2.2.2-0-g6259d80)
[000000000126dff8] dummy interface: using the dummy interface module...
[00007fa9f8000e58] live555 demux error: Nothing to play for rtsp://192.168.1.19:8554/H264_MP3.ts
[00007fa9fc0009b8] core input error: open of `rtsp://192.168.1.19:8554/H264_MP3.ts' failed
[00007fa9fc0009b8] core input error: Your input can't be opened
[00007fa9fc0009b8] core input error: VLC is unable to open the MRL 'rtsp://192.168.1.19:8554/H264_MP3.ts'. Check the log for details.

With GStreamer

TERMINAL 1

# In case the required tools are not installed
sudo apt-get update
sudo apt-get install ffmpeg \
  gstreamer1.0-{tools,libav} \
  gstreamer1.0-plugins-{base,good,bad,ugly}

go get github.com/djwackey/dorsvr
cd "${GOPATH}/bin"

ffmpeg -i ~/Some_Video.mp4 -c:v h264 -c:a mp3 ./H264_MP3.ts

$ ./dorsvr
We use port 80 for optional RTSP-over-HTTP tunneling, or for HTTP live streaming (for indexed Transport Stream files only).
This server's URL: rtsp://192.168.1.19:8554/<filename>.

# (Launch the player on Terminal 2 ...)

2018/11/16 19:59:20 [I] Received 456 new bytes of request data.
2018/11/16 19:59:20 [I] Received a complete OPTIONS request:
OPTIONS rtsp://192.168.1.19:8554/H264_MP3.ts RTSP/1.0
CSeq: 1
User-Agent: GStreamer/1.8.3
User-Agent: RealMedia Player Version 6.0.9.1235 (linux-2.0-libc6-i386-gcc2.95)
ClientChallenge: 9e26d33f2984236010ef6253fb1887f7
CompanyID: KnKV4M4I/B2FjJ1TToLycw==
GUID: 00000000-0000-0000-0000-000000000000
RegionData: 0
PlayerStarttime: [28/03/2003:22:50:23 00:00]
ClientID: Linux_2.4_6.0.9.1235_play32_RN01_EN_586
Date: Fri, 16 Nov 2018 18:59:20 GMT

2018/11/16 19:59:20 [I] send response:
RTSP/1.0 200 OK
CSeq: 1
Date: 2018-11-16 19:59:20.256054777 +0100 CET
Public: [OPTIONS DESCRIBE SETUP TEARDOWN PLAY PAUSE RECORD GET_PARAMETER SET_PARAMETER]

2018/11/16 19:59:20 [I] Received 158 new bytes of request data.
2018/11/16 19:59:20 [I] Received a complete DESCRIBE request:
DESCRIBE rtsp://192.168.1.19:8554/H264_MP3.ts RTSP/1.0
CSeq: 2
User-Agent: GStreamer/1.8.3
Accept: application/sdp
Date: Fri, 16 Nov 2018 18:59:20 GMT

2018/11/16 19:59:20 [I] send response:
RTSP/1.0 200 OK
CSeq: 2
Date: 2018-11-16 19:59:20.256627031 +0100 CET
Content-Base: rtsp://192.168.1.19:8554/H264_MP3.ts/
Content-Type: application/sdp
Content-Length: 383

v=0
o=- 1542394760256422 1 IN IP4 192.168.1.19
s=MPEG Transport Stream, streamed by the Dor Media Server
i=H264_MP3.ts
t=0 0
a=tool:Dor Streaming Media v1.0.0.3
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:MPEG Transport Stream, streamed by the Dor Media Server
a=x-qt-text-inf:H264_MP3.ts
m=data 0 RTP/AVP 33
c=IN IP4 0.0.0.0
b=AS:500
a=control:track1

2018/11/16 19:59:20 [I] Received 189 new bytes of request data.
2018/11/16 19:59:20 [I] Received a complete SETUP request:
SETUP rtsp://192.168.1.19:8554/H264_MP3.ts/track1 RTSP/1.0
CSeq: 3
User-Agent: GStreamer/1.8.3
Transport: RTP/AVP;unicast;client_port=33166-33167
Date: Fri, 16 Nov 2018 18:59:20 GMT

2018/11/16 19:59:20 [I] send response:
RTSP/1.0 200 OK
CSeq: 3
Date: 2018-11-16 19:59:20.25785711 +0100 CET
Transport: RTP/AVP;unicast;destination=192.168.1.19;source=192.168.1.19;client_port=33166-33167;server_port=6970-6971
Session: 6A3461B6

2018/11/16 19:59:20 [I] Received 164 new bytes of request data.
2018/11/16 19:59:20 [I] Received a complete PLAY request:
PLAY rtsp://192.168.1.19:8554/H264_MP3.ts/ RTSP/1.0
CSeq: 4
User-Agent: GStreamer/1.8.3
Range: npt=0-
Session: 6A3461B6
Date: Fri, 16 Nov 2018 18:59:20 GMT

2018/11/16 19:59:20 [I] send response:
RTSP/1.0 200 OK
CSeq: 4
Date: 2018-11-16 19:59:20.25993928 +0100 CET
Range: npt=0.000-
Session: 6A3461B6
RTP-INFO: url=rtsp://192.168.1.19:8554/H264_MP3.ts/track1;seq=7144;rtptime=471198779

2018/11/16 19:59:20 [I] sendReport
2018/11/16 19:59:21 [W] pt: 201
2018/11/16 19:59:21 [I] RTCP_PT_RR
2018/11/16 19:59:21 [W] pt: 202
2018/11/16 19:59:21 [I] validated entire RTCP packet
2018/11/16 19:59:25 [I] Received 153 new bytes of request data.
2018/11/16 19:59:25 [I] Received a complete TEARDOWN request:
TEARDOWN rtsp://192.168.1.19:8554/H264_MP3.ts/ RTSP/1.0
CSeq: 5
User-Agent: GStreamer/1.8.3
Session: 6A3461B6
Date: Fri, 16 Nov 2018 18:59:25 GMT

2018/11/16 19:59:25 [I] send response:
RTSP/1.0 200 OK
CSeq: 5
Date: 2018-11-16 19:59:25.267010016 +0100 CET

2018/11/16 19:59:25 [.../rtcp_linux_amd64.go:119 incomingReportHandler)-fm()] [E] failed to read.read udp [::]:6971: use of closed network connection
2018/11/16 19:59:25 [I] incomingReportHandler ending.
2018/11/16 19:59:25 [I] default: EOF
2018/11/16 19:59:25 [I] disconnected the connection[192.168.1.19:43276].
2018/11/16 19:59:25 [I] Received 456 new bytes of request data.
2018/11/16 19:59:25 [I] Received a complete OPTIONS request:
OPTIONS rtsp://192.168.1.19:8554/H264_MP3.ts RTSP/1.0
CSeq: 1
User-Agent: GStreamer/1.8.3
User-Agent: RealMedia Player Version 6.0.9.1235 (linux-2.0-libc6-i386-gcc2.95)
ClientChallenge: 9e26d33f2984236010ef6253fb1887f7
CompanyID: KnKV4M4I/B2FjJ1TToLycw==
GUID: 00000000-0000-0000-0000-000000000000
RegionData: 0
PlayerStarttime: [28/03/2003:22:50:23 00:00]
ClientID: Linux_2.4_6.0.9.1235_play32_RN01_EN_586
Date: Fri, 16 Nov 2018 18:59:25 GMT

2018/11/16 19:59:25 [I] send response:
RTSP/1.0 200 OK
CSeq: 1
Date: 2018-11-16 19:59:25.268685086 +0100 CET
Public: [OPTIONS DESCRIBE SETUP TEARDOWN PLAY PAUSE RECORD GET_PARAMETER SET_PARAMETER]

2018/11/16 19:59:25 [I] Received 158 new bytes of request data.
2018/11/16 19:59:25 [I] Received a complete DESCRIBE request:
DESCRIBE rtsp://192.168.1.19:8554/H264_MP3.ts RTSP/1.0
CSeq: 2
User-Agent: GStreamer/1.8.3
Accept: application/sdp
Date: Fri, 16 Nov 2018 18:59:25 GMT

2018/11/16 19:59:25 [I] send response:
RTSP/1.0 200 OK
CSeq: 2
Date: 2018-11-16 19:59:25.272600609 +0100 CET
Content-Base: rtsp://192.168.1.19:8554/H264_MP3.ts/
Content-Type: application/sdp
Content-Length: 383

v=0
o=- 1542394765269642 1 IN IP4 192.168.1.19
s=MPEG Transport Stream, streamed by the Dor Media Server
i=H264_MP3.ts
t=0 0
a=tool:Dor Streaming Media v1.0.0.3
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:MPEG Transport Stream, streamed by the Dor Media Server
a=x-qt-text-inf:H264_MP3.ts
m=data 0 RTP/AVP 33
c=IN IP4 0.0.0.0
b=AS:500
a=control:track1

2018/11/16 19:59:25 [I] Received 185 new bytes of request data.
2018/11/16 19:59:25 [I] Received a complete SETUP request:
SETUP rtsp://192.168.1.19:8554/H264_MP3.ts/track1 RTSP/1.0
CSeq: 3
User-Agent: GStreamer/1.8.3
Transport: RTP/AVP/TCP;unicast;interleaved=0-1
Date: Fri, 16 Nov 2018 18:59:25 GMT

Failed to listen UDP address. listen udp :6970: bind: address already in use
2018/11/16 19:59:25 [I] send response:
RTSP/1.0 200 OK
CSeq: 3
Date: 2018-11-16 19:59:25.275709929 +0100 CET
Transport: RTP/AVP/TCP;unicast;destination=192.168.1.19;source=192.168.1.19;interleaved=0-2
Session: 0C231EBC

2018/11/16 19:59:25 [I] Received 164 new bytes of request data.
2018/11/16 19:59:25 [I] Received a complete PLAY request:
PLAY rtsp://192.168.1.19:8554/H264_MP3.ts/ RTSP/1.0
CSeq: 4
User-Agent: GStreamer/1.8.3
Range: npt=0-
Session: 0C231EBC
Date: Fri, 16 Nov 2018 18:59:25 GMT

2018/11/16 19:59:25 [I] send response:
RTSP/1.0 200 OK
CSeq: 4
Date: 2018-11-16 19:59:25.276985632 +0100 CET
Range: npt=0.000-
Session: 0C231EBC
RTP-INFO: url=rtsp://192.168.1.19:8554/H264_MP3.ts/track1;seq=22048;rtptime=2443915851

2018/11/16 19:59:25 [I] sendReport
2018/11/16 19:59:26 [I] Received 60 new bytes of request data.
2018/11/16 19:59:26 [I] Received a complete $8€ÉgïÊ
                                                        gïuser27863378@host-4de0957 request:
$8��g����
            g��user27863378@host-4de0957    GStreamer
2018/11/16 19:59:26 [I] send response:
RTSP/1.0 405 Method Not Allowed
CSeq: 
Date: 2018-11-16 19:59:26.955664338 +0100 CET
Allow: [OPTIONS DESCRIBE SETUP TEARDOWN PLAY PAUSE RECORD GET_PARAMETER SET_PARAMETER]

2018/11/16 19:59:48 [I] Received 17 new bytes of request data.
2018/11/16 19:59:48 [I] Received a complete 0957 request:
0957   GStreamer
2018/11/16 19:59:48 [I] send response:
RTSP/1.0 405 Method Not Allowed
CSeq: 
Date: 2018-11-16 19:59:48.271079383 +0100 CET
Allow: [OPTIONS DESCRIBE SETUP TEARDOWN PLAY PAUSE RECORD GET_PARAMETER SET_PARAMETER]

2018/11/16 19:59:57 [I] Received 14 new bytes of request data.
2018/11/16 19:59:57 [I] Received a complete 7 request:
7  GStreamer
2018/11/16 19:59:57 [I] send response:
RTSP/1.0 405 Method Not Allowed
CSeq: 
Date: 2018-11-16 19:59:57.280054054 +0100 CET
Allow: [OPTIONS DESCRIBE SETUP TEARDOWN PLAY PAUSE RECORD GET_PARAMETER SET_PARAMETER]

TERMINAL 2

export GST_DEBUG=3
$ gst-launch-1.0 playbin uri="rtsp://192.168.1.19:8554/H264_MP3.ts"
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.1.19:8554/H264_MP3.ts
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Progress: (request) Sending PLAY request
0:00:00.021431603 27621 0x7f06c0058800 FIXME                default gstutils.c:3766:gst_pad_create_stream_id_internal:<fakesrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Progress: (request) Sent PLAY request
0:00:05.029553566 27621      0x174ad90 WARN                 rtspsrc gstrtspsrc.c:4879:gst_rtspsrc_reconnect:<source> warning: Could not receive any UDP packets for 5.0000 seconds, maybe your firewall is blocking it. Retrying using a tcp connection.
WARNING: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Could not read from resource.
Additional debug info:
gstrtspsrc.c(4879): gst_rtspsrc_reconnect (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Could not receive any UDP packets for 5.0000 seconds, maybe your firewall is blocking it. Retrying using a tcp connection.

In summary, neither VLC nor GStreamer (via the GstRTSPSrc element) are able to play the RTSP stream. README doesn't show expected usage, either. Is this publishing the given <filename>?

ccaum commented 5 years ago

Did you figure this out? I'm having a similar issue. In my case, VLC is sending a CSeq request and dorsvr is saying it's not allowed.

With ffplay I'm getting an error that the session is not found