x264库的编译可以见之前博客:http://blog.youkuaiyun.com/li_wen01/article/details/53571929
在PC上编译X264,可以直接执行下面三条命令:
./configure --enable-shared
make
make install
/*=============================================================================
# FileName: h264encoder.c
# Desc: this program aim to get image from USB camera,
# used the V4L2 interface.
# Author: licaibiao
# Version:
# LastChange: 2017-02-21
=============================================================================*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "./include/h264encoder.h"
int WIDTH = 640;
int HEIGHT = 480;
void compress_begin(Encoder *en, int width, int height) {
en->