Commit 1c0c19f8 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '884f7c97'

* commit '884f7c97':
  output example: set the stream timebase

Conflicts:
	doc/examples/muxing.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 1ace9573 884f7c97
......@@ -117,6 +117,7 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
c->sample_rate = 44100;
c->channels = 2;
c->channel_layout = AV_CH_LAYOUT_STEREO;
ost->st->time_base = (AVRational){ 1, c->sample_rate };
break;
case AVMEDIA_TYPE_VIDEO:
......@@ -130,8 +131,9 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
* of which frame timestamps are represented. For fixed-fps content,
* timebase should be 1/framerate and timestamp increments should be
* identical to 1. */
c->time_base.den = STREAM_FRAME_RATE;
c->time_base.num = 1;
ost->st->time_base = (AVRational){ 1, STREAM_FRAME_RATE };
c->time_base = ost->st->time_base;
c->gop_size = 12; /* emit one intra frame every twelve frames at most */
c->pix_fmt = STREAM_PIX_FMT;
if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment