I am trying to find a way to use the drawbox and drawtext ffmpeg filters to overlay text onto video,and speed this process up using GPU acceleration. From the reference materials listed below, I have been unsuccessful in finding a way to do so, but I wanted to check with the community to see if there is are additional approaches.
Below is an example of drawtext and drawbox being used together.
ffmpeg -i <input.mp4> -vf "[in] drawbox= x=iw*0.75:y=ih*0.88:w=iw*0.25:h=ih*0.12:color=black@0.7:t=fill, drawtext=fontsize=20:fontcolor=White:text='Test Line 1':x=(w*.75)+15:y=(h*.88)+15,[out]" -y C:/Users/Garrett/Desktop/video/test.mp4
Below is an example using GPU hardware acceleration from documentation.
ffmpeg -vsync 0 -hwaccel cuvid -hwaccel_device 1 -c:v h264_cuvid -i input.mp4 -c:a copy -c:v h264_nvenc -b:v 5M output.mp4
What I’d like to do is somehow combine these commands so I get the output of command 1 with the speed of command 2. I’ve tried placing the drawtext portion standalone portion within command 2 without success.
FFMPEG (drawbox): FFmpeg Filters Documentation
FFMPEG (drawtext): FFmpeg Filters Documentation
NVIDIA transcoding guide: NVIDIA FFmpeg Transcoding Guide | NVIDIA Technical Blog
NVIDIA (ffmpeg): FFmpeg | NVIDIA Developer