New to Manjaro, but not new to Linux by a long shot.
I wanted to compile a custom ffmpeg with some patches for hwaccel on a PBP. I want to get the source for the Manjaro package (i.e., PKGBUILD file), since I want to make a properly packaged version. It looks like there’s no equivalent of dnf download --source with pacman to get it automatically.
Some googling leads me to “asp”. That works! But this ffmpeg will clearly only build on x86_64 and not aarch64. x86_64 is the only arch listed and some of the configure options are x86 only.
And this appears to be because asp just gets an Arch package, and they only do x86_64. If I want the Manjaro package, I need to go hunt on gitlab for it.
So I do that, and there is no ffmpeg package. Nothing for arm in fact, no kernel, no nothing… And this is because there is another gitlab for Manjaro ARM! A package can’t build for both from the same source? Seems like a lot of duplicated package building code. I look in there, find the kernel package and other things, but still no ffmpeg.
So where the heck is it??? I know it exists because I’ve got the package installed!
Is there some automatic way to find the corresponding source from the binary package file? Like how a binary RPM has the SRPM name in the metadata. Or is there some more reliable tool to get the source, like dnf download or asp, rather than manually hunting in gitlab?
I’ve already modified it to build on aarch64 and added the patches for v4l2_request support. mpeg2 hardware decode on hantro works, but nothing else does.
But my question wasn’t how to build ffmpeg, but rather how one finds the correct source to the package. asp doesn’t appear to work since it only looks in the main x86_64 arch repo and ignores arch-arm, manjaro, and manjaro-arm.
I think I got hwaccell working with mpv and this ffmpeg fork. I haven’t done any measurements, but it seems that battery usage when watching movies lowered significantly. Either that, or I wanted to believe that really hard:D
time mpv --framedrop=no --length=30 --no-audio ...other options...
That will play 30 seconds with no audio and no framedrops, and report the user and sys time, add those two times together to get how much CPU was spent to play the video. It should change pretty dramatically with hardware decoding. The frame drop and audio makes it more accurate, but doesn’t really make much different. The frequency scaling of the CPUs messes up the pure time measurement, but they pretty much run at full speed to keep up with HD video, so it still works pretty well.
On a PBP for 720p60 video, I get this for software decoding and vo=gpu:
MPEG2: 43 seconds per 30 seconds = 1.43
H264: 50 seconds per 30 seconds = 1.67
H265: 94 seconds per 30 seconds = 3.13
With hardware decoding, it should be more like 15 seconds.
Then added up the user and sys time and divide by 30 to get CPU seconds per second of video. With hwaccel it’s MPEG2 0.223 and H264 0.290. Without hwaccel it’s .550 and 1.237. And for H265, where hwaccel doesn’t work, it’s 2.483. So hwaccel provides about a 2x speedup for MPEG2 and 4x for H264. I didn’t bother with vp8 or vp9, but I think in theory they are supposed to be possible too.
How does one compile mpv with v4l2_request support? I see no option in mpv and no references to v4l2_request at all in the mpv source code. Are there patches somewhere? I’ve searched but haven’t found any.
Sorry for leading you into a rabbit hole - seems like my placebo was strong. Thanks for doing the tests:). Could you share PKGBUILD’s, or even add them to AUR, once you’re done? I’d be happy to enable it for real this time, and it’s one of the notorious questions here and on Pine forums.
Is this a special rkvdec kernel or just the normal Manjaro ARM kernel?
Is there a git repo of the Manjaro ARM kernel somewhere? I know about the manjaro arm package of the kernel, but I’d much rather work with the kernel source code itself in a git repo. Importing all the patches into git was a PITA since they aren’t all valid git commits and require manual action.
I made that from an older release. It a pain to keep up to date because the manjaro patches don’t apply cleanly and aren’t even all git patches.
Using just the PKGBUILD system, any update requires one to wipe the kernel tree, re-extract, re-patch, and totally re-build, which takes hours on a PBP.
With the kernel code in git, you can pull a new kernel update into the existing build tree and only recompile the changed files and it takes a minute to test a new kernel instead of hours.