[FFmpeg-user] Drawtext - complex expression to show feet+frames
mwjburton at gmail.com
Tue Apr 11 21:36:36 EEST 2017
New here, hope this is an appropriate question layout...
I’ve been trying to learn more about expression evaluation and some of the more complex aspects of controlling drawing text. I’m trying to achieve something which is a bit far fetched, but I’d love to get any help I can and this would be a huge feature for me if we can get it working. I’ve not come across this anywhere in my numerous searches, but perhaps someone has an existing solution to this?
The idea is to write a drawtext expression which can draw a film footage counter onto my video. The 35mm 4perf counter I want to use counts 16 frames per foot, like so:
… and so on.
Although a single filter expression would be much more useful in the long run, I figured it may be easier to break the display into 3 drawtext filters to get started. One for the feet counter, one for the ‘+’ character and one for the frames counter. So far I have the feet working almost right, but I’m not getting anywhere with the third.
My source material is always going to be 24fps Avid DNx115.
Here is the basic command:
-i $inputFile \
-c:v mjpeg -qscale:v 4 -pix_fmt yuvj422p \
The first drawtext for the feet value is 99% accurate, but sometimes it does not change to the next number of the exact frame it should. Is there a way to use a per frame value instead of ’t’? I’m guessing its this calculation is not producing an accurate enough result to calculate the exact frame each time? It needs to iterate to the next number every 16 frames exactly.
Any advice on where to begin with the frames counter. It needs to start at 0, count on every frame to 15 and then restart at 0 on the next frame.
Lastly (perhaps I’m dreaming here!) could this theoretically all be combined into a single expression with ability to set the starting counter to 12+06 for example and have it count accurately from there? Had to ask!
Thanks for your help,
More information about the ffmpeg-user