[FFmpeg-user] Stream diferent window of panoramic video
Moritz Barsnick
barsnick at gmx.net
Wed Aug 19 11:42:25 CEST 2015
On Wed, Aug 19, 2015 at 10:29:20 +0200, Marc Camacho Cateura wrote:
> Is exist a way to cut the video and stream only a window that change the
> position? I need a way to tell the ffmpeg what zone I want in realtime...
> Like paramterization of coordinates to crop?
If you know beforehand what to change, you can use expressions as
parameters to the crop filter. Although I can't get it to work right now,
the syntax would be:
-vf "crop=if(gte(t\,10)\,200\,100):if(gte(t\,20)\,100\,50)"
(At 10 seconds, the width changes from 100 to 200. At 20 seconds, the
height changes from 50 to 100.)
As you mention "realtime": The zmq filter can dynamically receive
commands to change parameters of other filters:
-vf "crop=640:480:100:100,zmq"
You then need to send commands to the zmq server with a tool like
zmqsend:
$ echo Parsed_crop_0 out_h 400 | tools/zmqsend
$ echo Parsed_crop_0 x 150 | tools/zmqsend
$ echo Parsed_crop_0 y 200 | tools/zmqsend
These examples change the crop filter's parameters out_h, x, y,
respectively.
(I haven't found a lot of documentation on this, unfortunately. For
example, I haven't figured out how to change two parameters at the same
time.)
Moritz
P.S.: ffmpeg needs to be compiled with zmq support for this filter to
be available.
More information about the ffmpeg-user
mailing list