examples/decoding_encoding.c: set a codec private option to demonstrate how to do that

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-10-17 20:22:45 +02:00
parent 82d9fafbb8
commit 98140abe85
1 changed files with 3 additions and 0 deletions

View File

@ -29,6 +29,7 @@
* format handling * format handling
*/ */
#include "libavutil/opt.h"
#include "libavcodec/avcodec.h" #include "libavcodec/avcodec.h"
#include "libavutil/mathematics.h" #include "libavutil/mathematics.h"
@ -224,6 +225,8 @@ static void video_encode_example(const char *filename)
c->max_b_frames=1; c->max_b_frames=1;
c->pix_fmt = PIX_FMT_YUV420P; c->pix_fmt = PIX_FMT_YUV420P;
av_opt_set(c->priv_data, "preset", "slow", 0);
/* open it */ /* open it */
if (avcodec_open(c, codec) < 0) { if (avcodec_open(c, codec) < 0) {
fprintf(stderr, "could not open codec\n"); fprintf(stderr, "could not open codec\n");