Opened 5 years ago

Closed 4 years ago

#1121 closed defect (fixed)

ffmpeg internal flac codec hangs on corrupted file

Reported by: nzqr Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: flac
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Ffmpeg internal flac codec hangs with 100% cpu usage on corrupted flac file, this happens both with ffplay/ffmpeg console utility, and in external players, such as mpd (http://musicpd.org/mantis/view.php?id=3472) or audacious.

here's only output of «ffmpeg -loglevel 99 -i» on corrupted file:
[flac @ 0x132b320] Format flac detected only with low score of 1, misdetection possible!

ffmpeg version is N-39046-g4246032, 0.10 and 0.10.2
Tested compiler is gcc4.5.3 and gcc4.6, under linux gentoo.

Change History (8)

comment:1 Changed 5 years ago by cehoyos

  • Component changed from FFmpeg to undetermined
  • Keywords flac added

To make this a valid ticket, please provide

  • the command line that hangs together with complete, uncut console ouput and
  • a sample that makes FFmpeg hang

comment:2 Changed 5 years ago by nzqr

I'd uploaded sample to upload.ffmpeg.org/incoming/, i beleive:
ffmpegs_flac_hangs_on_this.flac
ffmpegs_flac_hangs_on_this.txt

Here's complete command line and console output:

$ ffmpeg -loglevel 99 -i '/mnt/1/multimedia/music/torrents music/[2010] - Natural History Revision [BMTDDLP002]/20 If I Could Tell You (Stray Remix).flac'
ffmpeg version N-39046-g4246032 Copyright (c) 2000-2012 the FFmpeg developers
  built on Mar 22 2012 21:23:28 with gcc 4.5.3
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-pipe -march=amdfam10 -O2 -g0' --extra-cflags='-pipe -march=amdfam10 -O2 -g0' --extra-cxxflags='-pipe -march=amdfam10 -O2 -g0' --disable-static --enable-gpl --enable-postproc --enable-avfilter --disable-stripping --disable-debug --disable-doc --disable-vaapi --disable-bzlib --disable-indev=v4l --disable-indev=v4l2 --disable-indev=alsa --disable-indev=oss --disable-indev=jack --disable-outdev=alsa --disable-outdev=oss --enable-pthreads --disable-altivec --disable-avx --disable-ssse3 --disable-vis --disable-neon --cpu=amdfam10 --enable-hardcoded-tables
  libavutil      51. 44.100 / 51. 44.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  2.100 / 54.  2.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 65.102 /  2. 65.102
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  7.100 /  0.  7.100
  libpostproc    52.  0.100 / 52.  0.100
[flac @ 0x2504320] Format flac detected only with low score of 1, misdetection possible!
Last edited 5 years ago by nzqr (previous) (diff)

comment:3 Changed 5 years ago by cehoyos

Does not hang here:

$ ffmpeg -i ffmpegs_flac_hangs_on_this.flac
ffmpeg version N-39129-gf6b7863 Copyright (c) 2000-2012 the FFmpeg developers
  built on Mar 22 2012 19:37:33 with gcc 4.3.2
  configuration: --cc=/usr/local/gcc-4.3.2/bin/gcc --enable-gpl
  libavutil      51. 44.100 / 51. 44.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  2.100 / 54.  2.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 65.102 /  2. 65.102
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  7.100 /  0.  7.100
  libpostproc    52.  0.100 / 52.  0.100
[flac @ 0x8ed4aa0] Format flac detected only with low score of 1, misdetection possible!
[flac @ 0x8ed4aa0] Could not find codec parameters (Audio: flac, 0 channels, s16)
[flac @ 0x8ed4aa0] Estimating duration from bitrate, this may be inaccurate
ffmpegs_flac_hangs_on_this.flac: could not find codec parameters

comment:4 follow-up: Changed 5 years ago by nzqr

I have no gcc-4.3.2 in repo, but with 4.3.3 and 4.3.6, and if compiled with default options, it still hangs:

$ ~/ffmpeg_bin/bin/ffmpeg -i ~/ffmpegs_flac_hangs_on_this.flac
ffmpeg version N-39134-gb1a0d69 Copyright (c) 2000-2012 the FFmpeg developers
  built on Mar 23 2012 00:28:16 with gcc 4.3.3
  configuration: --enable-gpl --prefix=/home/kozi/ffmpeg_bin
  libavutil      51. 44.100 / 51. 44.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  2.100 / 54.  2.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 65.102 /  2. 65.102
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  7.100 /  0.  7.100
  libpostproc    52.  0.100 / 52.  0.100
[flac @ 0x2c6c3a0] Format flac detected only with low score of 1, misdetection possible!

Maybe it's cpu and simd relevant?

Last edited 5 years ago by nzqr (previous) (diff)

comment:5 Changed 5 years ago by richardpl

It "hangs" here.

comment:6 in reply to: ↑ 4 ; follow-up: Changed 5 years ago by cehoyos

Replying to nzqr:

I have no gcc-4.3.2 in repo, but with 4.3.3 and 4.3.6, and if compiled with default options, it still hangs:

How long did you wait?

comment:7 in reply to: ↑ 6 Changed 5 years ago by nzqr

How long did you wait?

Ha. It collects oneself (sorry for misinformation) in more than minute (on phenom ii 3.2Ghz that long is pretty strange).

$ time ffmpeg -loglevel 99 -i ffmpegs_flac_hangs_on_this.flac 
ffmpeg version 0.10.2 Copyright (c) 2000-2012 the FFmpeg developers
  built on Mar 24 2012 15:48:00 with gcc 4.6.2
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-pipe -march=amdfam10 -O2 -g0' --extra-cflags='-pipe -march=amdfam10 -O2 -g0' --extra-cxxflags='-pipe -march=amdfam10 -O2 -g0' --disable-static --enable-gpl --enable-postproc --enable-avfilter --disable-stripping --disable-debug --disable-doc --disable-vaapi --disable-bzlib --disable-indev=v4l --disable-indev=v4l2 --disable-indev=alsa --disable-indev=oss --disable-indev=jack --disable-outdev=alsa --disable-outdev=oss --enable-pthreads --disable-altivec --disable-avx --disable-ssse3 --disable-vis --disable-neon --cpu=amdfam10 --enable-hardcoded-tables
  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
[flac @ 0x162f320] Format flac detected only with low score of 1, misdetection possible!
[flac @ 0x16355f0] err{or,}_recognition separate: 1; 1
[flac @ 0x16355f0] err{or,}_recognition combined: 1; 10001
[flac @ 0x162f320] decoding for stream 0 failed
[flac @ 0x162f320] Could not find codec parameters (Audio: flac, 0 channels, s16)
[flac @ 0x162f320] Estimating duration from bitrate, this may be inaccurate
ffmpegs_flac_hangs_on_this.flac: could not find codec parameters

real	0m48.604s
user	0m32.160s
sys	0m16.340s

BUT mpd does not! And on it's bugzilla they said to me «it turns out to be a libav/ffmpeg bug. Please report to libav/ffmpeg».

comment:8 Changed 4 years ago by michael

  • Reproduced by developer set
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in ffmpeg git master

Note: See TracTickets for help on using tickets.