我需要一个RTSP-服务器,它可以侦听配置好的端口(例如8554),然后,例如,如果我用以下方式运行FFmpeg:
ffmpeg -f v4l2 -i /dev/video0 -c:v libx264 -intra -an -f rtsp -rtsp_transport tcp rtsp://192.168.1.10:8554/test然后RTSP-服务器将录制视频,为了播放它,我只需要运行它:
ffplay -i rtsp://192.168.1.10:8554/test我需要RTSP-服务器支持TCP传输和H264视频编码器和OPUS音频编码器和来自实时视频(而不是来自文件)的流+该程序应该是无许可证E 211。
对于支持上述所有要求的RTSP服务器,有什么建议吗?
编辑:
我试过Gstreamer,看上去很有希望,但我还是没有成功。然而,我确信我走对了路(也许我还不知道如何使用管道)。
./test-record "( decodebin name=depay0 ! videoconvert ! rtspsink )"netstat -anp,我可以清楚地看到,服务器正在监听tcp端口8554。Gstreamer
gst-launch-1.0 videotestsrc ! x264enc ! rtspclientsink location=rtsp://127.0.0.1:8554/testFFmpeg
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在这两种情况下,我都可以在wireshark中看到RTP数据包,通过再次调用netstat -anp,我看到:
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 这样我就能明显地理解我在流(或者流什么.)。然而,当我试图播放这个视频时,我就失败了(我试着玩Gstreamer、FFplay和VLC --都失败了……):
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知道我做错什么了吗?
发布于 2020-01-07 20:36:40
好吧,到目前为止,我发现的最接近的RTSP服务器与(几乎)我的所有需求都可以在这里找到:https://github.com/RSATom/RtspRestreamServer (RTSP-服务器的学分是RSATom的学分)。
下面是我正在寻找的所有功能的清单:
发布于 2020-01-02 16:32:20
Wowza支持H264、Opus、VP8,因为它支持WebRTC。
该插件为广播频道提供了一个与WebRTC、RTMP、RTSP低谷Wowza SE实时直播的统包设置。还可以处理所有流类型,包括使用FFMPEG的RTSP,用于按需自适应转码(例如,在WebRTC和HLS之间)。https://wordpress.org/plugins/videowhisper-live-streaming-integration/
https://stackoverflow.com/questions/59458505
复制相似问题