Pi4: ffmpeg & hw-encoding/re-coding (32bit)

This is for ARMv8 based devices

Pi4: ffmpeg & hw-encoding/re-coding (32bit)

Postby wolfn » Mon Feb 07, 2022 2:42 pm

Hello,
I am running Arch for some years on a Pi3, now Pi4, all 32bit because I need the GPIO, I2C etc. here.
Afaik this is not available in Aarch64 till now, so I'm stuck on the old system.

Last week I needed to re-code some AVI's (h264) from older IP-cams into a Web-compliant mp4-format.
My ffmpeg here shows codecs h264_v4l2m2m for de-/encoding available.
But, I am not able to use this HW-accel, SW only (around 5fps :-(
My Mem-split is still 32MB only for GPU, I found some hints to give more for this use, but how much?
And - are there some more things needed to prepare my machine for this job?
Found some discussions there, but could not understand, what is 64bit only, what do I really need for my use-case.

Can somebody point me to the right direction? My researching had no real success till now...
Thank you!
wolfn
 
Posts: 2
Joined: Mon Feb 07, 2022 2:06 pm

Re: Pi4: ffmpeg & hw-encoding/re-coding (32bit)

Postby graysky » Mon Feb 07, 2022 4:11 pm

Our kodi packages use the jc-kynesim patched ffmpeg for this which along with other kodi specific code (it has its own version of vout_drm and hello_primeprime but with more internal stuff). If you want
to look at what Kodi does grab the source code and look for files with drmprime (case-insensitive) in the filename.

I do not believe it works directly on ffmpeg or on ffplay as you want to use it though. I could be mistaken.
graysky
Developer
 
Posts: 1728
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Pi4: ffmpeg & hw-encoding/re-coding (32bit)

Postby wolfn » Mon Feb 07, 2022 5:05 pm

Thank you, will go there and check it.

But I think my regular ffmpeg (n4.4.1) would run if I'm able to configure all stuff as needed.
If I call ffmpeg to recode in HW, it says "Could not find a valid device, can't configure encoder".

And I found some hints to change the config.txt, but all I found was in 64bit context.
So I'm very unsure if I can use it in my case.
Last edited by wolfn on Mon Feb 07, 2022 5:37 pm, edited 1 time in total.
wolfn
 
Posts: 2
Joined: Mon Feb 07, 2022 2:06 pm

Re: Pi4: ffmpeg & hw-encoding/re-coding (32bit)

Postby graysky » Mon Feb 07, 2022 5:26 pm

$this->bbcode_second_pass_quote('graysky', 'I') do not believe it works directly on ffmpeg or on ffplay as you want to use it though. I could be mistaken.
graysky
Developer
 
Posts: 1728
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Pi4: ffmpeg & hw-encoding/re-coding (32bit)

Postby armuseru » Fri Feb 11, 2022 10:30 am

Maybe it helps
in my case (chromebook) kernel loads some firmware at boot, and dmesg says that system find some video encoder and video decoder
and also ffmpeg wants a nv21 colorspace.
Couple frames from encoding process:
1.jpg
1.jpg (77.09 KiB) Viewed 1650 times

2.jpg
2.jpg (103.75 KiB) Viewed 1650 times
armuseru
 
Posts: 34
Joined: Sat Jan 09, 2021 9:36 am


Return to ARMv8 Devices

Who is online

Users browsing this forum: No registered users and 5 guests