How to use values from array in FFMPEG expression?
I have a text file containing a list of 30 numeric values and I'm making a 1-second video at 30fps.
# values.txt
0 0.1 0.6 0.8 1.0 ... <= 30 values
How can I use those values per frame in, for instance, an eq filter?
Something like reading the array then using the current frame number to get a value from the array:
# pseudo FFMPEG code
values=$(cat values.txt)
arr=($values)
ffmpeg -i in.mp4 -filter-complex eq=brightness=${arr}[n]:eval=frame out.mp4
You would use elements of the form eq(N\,frame#)*value
and add them together.
For three frames it would be
eq=brightness=eq(N\,0)*0+eq(N\,1)*0.1+eq(N\,2)*0.6:eval=frame