Video and audio decode/encode libraries.
allwinner-zh / media-codec Goto Github PK
View Code? Open in Web Editor NEWVideo and audio deconde/encode libraries.
License: Other
Video and audio deconde/encode libraries.
License: Other
不支持texture 捕捉摄像头编码。提示:
08-08 20:22:42.520 113-8296/? W/awplayer: VideoEncodeOneFrame:339: venc_ctx->curEncInputbuffer.pAddrPhyY: 0x0, maybe not right
一下是测试代码。结果出来的视频是一片红花屏。
CameraToMpegTest
http://bigflake.com/mediacodec/CameraToMpegTest.java.txt
The published source files contain the (correct) formulation “GNU Lesser General Public License version 2.1”, but the license text in media-codec is the older GNU Library General Public License, version 2.
Here is the license text for LGPL v. 2.1:
https://www.gnu.org/licenses/lgpl-2.1.html
Also, I can't read Chinese but the translation of the license text appears to be incorrect since it states that it's an unofficial translation of the “LGPL Free Documentation License”. Elsewhere in the text I see “(C)2007 Free Software Foundation, Inc”, but the LGPL v. 2.1 is from 1999.
Does this work on H8 SoC based boards? Ex. Cubieboard5 / Cubietruck Plus
Some files are missing, or lack instructions where they're found.
If you select ION or SUNXI_MEM options, the build fails.
There should be instructions where the libraries required when these options are selected come from.
The kernel driver does not work with "VE" memory ( default option ). There is a comment in the driver to return "0" memory when called.
Hello Allwinner, thanks for sharing this repo.
Could you please elaborate on topic of usage of these libraries?
linaro@cubieboard4:~$ readelf -h media-codec/sunxi-cedarx/LIBRARY/CODEC/VIDEO/DECODER/libvdecoder.so
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: ARM
Version: 0x1
Entry point address: 0xf4e8
Start of program headers: 52 (bytes into file)
Start of section headers: 443552 (bytes into file)
Flags: 0x5000402, has entry point, Version5 EABI, hard-float ABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 6
Size of section headers: 40 (bytes)
Number of section headers: 29
Section header string table index: 26
linaro@cubieboard4:~$ readelf -A media-codec/sunxi-cedarx/LIBRARY/CODEC/VIDEO/DECODER/libvdecoder.so
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "7-A"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_FP_arch: VFPv3
Tag_Advanced_SIMD_arch: NEONv1
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_VFP_args: VFP registers
Tag_CPU_unaligned_access: v6
Thanks again,
Best Regards.
The files
contain the text
* This software is confidential and proprietary and may be used
* only as expressly authorized by a licensing agreement from
* Softwinner Products.
*
* The entire notice above must be reproduced on all copies
* and should not be removed.
which is not suitable for an LGPL library.
According to the other files in the repository, the above text should be replaced with
* This file is part of Cedarx.
*
* Cedarx is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
file: Video Decoder API.pdf
chapter: 3.1.3 InitializeVideoDecoder()
issue: the field of parameter VideoStreamInfo has no comment.
the pdf document said that. let me refer "第6节附录部分的"视频初始化信息设置",
I can not find more document.
could you help me?
thank you very much.
It supports h265 decoding?I want to test on the a80 or h3 platform.
Hi,
VideoTest.c does not work because of missing code. It will segfault on VideoEncCreate, because gVEncoderList.list (venc_device.c) has not been initialized.
More specificially it segfaults on (posVEncNode) in the following (venc_device.c)
CdxListForEachEntry(posVEncNode, &gVEncoderList.list, node)
{
if (posVEncNode->type == type)
{
logi("Create encoder '%x:%s'", posVEncNode->type, posVEncNode->desc);
vencoder_device_handle = posVEncNode->device;
return vencoder_device_handle;
}
}
To initialize this list something needs to call VEncoderRegister , but nothing in this code base calls this function. In the case of VideoTest.c something needs to call VEncoderRegister with a VENC_DEVICE for H264 providing the functions for setting/getting/encoding/init/uninit/etc , I did not see this in the code base either. I think this might be unfortunately missing, making this code not very usable at the moment.
To reproduce the error you can compile and run the following (linked against library from this repo),
#include "vencoder.h"
int main () {
VideoEncoder *pVideoEnc = VideoEncCreate (VENC_CODEC_H264);
return 0;
}
I am trying to make a nice gstreamer plugin.... any help would be appreciated.
This repo contains decoders, but no encoder plugins.
The https://github.com/fsebentley/CedarX-12.06.2015.git repo contains 32-bit binary plugins but no arm64 binaries.
Is there any support for video encoders on A64 or H5 (Cortex-A53) processors?
Don't know why Line.120 code :
//* Destroy the stream buffer manager.
if(p->pSbm != NULL)
SbmDestroy(p->pSbm);
if(p->pSbm != NULL)
SbmDestroy(p->pSbm);
caused the program crashed at the end stage of DestroyVideoDecoder. Could I remove the second one for correction ??
Having the whole media-codec under LGPL is stil good for 3rd parties however, as can be seen in allwinner-zh/media-codec-lib#1 the media-codec-lib is still infringing on the GPL.
#旧接口--可正常使用
DPRCT_W virtual int encode(const void* inputBuf, unsigned int inputLen,
void* outputBuf, unsigned int outputLen) = 0;
# 新接口---编码H264异常
virtual int encode(AVPacket* inPacket) = 0;
使用上述接口编码NV12->H264. 可以正常工作. 但根据官方提示, 该接口已废弃. 推荐使用新的接口
// init part
if (!m_avPacket )
{
m_avPacket = (AVPacket*)calloc(1,sizeof(AVPacket));
if (!m_avPacket->pAddrVir0)
{
int32_t frameSize = encode_param_.srcW * encode_param_.srcH *1.5;
m_avPacket->pAddrVir0 = (unsigned char* )calloc(frameSize, sizeof(int8_t));
m_avPacket->pAddrVir1 = m_avPacket->pAddrVir0+ encode_param_.srcW * encode_param_.srcH;
}
}
p_encoder_ = AWVideoEncoder::create();
p_encoder_->init(&encode_param_,this);
int32_t Encoder::EncodeFrame(int8_t *buff, uint32_t buffSize, int64_t pts, int32_t format)
{
if (buff == NULL || !m_avPacket)
{
PLOGE.printf("raw image data is null and return!\n");
return -1;
}
static int64_t frameIndex =0;
m_avPacket->id = frameIndex ++;
m_avPacket->pts = pts;
int32_t frameUint = encode_param_.srcW * encode_param_.srcH ;
m_avPacket->dataLen0 = frameUint;
m_avPacket->dataLen1 = frameUint/2;
memcpy(m_avPacket->pAddrVir0 , buff,frameUint*1.5);
// memcpy(m_avPacket->pAddrVir1 , buff+frameUint,frameUint/2);
int32_t ret = p_encoder_->encode(m_avPacket);
LOGI("encode input pts:%d , index:%d result:%d", buffSize, pts, m_avPacket->id,ret);
}
替换使用新的接口, 编码第二帧数据的时候, 编码器内部一直提示一下错误
ERROR : cedarc <ReturnOneAllocateInputBuffer:424>: this buffer isn't allocate buffer,can't return
ERROR : cedarc <ReturnOneAllocInputBuffer:390>: ReturnOneAllocInputBuffer failed
根据提示信息大意为未分配内存. 但实际输入的avpacket已经正常分配内存.
greetings
Would be possible to publish the A8x (sun9i) vpu/gpu libs and sources (even closed binaries are ok) in order to be able to run linux Desktop distributions or even Linux Kodi with vpu/gpu hardware acceleration support
Thank you
File media-codec/sunxi-cedarx/openmax/omxcore/src/aw_registry_table.c has
This module contains the registry table for the QCOM's OpenMAX core.
which means that it was before rewriting for allwinner copypasted from Qualcomm's
https://android.googlesource.com/platform/hardware/qcom/media/+/affbdfe8488348fd3698f7b7b522dccf1c35d4dd/mm-core/src/7627A/qc_registry_table.c
So,
Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
is missing.
Also, if you've used other omx_core components from mm-core Qualcomm/Android repository, please add copyrights from files they are based on.
Please remove the current precompiled binaries libvdecoder.so and libvencoder.so from the tree, and make sure it can be rebuilt from the supplied sources.
https://groups.google.com/forum/#!topic/linux-sunxi/NKyOR4gxYgY
http://linux-sunxi.org/GPL_Violations#CedarX
http://linux-sunxi.org/CedarX_GPL_Violations
http://www.cnx-software.com/2015/03/23/allwinner-cedarx-media-codec-library-gpl-lgpl-compliance-update/
http://www.phoronix.com/scan.php?page=news_item&px=Allwinner-Obfuscating-Code
Hello,
when I type make ARCH=arm,
I get error like:
/usr/bin/ld: .libs/libcedar_omxadapter_la-aw_omx_core.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/libcedar_omxadapter_la-aw_omx_core.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/libcedar_omxadapter_la-aw_omx_core.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/libcedar_omxadapter_la-aw_omx_core.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/libcedar_omxadapter_la-aw_omx_core.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/libcedar_omxadapter_la-aw_omx_core.o: Relocations in generic ELF (EM: 40)
.libs/libcedar_omxadapter_la-aw_omx_core.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
Makefile:443: recipe for target 'libcedar_omxadapter.la' failed
make[2]: *** [libcedar_omxadapter.la] Error 1
make[2]: Leaving directory '/home/niyaz/lichee-pi-zero/media-codec/sunxi-cedarx/SOURCE/omxil'
Makefile:396: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/niyaz/lichee-pi-zero/media-codec/sunxi-cedarx/SOURCE'
Makefile:328: recipe for target 'all' failed
make: *** [all] Error 2
原有的库并不是hardfloat的,导致在现在的大部分的内核下都跑不了了,能不能放出新版的AWCodec或者给出OpenMAX在Native Linux下的视频编码的示例?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.