ffmpeg/ffserver does not crop video before streaming
Posted: Thu Jan 28, 2021 12:13 am
I'm getting the h264 video from IP camera. I need to crop it and retranslate with ffserver for viewing in zoneminder. Here is ffserver's config:
Launching ffserver:
Here is the ffmpeg command:
The video is shown in Zoneminder, but not cropped, however the size is reduced.
I've tried to record video with these parameters:
This video is recorded and played without problems and it is cropped, as it should be.
How to crop the video before sending it to stream?
Code: Select all
HTTPPort 8090
RTSPPort 8594
HTTPBindAddress 127.0.0.1
MaxHTTPConnections 2000
MaxClients 100
MaxBandwidth 50000
CustomLog -
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 20M
ACL allow 127.0.0.1
</Feed>
<Stream s1.sdp>
Format rtp
VideoSize 400x248
NoAudio
ACL allow 127.0.0.1
ACL allow 192.168.0.0 192.168.255.255
#NoDefaults
</Stream>
Code: Select all
ffserver -d -f /etc/ffserver.conf
Code: Select all
ffmpeg -rtsp_transport tcp -i \
"rtsp://admin:@192.168.88.10:554/channel=1&stream=0.sdp" \
-filter:v "crop=400:248:800:1045" -c:v vp9 -strict -2 \
http://127.0.0.1:8090/feed1.ffm
I've tried to record video with these parameters:
Code: Select all
ffmpeg -rtsp_transport tcp -i \
"rtsp://admin:@192.168.88.10:554/channel=1&stream=0.sdp" \
-filter:v "crop=400:248:800:1045" -c:v vp9 -strict -2 a.webm
How to crop the video before sending it to stream?