I have a board nanopi neo air with armbian linux on it. We with my colleague try to setting up ffmpeg with cedrus264 for hardware accelerated capturing video from ov5640-like camera device.
Driver Info:
Driver name : cedrus
Card type : cedrus
Bus info : platform:cedrus
Driver version : 5.4.51
Capabilities : 0x84208000
Video Memory-to-Memory
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04208000
Video Memory-to-Memory
Streaming
Extended Pix Format
Media Driver Info:
Driver name : cedrus
Model : cedrus
Serial :
Bus info : platform:cedrus
Media version : 5.4.51
Hardware revision: 0x00000000 (0)
Driver version : 5.4.51
Interface Info:
ID : 0x0300000c
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : cedrus-source
Function : V4L2 I/O
Pad 0x01000002 : 0: Source
Link 0x02000008: to remote pad 0x1000004 of entity 'cedrus-proc': Data, Enabled, Immutable
Spoiler
Driver Info:
Driver name : sun6i-video
Card type : sun6i-csi
Bus info : platform:camera
Driver version : 5.4.51
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : sun6i-csi
Model : Allwinner Video Capture Device
Serial :
Bus info :
Media version : 5.4.51
Hardware revision: 0x00000000 (0)
Driver version : 5.4.51
Interface Info:
ID : 0x03000003
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : sun6i-csi
Function : V4L2 I/O
Pad 0x01000002 : 0: Sink, Must Connect
Link 0x02000007: from remote pad 0x1000006 of entity 'Borei_VideoDriver 0-003c': Data, Enabled, Immutable
After some reconfiguration of dts, we can successfully capture video in low fps with
After some inspecting sources of ffmpeg-cedrus we found that ffmpeg try to open /dev/cedar_dev device, which don't exists in our system. Ffmpeg fails on opening device. If we replace /dev/cedar_dev by /dev/video0, where is our cedrus driver, ffmpeg fails on ioctl IOCTL_GET_ENV_INFO. In source, it is 99 or 101 line.
We check kernel config for configuration, provided by Sunxi-Cedrus and determine that cedrus was configured right.
Also we have tried all described actions on official armbian buster image for nanopi neo air and we have got the same result.
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.
Question
a.rodionov
Hi all.
I have a board nanopi neo air with armbian linux on it. We with my colleague try to setting up ffmpeg with cedrus264 for hardware accelerated capturing video from ov5640-like camera device.
There is my armbianmonitor.
There are my v4l2-ctl -d /dev/videox -D out:
Driver Info:
Driver name : cedrus
Card type : cedrus
Bus info : platform:cedrus
Driver version : 5.4.51
Capabilities : 0x84208000
Video Memory-to-Memory
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04208000
Video Memory-to-Memory
Streaming
Extended Pix Format
Media Driver Info:
Driver name : cedrus
Model : cedrus
Serial :
Bus info : platform:cedrus
Media version : 5.4.51
Hardware revision: 0x00000000 (0)
Driver version : 5.4.51
Interface Info:
ID : 0x0300000c
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : cedrus-source
Function : V4L2 I/O
Pad 0x01000002 : 0: Source
Link 0x02000008: to remote pad 0x1000004 of entity 'cedrus-proc': Data, Enabled, Immutable
Driver Info:
Driver name : sun6i-video
Card type : sun6i-csi
Bus info : platform:camera
Driver version : 5.4.51
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : sun6i-csi
Model : Allwinner Video Capture Device
Serial :
Bus info :
Media version : 5.4.51
Hardware revision: 0x00000000 (0)
Driver version : 5.4.51
Interface Info:
ID : 0x03000003
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : sun6i-csi
Function : V4L2 I/O
Pad 0x01000002 : 0: Sink, Must Connect
Link 0x02000007: from remote pad 0x1000006 of entity 'Borei_VideoDriver 0-003c': Data, Enabled, Immutable
After some reconfiguration of dts, we can successfully capture video in low fps with
but with
ffmpeg -f v4l2 -channel 0 -video_size 960x720 -i /dev/video1 -pix_fmt nv12 -r 30 -b:v 64k -c:v cedrus264 test.mp4
ffmpeg failed:
root@nanopiair:/home/pi# ffmpeg -f v4l2 -channel 0 -video_size 960x720 -i /dev/video1 -pix_fmt nv12 -r 30 -b:v 64k -c:v cedrus264 test.mp4 > ffmpeg_error.txt
ffmpeg version git-2015-01-22-f86a076 Copyright (c) 2000-2014 the FFmpeg developers
built on Jul 14 2020 09:02:41 with gcc 8 (Debian 8.3.0-6)
configuration: --prefix=/usr --enable-nonfree --enable-gpl --enable-vdpau --enable-libx264 --enable-libv4l2
libavutil 54. 6.100 / 54. 6.100
libavcodec 56. 0.101 / 56. 0.101
libavformat 56. 2.100 / 56. 2.100
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 0.102 / 5. 0.102
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
Input #0, video4linux2,v4l2, from '/dev/video1':
Duration: N/A, start: 1581.872201, bitrate: 248832 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 960x720, 248832 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
File 'test.mp4' already exists. Overwrite ? [y/N] y
[cedrus264 @ 0x241ff20] VE Open error.
Output #0, mp4, to 'test.mp4':
Stream #0:0: Video: h264, q=2-31, 128 kb/s, 30 fps
Metadata:
encoder : Lavc56.0.101 cedrus264
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (cedrus264))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Ffmpeg was buided from FFmpeg-Cedrus, also we try follow this and use this binaries - result haven't changed.
After some inspecting sources of ffmpeg-cedrus we found that ffmpeg try to open /dev/cedar_dev device, which don't exists in our system. Ffmpeg fails on opening device. If we replace /dev/cedar_dev by /dev/video0, where is our cedrus driver, ffmpeg fails on ioctl IOCTL_GET_ENV_INFO. In source, it is 99 or 101 line.
We check kernel config for configuration, provided by Sunxi-Cedrus and determine that cedrus was configured right.
Also we have tried all described actions on official armbian buster image for nanopi neo air and we have got the same result.
What we does wrong?
Link to comment
Share on other sites
16 answers to this question
Recommended Posts
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.