[SCM] libav/experimental: time_base description by Rich Felker | dalias, aerifal cx
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 15:44:56 UTC 2013
The following commit has been merged in the experimental branch:
commit 5b28c8c3552626eb4beda42731232bc697073264
Author: Michael Niedermayer <michaelni at gmx.at>
Date: Sun Aug 21 22:31:01 2005 +0000
time_base description by Rich Felker | dalias, aerifal cx
Originally committed as revision 4536 to svn://svn.ffmpeg.org/ffmpeg/trunk
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index ab00920..e4900dc 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -732,14 +732,17 @@ typedef struct AVCodecContext {
void *extradata;
int extradata_size;
- /* video only */
/**
- * time base in which the timestamps are specified.
+ * this is the fundamental unit of time (in seconds) in terms
+ * of which frame timestamps are represented. for fixed-fps content,
+ * timebase should be 1/framerate and timestamp increments should be
+ * identically 1.
* - encoding: MUST be set by user
* - decoding: set by lavc.
*/
AVRational time_base;
+ /* video only */
/**
* picture width / height.
* - encoding: MUST be set by user.
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index e891b97..8b75152 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -229,6 +229,13 @@ typedef struct AVStream {
int codec_info_nb_frames;
/* encoding: PTS generation when outputing stream */
AVFrac pts;
+
+ /**
+ * this is the fundamental unit of time (in seconds) in terms
+ * of which frame timestamps are represented. for fixed-fps content,
+ * timebase should be 1/framerate and timestamp increments should be
+ * identically 1.
+ */
AVRational time_base;
int pts_wrap_bits; /* number of bits in pts (used for wrapping control) */
/* ffmpeg.c private use */
diff --git a/output_example.c b/output_example.c
index f61229d..6091d85 100644
--- a/output_example.c
+++ b/output_example.c
@@ -199,7 +199,10 @@ AVStream *add_video_stream(AVFormatContext *oc, int codec_id)
/* resolution must be a multiple of two */
c->width = 352;
c->height = 288;
- /* frames per second */
+ /* time base: this is the fundamental unit of time (in seconds) in terms
+ of which frame timestamps are represented. for fixed-fps content,
+ timebase should be 1/framerate and timestamp increments should be
+ identically 1. */
c->time_base.den = STREAM_FRAME_RATE;
c->time_base.num = 1;
c->gop_size = 12; /* emit one intra frame every twelve frames at most */
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list