Opened 7 years ago

Closed 7 years ago

#6359 closed defect (needs_more_info)

FFmpeg should exit with non-zero exit code when an error happens with -xerror

Reported by: nyuszika7h Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

When -xerror is used and an error occurs, FFmpeg does not always exit with a non-zero exit code, making it difficult for scripts to tell if there was an error.

How to reproduce:

Any file with errors works, but I deleted random bytes from the beginning of a JPEG image to test.

$ ffmpeg -xerror -v error -i brokenfile.jpg -f null -
[mjpeg @ 0000000002545460] error count: 64
[mjpeg @ 0000000002545460] error y=1 x=3
$ echo "$?"
0

Version info:

ffmpeg version N-85653-gb4330a0 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
  libavutil      55. 61.100 / 55. 61.100
  libavcodec     57. 93.100 / 57. 93.100
  libavformat    57. 72.101 / 57. 72.101
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 87.100 /  6. 87.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100

Change History (2)

comment:1 by Carl Eugen Hoyos, 7 years ago

Please provide a sample file.

comment:2 by Carl Eugen Hoyos, 7 years ago

Resolution: needs_more_info
Status: newclosed
Note: See TracTickets for help on using tickets.