In Gentoo there are bug https://bugs.gentoo.org/590752 which reports absense of that, but it not about adding, so I create new ones. FFMPEG already have good support for QSV maintained directly by Intel. Also in Gentoo tree there are all necessary depends. All required changes in ebuild is listed in additional information: Reproducible: Always --- /var/db/repos/gentoo/media-video/ffmpeg/ffmpeg-4.3.1.ebuild 2020-12-25 07:39:23.000000000 +0500 +++ ffmpeg-4.3.1-r1.ebuild 2020-07-28 15:30:50.000000000 +0500 @@ -91,6 +91,9 @@ libsoxr # Threads; we only support pthread for now but ffmpeg supports more +threads:pthreads + # Intel Quick Sync Video + qsv:libmfx + ) # Same as above but for encoders, i.e. they do something only with USE=encode. @@ -172,6 +175,9 @@ RDEPEND=" alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] ) + amd64? ( + qsv? ( >=media-libs/intel-mediasdk-20.1.1 ) + ) amr? ( >=media-libs/opencore-amr-0.1.3-r1[${MULTILIB_USEDEP}] ) bluray? ( >=media-libs/libbluray-0.3.0-r1:=[${MULTILIB_USEDEP}] ) bs2b? ( >=media-libs/libbs2b-3.1.0-r1[${MULTILIB_USEDEP}] ) @@ -314,6 +320,7 @@ cuda? ( video_cards_nvidia ) libv4l? ( v4l ) fftools_cws2fws? ( zlib ) + qsv? ( abi_x86_64 ) test? ( encode ) ${GPL_REQUIRED_USE} ${CPU_REQUIRED_USE}" MULTILIB_WRAPPED_HEADERS=( @@ -396,7 +401,7 @@ # (temporarily) disable non-multilib deps if ! multilib_is_native_abi; then - for i in frei0r librav1e libzmq ; do + for i in frei0r libmfx librav1e libzmq ; do myconf+=( --disable-${i} ) done fi
Created attachment 695232 [details, diff] example changes
QSV is not supported for ABI_X86_32.
I'm getting "invalid atom in RDEPEND abi_x86_64" with `+ qsv? ( abi_x86_64 )`. Is this the correct constraint definition location?
>Is this the correct constraint definition location? Absolutely not. It should be in REQUIRED_USE qsv? ( abi_x86_64 ) look carefully: libv4l? ( v4l ) fftools_cws2fws? ( zlib ) + qsv? ( abi_x86_64 )
Beautiful, it all works. Figured out a cmdline that dropped `gphoto2 --capture-movie` CPU usage from 28% -> 8% ``` $ gphoto2 --stdout --capture-movie | ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -c:v mjpeg_qsv -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0 ``` I'm a complete ffmpeg - can this cmdline be optimized further? For example, a more clear (to a newb eye) parameter set produced an format conversion error: ``` $ ... | ffmpeg -hwaccel qsv -c:v mjpeg_qsv -i - ... ``` Slightly off-topic perhaps, but I'd really like to know why that magic-like `-init_hw_device` stuff works, and `-hwaccel -c:v` combo doesn't.
I don't really see how bug 590752 is different from this. *** This bug has been marked as a duplicate of bug 590752 ***