I am trying to edit some video footage using ffmpeg rather than a GUI editor.
This example works, to read a PNG file and overlay a resized video on top of it:
ffmpeg -y \
-loop 1 -i 'Title.png' \
-i 'Presentation.mp4' \
-filter_complex_script 'my.nodes' \
-map "[video]" -map 1:a -codec:a copy output.mkv
The file my.nodes contains:
[1:v]scale=430:240[a];
[1:v]scale=1280:720[b];
[0:v][a]overlay=0:0[c];
[c][b]overlay=overlay_w*2:overlay_h:shortest=1[video]
However rather than referring to the input files as numbers (1:v etc.) I wanted to use the "movie" filter to input the files as a source filter, like this:
ffmpeg -y \
-filter_complex_script 'my_improved.nodes' \
-map "[video]" output.mkv
The file my_improved.nodes contains:
movie=Title.png[title];
movie=Presentation.mp4[talk];
[talk]scale=430:240[a];
[talk]scale=1280:720[b];
[title][a]overlay=0:0[c];
[c][b]overlay=overlay_w*2:overlay_h:shortest=1[video]
This gives the error:
Invalid file index 0 in filtergraph description movie=Title.png[title];
movie=Presentation.mp4[talk];
[talk]scale=430:240[a];
[talk]scale=1280:720[b];
[title][a]overlay=0:0[c];
[c][b]overlay=overlay_w*2:overlay_h:shortest=1[video]
.
How can I embed video/image names into the filter itself?