问题描述
使用ffmpeg,我从重复读取的图像向ffserver提供提要.我使用以下说明
With ffmpeg I am providing a feed to ffserver from an image repeatedly read.I use the following instruction
ffmpeg -v debug -loop 1 -f image2 -i http://IP_ADDRESS/image.jpg -c:v libx264 http://FFSERVER_IP_ADDRESS:8090/feed.ffm
通过这种方式,我可以从服务器获取流,但是我需要旋转结果流.
In this way I can get the stream from the server but I need to rotate the resulting stream.
我以这种方式尝试了-vf transpose = 1选项
I tried with the -vf transpose=1 option in this way
ffmpeg -v debug -loop 1 -f image2 -i http://IP_ADDRESS/image.jpg -c:v libx264 -vf transpose=1 http://FFSERVER_IP_ADDRESS:8090/feed.ffm
但什么也没发生.
我的ffserver.conf
my ffserver.conf
HTTPPort 8090
RTSPPort 7654
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog -
<Feed feed.ffm>
File path_to_file/feed.ffm
FileMaxSize 10000K
ACL allow 192.168.1.0 192.168.1.255
</Feed>
<Stream test.h264>
Feed feed.ffm
Format rtp
Noaudio
</Stream>
建议?
谢谢
推荐答案
我设法解决了一个类似的问题,其中最重要的部分是"-c:v mjpeg"和"-override_ffserver".
I managed to solve a similar problem with this, with the most important bits being the "-c:v mjpeg" and "-override_ffserver".
<Feed feed1.ffm>
File /var/tmp/feed1.ffm
FileMaxSize 1M
Launch ffmpeg -i /dev/video0 -override_ffserver -c:v mjpeg -metadata:s:v rotate=0 -vf 'transpose=dir=clock,drawtext=fontcolor=white:fontfile=/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-R.ttf:expansion=strftime:text=%FT%T:x=(w-text_w)/2:y=h-text_h-5'
</Feed>
<Stream test>
Feed feed1.ffm
Format mpjpeg
VideoSize 720x1280
VideoFrameRate 5
Strict -2
</Stream>
然后转到: http://localhost:8090/test
这最终显示了我的网络摄像头视频,但过滤器没有被ffserver默认设置覆盖,即:
This ended up finally showing my webcam's video with the filters not being overridden by ffserver defaults, i.e:
- 旋转90度以补偿网络摄像头的奇怪安装
- 时间戳记位于底部中心
我仍然对分辨率感到困惑,但是我希望这可以为您解决过滤器问题.
I'm still messing with the resolution, but I hope this helps solve the filters problem for you.
这篇关于ffmpeg旋转图像以馈送ffserver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!