Giter VIP home page Giter VIP logo

libcedarc's People

Contributors

aodzip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

libcedarc's Issues

h264 bitrate exceed my value in runtime

hello
I am using this Configuration for my encoder.

VencH264Param h264ParamDefualt = {
.bEntropyCodingCABAC = 1,
.nBitrate = 1 * 1024 * 1024,
.nFramerate = fps,
.nCodingMode = VENC_FRAME_CODING,
.nMaxKeyInterval = fps,
.sProfileLevel.nProfile = VENC_H264ProfileMain,
.sProfileLevel.nLevel = VENC_H264Level31,
.sQPRange.nMinqp = 10,
.sQPRange.nMaxqp = 32,
};

but I wondering why bitrate exceed 1 * 1024 * 1024

调用接口报错Illegal instruction

我使用的是Linux 5.4主线,用的https://github.com/aodzip/cedar 搞出来了/dev/cedar_dev和/dev/ion,然后按照社区的文章采用gstreamer+omx的方式调用视频硬解码,报错Illegal instruction,不知道为什么,然后开始切换buildroot版本,19.08、20.02、22.02、23.02都尝试了,报错都是一样的,使用ffmpeg或gstreamer软解码都可以。然后就不用播放器了,按照Video_Decoder_API_Guide.pdf文档说说的接口直接调用AddVDPlugin或者CreateVideoDecoder也还是报错,这个错误有点奇怪。

OMX is not sending frames

SoC: S3

I have verified that camera works good.

# ffmpeg -s 640x480 -r 15 -i /dev/video0 -vcodec h264 out5.mp4

ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.0 (Buildroot 2020.08-951-g20ddd63292-dirty)
  configuration: --enable-cross-compile --cross-prefix=/home/gamiee/Desktop/buildroot/output/host/bin/arm-buildroot-linux-gnueabihf- --sysroot=/home/gamiee/Desktop/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot --host-cc=/usr/bin/gcc --arch=arm --target-os=linux --disable-stripping --pkg-config=/home/gamiee/Desktop/buildroot/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 --disable-avresample --disable-ffprobe --disable-libxcb --disable-postproc --disable-swscale --enable-indevs --disable-alsa --enable-outdevs --enable-pthreads --disable-zlib --disable-bzlib --disable-libfdk-aac --disable-libcdio --disable-gnutls --disable-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 --disable-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
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswresample   3.  7.100 /  3.  7.100
[video4linux2,v4l2 @ 0x5b380] ioctl(VIDIOC_G_PARM): Inappropriate ioctl for device
[video4linux2,v4l2 @ 0x5b380] Time per frame unknown
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 117.711179, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480, 15 tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_omx))
Press [q] to stop, [?] for help
[h264_omx @ 0x5f2e0] libOMX_Core.so not found
 Leaving OMX_GetComponentsOfRole
[h264_omx @ 0x5f2e0] Using OMX.allwinner.video.encoder.avc
debug  : omx_venc <__AwOmxVencComponentCreate:2501>: COMPONENT_CREATE
debug  : cedarc <AwOmxComponentInit:26>:OMXCORE: aw_omx_component_init 67098

debug  : omx_venc <__AwOmxVencInit:392>: COMPONENT_INIT
debug  : ionAlloc <__GetIonMemOpsS:985>:*** get __GetIonMemOpsS ***
debug  : ionAlloc <ion_alloc_open:134>:begin ion_alloc_open

debug  : cedarc <VeSetSpeed:1559>: *** set ve freq to 360 Mhz ***
debug  : cedarc <VeInitialize:1198>: ve init ok

debug  : ionAlloc <ion_alloc_open:175>:** phy offset = 40000000
debug  : cedarc <VeRelease:1253>: ve release ok

debug  : cedarc <CdcMessageQueueCreate:47>:nMessageSize = 20
debug  : cedarc <CdcMessageQueueCreate:47>:nMessageSize = 20
debug  : cedarc <updateOmxDebugFlag:238>:DEBUG_TYPE is (null).
debug  : cedarc <AwOmxComponentSetCallbacks:309>:OMXCORE: aw_omx_component_set_callbacks 67098, b6233a2c , 5f690

