I have the exact same question as this but I am using Windows 10 batch file, not bash.

It seems the answer by @llogan is what I need, but I cannot seem to translate it for batch.

The full code is:

duration=$(ffprobe -loglevel error -show_entries format=duration -of default=nw=1:nk=1 "$input")
ffmpeg -i "$input" -vf "drawtext=fontfile=OpenSans-Regular.ttf:text='%{eif\:$duration-t\:d}':fontcolor=white:fontsize=24:x=w-tw-20:y=th:box=1:boxcolor=black@0.5:boxborderw=10,format=yuv420p" -c:v libx264 -c:a copy -movflags +faststart output.mp4

What I am struggling with in particular is to translate the %{eif\:$duration-t\:d} part to batch/CMD.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.