[FFmpeg-user] Confusing ffprobe exit codes

Dalibor Mitrovic dalibor.mitrovic.coding at gmail.com
Wed Jun 26 10:44:22 CEST 2013


Hi!

I am having an issue while using ffprobe to gather information regarding
the audio stream(s) of video files.

I use the following command line
"ffprobe -show_streams -select_streams a singleAudioStreamVideoFile.mp4".
ffprobe returns the requested meta data but exits with exit code "1"
indicating that "the file cannot be opened or recognized as a multimedia
file" [1].
Calling ffprobe for the same video file and requesting meta data regarding
the video stream, using the following command line
"ffprobe -show_streams -select_streams v singleAudioStreamVideoFile.mp4"

results in the metadata being returned and exit code "0".
The exit codes do not change if the parameter "-show_streams" is omitted.

The exit code should be "0" both times, shouldn't it?

While playing around I observed that the described behavior is influenced
by the number of audio streams in the video file, if multiple audio streams
are present, then calling
"ffprobe -show_streams -select_streams a multiAudioStreamsVideoFile.mp4"

returns the meta data and exits with code 0.



I have used the following files:
http://archive.org/download/TheFightingLadyUssYorktown/2115_512kb.mp4

Beep-12 in MP3 and in WAV format from http://www.soundjay
.com/beep-sounds-2.html

test1.mkv and test5.mkv from the matroska test suite available at http://www
.matroska.org/downloads/test_w1.html

All of my tests were performed using ffmpeg built from git under
ubuntu12.10 and could be reproduced using a windows build of
ffmpeg.

Output of:
Windows "ffprobe -version"
ffprobe version N-53359-gc54a156
built on May 23 2013 01:55:10 with gcc 4.7.3 (GCC)
configuration: --disable-static --enable-shared
--enable-gpl--enable-version3 --disable-w32threads --enable-
avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnutls--enable-
iconv --enable-libass --enable-libbluray --enable-libcaca --enable-
libfreetype --enable-libgsm --enable-libilbc
--enable-libmodplug--enable-libmp3lame --enable-
libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-
libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-
libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc--enable-
libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-
libxavs --enable-libxvid --enable-zlib
libavutil      52. 33.100 / 52. 33.100
libavcodec     55. 10.101 / 55. 10.101
libavformat    55.  7.100 / 55.  7.100
libavdevice    55.  1.101 / 55.  1.101
libavfilter     3. 69.100 /  3. 69.100
libswscale      2.  3.100 /  2.  3.100
libswresample   0. 17.102 /  0. 17.102
libpostproc    52.  3.100 / 52.  3.100

Ubuntu "ffprobe -version"
ffprobe version git-2013-06-26-e59fb3f
built on Jun 26 2013 08:58:33 with gcc 4.7 (Ubuntu/Linaro 4.7.2-2ubuntu1)
configuration: --prefix=/home/ubuntu/ffmpeg_build --extra-cflags=-I/home/
ubuntu/ffmpeg_build/include --extra-ldflags=-L/home/ubuntu/ffmpeg_build/lib
--bindir=/home/ubuntu/bin --extra-libs=-ldl --enable-gpl
--enable-libass--enable-
libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-
libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
libavutil      52. 37.101 / 52. 37.101
libavcodec     55. 17.100 / 55. 17.100
libavformat    55. 10.100 / 55. 10.100
libavdevice    55.  2.100 / 55.  2.100
libavfilter     3. 77.101 /  3. 77.101
libswscale      2.  3.100 /  2.  3.100
libswresample   0. 17.102 /  0. 17.102
libpostproc    52.  3.100 / 52.  3.100

Is the described behavior a bug or did I miss something?

Thanks for your input,
Dalibor

[1] http://ffmpeg.org/ffprobe.html#toc-Description


More information about the ffmpeg-user mailing list