Hi Nicolas,



Thank you for the feedback.




I've updated the patch series in response to your comments. The latest version 
is now available at:




https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20621




Below is a summary of the changes and clarifications:




> "We normally avoid introducing APIs that nothing uses."




The `avfilter_forward_command()` API is already used in `fftools/ffmpeg.c` via 
the `'f'/'F'` hotkeys, which allow real-time control of filters deep in the 
graph (e.g., adjusting the volume of a specific input in an `amix` filter 
during playback).




Additionally, a comprehensive technical proposal detailing the limitations of 
existing APIs (`avfilter_process_command` and `avfilter_graph_send_command`) 
and how `avfilter_forward_command()` addresses these issues is available here:

https://github.com/cenzhanquan1/ffmpeg-reply/blob/main/FFmpeg%20Filter%20Command%20Forwarding%20Mechanism%20Proposal.pdf




This document:

- Constructs scenarios where current APIs (`avfilter_process_command` and 
`avfilter_graph_send_command`) fail to meet the requirements.

- Describes specific use cases where `avfilter_forward_command()` provides a 
solution.

- Includes detailed, reproducible test cases with code snippets.




Best regards,

Cen Zhanquan

​

---- Replied Message ----
| From | Nicolas George via ffmpeg-devel<[email protected]> |
| Date | 09/28/2025 19:18 |
| To | FFmpeg development discussions and patches<[email protected]> |
| Cc | cenzhanquan1 <[email protected]>,
Nicolas George<[email protected]> |
| Subject | [FFmpeg-devel] Re: [PATCH] avfilter: add avfilter_forward_command 
API for recursive command processing. (PR #20621) |
cenzhanquan1 via ffmpeg-devel (HE12025-09-28):
> PR #20621 opened by cenzhanquan1
> URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20621
> Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20621.patch
>
> This commit introduces a new API that allows commands to be recursively
> forwarded through filter graphs, enabling dynamic control of filters
> at runtime.
>
> Key changes:
>
> 1. Added avfilter_forward_command() function in avfilter.c:
>    - Supports both forward and reverse command propagation via
>      AVFILTER_CMD_FLAG_REVERSE flag
>    - Recursively traverses filter links to find target filters
>    - Falls back to filter-specific forward_command callback when available
>    - Properly handles "all" target for broadcasting commands
>
> 2. Extended AVFilter struct in filters.h:
>    - Added forward_command callback for filter-specific implementations
>    - Maintains backward compatibility with existing filters
>
> 3. New API documentation in avfilter.h:
>    - Detailed parameter descriptions including pad_idx and flags
>    - Clear explanation of AVFILTER_CMD_FLAG_REVERSE behavior
>    - Usage examples for common scenarios
>
> 4. Added AVFILTER_CMD_FLAG_REVERSE flag:
>    - Enables reverse traversal from sink to source filters
>    - Useful for targeting specific filters in complex graphs

Thanks for the patch.

We normally avoid introducing APIs that nothing uses. If this API is
useful, then it probably can be made use of by one of the fftools, most
likely ffmpeg itself. Please submit a patch series that also adds this
use.

Also, please explain what this makes possible that was not already
possible with existing functions, in particular simply
avfilter_process_command() and avfilter_graph_send_command().

Regards,

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

Reply via email to