H 264でエンコード
gcc encode_video.c -L /usr/local/ffmpeg/lib -lavutil -lavformat -lavcodec -o encode_video
./encode_video 1.h264 libx264
#include
#include
#include
#include
#include
#include
int main(int argc, char **argv)
{
const char *filename, *codec_name;
const AVCodec *codec;
AVCodecContext *c= NULL;
int i, ret, x, y, got_output;
FILE *f;
AVFrame *frame;
AVPacket pkt;
uint8_t endcode[] = { 0, 0, 1, 0xb7 };
if (argc <= 2) {
fprintf(stderr, "Usage: %s