[FFmpeg-cvslog] af_asyncts: add first_pts option

Justin Ruggles git at videolan.org
Mon Jul 30 23:32:23 CEST 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Sat Jul 28 12:57:05 2012 -0400| [70d71b58018e640a09a4d919993766a2050cef8d] | committer: Justin Ruggles

af_asyncts: add first_pts option

This allows for padding/trimming at the start of stream. By default, no
assumption is made about the first frame's expected pts, so no padding or
trimming is done.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=70d71b58018e640a09a4d919993766a2050cef8d
---

 doc/filters.texi         |    7 +++++++
 libavfilter/af_asyncts.c |    3 +--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index d3543b3..58a6903 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -205,6 +205,13 @@ adding/dropping samples.
 @item max_comp
 Maximum compensation in samples per second.
 
+ at item first_pts
+Assume the first pts should be this value.
+This allows for padding/trimming at the start of stream. By default, no
+assumption is made about the first frame's expected pts, so no padding or
+trimming is done. For example, this could be set to 0 to pad the beginning with
+silence if an audio stream starts after the video stream.
+
 @end table
 
 @section channelsplit
diff --git a/libavfilter/af_asyncts.c b/libavfilter/af_asyncts.c
index 4052fbd..5a12a6f 100644
--- a/libavfilter/af_asyncts.c
+++ b/libavfilter/af_asyncts.c
@@ -49,6 +49,7 @@ static const AVOption options[] = {
     { "min_delta",  "Minimum difference between timestamps and audio data "
                     "(in seconds) to trigger padding/trimmin the data.",        OFFSET(min_delta_sec), AV_OPT_TYPE_FLOAT, { 0.1 }, 0, INT_MAX, A },
     { "max_comp",   "Maximum compensation in samples per second.",              OFFSET(max_comp),      AV_OPT_TYPE_INT,   { 500 }, 0, INT_MAX, A },
+    { "first_pts",  "Assume the first pts should be this value.",               OFFSET(pts),           AV_OPT_TYPE_INT64, { AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, A },
     { NULL },
 };
 
@@ -73,8 +74,6 @@ static int init(AVFilterContext *ctx, const char *args)
     }
     av_opt_free(s);
 
-    s->pts = AV_NOPTS_VALUE;
-
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list