I need to make stream to youtube with 1080p 30fps. I was trying to do it using ffmpeg and gstreamer with v4l2m2m de/encoding drivers. Both of them gave errors like there is no frames on output of video decoder. I thought that drivers for videodecoding on aml-s905x are not fully ready in linux kernel, but my friend can play 1080p 30fps video on the same machine in xfce desktop environment. Is there any possibility of hardware accelerated de/encoding for streaming on Le Potato?
There are multiple hardware decoders on the SoC. Two are capable of decoding H.264. 1 has an upstream driver that works via V4L2 M2M for certain profiles. Any application that makes use of V4L2 M2M will work although seek may not work. You can also wire the pipeline between a video, the hardware decoder, and video output directly using gstreamer.
The encoder is not supported but we plan to have it supported in 2024.
@librecomputer Hello. Glad that it will be supported in 2024. Any estimations if it’ll be ready for Christmas or we should wait longer?
Next year, not this year.
Could you say where i can track if drivers are ready?
This requires multiple parties to participate. We have approached Amlogic repeatedly on this for multiple years but support has yet to materialize.
This is the same for Ubuntu Server 22.04.3 on the Le Potato as well, as I couldn’t get it to work? Is there an idea of when hardware encoding might be working on Linux? Seems like it shouldn’t be listed as part of the specs without a stipulation it only works on Android (if this Armbian post is to be believed: Libraries for s905x hardware video encoding - Libre Le Potato - Armbian Community Forums)
Specs are hardware specs. Not software specs. All upstream work is done on a best effort basis.
Just an FYI for anyone who comes across this thread, I did some basic JPEG to h.264 MP4 performance tests and compared the Le Potato to the Pi3b 1080p25 (what I use for my time lapse from OctoPrint). In short, the Le Potato was about the same with software encoding than the Pi3b with hardware encoding when using the ultrafast preset, so for basic encoding, no benefit to have hardware at the moment:
Source: 2206 1920x1080 JPG files
Output: h.264 MP4
Sample commands:
### Hardware
ffmpeg -r 25 -i "test-%d.jpg" -vcodec h264_v4l2m2m -threads 4 -b:v 10000k -f mp4 -y -vf "[in] scale=1920:1080,format=yuv420p [out]" "test.mp4"
### Software
ffmpeg -r 25 -i "test-%d.jpg" -vcodec libx264 -threads 4 -b:v 10000k -f mp4 -y -vf "[in] scale=1920:1080,format=yuv420p [out]" "test.mp4"
### Hardware, preset ultrafast
ffmpeg -r 25 -i "test-%d.jpg" -vcodec h264_v4l2m2m -threads 4 -b:v 10000k -preset ultrafast -f mp4 -y -vf "[in] scale=1920:1080,format=yuv420p [out]" "test.mp4"
### Software, preset ultrafast
ffmpeg -r 25 -i "test-%d.jpg" -vcodec libx264 -threads 4 -b:v 10000k -preset ultrafast -f mp4 -y -vf "[in] scale=1920:1080,format=yuv420p [out]" "test.mp4"
Le Potato (software): 16m30.904s
Le Potato (software, ultrafast): 5m6.191s
Pi3b (software): 22m6.802s
Pi3b (software, ultrafast): 5m6.341s
Pi3b (hardware): 4m42.756s
Pi3b (hardware, ultrafast): 4m45.721s