I assume you get:
Error when evaluating the expression 'oh'. Maybe the expression for out_w:'ow' or for out_h:'oh' is self-referencing.
Because you are trying to set the w / h output to the w / h output ?! What you want to do is
ffmpeg -i video.mp4 -vf "crop=640:480,scale=iw:ih" -f mpegts udp:
That is, by setting the output w / h to what the input width (iw) and the input height (ih) were.
Please note that you will receive an error message if the original video is less than what you are trying to trim (640: 480). You can use the ffmpeg expression syntax to first check if cropping / scaling is needed to avoid this error.
source share