Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

avcodec

> 编程语言
Open source

av encoder/decoder/render/player

191 stars0 likes1 views
WebsiteGitHub

About

av encoder/decoder/render/player

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

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言