Changes between Version 49 and Version 50 of FilteringGuide


Ignore:
Timestamp:
Nov 28, 2019, 11:59:28 AM (7 years ago)
Author:
slhck
Comment:

add sendcmd examples

Legend:

Unmodified
Added
Removed
Modified
  • FilteringGuide

    v49 v50  
    187187There are other options for generating synthetic video input, see [http://stackoverflow.com/questions/11640458/how-can-i-generate-a-video-file-directly-from-an-ffmpeg-filter-with-no-actual-in here] and [http://stackoverflow.com/a/15795112/32453 here] ("generic equation" filter).
    188188
     189== Scripting Filters from a File ==
     190
     191Suppose you want to change some filter parameters based on an input file. Some filters support the option to receive commands via [https://ffmpeg.org/ffmpeg-filters.html#sendcmd_002c-asendcmd `sendcmd`]. Run `ffmpeg -filters` and check the `C` column – if it is present, a filter supports receiving input this way.
     192
     193For example, if you want to rotate the input at seconds 0, 1, and 2, create a file called `cmd.txt` with the content:
     194
     195{{{
     1960 rotate angle '45*PI/180';
     1971 rotate angle '90*PI/180';
     1982 rotate angle '180*PI/180';
     199}}}
     200
     201Now run an example stream:
     202
     203{{{
     204ffmpeg -f lavfi -i testsrc -filter_complex "[0:v]sendcmd=f=cmd.txt,rotate" -f matroska - | ffplay -
     205}}}
     206
     207Some examples of this technique can be seen [https://stackoverflow.com/a/49600924/435093 here].
     208
    189209== Other Filter Examples ==
    190210