FFMpeg exits with non-zero code when it is asked for version or supported formats

Bug #380165 reported by nick
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ffmpeg (Ubuntu)
Fix Released
Undecided
Unassigned
Hardy
Won't Fix
Low
Unassigned

Bug Description

Binary package hint: ffmpeg

I have Ubuntu 8.04, 64 bit edition. Normally, any unix program should return 0 when it finished without errors. But when I run "ffmpeg -version", return code is 1. Similar, when I run "ffmpeg -formats" it also return 1. This bug is fixed in latest svn version and in Ubuntu 9.04.

nmn@omd1:~$ ffmpeg -version
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-shared --prefix=/usr
  libavutil version: 1d.49.3.0
  libavcodec version: 1d.51.38.0
  libavformat version: 1d.51.10.0
  built on Mar 16 2009 21:19:49, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
ffmpeg SVN-rUNKNOWN
libavutil 3212032
libavcodec 3352064
libavformat 3344896
nmn@omd1:~$ echo $?
1
nmn@omd1:~$ aptitude show ffmpeg
Package: ffmpeg
State: installed
Automatically installed: yes
Version: 3:0.cvs20070307-5ubuntu7.3
Priority: optional
Section: universe/graphics
Maintainer: Ubuntu MOTU Developers <email address hidden>
Uncompressed Size: 705k
Depends: libavcodec1d (>= 0.cvs20070307), libavformat1d (>= 0.cvs20070307), libavutil1d (>= 0.cvs20070307), libc6 (>= 2.7), libfreetype6 (>= 2.3.5),
         libimlib2, libsdl1.2debian (>= 1.2.10-1), libswscale1d (>= 0.cvs20070307)
Description: multimedia player, server and encoder
 This package contains the ffplay multimedia player, the ffserver streaming server and the ffmpeg audio and video encoder. They support most existing file
 formats (AVI, MPEG, OGG, Matroska, ASF...) and encoding formats (MPEG, DivX, MPEG4, AC3, DV...).

nmn@omd1:~$

Looking to the source code of ffmpeg (that I get with apt-src) I found , that the problem is in show_version() and similar info functions. They print necessary information and than there is "exit(1)". It is very easy to fix this bug!

Revision history for this message
Reinhard Tartler (siretart) wrote : Re: [Bug 380165] [NEW] FFMpeg exits with non-zero code when it is asked for version or supported formats

nick <email address hidden> writes:

> I have Ubuntu 8.04, 64 bit edition. Normally, any unix program should
> return 0 when it finished without errors. But when I run "ffmpeg
> -version", return code is 1. Similar, when I run "ffmpeg -formats" it
> also return 1. This bug is fixed in latest svn version and in Ubuntu
> 9.04.
>
> nmn@omd1:~$ ffmpeg -version
> FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.

that looks fishy. What exact package version of libavcodec52 or
libavcodec51 do you have installed?

--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4

Revision history for this message
nick (nmn1) wrote :

There is no libavcodec52 or libavcodec51 in Ubuntu Hardy (8.04). You can check this by ubuntu package search. And I've already written, this bug does not exist on Jaunty (9.04).

I've installed ffmpeg from standard ubuntu repositories and the same bug I found in the source package.

Revision history for this message
nick (nmn1) wrote :

I've fixed the bug and make patch according to https://wiki.ubuntu.com/Bugs/HowToFix. I just replace exit(1) by exit(0) at the end of functions show_help, show_license, show_version and show_formats.

Nikolay.

Revision history for this message
Reinhard Tartler (siretart) wrote :

Oh I see, sorry for not having read the bug properly.

I've triaged this bug accordingly.

Changed in ffmpeg (Ubuntu):
status: New → Fix Released
Changed in ffmpeg (Ubuntu Hardy):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
nick (nmn1) wrote :

I've fixed this bug 6 month ago, why this patch is not yet included in update? Maybe I've done something wrong? Hardy is LTS release, it is used on many servers, so this is still relevant.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Hardy has seen the end of its life and is no longer receiving any updates. Marking the Hardy task for this ticket as "Won't Fix".

Changed in ffmpeg (Ubuntu Hardy):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.