All pastes #374463 Raw Edit

Someone

public text v1 · immutable
#374463 ·published 2007-02-27 16:33 UTC
rendered paste body
#include <ffmpeg/avcodec.h>
#include <ffmpeg/avformat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>







int main()
{

  AVCodecContext ctx;
  AVFrame *picture;
  int got_picture_ptr =1;
  unsigned char buf[4096];
  int buf_size=100;
  int rc;


  avcodec_init();
  avcodec_register_all();
  av_register_all();



  ctx.flags |= CODEC_FLAG_QP_RD;
  ctx.flags |= CODEC_FLAG_QSCALE;
  ctx.flags |= CODEC_FLAG_PASS1;
  ctx.flags |= CODEC_FLAG_INPUT_PRESERVED;
  ctx.flags |= CODEC_FLAG_EMU_EDGE;

  ctx.mb_decision = FF_MB_DECISION_RD;
  ctx.gop_size = 30;
  ctx.thread_count = 1;
  ctx.rc_min_rate = 40000;
  ctx.rc_max_rate = 55000;
  ctx.rc_buffer_size = 128000;
  ctx.bit_rate = 50000;
  ctx.width = 176;
  ctx.height=144;

  memset(picture,0,sizeof(picture));

  rc =   avcodec_decode_video(&ctx, picture,
                       &got_picture_ptr,
                       buf,sizeof(buf));




  return 0;
}