⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 enc.c~

📁 linux 或者arm动态连接库的调用
💻 C~
字号:
//#include <unistd.h>
//#include "mpeg4ip.h"
//#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>

#include <fcntl.h>
#include <math.h>
#include <time.h>
#include "include/encore.h"

int main(int argc, char** argv)
{
	/* variables controlable from command line */
	unsigned int bitRate = 500000;			/* --bitrate=<uint> */
	unsigned int frameWidth = 320;			/* --width=<uint> */
	unsigned int frameHeight = 240;		/* --height=<uint> */
	float frameRate = 30.0;			/* --rate=<float> */
	unsigned int iFrameFrequency = 10;		/* --ifrequency=<uint> */

	ENC_PARAM encParams;
			
	// initialize encoder 
	encParams.x_dim = frameWidth;
	encParams.y_dim = frameHeight;
	encParams.framerate = frameRate;
	encParams.bitrate = bitRate;
	encParams.rc_period = 2000;
	encParams.rc_reaction_period = 10;
	encParams.rc_reaction_ratio = 20;
	encParams.max_key_interval = iFrameFrequency;

	if (encore(stdin, ENC_OPT_INIT, &encParams, NULL) != ENC_OK) {
		fprintf(stderr, 
			" error: can't initialize encoder\n"
			);
		exit(5);
	}

	// cleanup最后的释放 
	encore(stdin, ENC_OPT_RELEASE, NULL, NULL);
	
	return(0);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -