1

I am trying to embed a video's source framerate onto it with ffmpeg's drawtext, but I am unsure how to get the framerate and have it display.

1 Answers1

1

I found from here that I can extract the framerate, then I used it in the command I found here. In the end:

FRAMERATE=$(ffprobe -show_streams temp.mp4 2>&1 | grep fps | awk '{split($0,a,"fps")}END{print a[1]}' | awk '{print $NF}')
ffmpeg -i temp.mp4 -vf "drawtext=fontfile=/home/matt/IBMPlexMono-Regular.ttf: text=(${FRAMERATE}) %{n}: start_number=1: x=10: y=10: fontcolor=black: fontsize=16: box=1: boxcolor=white: boxborderw=5" -c:a copy temp_frames.mp4