1 1
divis1969

Cedrus on Armbian

Recommended Posts

Hi,

Did anybody play with Cedrus on the recent kernels?

I'm going to play with it on Bananapi m1, kernel 5.4 and Ubuntu Bionic.

Should I just got step-by-step using this instructions http://linux-sunxi.org/Sunxi-Cedrus ?

The goal is to evaluate whether this is suitable solution for video surveillnace. I'd used kerberosio with an IP camera for couple years and this does not work good with motion detection.

Share this post


Link to post
Share on other sites

cedrus module should be available at boot for sunxi and sunxi64 configurations. Just check with lsmod.

Also someone else playing with it:

 

Share this post


Link to post
Share on other sites
11 hours ago, divis1969 said:

play with Cedrus on the recent kernels

If you find an image over here: https://libreelec.tv/  and its HW-Acceleration works properly. You already know - there is a way to go. Before try and error.

 

Share this post


Link to post
Share on other sites

@divis1969

 

I also use kerberosio since years with some OrangePi's (Frontdoor, Garden Cam..)
and USBCameras. But not directly in kerberosio. I'm runing mjpg_streamer for live-streaming and in kerberosio i us it like a IP-Camera.

 

Did you try out Zoneminder? I think about to try it in the next time when i've time.

 

Share this post


Link to post
Share on other sites
(edited)
On 4/27/2020 at 11:13 AM, MacBreaker said:

Did you try out Zoneminder? I think about to try it in the next time when i've time.

Yes, I did. If was long time ago and I found kerberosio more attractive. There was also a performace issue with ZM on bananapi that time.
I've tested ZM recently again (on bananapi m3) and it seems using less CPU than kerberosio while movement detection. So, I would switch to ZM if it will be able to handle >1 cameras.
But I decided to first play with HW decoding on bananapi prior to migrating to ZM.

 

-----

Here are the results of my attempt to use cedrus.
- I've built libva-v4l2-request. There were few issues with it. It requires libva-dev and libdrm-dev, I've installed it with apt.
Version release-2019.03 of libva-v4l2-request failed on build due to libva-dev version mismatch (this package seems declared incorrect verion for pkg-config).
I've switched to a tip of the master branch was built successfully (but with small change in the /usr/include/linux/videodev2.h - I've added v4l2_timeval_to_ns which
is missing. BTW, I've also installed linux headers with apt, these headers contain v4l2_timeval_to_ns but libva-v4l2-request does not use these)

This lib is installed by default to /usr/lib/dri/, but libVA will search it under /usr/lib/arm-linux-gnueabihf/dri/ and I've just create a symbolic link. Maybe --prefic should be specified to autoconf instead.


- I've tried to use this lib with ffmpeg (default, installed with apt):

export LIBVA_DRIVER_NAME=v4l2_request
ffmpeg -v verbose -hwaccel vaapi -hwaccel_device /dev/video0 -hwaccel_output_format vaapi -i big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 -r 5 -an stream.mp4


It produces the following error:
 

[AVHWDeviceContext @ 0x1d7a820] libva: VA-API version 1.1.0
[AVHWDeviceContext @ 0x1d7a820] libva: va_getDriverName() returns -1
[AVHWDeviceContext @ 0x1d7a820] libva: User requested driver 'v4l2_request'
[AVHWDeviceContext @ 0x1d7a820] libva: Trying to open /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so
[AVHWDeviceContext @ 0x1d7a820] libva: Found init function __vaDriverInit_1_1
[AVHWDeviceContext @ 0x1d7a820] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x1d7a820] Initialised VAAPI connection: version 1.1
[AVHWDeviceContext @ 0x1d7a820] Unknown driver "v4l2-request", assuming standard behaviour.
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[h264 @ 0x1d77fc0] Reinit context to 1280x720, pix_fmt: vaapi_vld
v4l2-request: Unable to set control: Bad address
v4l2-request: Unable to queue media request: No such file or directory
[h264 @ 0x1d77fc0] Failed to end picture decode issue: 1 (operation failed).
[h264 @ 0x1d77fc0] hardware accelerator failed to decode picture

Kernel log also contains errors:
 

[94838.781065] cedrus 1c0e000.video-codec: Missing required codec control
[94838.785428] cedrus 1c0e000.video-codec: Missing required codec control
[94838.791230] cedrus 1c0e000.video-codec: Missing required codec control
[94838.794613] cedrus 1c0e000.video-codec: Missing required codec control

- I've built v4l2-request-test and play with it. Initially it complains "Unable to start display engine" so, I've commented this functionality (so it can decode, but does not try to display frames).
This suite contains several test packages (frames). MPEG2 tests works perfectly (decoding only, as I said).

H265 tests fail with error
Processing frame 1/50
Loaded 145064 bytes of video slice data
Unable to set control: Bad address

There was no kernel errors.
H264 tests are disabled because of absence of V4L2_PIX_FMT_H264_SLICE in the system headers (linux headers contain it but autoconf does not see those).

 

Any suggestions how to enable H264? Should I also rebuild the kernel? What's wrong with H265?

Edited by divis1969
Corrections

Share this post


Link to post
Share on other sites

I also like to change mjpg streamer to ffmpeg.

But in the moment i haven'd time for this.. :(

 

Keep on posting your results pls.

 

Regards

Share this post


Link to post
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
1 1