Bug #5665
VA-API encodes with hardware but doesn't decode
0%
Description
When transcoding with va-api, the CPU usage is reduced but not as much as it could be.
The problem is that although it encodes using hardware, it doesn't decode the original stream in hardware. I can tell because I still see ~50% cpu usage while it's transcoding, while using pass is around 10%.
I don't know the C version of ffmpeg enough to suggest a patch, but the following is the equivalent ffmpeg command that's being run:
```
ffmpeg -vaapi_device /dev/dri/renderD128 -i {STREAM} -vf 'format=nv12,hwupload,deinterlace_vaapi' -c:v h264_vaapi -qp 15 {OUT}
```
However, it's possible to do everything in hardware if supported:
```
ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i {STREAM} -vf 'deinterlace_vaapi' -c:v h264_vaapi -qp 15 {OUT}
```
This decodes the original stream in hardware and transcodes it in hardware, skipping the software decode and hwupload steps.