如何将 RTSP 流转换为 flv/swf 流(w. ffmpeg)?

发布于 2024-10-12 19:05:44 字数 1130 浏览 1 评论 0原文

我想将网络摄像头流(来自 geovision 视频服务器)嵌入到网站中。不幸的是,只有 rtsp 流可以直接访问视频数据。

我尝试了很多不同的变体。在这个版本中我没有遇到任何错误:

openRTSP -b 50000 -w 352 -h 288 -f 5 -v -c -u admin password rtsp://xxxxxx.dyndns.org:8554/CH001.sdp | \
ffmpeg -r 5 -b 256000 -f mp4 -i - http://127.0.0.1:8090/feed1.ffm

不幸的是我没有得到视频。有时我会看到网络摄像头的单帧,但看不到直播。

这是我的 ffserver.conf

Port 8090
BindAddress 0.0.0.0
MaxClients 200
MaxBandwidth 20000
CustomLog /var/log/flvserver/access.log

NoDaemon

# Server Status
<Stream stat.html>
Format status
</Stream>

<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 200K
ACL allow 127.0.0.1
</Feed>

# SWF output - great for testing
<Stream test.swf>
 # the source feed
 Feed feed1.ffm
 # the output stream format - SWF = flash
 Format swf
 #VideoCodec flv
 # this must match the ffmpeg -r argument
 VideoFrameRate 5
 # another quality tweak
 VideoBitRate 256K
 # quality ranges - 1-31 (1 = best, 31 = worst)
 VideoQMin 1
 VideoQMax 3
 VideoSize 352x288
 # wecams don't have audio
 NoAudio
</Stream>

我做错了什么? test.swf 似乎永远加载......

I want embed a webcam stream (From geovision video server) into a website. Unfortunately only the rtsp stream gives direct access to the video data.

I tried a bunch of different variants. With this version I got no errors:

openRTSP -b 50000 -w 352 -h 288 -f 5 -v -c -u admin password rtsp://xxxxxx.dyndns.org:8554/CH001.sdp | \
ffmpeg -r 5 -b 256000 -f mp4 -i - http://127.0.0.1:8090/feed1.ffm

Unfortunately I get no video. Sometimes I see a single frame of the webcam, but no livestream.

This is my ffserver.conf

Port 8090
BindAddress 0.0.0.0
MaxClients 200
MaxBandwidth 20000
CustomLog /var/log/flvserver/access.log

NoDaemon

# Server Status
<Stream stat.html>
Format status
</Stream>

<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 200K
ACL allow 127.0.0.1
</Feed>

# SWF output - great for testing
<Stream test.swf>
 # the source feed
 Feed feed1.ffm
 # the output stream format - SWF = flash
 Format swf
 #VideoCodec flv
 # this must match the ffmpeg -r argument
 VideoFrameRate 5
 # another quality tweak
 VideoBitRate 256K
 # quality ranges - 1-31 (1 = best, 31 = worst)
 VideoQMin 1
 VideoQMax 3
 VideoSize 352x288
 # wecams don't have audio
 NoAudio
</Stream>

What am I doing wrong? THe test.swf seems to load forever...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烟火散人牵绊 2024-10-19 19:05:44

使用 vlc 尝试过类似的操作,它对我有用...

vlc.exe -I http -vv camURL :sout=#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:http{mux=ffmpeg{mux=flv},dst=addr:availablePort}

camurl 是相机的 url....

addr 是地址您希望将 httpstream 发送到的位置...

availablePort 是您希望将 httpstream 发送到的端口

Tried something like this with vlc and it worked for me...

vlc.exe -I http -vv camURL :sout=#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:http{mux=ffmpeg{mux=flv},dst=addr:availablePort}

camurl is the url of the camera....

addr is the address where you want the httpstream to be sent to...

availablePort is the port where you want the httpstream to be sent to

网白 2024-10-19 19:05:44

您需要以正确的方式插入引号:

cvlc rtsp://192.168.13.162:554/ :sout='#transcode{vcodec=FLV1,vb=2048,fps=25,scale=1,acodec=none,deinterlace}:http{mime=video/x-flv,mux=ffmpeg{mux=flv},dst=0.0.0.0:5555/}' :no-sout-standard-sap :ttl=5 :sout-keep :no-audio --rtsp-caching 10200 --video --no-sout-audio --udp-caching=30000 --http-caching=5000

You need to insert quotes in right way:

cvlc rtsp://192.168.13.162:554/ :sout='#transcode{vcodec=FLV1,vb=2048,fps=25,scale=1,acodec=none,deinterlace}:http{mime=video/x-flv,mux=ffmpeg{mux=flv},dst=0.0.0.0:5555/}' :no-sout-standard-sap :ttl=5 :sout-keep :no-audio --rtsp-caching 10200 --video --no-sout-audio --udp-caching=30000 --http-caching=5000
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文