Opened 3 years ago

Closed 3 years ago

#7578 closed defect (fixed)

converting to ogg (opus) with wrong -ss leads to infinite loop

Reported by: Hamid Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: opus deadlock
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
I am trying to generate .ogg samples from the middle 30 seconds of a batch of mp3 files. The file durations are retrieved from ffprobe and are generally orrect. However when the actual duration is smaller, the ffmpeg command falls into an infinit loop of logging error. Ideally, the ffmpeg process should terminate/crash immediately.
How to reproduce:

% ffmpeg -report -i ashoobam.mp3 -codec:a opus -strict -2 -ss 1000 -t 30 x.ogg
ffmpeg version: 4.0.3
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10)

Attachments (1)

ffmpeg-20181128-184543.log (394.7 KB ) - added by Hamid 3 years ago.
report generated by ffmpeg from an earlier version but bug exists in 4.0.3 as well.

Download all attachments as: .zip

Change History (5)

by Hamid, 3 years ago

Attachment: ffmpeg-20181128-184543.log added

report generated by ffmpeg from an earlier version but bug exists in 4.0.3 as well.

comment:1 by Carl Eugen Hoyos, 3 years ago

Keywords: opus deadlock added
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

For future tickets: Please remember to always test current FFmpeg git head before reporting issues.

$ ffmpeg -i fate-suite/mp3-conformance/compl.bit -acodec opus -strict -2 -ss 6 -f null -
ffmpeg version N-92549-g3317155 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.4.0 (GCC)
  configuration: --enable-gpl --enable-libxml2 --enable-gnutls
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 40.100 / 58. 40.100
  libavformat    58. 23.100 / 58. 23.100
  libavdevice    58.  6.100 / 58.  6.100
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[mp3 @ 0x3f52700] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'fate-suite/mp3-conformance/compl.bit':
  Duration: 00:00:05.19, start: 0.000000, bitrate: 64 kb/s
    Stream #0:0: Audio: mp3, 48000 Hz, mono, fltp, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (mp3float) -> opus (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf58.23.100
    Stream #0:0: Audio: opus, 48000 Hz, mono, fltp, 48 kb/s
    Metadata:
      encoder         : Lavc58.40.100 opus
[opus @ 0x3f60840] Trying to remove 960 samples, but the queue is empty
[null @ 0x3f56d40] Encoder did not produce proper pts, making some up.
[opus @ 0x3f60840] Trying to remove 960 samples, but the queue is empty
    Last message repeated 37393 times
^C

Also reproducible with:

$ ffmpeg -f f32le -i /dev/null -acodec opus -strict -2 -f null -

comment:3 by Hamid, 3 years ago

The patch seems to be working with no problem. Thanks.

comment:4 by Rostislav Pehlivanov, 3 years ago

Resolution: fixed
Status: openclosed

Fixed by 83db1efd42bd4d

Note: See TracTickets for help on using tickets.