[FFmpeg-trac] #5238(undetermined:new): gapless playback doesn't work (with at least Opus)

FFmpeg trac at avcodec.org
Sun Feb 14 23:50:35 CET 2016


#5238: gapless playback doesn't work (with at least Opus)
-------------------------------------+-------------------------------------
             Reporter:  calestyo     |                     Type:  defect
               Status:  new          |                 Priority:  important
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Hi.

 It seems that ffmpeg has quite some issues with respect to gapless
 playback at several formats.
 I'll show it here for Opus but it probably doesn't work for at least AAC
 either.



 The following is basically from https://github.com/mpv-
 player/mpv/issues/2823, which AFAIU uses ffmpeg for opus playback:
 -----------------------
 The approach is basically: take and two tracks that play gapless (or take
 a single track and split it at a position with audio into two WAVs),
 encode them with opusenc, play it back with mpv... and one will hear a
 really very tiny gap (which sounds therefore more like a click) between
 the two.

 Encoding settings I've used were: opusenc --bitrate 128 --vbr in.wav
 out.opus.
 Further, I decoded the opus files again with opusdec, opened the 6 files
 in audactiy (which AFAICS also uses ffmpeg to import Opus, just as mpv)
 and concatenated the corresponding files:

 1st track: original WAV
 2nd track: ffmpeg imported Opus
 3rd track: WAV, gained by decoding the Opus files with opusdec

 The beginning looks like:
 screenshot from 2016-02-14 23-26-40
 The approach is basically: take and two tracks that play gapless (or take
 a single track and split it at a position with audio into two WAVs),
 encode them with opusenc, play it back with mpv... and one will hear a
 really very tiny gap (which sounds therefore more like a click) between
 the two.

 Encoding settings I've used were: opusenc --bitrate 128 --vbr in.wav
 out.opus.
 Further, I decoded the opus files again with opusdec, opened the 6 files
 in audactiy (which AFAICS also uses ffmpeg to import Opus, just as mpv)
 and concatenated the corresponding files:

 1st track: original WAV
 2nd track: ffmpeg imported Opus
 3rd track: WAV, gained by decoding the Opus files with opusdec

 The beginning looks like beginning.png.


 The join section looks like intersection.png


 And the end like end.png


 One can quite clearly see that 1st and 3rd track are pretty fine... but
 the directly read Opus is not only shifted, but also badly broken at the
 intersection.
 -----------------------

 I have basically the same problem with AAC, more detailed described here:
 https://github.com/mpv-player/mpv/issues/2284
 and
 https://github.com/mstorsjo/fdk-aac/issues/35
 https://github.com/nu774/fdkaac/issues/19

 Interestingly, mpv does perfectly playback MP3s encoded gaplessly with
 lame (which confusingly does mean NOT to use the --gapless* options, which
 are broken for a long time).

 mplayer OTOH, fails to badly with playing back anything gapless (including
 WAVs)

 Cheers,
 Chris.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5238>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list