Page 1 of 1

ffmpeg/ffserver does not crop video before streaming

Posted: Thu Jan 28, 2021 12:13 am
by Michael222
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:

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>
Launching ffserver:

Code: Select all

ffserver -d -f /etc/ffserver.conf
Here is the ffmpeg command:

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
The video is shown in Zoneminder, but not cropped, however the size is reduced.

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
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?