- mad.daemon
- Posts: 5
- Joined: Sun Jun 15, 2025 12:57 pm
Is it possible to use accelerated H264 encoding with upstream 6.x kernel on RPI2 in 2025?
Hello,
I have a bunch of Pi's, all running upstream Debian (not Raspbian) Bookworm with upstream (a.k.a. mainline or vanilla) 6.x kernels. A few months ago I spent quite a lot of time of trying to get ffmpeg working with h264_v4l2m2m codec on Pi 4B, but I never managed to get it working and eventually found a mid-2024 thread in this forum which explained that support for accelerated encoding on BCM2711 wasn't merged into upstream kernel yet, so I gave up with trying to make it work on Pi 4.
Right now I'm attempting to make it work on Pi 2B v1.1 (BCM2836 SoC in mainline kernel terminology), but I'm getting basically the same results as when I failed with Pi 4B - although I seem to have all the relevant drivers (e.g. BCM2835_VCHIQ, BCM2835_VCHIQ_MMAL, V4L2_MEM2MEM_DEV, V4L_PLATFORM_DRIVERS, CONFIG_V4L_MEM2MEM_DRIVERS) compiled in my kernel, gpu_mem set to 128 in config.txt, I don't see any /dev/video* device nodes and ffmpeg's h264_v4l2m2m codec doesn't work.
So my question is as in the title - is it possible to use accelerated H264 encoding with recent upstream kernels (tried 6.1.141 and 6.12.33) upstream kernels on Rpi 2B? And if it's possible, which way should work (h264_v4l2m2m or h264_omx)?
I have a bunch of Pi's, all running upstream Debian (not Raspbian) Bookworm with upstream (a.k.a. mainline or vanilla) 6.x kernels. A few months ago I spent quite a lot of time of trying to get ffmpeg working with h264_v4l2m2m codec on Pi 4B, but I never managed to get it working and eventually found a mid-2024 thread in this forum which explained that support for accelerated encoding on BCM2711 wasn't merged into upstream kernel yet, so I gave up with trying to make it work on Pi 4.
Right now I'm attempting to make it work on Pi 2B v1.1 (BCM2836 SoC in mainline kernel terminology), but I'm getting basically the same results as when I failed with Pi 4B - although I seem to have all the relevant drivers (e.g. BCM2835_VCHIQ, BCM2835_VCHIQ_MMAL, V4L2_MEM2MEM_DEV, V4L_PLATFORM_DRIVERS, CONFIG_V4L_MEM2MEM_DRIVERS) compiled in my kernel, gpu_mem set to 128 in config.txt, I don't see any /dev/video* device nodes and ffmpeg's h264_v4l2m2m codec doesn't work.
So my question is as in the title - is it possible to use accelerated H264 encoding with recent upstream kernels (tried 6.1.141 and 6.12.33) upstream kernels on Rpi 2B? And if it's possible, which way should work (h264_v4l2m2m or h264_omx)?
- 6by9
- Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator - Posts: 18476
- Joined: Wed Dec 04, 2013 11:27 am
Re: Is it possible to use accelerated H264 encoding with upstream 6.x kernel on RPI2 in 2025?
No it's still not in mainline.
Mainline devs are wanting vc04_services to be destaged before extra things get merged, and that is being chipped away at.
Mainline devs are wanting vc04_services to be destaged before extra things get merged, and that is being chipped away at.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
- mad.daemon
- Posts: 5
- Joined: Sun Jun 15, 2025 12:57 pm
Re: Is it possible to use accelerated H264 encoding with upstream 6.x kernel on RPI2 in 2025?
Thanks for the quick reply. Now I know that a switch to a downstream kernel is inevitable when it gets to accelerated encoding (on the other hand, this will also allow me to use Pi 4 for that camera).
Also, many thanks to everyone involved in working on related drivers; the efforts spent on these so far seem just formidably enormous to me, and it's good to hear that the mainlining process is still underway!
Also, many thanks to everyone involved in working on related drivers; the efforts spent on these so far seem just formidably enormous to me, and it's good to hear that the mainlining process is still underway!
Return to "Graphics programming"
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion