[FFmpeg-user] Problem with changing options at runtime with a command

Gyan Doshi ffmpeg at gyani.pro
Sat Jul 3 15:36:39 EEST 2021



On 2021-07-03 17:17, Alex Christoffer Rasmussen wrote:
> Hello
> i am trying to change options in the crop filter at runtime with a command
>
> this it my test command:
> ./ffmpeg -hide_banner -y -f dshow -rtbufsize 128M -i video="Cam Link 4K"
> -filter_complex "[0:v]fps=10[rate], [rate]scale=1280:720, crop=in_w,
> drawtext=fontfile=RobotoMono-Medium.ttf: text=\'test\': fontsize=50:
> fontcolor=white: box=1: boxcolor=black at 0.5: boxborderw=5" -update 1
> public\img.png
>
> it works and returns:
> Input #0, dshow, from 'video=Cam Link 4K':
>    Duration: N/A, start: 136428.863000, bitrate: N/A
>    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 60
> fps, 60 tbr, 10000k tbn
> Stream mapping:
>    Stream #0:0 (rawvideo) -> fps
>    drawtext -> Stream #0:0 (png)
> Press [q] to stop, [?] for help
> Output #0, image2, to 'public\img.png':
>    Metadata:
>      encoder         : Lavf59.3.101
>    Stream #0:0: Video: png, rgb24(pc, progressive), 1280x720, q=2-31, 200
> kb/s, 10 fps, 10 tbn
>      Metadata:
>        encoder         : Lavc59.2.100 png
>
>
> then sending:
>     c crop -1 w=100
> the retun is:
>     Command reply for stream 0: ret:-40 res:
> and nothing changes
>
> instead trying:
>    c drawtext -1 reinit fontcolor=red
> the retun is:
>    Command reply for stream 0: ret:0 res:
> and the text turns red
>
> what am i missing?

As the docs state, the acceptable commands are w, h, x, ,y

so the syntax is

     c crop -1 w 100


Regards,
Gyan



More information about the ffmpeg-user mailing list