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.
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
but nothing happens.
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>
Suggestions?
thanks
答案 0 :(得分:2)
我设法解决了类似的问题,最重要的部分是“-c:v mjpeg”和“-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>
最终显示我的摄像头视频,其过滤器未被ffserver默认值覆盖,即:
我仍然在搞乱分辨率,但我希望这有助于解决你的滤镜问题。
答案 1 :(得分:0)
您未在ffserver
流配置中指定视频大小,因此它使用默认值。例如:
ffserver.conf:15: Setting default value for video size = 160x128. Use NoDefaults to disable it.
出于某种原因,它似乎会恢复转置。
解决方法是使用转置图片的帧大小向VideoSize WxH
添加<Stream>
。