Hi,

this patch makes the CUDA-based scaler scale_npp react to runtime
commands for width and height, so that the output size can be changed
without recreating the filter graph.


In particular:


- mark the "w" and "h" options as AV_OPT_FLAG_RUNTIME_PARAM;
- implement process_command() to re-parse the expression for "w" / "h"
  when receiving "width"/"w" or "height"/"h" commands;
- when the new expression is successfully parsed, the filter is
  reconfigured on the next frame so the new size takes effect.


If parsing fails, the old expression is kept and an error is logged, so
existing pipelines are not broken.


This enables controlling scale_npp with sendcmd/zmq, for example:


    -vf "scale_npp@sn0=w=iw:h=ih,zmq"


    echo "scale_npp@sn0" w iw/2 | zmqsend
    echo "scale_npp@sn0" h ih/2 | zmqsend


Tested with a simple RTSP output and verified that changing width and
height at runtime updates the output size without interrupting the stream.


Patch generated against current master.


Regards,
Wei Minghui (??????)

Attachment: 0001-avfilter-scale_npp-support-runtime-width-height-commands.patch
Description: Binary data

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to