从FFMPEG流RTSP需要什么步骤? [英] What steps are needed to Stream RTSP from FFMPEG?
问题描述
流式udp不是问题,但是我想要流式传输到可以本机读取rtsp流的移动设备,我找不到任何设置,告诉什么是需要的我需要像LIVE555这样的rtsp流服务器,还是只能使用ffmpeg?
我的命令:
ffmpeg -i space.mp4 -vcodec libx264 -tune zerolatency -crf 18 -f rtsp -muxdelay 0.1 rtsp://192.168.1.200:1234
/ pre>
我收到输入/输出错误
我需要SDP说明才能使用rtsp吗?如果是,我必须把它放在哪里?
解决方案你可以使用 ffserver 使用RTSP流式传输视频。
只需更改控制台这样的语法
ffmpeg -i space.mp4 -vcodec libx264 -tune zerolatency -crf 18 http:// localhost: 1234 / feed1.ffm
创建ffserver.config文件(示例),其中声明HTTPPort,RTSPPort和sdp流。您的配置文件可能看起来像这样(一些重要的东西可能会丢失):
HTTPPort 1234
RTSPPort 1235
< Feed feed1.ffm>
文件/tmp/feed1.ffm
FileMaxSize 2M
ACL允许127.0.0.1
< / Feed>
< Stream test1.sdp>
Feed feed1.ffm
格式rtp
Noaudio
VideoCodec libx264
AVOptionVideo flags + global_header
AVOptionVideo me_range 16
AVOptionVideo qdiff 4
AVOptionVideo qmin 10
AVOptionVideo qmax 51
ACL允许192.168.0.0 192.168.255.255
< / Stream>
通过这样的设置,您可以通过键入
来观看ie vlc的流
rtsp://192.168.0.xxx:1235 / test1.sdp
以下是 ffserver 文档
What steps are needed to Stream RTSP from FFMPEG?
Streaming udp is not a problem, but as i want to stream to mobile-devices which can natively read rtsp streams, i couldn't find any setup which tells what exactly is needed. Do i need an rtsp streaming server like LIVE555 or can i use ffmpeg only?
My Command:
ffmpeg -i space.mp4 -vcodec libx264 -tune zerolatency -crf 18 -f rtsp -muxdelay 0.1 rtsp://192.168.1.200:1234
I get an Input/Output error
Do i need a SDP Description to use rtsp? and if yes where do i have to put it?
解决方案You can use ffserver to stream a video using RTSP.
Just change console syntax to something like this
ffmpeg -i space.mp4 -vcodec libx264 -tune zerolatency -crf 18 http://localhost:1234/feed1.ffm
create ffserver.config file (sample) where you declare HTTPPort, RTSPPort and sdp stream. Your config file could look like this (some important stuff might be missing):
HTTPPort 1234 RTSPPort 1235 <Feed feed1.ffm> File /tmp/feed1.ffm FileMaxSize 2M ACL allow 127.0.0.1 </Feed> <Stream test1.sdp> Feed feed1.ffm Format rtp Noaudio VideoCodec libx264 AVOptionVideo flags +global_header AVOptionVideo me_range 16 AVOptionVideo qdiff 4 AVOptionVideo qmin 10 AVOptionVideo qmax 51 ACL allow 192.168.0.0 192.168.255.255 </Stream>
With such setup you can watch the stream with i.e. vlc by typing
rtsp://192.168.0.xxx:1235/test1.sdp
Here is ffserver documentation
这篇关于从FFMPEG流RTSP需要什么步骤?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!