Opened 16 years ago

Closed 15 years ago

#5580 closed task (fixed)

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)

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 (2)

mythmusic_ffmpeg.diff (31.3 KB) - added by stuartm 15 years ago.
mythmusic_wavpack.diff (8.9 KB) - added by Panagiotis Skintzos <p@…> 15 years ago.
patch for wavpack decoding in mythmusic

Download all attachments as: .zip

Change History (19)

comment:1 Changed 16 years ago by stuartm

Status: newassigned

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

comment:2 Changed 16 years ago by stuartm

Description: modified (diff)
Status: assignedaccepted

comment:3 Changed 16 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 16 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 16 years ago by skd5aner@…

ffmpeg -formats will list the formats/codecs available.

comment:6 Changed 16 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 15 years ago by stuartm

Status: acceptedstarted

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.

Changed 15 years ago by stuartm

Attachment: mythmusic_ffmpeg.diff added

comment:8 Changed 15 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 15 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 15 years ago by Panagiotis Skintzos <p@…>

Attachment: mythmusic_wavpack.diff added

patch for wavpack decoding in mythmusic

comment:10 Changed 15 years ago by paulh

Component: mythtvPlugin - MythMusic

comment:11 Changed 15 years ago by stuartm

(In [21091]) Add wavpack decoding and metadata support to mythmusic. Based on a patch by Panagiotis Skintzos. Refs #5580

comment:12 Changed 15 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 15 years ago by stuartm

(In [21105]) Bump the minimum required version of Taglib to 1.5. Refs #5580

comment:14 Changed 15 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 15 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 15 years ago by stuartm

(In [21145]) Replace the existing Flac Vorbis tagging class with one based on Taglib. See [21143] for more information. Refs #5580

comment:17 Changed 15 years ago by stuartm

Resolution: fixed
Status: startedclosed
Note: See TracTickets for help on using tickets.