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:email@example.com: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): http://ffmpeg.org/ffmpeg-filters.html#drawbox
FFMPEG (drawtext): http://ffmpeg.org/ffmpeg-filters.html#drawtext
NVIDIA transcoding guide: https://devblogs.nvidia.com/nvidia-ffmpeg-transcoding-guide/
NVIDIA (ffmpeg): https://developer.nvidia.com/ffmpeg