Giter Club home page Giter Club logo

avcodec's Introduction

avcodec

  1. H.264 bit stream parse
  2. H.264 encode by X264
  3. H.264 encode by OpenH264
  4. FFMPEG video encode/decode

h264_parameter_t param;
param.profile = H264_PROFILE_BASELINE;
param.level = H264_LEVEL_2_0;
param.width = 352;
param.height = 288;
param.format = PICTURE_YUV420;
param.frame_rate = 25000;
param.gop_size = 50;
param.bitrate = 500000;

void* h264 = x264enc_create(& param);
//void* h264 = openh264enc_create(& param);

picture_t pic;
memset(&pic, 0, sizeof(pic));
pic.format = PICTURE_YUV420;
pic.width = 352;
pic.height = 288;
pic.pts = i * 40;
pic.dts = i * 40;
pic.flags = 0; // AVPACKET_FLAG_KEY force IDR frame
pic.data[0] = s_yuv;
pic.linesize[0] = pic.width;
pic.data[1] = pic.data[0] + pic.linesize[0] * pic.height;
pic.linesize[1] = pic.width / 2;
pic.data[2] = pic.data[1] + pic.linesize[1] * pic.height / 2;
pic.linesize[2] = pic.width / 2;
assert(x264enc_input(h264, &pic) > 0);
//assert(openh264enc_input(h264, &pic) > 0);

avpacket_t pkt;
memset(&pkt, 0, sizeof(pkt));
assert(x264enc_getpacket(h264, &pkt) > 0);
//assert(1 == openh264enc_getpacket(h264, &pkt));

// save data
assert(pkt.bytes == fwrite(pkt.data, 1, pkt.bytes, wfp));

avcodec's People

Contributors

alexliyu7352 avatar dw9 avatar ireader 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  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

avcodec's Issues

x264内存泄漏

’‘’
static void x264enc_destroy(void* h264)
{
struct x264_encoder_t* p;
p = (struct x264_encoder_t*)h264;
x264_encoder_close(p->x264);
// x264_picture_clean(&p->pic);
}
‘’‘
x264enc_destroy没有free掉p产生内存泄漏

Which software LICENSE applied?

Hi,

May I ask you about which type of software LICENSE would be applied in this software? I understand that the media-server and the sdk is based on MIT license. However, I could not find LICENSE file in the repository... It would be appreciated if you could clarify the license.

Kind regards,
smg31

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.