Ticket #5580 (closed task: fixed)
Opened 4 years ago
Last modified 3 years ago
Use ffmpeg's native decoders for audio in mythmusic
| Reported by: | stuartm | Owned by: | stuartm |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.22 |
| Component: | Plugin - MythMusic | Version: | head |
| Severity: | medium | Keywords: | |
| Cc: | Ticket locked: | no |
Description (last modified by stuartm) (diff)
In the long term it would be nice to reduce dependencies and increase the number of supported audio codecs in mythmusic, to this end I'm creating this task ticket.
Attached is a patch which switches OGG Vorbis decoding from libvorbis to ffmpeg's native decoder. It also fixes a long standing, but unreported bug in mythmusic's avfdecoder. Could anyone with lots of oggs in their audio collection please test this, since I only have a few short samples?
Related to this task is the ongoing conversion of replacing existing tagging libraries with taglib (supports Vorbis/Ogg? Vorbis comments in a wide variety of containers and file formats in addition to mp3).
Attachments
Change History
comment:1 Changed 4 years ago by stuartm
- Status changed from new to assigned
comment:2 Changed 4 years ago by stuartm
- Status changed from assigned to accepted
- Description modified (diff)
comment:3 Changed 4 years ago by stuartm
Apparently I didn't make it clear enough that the bug fix has nothing to do with OGG, but the AVF decoder which means it previously only affected WMA and WAV formats.
I'll attach a patch shortly which moves Flac, MP3 and MP2 decoding and adds AC3, Real Audio, ALAC, ATRAC3 and others to the AVF decoder. I need to fix another bug first which prevents switching between different formats in a playlist.
comment:4 Changed 4 years ago by stuartm
Ok, updated patch attached which switches mp3 and flac to the ffmpeg decoders. Formats which should now be supported are .mp3 .mp2 .ogg .flac .wma .wav .ac3 .oma .omg .atp .ra .dts
I've only tested mp3, flac and ogg.
There are some samples (mp3 and flac) which play with ffplay but not with mythmusic. I suspect that an ffmpeg resync could help with these.
comment:5 Changed 4 years ago by skd5aner@…
ffmpeg -formats will list the formats/codecs available.
comment:6 Changed 4 years ago by stuartm
Thanks, I knew about -format but it doesn't distinguish between native and linked decoders. The link Janneg provided was what I was after, clearly marks native decoders and encoders with the full codec names, plus it helpfully groups the audio codecs together.
comment:7 Changed 4 years ago by stuartm
- Status changed from accepted to started
I've updated the patch against current trunk. All the ffmpeg bugs I saw before the ffmpeg re-sync have been fixed (thanks to Janne).
Could we get some more volunteers to test the patch, especially with Flac and Ogg/Vorbis? collections? Mine are mostly mp3s so that's well tested, but before I remove the dependencies on livFlab and libVorbis I need to be sure that libavcodec handles all examples of these formats.
comment:8 Changed 3 years ago by stuartm
(In [19477]) Replaces the mad,vorbis and flac decoders with the AVF decoder which uses our internal ffmpeg libs. This is the first stage of the switch which includes using libav* for decoding and taglib for tagging in formats other than mp3. Ultimately these changes will reduce the long list of mythmusic dependancies and simplify packaging/compilation. There are some minor seeking and buffering regressions with the AVF decoder compared to the decoders it replaces and I'll address those in the coming weeks. Refs #5580
comment:9 Changed 3 years ago by p@…
That's great change, thanks. Since all my lossless music library is in WavPack?, I tried to add decoding support for it (using your method) and now it works pretty well. I slightly modified avfdecoder.cpp to add .wv extension and I added files (metaiowavpack.h/cpp) for tagging support (using taglib for reading APE tags). Should I open a new "enhancement" ticket for it or should I submit the patch here?
Changed 3 years ago by Panagiotis Skintzos <p@…>
- Attachment mythmusic_wavpack.diff added
patch for wavpack decoding in mythmusic
comment:11 Changed 3 years ago by stuartm
comment:12 Changed 3 years ago by steve@…
this patch requires a taglib version of 1.5+ it seems. my old hardy ubuntu with its 1.4.8 version doesnt have the needed header files. needed to build taglib from source. as an fyi.
comment:13 Changed 3 years ago by stuartm
comment:14 Changed 3 years ago by stuartm
I was under the impression that I'd bumped the min version to 1.5 in trunk sometime last year, but it seems I didn't.
comment:15 Changed 3 years ago by stuartm
(In [21143]) Replace the existing Ogg Vorbis tagging class with one based on Taglib. Taglib claim that their library is three times faster at reading/writing Ogg tags, the claim is unverified but if true it should result in a speed up when scanning Ogg audio collections. This change is being made mostly to make the code easier to maintain and eventually remove the external dependancies on libogg*/libvorbis*. Refs #5580
comment:16 Changed 3 years ago by stuartm
comment:17 Changed 3 years ago by stuartm
- Status changed from started to closed
- Resolution set to fixed

List of supported audio codecs, thanks to Janne - http://ffmpeg.mplayerhq.hu/general.html#SEC7