ChanServ changed the topic of #cedrus to: Cedrus development channel (http://linux-sunxi.org/Cedrus) | *only registered users can talk* | Logs at https://oftc.irclog.whitequark.org/cedrus/
Danct12 has joined #cedrus
jason123onirc has joined #cedrus
<jason123onirc> Should the version of ffmpeg with v4l2-requests work on the a64 pinephone? When I compile it then it gives me an error about VK_EXT_VIDEO_DECODE_H264_EXTENSION_NAME
<jernej> sure, but VK_EXT_VIDEO_DECODE_H264_EXTENSION_NAME has nothing to do with v4l2-requests
<jernej> and depending on the kernel version you're using, v4l2-request patches must match
<jason123onirc> I think that the kernel has v4l2 patches its the kernel from megi for the pinephone
<jernej> you need patched ffmpeg too
<jernej> and kernel 6.2 basically doesn't need any patch anymore
<jernej> ffmpeg still does
<jernej> in short, it's a bit tricky to find proper ffmpeg patches for wanted kernel version
<jernej> we, at LibreELEC, maintain only versions which are currently in use by us
<jason123onirc> That is what i am trying to do compile the patched ffmpeg
<jason123onirc> but its giving me errors
<linkmauve> jernej, has there been any push towards updating to a more recent version of ffmpeg?
<linkmauve> I once tried to rebase the 4.4 patches on top of master, in order to upstream them, but it was too much for me at that time.
<jernej> yeah, there is 5.1 branch
<linkmauve> I’ll have a look at how hard it would be to upstream it.
<linkmauve> Did you try any recently?
<jernej> but newest ffmpeg has one change which breaks v4l2-requests. I believe something regarning parallel decoding
<linkmauve> Ugh, thanks for the warning.
<jernej> in any case, hopefully RPi devs will upstream their variant, since it's totaly async
<jason123onirc> I tried to compile the 5.1 branch of ffmpeg with the v4l2 but its not working
<jason123onirc> Should it work on the a64?
<jason123onirc> Its just not compiling
<jernej> I support several A64 board in LibreELEC and it works just fine.
<jernej> but as I said, it's a bit tricky
<jernej> we don't have ffmpeg 5.1 just yet, only 4.4
<jason123onirc> The forked ffmpeg has a 5.1 branch but I only got it to compile on my rockchip
<jason123onirc> The pinephone does not have a libreelec build so its not an option
<linkmauve> jernej, what are the differences between their variant and yours?
<linkmauve> Do you think it would be easier for me to start from theirs?
<linkmauve> I don’t have any Raspberry Pi board though, I only have some Allwinner, one Amlogic and one Qualcomm.
<jernej> linkmauve: there is plenty of differences. As I said, their version is asynchronous, which means it's faster. Due to that, there is also more code.
<jernej> but it's only implemented for HEVC and even that probably doesn't work with Cedrus
<jernej> proper approach would be to take RPi base code and our request api codecs
<linkmauve> Oh, they use a different API than requests?
<jernej> no, it's request api. It's just that for H264 and HEVC you have two modes of operation.
<jernej> frame mode and slice mode
<jernej> Cedrus and RPi4 use slice mode, while Rockchip (hantro) frame mode
<jernej> and even in slice mode, different drivers require different amount of controls to be filled
<jernej> for example, Cedrus needs entry point offsets, while RPi4 does not
<jernej> so ffmpeg must query which mode is requested by driver and then list all needed controls to fill out
<jernej> RPi ffmpeg patches did just bare minimum needed for RPi4
<jernej> but since that approach is more performant, it makes sense to use it and add all modes of operation
<jason123onirc> If I could get ffmpeg to not give a vk error and compile then hardware acceleration should end up working
<linkmauve> jason123onirc, Vulkan is a completely different API than V4L2.
<linkmauve> It’s completely unrelated to what’s implemented for your hardware.
<jason123onirc> So then how do I make the ffmpeg compile successfully?
<linkmauve> jason123onirc, certainly you have already compiled it, otherwise you wouldn’t get the Vulkan error.
<jason123onirc> I did not get it to compile it gave the error when I tried to compile it
<jason123onirc> VK_EXT_VIDEO_DECODE_H264_EXTENSION_NAME error
<linkmauve> Oh!
<jason123onirc> I could try and take the version I have compiled on my pinebook pro and see if it works on the a64
<linkmauve> That’s because your vulkan.h is too old.
<linkmauve> Try updating your vulkan-headers package.
<linkmauve> You could also --disable-vulkan I guess.
<jason123onirc> Do I need vulkan if I am just going to be using the ffmpeg for mpv?
<linkmauve> I don’t know your hardware, but mpv has an OpenGL vo which is the default.
<linkmauve> I think even if you pass it --gpu-api=vulkan it will use libplacebo and not ffmpeg for the display.
<jason123onirc> Guess I don't need vulkan but I will try and see if vulkan headers are installed
<jason123onirc> My hardware is an a64
<jason123onirc> Does linux-sunxi on armbian have cedrus support compiled?
<linkmauve> jason123onirc, the H.264 Vulkan extension is very recent, so your distribution might not ship a new enough version yet.
<linkmauve> jason123onirc, the A64 doesn’t have any Vulkan driver.
<jason123onirc> Ah so that is the issue then
<jason123onirc> I need to disable vulkan when I compile
<linkmauve> No, that is not.
<jason123onirc> Then what is the issue? Because if the a64 has no vulkan driver then it would not work or actually it might compile if I have vulkan stuff installed but idk why I would need it
<linkmauve> jason123onirc, the issue is that your vulkan.h is too old for what ffmpeg wants, but you won’t use Vulkan anyway since you have no driver on your hardware so you can disable it when building ffmpeg without issue.
<jason123onirc> Weird since I am using arch
<linkmauve> This extension is really recent.
<jason123onirc> The ffmpeg repo has no been updated since november if the extension is newer than thay
<jason123onirc> that*
<linkmauve> It has been provisional since April 2021, but only got made stable last December.
<linkmauve> But you won’t use that on the A64, at least no code has been written for it.
<linkmauve> I wonder if it would be a good API to target, and then write a shim library to do the V4L2 request instead.
<jason123onirc> Yeah vulkan would not be needed on the a64
<linkmauve> For video decoding it could, if someone were to implement that.
<linkmauve> But without the compute and graphics queues, I’m not sure how useful it would be.