debug  : omx_venc <__AwOmxVencSetCallbacks:2317>:===== vdec set callbacks***************
debug  : omx_venc <__AwOmxVencGetParameter:953>:InPort definition: width = 0, height = 0
debug  : omx_venc <__AwOmxVencGetParameter:965>:OutPort definition: width = 176, height = 144
debug  : omx_venc <__AwOmxVencSetParameter:1335>:init_input_port: stride = 640, width = 640, height = 480
debug  : omx_venc <__AwOmxVencSetParameter:1341>:set video port format 0x13
debug  : omx_venc <__AwOmxVencGetParameter:953>:InPort definition: width = 640, height = 480
debug  : omx_venc <__AwOmxVencGetParameter:965>:OutPort definition: width = 176, height = 144
debug  : omx_venc <__AwOmxVencSetParameter:1405>:init_output_port: framerate: 983040(>>16) 15, output width 640 height 480.
debug  : omx_venc <__AwOmxVencGetParameter:965>:OutPort definition: width = 640, height = 480
debug  : omx_venc <__AwOmxVencAllocateBuffer:1963>:allocate buffer, nPortIndex: InPort, nSizeBytes: 460800
debug  : omx_venc <__AwOmxVencAllocateBuffer:1963>:allocate buffer, nPortIndex: InPort, nSizeBytes: 460800
debug  : omx_venc <__AwOmxVencAllocateBuffer:1963>:allocate buffer, nPortIndex: OutPort, nSizeBytes: 460800
debug  : omx_venc <__AwOmxVencAllocateBuffer:1963>:allocate buffer, nPortIndex: OutPort, nSizeBytes: 460800
debug  : omx_venc <__AwOmxVencAllocateBuffer:1963>:allocate buffer, nPortIndex: OutPort, nSizeBytes: 460800
debug  : omx_venc <__AwOmxVencAllocateBuffer:1963>:allocate buffer, nPortIndex: OutPort, nSizeBytes: 460800
debug  : omx_venc <processThreadCommand:3317>:x set state command, cmd = main_thread_cmd_set_state, pCmdData = OMX_StateIdle.
debug  : omx_venc <processThreadCommand:3317>:x set state command, cmd = main_thread_cmd_set_state, pCmdData = OMX_StateExecuting.
debug  : omx_venc <ComponentVencThread:4316>:(vdrvThread receive cmd[venc_cmd_open]
debug  : cedarc <LogVersionInfo:40>:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Cedar Codec <<<<<<<<<<<<<<<<<<<<<<<<<<<<
tag   : createBranch_customize_sylix
branch: CedarC-v1.1.9
commit: 4a182bd42c931bea2f77b0ff9a531d233df8541e
date  : Thu May 25 15:34:03 2017 +0800
author: jenkins8080
patch :
----------------------------------------------------------------------

debug  : cedarc <VeSetSpeed:1559>: *** set ve freq to 360 Mhz ***
debug  : cedarc <VeInitialize:1198>: ve init ok

debug  : ionAlloc <__GetIonMemOpsS:985>:*** get __GetIonMemOpsS ***
debug  : ionAlloc <ion_alloc_open:134>:begin ion_alloc_open

debug  : omx_venc <init_h264_param:2820>:profile-venc=66, profile-omx=1, frame_rate:983040, bit_rate:200000, idr:12, eColorFormat:00000013

debug  : omx_venc <init_h264_param:2946>:Enable VBR. QpMin: 20. QpMax: 45. Bitrate: 200000.
debug  : cedarc <determineVencColorFormat:167>:color format: VENC_PIXEL_YUV420P/I420
debug  : omx_venc <openVencDriver:3184>:omx_venc base_config info: src_wxh:640x480, dis_wxh:640x480, stride:640

debug  : ionAlloc <__GetIonMemOpsS:985>:*** get __GetIonMemOpsS ***
debug  : omx_venc <openVencDriver:3221>:AVC 4 byte interleave nalu Disable.
debug  : cedarc <VideoEncInit:195>: (f:VideoEncInit, l:195)
debug  : cedarc <VideoEncInit:210>: (f:VideoEncInit, l:210)
debug  : cedarc <BitStreamCreate:102>: BitStreamCreate OK

Yi Y20GA is an IP camera with QG2101A chip

Running demo, i get:

root@yi-cam-01:/tmp/sd/my# ./EncoderTest -i /dev/video0 -o /tmp/img.jpg -n 1 -s 1080 -d 1080
error  : cedarc <main:1287>:TEST POINT 0.1
error  : cedarc <main:1311>:TEST POINT 0.2
error  : cedarc <main:1336>:TEST POINT 0.3
debug  : cedarc <ParseArgument:279>: get input file: /dev/video0 
debug  : cedarc <ParseArgument:290>: get output file: /tmp/img.jpg 
debug  : cedarc <ParseArgument:294>: get src_size: 1080p 
debug  : cedarc <ParseArgument:330>: get dst_size: 1080p 
error  : cedarc <main:1406>:TEST POINT 0.4
debug  : ionAlloc <__GetIonMemOpsS:985>:*** get __GetIonMemOpsS ***
error  : cedarc <main:1417>:TEST POINT 0.5
debug  : ionAlloc <ion_alloc_open:134>:begin ion_alloc_open 

error  : cedarc <initVELocks:163>: check (i < VLPL_size) failed:IC not support. '0x2111000021210'
Assertion failed: 0 (veAw/veAw.c: initVELocks: 163)
Aborted (core dumped)

This config file is shipped with the IPCAM
cat /etc/cedarx.conf (default file)


########### paramter (ref to tulip_cedarx.conf)############
[paramter]
start_play_cache_video_frame_num = 30
start_play_cache_size = 128            # KB
cache_buffer_size = 20480              # KB
cache_buffer_size_live = 20480         # KB
start_play_cache_time = 5              # Second
max_start_play_chache_size = 153600    # KB
max_cache_buffer_size = 204800         # KB

# see comment in player.cpp
av_sync_duration = 0              # millisecond

# picture num for modules
pic_4list_num = 3
pic_4di_num = 0
pic_4rotate_num = 0
pic_4smooth_num = 0
# picture format: mb32/nv21/nv12/nv
# deinterlace format
deinterlace_fmt = nv12

# video decoder output picture format
vd_output_fmt = nv21

# gpu align stride values: 16/32
# mali 400mp2 32bit
gpu_align_bitwidth = 32

# if value 1 : send 3-frames black-pic to GPU
# SP: switch Program
#black_pic_4_SP = 0

# compensate for av vsync
compensate_vsync = 4

# log will output if level >= log_level
#VERBOSE = 2,
#DEBUG = 3,
#INFO = 4,
#WARNING = 5,
#ERROR = 6,
log_level = 3

########### plugin ##############
# 1. audio decoder plugin

# 2. video decoder plugin

[vdecoder-0]
comment = h264_vdecoder
id = vdecoder.h264
lib = libawh264.so
init = CedarPluginVDInit

[vdecoder-1]
comment = h265_vdecoder
id = vdecoder.h265
lib = libawh265.so
init = CedarPluginVDInit

[vdecoder-2]
comment = mjpegplus_vdecoder
id = vdecoder.mjpegplus
lib = libawmjpegplus.so
init = CedarPluginVDInit

# 3. external plugin

#[plugin-0]
#comment = rtp_plugin
#id = rtp
#lib = librtp.so

Trying to compile on the board (not buildroot)

Hi,

I want to compile the library on the board itself.
I cloned the repo, and start to compile with:

./bootstrap
./configure

but when running make I get the following error:

root@localhost:~/src/cedar/libcedarc# make
make  all-recursive
make[1]: Entering directory '/root/src/cedar/libcedarc'
Making all in base
make[2]: Entering directory '/root/src/cedar/libcedarc/base'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/src/cedar/libcedarc/base'
Making all in memory
make[2]: Entering directory '/root/src/cedar/libcedarc/memory'
  CCLD     libMemAdapter.la
/usr/bin/ld: cannot find -lVE
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:441: libMemAdapter.la] Error 1
make[2]: Leaving directory '/root/src/cedar/libcedarc/memory'
make[1]: *** [Makefile:398: all-recursive] Error 1
make[1]: Leaving directory '/root/src/cedar/libcedarc'
make: *** [Makefile:330: all] Error 2

What is the library that is missing? I couldn't find what library is associated to -lVE

thanks a lot!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.