Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

video encoder using mainline kernel

Featured Replies

Has anyone managed to get video encoder working with the latest mainline kernel?

 

I'm getting stuck trying to compile the cedar_ve kernel driver from https://github.com/uboborov/sunxi-cedar-mainline

 

I have downloaded the kernel source using armbian-config and then built the sunxi-cedar-mainline kernel driver. However, I fail to load the driver due to version magic:

Quote

root@nanopineo:~# modprobe cedar_ve
modprobe: ERROR: could not insert 'cedar_ve': Exec format error
root@nanopineo:~# dmesg | tail -n 1
[  653.998366] cedar_ve: version magic '5.15.80 SMP mod_unload ARMv7 thumb2 p2v8 ' should be '5.15.80-sunxi SMP mod_unload ARMv7 thumb2 p2v8 '

 

When trying to force the load:

Quote

root@nanopineo:~# modprobe -f cedar_ve
modprobe: ERROR: could not insert 'cedar_ve': Exec format error

 

But no dmesg message about magic check failure.
 

  • Author

Some updates:

1) Updated the dts file as required in https://github.com/uboborov/sunxi-cedar-mainline

2) Fixed cedar_ve compilation issues / kernel name

3) after loading the cedar_ve.ko, get only this is dmesg:

Quote

[   71.096286] cedar_ve: loading out-of-tree module taints kernel.
[   71.097176] cedar_ve: module verification failed: signature and/or required key missing - tainting kernel
[   71.098546] sunxi cedar version 0.1

 

@ubobrov I would appreciate any insights. 

  • Author

@ning Thanks for the link. But if I understand correctly - this is for decode. I need to encode h264.

Hi, maybe someone will find this patch useful. It adds JPEG and H264 encoding to the main Cedrus driver. Both encoders use a stable stateful API, so they can be used with any multimedia software, such as gstreamer, ffmpeg, etc.

 

gst-launch-1.0 videotestsrc pattern=smpte ! video/x-raw,width=1920,height=1080 ! v4l2h264enc ! h264parse ! matroskamux ! filesink location=test_h264.mkv

 

gst-launch-1.0 videotestsrc ! v4l2jpegenc ! matroskamux ! filesink location=test_mjpeg.mkv

 

I tested it on T113 (jpeg) and A40 (jpeg, h264) processors and I think it should work with H3 as well. It doesn't work with 64-bit processors like H616/T507 because their encoders have been updated, and as far as I know, they haven't been reverse-engineered yet.

 

linux-6.12.28-cedrus-enc.patch

14 часов назад, sasa сказал:

Hi, maybe someone will find this patch useful. It adds JPEG and H264 encoding to the main Cedrus driver. Both encoders use a stable stateful API, so they can be used with any multimedia software, such as gstreamer, ffmpeg, etc.

 

gst-launch-1.0 videotestsrc pattern=smpte ! video/x-raw,width=1920,height=1080 ! v4l2h264enc ! h264parse ! matroskamux ! filesink location=test_h264.mkv

 

gst-launch-1.0 videotestsrc ! v4l2jpegenc ! matroskamux ! filesink location=test_mjpeg.mkv

 

I tested it on T113 (jpeg) and A40 (jpeg, h264) processors and I think it should work with H3 as well. It doesn't work with 64-bit processors like H616/T507 because their encoders have been updated, and as far as I know, they haven't been reverse-engineered yet.

 

linux-6.12.28-cedrus-enc.patch 66.8 \u041a\u0431 · 2 скачивания

 

Please tell me the source of this patch.

1 час назад, going сказал:

Please tell me the source of this patch.

 

This is internal development for our boards, unfortunately, there is no public repository for our kernel. The code is borrowed from reverse-engineered POCs

 

h264

+ * Based on https://github.com/jemk/cedrus
+ * Copyright (c) 2014-2015 Jens Kuske <jenskuske@gmail.com>

 

jpeg

+ * Based on https://gitorious.org/recedro/jepoc
+ * Copyright (c) 2014 Manuel Braga <mul.braga@gmail.com>

Thanks a lot for the patch. Got the H264 encoder to encode the test pattern on Allwinner V3s, with the additional following patches:

https://lkml.org/lkml/2020/11/16/486 "ARM: dts: sun8i: v3s: Add node for system control",

https://lkml.org/lkml/2020/11/16/485 "ARM: dts: sun8i: v3s: Add video engine node",

and the patch in attachment to enable JPEG/H264 encoder capabilities on V3s.

 

However the lack of RAM on V3s causes the kernel CMA to really struggle so I have only been able to run the encoder at low definitions for now.

0001-media-cedrus-v3s-H264-and-JPEG-and-capabilities.patch

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.