diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-26 21:04:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-26 21:04:31 +0200 |
commit | 1c0c19f8bd4b3469ce054a0a78bc1edba0e30689 (patch) | |
tree | 34760cd51f5ab434683f054a82f2eb33ba1984d0 /doc/examples | |
parent | 1ace9573dce509e2b25165199c3b658667860ecf (diff) | |
parent | 884f7c975f0af25febe86660e87bf3b2165a0309 (diff) | |
download | ffmpeg-1c0c19f8bd4b3469ce054a0a78bc1edba0e30689.tar.gz |
Merge commit '884f7c975f0af25febe86660e87bf3b2165a0309'
* commit '884f7c975f0af25febe86660e87bf3b2165a0309':
output example: set the stream timebase
Conflicts:
doc/examples/muxing.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'doc/examples')
-rw-r--r-- | doc/examples/muxing.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c index ea5c78e289..72131139ef 100644 --- a/doc/examples/muxing.c +++ b/doc/examples/muxing.c @@ -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) { |