您尚未登录。

楼主 # 2021-06-30 17:41:11

niyazfattahov
会员
注册时间: 2021-06-23
已发帖子: 21
积分: 10

v3s hardware h264 encoder

Hello, Does anybody have success with hardware encoder CedarX from aodzip? I've compiled it in buildroot 2020.02.1 & linux-5.4.31
I see in logs when linux is booting:

[    1.447975] sunxi-cedar 1c0e000.video-codec: sunxi cedar version 0.01alpha
[    1.455128] sunxi-cedar 1c0e000.video-codec: cedar-ve the get irq is 23

when I try use it with ffmpeg with this command: 
ffmpeg  -f lavfi -i testsrc=duration=2:size=1280x720:rate=30 testsrc.h264 -y
I get:

# ffmpeg  -f lavfi -i testsrc=duration=2:size=1280x720:rate=30 testsrc.h264 -y
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.4.0 (Buildroot 2020.02.1)
  configuration: --enable-cross-compile --cross-prefix=/home/niyaz/licheepizero_linux_build_latest/buildroot_rootfs/buildroot-2020.02.1/output/host/bin/arm-buildroot-linux-uclibcgnueabihf- --sysroot=/home/niyaz/licheepizero_linux_build_latest/buildroot_rootfs/buildroot-2020.02.1/output/host/arm-buildroot-linux-uclibcgnueabihf/sysroot --host-cc=/usr/bin/gcc --arch=arm --target-os=linux --disable-stripping --pkg-config=/home/niyaz/licheepizero_linux_build_latest/buildroot_rootfs/buildroot-2020.02.1/output/host/bin/pkg-config --disable-static --enable-shared --prefix=/usr --enable-avfilter --disable-version3 --enable-logging --enable-optimizations --disable-extra-warnings --enable-avdevice --enable-avcodec --enable-avformat --enable-network --disable-gray --enable-swscale-alpha --disable-small --enable-dct --enable-fft --enable-mdct --enable-rdft --disable-crystalhd --disable-dxva2 --enable-runtime-cpudetect --disable-hardcoded-tables --disable-mipsdsp --disable-mipsdspr2 --disable-msa --enable-hwaccels --disable-cuda --disable-cuvid --disable-nvenc --disable-avisynth --disable-frei0r --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libdc1394 --disable-libgsm --disable-libilbc --disable-libvo-amrwbenc --disable-symver --disable-doc --enable-gpl --enable-nonfree --enable-ffmpeg --disable-ffplay --enable-avresample --disable-ffprobe --disable-postproc --enable-swscale --enable-indevs --disable-alsa --enable-outdevs --enable-pthreads --enable-zlib --disable-bzlib --disable-libfdk-aac --disable-libcdio --disable-gnutls --enable-openssl --disable-libdrm --disable-libopenh264 --disable-vaapi --disable-vdpau --disable-mmal --disable-omx --disable-omx-rpi --disable-libopencv --disable-libopus --disable-libvpx --disable-libass --disable-libbluray --disable-libmfx --disable-librtmp --disable-libmp3lame --disable-libmodplug --disable-libspeex --disable-libtheora --disable-libwavpack --enable-iconv --disable-libfreetype --disable-fontconfig --disable-libopenjpeg --disable-libx264 --disable-libx265 --disable-libdav1d --disable-x86asm --disable-mmx --disable-sse --disable-sse2 --disable-sse3 --disable-ssse3 --disable-sse4 --disable-sse42 --disable-avx --disable-avx2 --enable-armv6 --enable-vfp --enable-neon --disable-altivec --extra-libs=-latomic --enable-pic --cpu=cortex-a7 --enable-omx --enable-swscale --enable-swscale-alpha --enable-filter=scale
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
Input #0, lavfi, from 'testsrc=duration=2:size=1280x720:rate=30':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1280x720 [SAR 1:1 DAR 16:9], 30 tbr, 30 tbn, 30 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_omx))
Press [q] to stop, [?] for help
[h264_omx @ 0x6d440] libOMX_Core.so not found
[h264_omx @ 0x6d440] libOmxCore.so not found
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

离线

#1 2021-06-30 18:47:34

sprintf
会员
注册时间: 2020-09-11
已发帖子: 50
积分: 45

Re: v3s hardware h264 encoder

