Giter VIP home page Giter VIP logo

media-codec's Introduction

media-codec

Video and audio decode/encode libraries.

media-codec's People

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

media-codec's Issues

LGPL v. 2 license text should be v. 2.1

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.

Memory Options - Link errors

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.

Usage on native linux && gstreamer-omx

Hello Allwinner, thanks for sharing this repo.

Could you please elaborate on topic of usage of these libraries?

  1. they are ARM hard-float ABI libraries, so this means that you've thought about running these on native linux setup (android is armel and not very interesting in aspect of linux-sunxi)
    proof:
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
  1. If these are meant to be used on native linux setup, what applications you were using to test these libraries? I was thinking about building the same setup as Raspberry Pi guys have - gstreamer-omx plugin. For more information about this, read http://freedesktop.org/wiki/GstOpenMAX/ http://gstreamer.freedesktop.org/releases/gst-omx/1.0.0.html
  2. If you haven't thought about running gst-omx, could you please post example of usage on native linux?

Thanks again,
Best Regards.

Unsuitable copyright text in some source code files

The files

  • omxil/include/OMX_Component.h
  • omxil/include/OMX_Component.h
  • omxil/include/OMX_Component.h
  • vencoder/vencoder.c
  • vencoder/EncAdapter.c
  • vencoder/venc_device.c
  • vencoder/BitstreamManager.c
  • vencoder/FrameBufferManager.c
  • vencoder/include/video_enc_reg.h
  • vencoder/include/BitstreamManager.h
  • vencoder/include/EncAdapter.h
  • vencoder/include/FrameBufferManager.h
  • vencoder/include/venc_device.h

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.

Vencoder demo does not work - segfault / missing code

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.

why the release code double free explicitly ??

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

T5编码AWVideoEncoder 新接口异常问题

背景

  1. 使用T517 AWCodec进行编码H264
  2. 旧的接口可正常编码, 新的接口异常
#旧接口--可正常使用
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已经正常分配内存.

1. 这个问题是SDKbug? 还是外部接口调用需要修改?

2. 官方提供的是一个jpg编码的demo, 能否提供一个H264编码的用法?

vpu/gpu libraries ?!?

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

missing copyright at media-codec/sunxi-cedarx/openmax/omxcore/src/aw_registry_table.c

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.

Remove all precompiled binary from the tree which contain LGPL code and can not be compiled from source

.libs/libcedar_omxadapter_la-aw_omx_core.o: error adding symbols: File in wrong format

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

能否提供新版的AWCodec开发参考?

原有的库并不是hardfloat的,导致在现在的大部分的内核下都跑不了了,能不能放出新版的AWCodec或者给出OpenMAX在Native Linux下的视频编码的示例?

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.