video – ffmpeg Get filter chain item dimensions later

I’m new to ffmpeg and trying some commands. I have a command with multiple inputs and filters like:

ffmpeg -y -f lavfi -i "color=c=red:s=1920x1080:d=10" 
-i background.jpg 
-i video.mp4 
-i overlay_image_1.png 
-i overlay_image_2.png 
-filter_complex 
"[1:v]scale=1920:-1[bg-color];
[0:v][bg-color]overlay=0:0[bg];
[2:v]scale=1000:-1;
[bg]overlay=(W-w)/2:(H-h)/2[bg_with_video];
[3:v]scale=300:800[scaled_3];
[bg_with_video][scaled_3]overlay=150:200[f_4];[4:v]scale=300:800[scaled_4];
[f_4][scaled_4]overlay=1470:200[f_5]"
-map "[f_5]" -map 2:a output.mp4

So here I take different background images to fit into 1920×1080, if there is free space in the bottom it’s filled with red color.
Then there can be videos with different resolutions, so I scale it to 1000 width and responsive height.
After that I place some png images to the left and to the right of video. X position for them is obvious since I know full output width and video with. But I also want to place another image above the video and maybe align side images with video top.

And I’m wondering if I can access my filter output width and height and maybe some other data like position. Is it possible in filter_complex?

Read more here: Source link