I want to be able to apply keystone correction to a webcam stream. The raw image-stream contains a rectangular background and I am using a rectangular overlay, which the user drags the corners to match the actual corners in the image. Finally, the user clicks a button that sends the coordinates to the server. The server then updates the filter parameters and restarts the stream. Everything works using ffmpeg
to stream RTMP to nginx
, but the HLS stream generated by nginx
lags unsatisfactorily and/or hangs. I am using the filter as follows:
-lavfi "perspective=x0=100:y0=20:x1=520:y1=20:x2=100:y2=380:x3=520:y3=380:interpolation=linear:sense=source"
Switching to using motion
to stream the image has much better real-time performance and I can embed the image in the HTML described above absolutely fine. The problem is I can't find a way of inserting the ffmpeg
filter into the motion
stream, I think it is only for saved files. Is is possible?