1.Do you have these two libraries on your board?(libOMX_Core.so  libOmxCore.so)
The two libraries have different names in buildroot 2020.02.1.

2.You can refer to this person's decoding operation.
https://whycan.com/t_5398.html

3.You can also add a codec to ffmpeg, you can refer to this.
https://blog.csdn.net/ddddfang/article/details/89330895

离线

楼主 #2 2021-07-24 21:59:51

niyazfattahov
会员
注册时间: 2021-06-23
已发帖子: 21
积分: 10

Re: v3s hardware h264 encoder

@sprintf
Thank you for help, I succesfully run cedarx in linux 5.4, but I can encode 640x480 at 50fps max from ov5640 camera data - cpu load 100%. How many fps do you get ?

离线

#3 2021-12-01 21:24:15

p3im4n
会员
注册时间: 2021-12-01
已发帖子: 4
积分: 5

Re: v3s hardware h264 encoder

niyazfattahov 说:

@sprintf
Thank you for help, I succesfully run cedarx in linux 5.4, but I can encode 640x480 at 50fps max from ov5640 camera data - cpu load 100%. How many fps do you get ?


HI Mr @niyazfattahov

HAve you solved  "data - cpu load 100%" problrm?

离线

楼主 #4 2021-12-02 04:17:07

niyazfattahov
会员
注册时间: 2021-06-23
已发帖子: 21
积分: 10

Re: v3s hardware h264 encoder

p3im4n 说:

HI Mr @niyazfattahov

HAve you solved  "data - cpu load 100%" problrm?


hi
no, I didn't find solution.
I think it is related with memory transaction, all I found out is that function like copy_from_user() consuming cpu ~ 40% at least

离线

#5 2021-12-02 16:37:36

p3im4n
会员
注册时间: 2021-12-01
已发帖子: 4
积分: 5

Re: v3s hardware h264 encoder

niyazfattahov 说:
p3im4n 说:

HI Mr @niyazfattahov

HAve you solved  "data - cpu load 100%" problrm?


hi
no, I didn't find solution.
I think it is related with memory transaction, all I found out is that function like copy_from_user() consuming cpu ~ 40% at least

HI Mr @niyazfattahov
maybe this help


https://stackoverflow.com/questions/20365114/linux-driver-development-how-to-investigate-copy-to-user-timing#:~:text=Update%20(January).%20Thanks,more%20copy_to_user()%20bottleneck

please let me know if it works for you

最近编辑记录 p3im4n (2021-12-02 16:37:56)

离线

#6 2021-12-02 17:12:46

unturned3
会员
注册时间: 2020-07-01
已发帖子: 263
积分: 301

Re: v3s hardware h264 encoder

That is strange... Do you know which part of the driver program is invoking frequently copy_to_user? I suppose using memory mapping would be a more efficent way to transfer data from the kernel to userspace, but maybe special circumtances in the driver doesn't allow that.

离线

楼主 #7 2021-12-02 18:11:29

niyazfattahov
会员
注册时间: 2021-06-23
已发帖子: 21
积分: 10

Re: v3s hardware h264 encoder

unturned3 说:

That is strange... Do you know which part of the driver program is invoking frequently copy_to_user? I suppose using memory mapping would be a more efficent way to transfer data from the kernel to userspace, but maybe special circumtances in the driver doesn't allow that.

I don't remember exactly, but it is related with V4L2. I found it by using perf tool. I launched ffmpeg with perf command. It can record events and show cpu usage by various functions/libraries/programs. I dont have enugh skills to deal this problem

离线

#8 2021-12-02 23:37:03

p3im4n
会员
注册时间: 2021-12-01
已发帖子: 4
积分: 5

Re: v3s hardware h264 encoder

unturned3 说:

That is strange... Do you know which part of the driver program is invoking frequently copy_to_user? I suppose using memory mapping would be a more efficent way to transfer data from the kernel to userspace, but maybe special circumtances in the driver doesn't allow that.

in my previous post I put a link about memory mapping instead use copy_to_user

最近编辑记录 p3im4n (2021-12-03 15:56:01)

离线

#9 2022-07-17 12:45:11

titishev
会员
注册时间: 2022-04-13
已发帖子: 19
积分: 9

Re: v3s hardware h264 encoder

有趣的!
請舉例說明如何使用 VE 解碼原始 h264 流。

Funny!
Please give an example how to decode a raw h264 stream using VE.

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn