[FFmpeg-cvslog] avconv: Match stream id

Luca Barbato git at videolan.org
Thu Mar 13 14:34:08 CET 2014


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Wed Mar 12 18:01:48 2014 +0100| [81498ceb5b2d1f72a3fd694849b1feaffc301e56] | committer: Luca Barbato

avconv: Match stream id

Quite useful to select by pid in MPEG-TS.

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

 cmdutils.c                   |    6 ++++++
 doc/avtools-common-opts.texi |    2 ++
 2 files changed, 8 insertions(+)

diff --git a/cmdutils.c b/cmdutils.c
index a1e5116..69a11bd 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -1530,6 +1530,12 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
                     return 1;
         }
         return 0;
+    } else if (*spec == 'i' && *(spec + 1) == ':') {
+        int stream_id;
+        char *endptr;
+        spec += 2;
+        stream_id = strtol(spec, &endptr, 0);
+        return stream_id == st->id;
     } else if (!*spec) /* empty specifier, matches everything */
         return 1;
 
diff --git a/doc/avtools-common-opts.texi b/doc/avtools-common-opts.texi
index 156319e..3bf321f 100644
--- a/doc/avtools-common-opts.texi
+++ b/doc/avtools-common-opts.texi
@@ -42,6 +42,8 @@ streams of this type.
 @item p:@var{program_id}[:@var{stream_index}]
 If @var{stream_index} is given, then matches stream number @var{stream_index} in
 program with id @var{program_id}. Otherwise matches all streams in this program.
+ at item i:@var{stream_id}
+Match the stream by stream id (e.g. PID in MPEG-TS container).
 @end table
 @section Generic options
 



More information about the ffmpeg-cvslog mailing list