ffmpeg 将 rtsp 重新串流到 mjpeg [英] ffmpeg restream rtsp to mjpeg

查看:45
本文介绍了ffmpeg 将 rtsp 重新串流到 mjpeg的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个 IP 摄像头可以通过 rtsp 传输 720 X264 视频.在 Android 上查看时,流确实不可靠.如果建立了 2 个以上的连接,它们也会失败.

I have a few IP cameras that stream 720 X264 video over rtsp. The streams are really unreliable when viewing on Android. They also fail if more then 2 connections are made.

我有一个 ubuntu 服务器,我可以用它来连接和重新传输为 mjpeg 或其他东西.有大量不同的命令,但它们似乎都涉及对视频进行转码.

I have a ubuntu server that I can use to connect and restream as mjpeg or something else. There are tons of different commands out there but they all seem to involve transcoding the video.

我怎样才能简单地将实时 rtsp 提要作为 mjpeg 重新传输而不对视频本身做任何事情?没有音频,所以不用担心.

How can I simply restream the live rtsp feed as a mjpeg without doing anything to the video itself? Theres no audio so no worries there.

推荐答案

最近好像做了类似的事情.我在/etc/ffserver.conf 文件中添加了以下部分:

It seems that recently I did something similar. I have added following section to the /etc/ffserver.conf file:

<Feed monitoring1.ffm>
File /tmp/monitoring1.ffm
FileMaxSize 50M
ACL allow 127.0.0.1
</Feed>

<Stream monitoring1.mjpg>
Feed monitoring1.ffm
Format mpjpeg
VideoCodec mjpeg
VideoFrameRate 22
VideoBufferSize 80
VideoSize 720x264
NoAudio
</Stream>

使用命令启动服务器后:

After that started server with command:

ffserver

并使用命令运行流式传输:

and run streaming with command:

ffmpeg -i "rtsp://<ip_camera>:554/user=admin&password=&channel=1&stream=0.sdp" http://localhost:8090/monitoring1.ffm

根据您的目的调整网络摄像机网址.现在您可以通过浏览器/播放器访问以下地址来访问 mjpeg 流:

Tune the ip camera url for your purposes. Now you can access the mjpeg stream by accessing following address with your browser/player:

http://localhost:8090/monitoring1.mjpg

对我来说效果很好,希望它能解决您的问题.

Works fine for me and hope it solves your problem.

这篇关于ffmpeg 将 rtsp 重新串流到 mjpeg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