2

I need a RTSP-server that can listen on a configured port (8554 for example), and then, for example, if I run FFmpeg with:

ffmpeg -f v4l2 -i /dev/video0 -c:v libx264 -intra -an -f rtsp -rtsp_transport tcp rtsp://192.168.1.10:8554/test

Then the RTSP-server will RECORD the video, and to play it, I just need to run it with:

ffplay -i rtsp://192.168.1.10:8554/test

I need the RTSP-server to support TCP transport and H264 video encoder and OPUS audio encoder and stream from a live-video (not from a file) + the program should be unlicensed.

  • This server works great, but don't support OPUS.

  • Live555 support H264 and OPUS, but only streams from files (VOD).

  • I've have found some other servers that can stream directly from /dev/video0, but it's also not a good solution for me.

  • Wowza and Red5Pro does answer all the above requirements, except that they are licenced programs.

Any suggestions for a RTSP-server that support all the above requirements?


EDIT:

I've tried Gstreamer and it looks promising, but I still didn't success. However, I'm quite sure I'm on the right way (perhaps I don't know how to use yet the pipelines).

  1. I've built gst-rtsp-server, version 1.13.91.
  2. Then, I ran ./test-record "( decodebin name=depay0 ! videoconvert ! rtspsink )"
  3. I ran netstat -anp and I can see clearly, the server is listening on tcp port 8554.
  4. Now it's time to stream to server. I've tried it once with Gstreamer and once with FFmpeg.

Gstreamer

gst-launch-1.0 videotestsrc ! x264enc ! rtspclientsink location=rtsp://127.0.0.1:8554/test

FFmpeg

ffmpeg -f v4l2 -video_size 640x480 -i /dev/video0 -c:v libx264 -qp 10 -an -f rtsp -rtsp_transport tcp rtsp://127.0.0.1:8554/test

In both cases, I can see the RTP packets in wireshark, and by calling again to netstat -anp, I see:

tcp        0      0 0.0.0.0:8554            0.0.0.0:*               LISTEN      14386/test-record  
tcp        0      0 127.0.0.1:8554          127.0.0.1:46754         ESTABLISHED 14386/test-record  
tcp        0      0 127.0.0.1:46754         127.0.0.1:8554          ESTABLISHED 19479/ffmpeg  

So I can surly understand that I'm streaming (or streaming something...). However, when I'm trying to play the video, I'm getting failure (I've tried to play with Gstreamer, FFplay and VLC - all fails...):

Gstreamer

gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/test latency=300 ! decodebin ! autovideoconvert ! autovideosink

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://127.0.0.1:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not get/set settings from/on resource.
Additional debug info:
gstrtspsrc.c(7507): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Server can not provide an SDP.
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

FFplay

ffplay -i rtsp://127.0.0.1:8554/test

[rtsp @ 0x7fb140000b80] method DESCRIBE failed: 405 Method Not Allowed
rtsp://127.0.0.1:8554/test: Server returned 4XX Client Error, but not one of 40{0,1,3,4}

VLC

vlc rtsp://127.0.0.1:8554/test

VLC media player 3.0.8 Vetinari (revision 3.0.8-0-gf350b6b)
[0000000000857f10] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
Qt: Session management error: None of the authentication protocols specified are supported
[00007f9fdc000ea0] live555 demux error: Failed to connect with rtsp://127.0.0.1:8554/test
[00007f9fdc001d10] satip stream error: Failed to setup RTSP session

Any ideas what I'm doing wrong ?

J.M.
  • 472
  • 1
  • 6
  • 15

2 Answers2

0

Wowza SE works with H264, Opus, VP8 as it supports WebRTC.

This plugin provides a turnkey setup for broadcasting channels live with WebRTC, RTMP, RTSP trough Wowza SE. Also can handle all stream types including RTSP with FFMPEG for on demand adaptive transcoding (in example between WebRTC & HLS). https://wordpress.org/plugins/videowhisper-live-streaming-integration/

TopReseller
  • 623
  • 4
  • 6
  • I forgot to write it in the post - I need an unlicensed program. Wowza is great, but if I'm right, it doesn't have an unlicensed edition. I think Red5Pro also support the features I need, but its also a licensed program. But thanks for your help! I will edit my post – J.M. Jan 02 '20 at 20:04
  • They provide developer licensing with limited usage. When it expires you can just sign up for another developer key. It depends on number of maximum streams/viewers you need at same time. Or you can get a turnkey plan from https://webrtchost.com/hosting-plans/ at lower price than licensing. – TopReseller Jan 08 '20 at 11:02
0

Well, the closest RTSP-server I found so far that matches (almost) all my requirements can be found here: https://github.com/RSATom/RtspRestreamServer (credits for the RTSP-server are for RSATom).

Here is the checklist for all of the features I was looking for:

  • Support TCP transpot.
  • Support H264 video codec (currently hard-codec for this codec only).
  • Support OPUS audio codec (not supported yet, but the server is based Gstreamer library, so it has all the infrastructure to support all the codecs Gstreamer supports - I just need to update the code and make it more generic).
  • Support RTSP RECORD option from a client with a Live-Stream.
  • Support RTSP PLAY option from a client.
  • URL and PORT should be configurable (currently hard-codec - just need to update the code and make it more generic).
  • The server is Unlicensed.
J.M.
  • 472
  • 1
  • 6
  • 15
  • i don't think an "unlicensed" server is what you're looking for. if intellectual property (code) is posted online without a license, then it belongs to the author(s) alone and no one else is licensed to use it. – Woodrow Barlow Oct 21 '20 at 16:19
  • I guess you are right. Perhaps a more accurate definition should be "License-free Server" ? – J.M. Oct 21 '20 at 16:45
  • not exactly. you need a license of some sort. if you want a server licensed so you can use it without paying money, you want "free as in beer" (as opposed to "free as in freedom", which has larger implications). if you want a license that allows you to use and modify their code while keeping your modifications proprietary, you want a "non-copyleft license". i have a feeling you're looking for software under the BSD or MIT licenses, or a public domain release (which is rare). the server you linked to is GPL (copyleft). – Woodrow Barlow Nov 03 '20 at 16:11
  • if license is a sticking point for you, it's going to be tough because the codecs themselves have licenses -- so a server that includes those codecs has limitations on how permissive their license can be. – Woodrow Barlow Nov 03 '20 at 16:16
  • It sounds like a GPL (copyleft) license is what I need . Thanks for the clarification regarding the license issue. I must say it's much more complicated then I thought... – J.M. Nov 04 '20 at 10:39
  • for what it's worth, i recently set up an RTSP server in gstreamer and it did require writing some code but their libraries do 95% of the work and i can definitely recommend gstreamer. not sure if it supports RTSP RECORD yet though. – Woodrow Barlow Nov 04 '20 at 14:08