mixxxdj / mixxx

Mixxx is Free DJ software that gives you everything you need to perform live mixes.
http://mixxx.org
Other
4.38k stars 1.26k forks source link

Prefer FFmpeg for all formats except FLAC/OGG #10313

Open mixxxbot opened 2 years ago

mixxxbot commented 2 years ago

Reported by: uklotzde Date: 2021-02-04T22:37:46Z Status: New Importance: Medium Launchpad Issue: lp1914662


SoundSourceCoreAudio: Unmaintained due to lack of macOS contributors. Already requires an internal API adapter since the last refactoring.

SoundSourceMediaFoundation: Unmaintained due to lack of Windows contributors and buggy (https://bugs.launchpad.net/mixxx/+bug/1899242)

SoundSourceMP3: Based on abandoned libraries libid3tag and libmad.

SoundSourceM4A: Based on abandoned (libmp4v2) and almost abandoned (libfaad2) libraries. Already requires an ugly workaround.

SoundSourceSndfile: Is well maintained, has a simple API and is already used as a fallback. Currently the primary SoundSource for AIFF and WAV. No offset issues expected when switching to FFmpeg.

SoundSourceWv: Minor maintenance burden, but otherwise does not hurt. The API is simple enough to keep it.

SoundSourceOpus: Obsolete. Contains some special metadata code that is unlikely to be used. Vorbis Comment tags are the most common.

SoundSourceFLAC/SoundSourceOggVorbis: Cannot be replaced by FFmpeg!!

mixxxbot commented 2 years ago

Commented by: Be-ing Date: 2021-02-04T22:41:06Z


Is there an inherit limitation in FFmpeg that prevents using it for FLAC, Vorbis, and Opus? Are there upstream bug reports about the limiting factors?

mixxxbot commented 2 years ago

Commented by: uklotzde Date: 2021-02-04T23:07:49Z


Decoding tests don't pass for FLAC and OGG, seeking seems to be buggy, all documented in code comments. The native libraries work (almost) flawlessly.

We could use FFmpeg for OPUS instead of the native decoder as I just noticed, all tests pass. I remember that this required raising the bounds for allowed decoding errors slightly.

mixxxbot commented 2 years ago

Commented by: uklotzde Date: 2021-02-04T23:09:54Z


Decoding WavPack files also works, so we don't necessarily need to keep SoundSourceWv for the 1 or 2 people who might still use it.

mixxxbot commented 2 years ago

Commented by: uklotzde Date: 2021-02-04T23:11:09Z


        ///////////////////////////////////////////////////////////
        // Codecs with failing tests
        ///////////////////////////////////////////////////////////
        /*
    } else if (!strcmp(pavInputFormat->name, "flac")) {
        // FFmpeg failure causes test failure:
        // [flac @ 0x2ef2060] read_timestamp() failed in the middle
        // SoundSourceFFmpeg - av_seek_frame() failed: Operation not permitted
        list.append("flac");
        continue;
    } else if (!strcmp(pavInputFormat->name, "ogg")) {
        // Test failures that might be caused by FFmpeg bug:
        // https://trac.ffmpeg.org/ticket/3825
        list.append("ogg");
        continue;
mixxxbot commented 2 years ago

Commented by: Be-ing Date: 2021-02-09T07:18:39Z


Perhaps we could drop all SoundSources besides FFmpeg and libsndfile once https://github.com/libsndfile/libsndfile/issues/643 is fixed.

mixxxbot commented 2 years ago

Commented by: Holzhaus Date: 2021-03-09T01:11:35Z


Unless we have a way to determine encoder sample offsets, this will potentially invalidate all existing cue points.