[Libav-user] setting framerate using libav
kamlendra chandra
kamlendra at vvidiacom.com
Tue Nov 20 14:45:04 CET 2012
hi all,
I am new to libav, i am trying to transcode a video using libav by taking
help from example code decoding_encoding.c given with ffmpeg source code. I
am trying to transcode a video in mp4 container to a different codec
CODEC_ID_MPEG1VIDEO but everytime program exits throwing
*[mpeg1video @ 0x15a12f60] framerate not set
could not open codec*
/* open it */
if (avcodec_open2(c, codec, NULL) < 0) {
fprintf(stderr, "could not open codec\n");
exit(1);
}
/* put sample parameters */
c_out->bit_rate = c ->bit_rate;
/* resolution must be a multiple of two */
c_out->width = c->width;
c_out->height = c->height;
/* frames per second */
c_out->time_base= c->time_base;
c_out->gop_size = c->gop_size; /* emit one intra frame every ten frames
*/
c_out->max_b_frames=c->max_b_frames;
c_out->pix_fmt = c->pix_fmt;
if(codec_id == CODEC_ID_MPEG1VIDEO)
av_opt_set(c->priv_data, "preset", "slow", 0);
/* open it */
if (avcodec_open2(c_out, codec_out, NULL) < 0) {
fprintf(stderr, "could not open codec\n");
exit(1);
}
plz suggest how can we set frame rate for encoding. thankx in advance
kamlendra
--
View this message in context: http://libav-users.943685.n4.nabble.com/setting-framerate-using-libav-tp4656081.html
Sent from the libav-users mailing list archive at Nabble.com.
More information about the Libav-user
mailing list