ffmpeg将rtsp重播到mjpeg [英] ffmpeg restream rtsp to mjpeg

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

问题描述

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

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

为您的目的调整IP摄像机的URL.现在,您可以通过使用浏览器/播放器访问以下地址来访问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天全站免登陆