I have a task to add running text to video stream (or file) on receive. Video need to be run on cubieboard with Armbian. I tested with mpv, with flag --hwdec=vdpau, and the video runs smoother that without it. To add running text I tried to use lavfi-drawtext filter, but when I use it, mpv falls back to software decoding and lag is seen. Here is one of the examples I used:
mpv --hwdec=vdpau Videos/VID* -vf lavfi=[drawtext=fontsize=40:fontcolor=yellow:x=w-50*t:y=h/2:textfile=livetext.txt:reload=1]
And an output from that command with --msg-level=vd=v, it is from my working PC, on cubieboard it also warns about audio/video desync:
Playing: Videos/VID_20180129_120726.mp4
(+) Video --vid=1 (*) (h264 1080x1920 30.000fps)
(+) Audio --aid=1 --alang=eng (*) (aac 2ch 44100Hz)
[vd] Container reported FPS: 30.000000
[vd] Codec list:
[vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vd] h264_crystalhd (h264) - CrystalHD H264 decoder
[vd] h264_cuvid (h264) - Nvidia CUVID H264 decoder
[vd] Opening video decoder h264
[vd] Probing 'vdpau'...
[vd] Trying hardware decoding.
[vd] Selected video codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)
Opening video filter: [lavfi graph=drawtext=fontsize=40:fontcolor=yellow:x=w-50*t:y=h/2:textfile=/opt/mpv-text/livetext.txt:reload=1]
[vd] Pixel formats supported by decoder: vdpau vaapi_vld yuv420p
[vd] Codec profile: High (0x64)
[vd] Requesting pixfmt 'vdpau' from decoder.
Using hardware decoding (vdpau).
[vd] Decoder format: 1080x1920 vdpau[yuv420p] bt.709/bt.709/bt.1886/limited CL=mpeg2/4/h264
[ffmpeg] Impossible to convert between the formats supported by the filter 'src' and the filter 'auto_scaler_0'
[lavfi] Can't configure libavfilter graph.
Video filter chain:
[in] 1080x1920 vdpau[yuv420p] bt.709/bt.709/bt.1886/limited SP=1.000000 CL=mpeg2/4/h264
[lavfi] "lavfi.00" 1080x1920 vdpau[yuv420p] bt.709/bt.709/bt.1886/limited SP=1.000000 CL=mpeg2/4/h264 <---
[out] ???
Falling back to software decoding.
[vd] Detected 8 logical cores.
[vd] Requesting 9 threads for decoding.
AO: [pulse] 44100Hz stereo 2ch float
[vd] Decoder format: 1080x1920 yuv420p bt.709/bt.709/bt.1886/limited CL=mpeg2/4/h264
VO: [opengl] 1080x1920 yuv420p
AV: 00:00:03 / 00:00:36 (9%) A-V: 0.000
[vd] Uninit video.
After a long search I doubt that hardware acceleration with mpv here is possible. If so, maybe you could give advice on other tools to achieve that? I am a newbie in this sphere and maybe there is a more efficient way to add running text to video. Thanks.