For a long time I have been using ffmpeg to convert mov-files taken on an iPhone to mp4 with the following command:
ffmpeg -i "in.MOV" -q:v 1 "out.MP4"
The result is files of good quality and relatively small volume (size).
I recently found out that ffmpeg already supports hardware acceleration. I decided to try, but got confused in the documentation. There are many complex and incomprehensible parameters. Google helped me compose this line:
ffmpeg -vaapi_device /dev/dri/renderD129 -i "in.MOV" -c:v h264_vaapi -vf 'format=nv12,hwupload' -c:a aac "out.MP4"
And it works. With hardware acceleration, files are converted much faster, but the size of the out.mp4 file turns out to be much larger than the size of the original file.
Please tell me how I can get about the same result as after the first command (quality / size), but using hardware acceleration.
Device / OS:
OS: Linuxmint 20.2 uma
Kernel: x86_64 Linux 5.4.0-91-generic
DE: Xfce
WM: Xfwm4
CPU: Intel Core i3-2310M @ 4x 2.1GHz
GPU: Mesa DRI Intel(R) HD Graphics 3000 (SNB GT2)
ffmpeg: 4.2.4
$ lspci -k | grep -i -A 2 -E "(vga|3d|display)"
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
DeviceName: 32
Subsystem: Hewlett-Packard Company 2nd Generation Core Processor Family Integrated Graphics Controller
--
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Seymour [Radeon HD 6400M/7400M Series]
Subsystem: Hewlett-Packard Company Radeon HD 6490M
Kernel driver in use: radeon