[FFmpeg-user] ffprobe select streams
petesea at frontier.com
petesea at frontier.com
Mon Mar 16 00:03:32 CET 2015
Not sure if this would be considered a bug or perhaps just needs a bit
more explanation in the docs:
I wanted to get some stream info for a specific subtitle stream and assumed
ffprobe would use the same stream selection syntax as ffmpeg, so I did
this (full output below):
$ ffprobe -select_streams 0:8 -show_entries streams:stream=index,codec_type -print_format flag
There were no errors and it displayed the stream info, but it was for the
video stream (0:0), not the subtitle stream (0:8) I wanted. After a bit
of experimentation I found I needed to use just "8" instead of "0:8".
Since ffprobe only accepts one input file I guess that makes sense, but
it's maybe a bit misleading based on how ffmpeg works. In addition, the
ffprobe docs include the same stream specifiers info as ffmpeg, which (at
least to me) made me believe "0:8" would work.
http://www.ffmpeg.org/ffprobe.html#Stream-specifiers-1
Maybe a mention in the "-select_streams" section of the ffprobe doc saying
that since ffprobe only accepts one input there's no need to use the "X:N"
syntax. And/Or perhaps an additional example showing how to select a
specific absolute stream, eg:
To show only a stream using the absolute stream id with index 5:
ffprobe -show_streams -select_streams 5 INPUT
And/Or maybe ffprobe could detect "0:8" and complain, in a similar way it
complains if "#0:8" is used:
[mpeg @ 0x894a520] Invalid stream specifier: 0:8.
As a side note, in the output below I asked to only see the index and
codec_type entries for each stream, ie:
-show_entries streams:stream=index,codec_type"
The output includes index and codec_type but also all the disposition
entries. Why does it include the disposition entries? A couple other
tests on an mkv file containing language tags reveals it also shows
streams.stream.8.tags.language entries.
-----------------------------------------------------------------------
$ ffprobe -i movie.vob -select_streams 0:8 -show_entries streams:stream=index,codec_type -print_format flat
ffprobe version N-70722-g96bd032 Copyright (c) 2007-2015 the FFmpeg developers
built with gcc 4.5.1 (GCC) 20100924 (Red Hat 4.5.1-4)
configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --disable-debug --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-x11grab
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 28.100 / 56. 28.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 12.100 / 5. 12.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mpeg, from 'movie.vob':
Duration: 02:15:53.34, start: 0.533000, bitrate: 6665 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, smpte170m), 720x480 [SAR 32:27 DAR 16:9], max. 9800 kb/s, 29.83 fps, 59.94 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:2[0x81]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x82]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream #0:4[0x83]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream #0:5[0x20]: Subtitle: dvd_subtitle
Stream #0:6[0x21]: Subtitle: dvd_subtitle
Stream #0:7[0x22]: Subtitle: dvd_subtitle
Stream #0:8[0x23]: Subtitle: dvd_subtitle
Stream #0:9[0x24]: Subtitle: dvd_subtitle
Stream #0:10[0x25]: Subtitle: dvd_subtitle
streams.stream.0.index=0
streams.stream.0.codec_type="video"
streams.stream.0.disposition.default=0
streams.stream.0.disposition.dub=0
streams.stream.0.disposition.original=0
streams.stream.0.disposition.comment=0
streams.stream.0.disposition.lyrics=0
streams.stream.0.disposition.karaoke=0
streams.stream.0.disposition.forced=0
streams.stream.0.disposition.hearing_impaired=0
streams.stream.0.disposition.visual_impaired=0
streams.stream.0.disposition.clean_effects=0
streams.stream.0.disposition.attached_pic=0
$ ffprobe -i movie.vob -select_streams 8 -show_entries streams:stream=index,codec_type -print_format flat
ffprobe version N-70722-g96bd032 Copyright (c) 2007-2015 the FFmpeg developers
built with gcc 4.5.1 (GCC) 20100924 (Red Hat 4.5.1-4)
configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --disable-debug --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-x11grab
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 28.100 / 56. 28.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 12.100 / 5. 12.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mpeg, from 'movie.vob':
Duration: 02:15:53.34, start: 0.533000, bitrate: 6665 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, smpte170m), 720x480 [SAR 32:27 DAR 16:9], max. 9800 kb/s, 29.83 fps, 59.94 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:2[0x81]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x82]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream #0:4[0x83]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream #0:5[0x20]: Subtitle: dvd_subtitle
Stream #0:6[0x21]: Subtitle: dvd_subtitle
Stream #0:7[0x22]: Subtitle: dvd_subtitle
Stream #0:8[0x23]: Subtitle: dvd_subtitle
Stream #0:9[0x24]: Subtitle: dvd_subtitle
Stream #0:10[0x25]: Subtitle: dvd_subtitle
streams.stream.0.index=8
streams.stream.0.codec_type="subtitle"
streams.stream.0.disposition.default=0
streams.stream.0.disposition.dub=0
streams.stream.0.disposition.original=0
streams.stream.0.disposition.comment=0
streams.stream.0.disposition.lyrics=0
streams.stream.0.disposition.karaoke=0
streams.stream.0.disposition.forced=0
streams.stream.0.disposition.hearing_impaired=0
streams.stream.0.disposition.visual_impaired=0
streams.stream.0.disposition.clean_effects=0
streams.stream.0.disposition.attached_pic=0
More information about the ffmpeg-user
mailing list