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

FFmpeg trac at avcodec.org
Mon Feb 22 00:27:36 CET 2016

#5238: gapless playback doesn't work (with at least Opus)
             Reporter:  calestyo     |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
              Version:  git-master   |  undetermined
             Keywords:               |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
Changes (by calestyo):

 * version:  unspecified => git-master


 Okay I'll attach a new set of sample files, all except music*.* should be
 free (source Wikicommons), and the music is just an excerpt.

 Except otherwise noted, all programs are from Debian unstable in the
 respective versions.
 lame 3.99.5
 oggenc from vorbis-tools 1.4.0
 opusenc opus-tools 0.1.9 (using libopus 1.1.1)
 audacity 2.1.2

 for the listening tests and what audacity used:
 mplayer 1.2
 mpv 0.14.0
 ffmpeg version: 2.8.6
    libavutil       54.31.100
    libavcodec      56.60.100
    libavformat     56.40.101
    libswscale      3.1.101
    libavfilter     5.40.101
    libswresample   1.2.101

 All files except music*.* were originally Oggs, which I've oggdec'ed to
 wav. music*.* was originally a WAV from CD-DA.
 The WAV files I've split/trimmed with audacity into two pieces.
 The files triangle*.wav are somehow strange,.. even the splitted WAV files
 showed already distortions at playing... no idea why?!

 All these resulting WAV files were then encoded with the following
 encoders/options (so far I've left out AAC, may follow later):
 lame --verbose -q 0 -v -V 4 --noreplaygain in.wav out.mp3
 oggenc -q5 in.wav out.mp3
 opusenc --bitrate 128 --vbr in.wav out.mp3

 Listening tests:
 mplayer beep0.wav beep1.wav   => gap/pops/distortions
 mplayer beep0.mp3 beep1.mp3   => gap/pops/distortions
 mplayer beep0.ogg beep1.ogg   => gap/pops/distortions
 mplayer beep0.opus beep1.opus => gap/pops/distortions
 mplayer h-moll0.wav h-moll1.wav   => gap/pops/distortions
 mplayer h-moll0.mp3 h-moll1.mp3   => gap/pops/distortions
 mplayer h-moll0.ogg h-moll1.ogg   => gap/pops/distortions
 mplayer h-moll0.opus h-moll1.opus => gap/pops/distortions
 mplayer music0.wav music1.wav   => gap/pops/distortions
 mplayer music0.mp3 music1.mp3   => gap/pops/distortions
 mplayer music0.ogg music1.ogg   => gap/pops/distortions
 mplayer music0.opus music1.opus => gap/pops/distortions
 => mplayer completely fails to properly play back gaplessly and/or without
 distortions between files

 mpv beep0.wav beep1.wav   => OK
 mpv beep0.mp3 beep1.mp3   => a very difficult to hear pop
 mpv beep0.ogg beep1.ogg   => gap/pops/distortions
 mpv beep0.opus beep1.opus => gap/pops/distortions
 mpv h-moll0.wav h-moll1.wav   => OK
 mpv h-moll0.mp3 h-moll1.mp3   => gap/pops/distortions
 mpv h-moll0.ogg h-moll1.ogg   => gap/pops/distortions
 mpv h-moll0.opus h-moll1.opus => gap/pops/distortions
 mpv music0.wav music1.wav   => OK
 mpv music0.mp3 music1.mp3   => unsure...maybe ok
 mpv music0.ogg music1.ogg   => gap/pops/distortions
 mpv music0.opus music1.opus => gap/pops/distortions

 For the following tests, FFmpeg was taken from git's HEAD of master
 with ./configure --enable-gpl --enable-shared --disable-stripping
 --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-
 avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-
 libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-
 libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype
 --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug
 --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-
 libpulse --enable-librtmp --enable-libschroedinger --enable-libshine
 --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh
 --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx
 --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid
 --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab
 --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r
 --enable-libx264 --enable-libopencv --enable-version3 --enable-
 libopencore_amrnb --enable-libopencore_amrwb --enable-libvo_amrwbenc

 All the above files were read and decoded to WAV (the results are
 Logs for that are attached.

 Playing back those FFmpeg decoded WAV files with mpv should now quite
 obviously show, where ffmpeg fails with proper gapless decoding (and thus
 playback for any those programs that use ffmpeg's libs for that):
 mpv beep0.wav.wav beep1.wav.wav   => OK
 mpv beep0.mp3.wav beep1.mp3.wav   => again, a very difficult to hear pop
 mpv beep0.ogg.wav beep1.ogg.wav   => gap/pops/distortions
 mpv beep0.opus.wav beep1.opus.wav => gap/pops/distortions

 mpv h-moll0.wav.wav h-moll1.wav.wav   => OK
 mpv h-moll0.mp3.wav h-moll1.mp3.wav   => gap/pops/distortions
 mpv h-moll0.ogg.wav h-moll1.ogg.wav   => gap/pops/distortions
 mpv h-moll0.opus.wav h-moll1.opus.wav => gap/pops/distortions

 mpv muisc0.wav.wav muisc1.wav.wav   => OK
 mpv muisc0.mp3.wav muisc1.mp3.wav   => unsure, but probably audible pop
 mpv muisc0.ogg.wav muisc1.ogg.wav   => slight, but still audible
 mpv muisc0.opus.wav muisc1.opus.wav => slight, but still audible

 (btw: I'd guess the cases of music*.mp3*, are not really okay,... but that
 I just cannot hear the pop due to the audio played)

 Since one may not believe my ears and/or mpv, one should open the decoded
 WAVs in some WAV editor and place the original WAVs next to it...
 I made this exemplary for beep and music:
 at begin/end:
 - one sees shifts/length changes compared to the original wav
 at the intersection:
 - MP3 fails for beep (big gap),... for music I cannot see anything, but
 still can hear a short pop/click around that area
 - ogg... seemed okay for beep (and IIRC even played okay)... but for
 music, one sees a short amount of silence just before the bar... which is
 actually audible
 - opus fails for both, big gap.

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

More information about the FFmpeg-trac mailing list