[MPlayer-dev-eng] [PATCH] Recognize audio/ogg as an OGG mimetype

Ben Boeckel mathstuf at gmail.com
Sat Dec 8 19:17:27 CET 2012


On Thu, Dec 06, 2012 at 20:31:53 GMT, Reimar Döffinger wrote:
> On 4 Dec 2012, at 07:23, Ben Boeckel <mathstuf at gmail.com> wrote:
>> I've been tracking down why an upgrade from MPD 0.15.8 to 0.17 has been
>> causing me issues. One is that the mimetype is now 'audio/ogg' (instead
>> of 'application/x-ogg') which MPlayer does not recognize and instead
>> falls back to default handling of the stream.
>
> Could you describe what the problem with the default handling is?
> Possibly with a sample? Because I think the default handling is the
> libavformat demuxer, and we'd like to switch to that eventually. Also
> it affects whether and how strongly we should recommend people to
> compile MPlayer against libogg.

The mpd part of this has some more information[1].

Output with libogg:

> [Ogg] stream 0: audio (Vorbis), -aid 0
> Ogg file format detected.
> Clip info:
>  Title: In the Beginning…
>  Creation Date: 2011-08-09
>  Album: Harmony of a Hunter
>  Artist: Mercury Adept
> ==========================================================================
> Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
> libavcodec version 54.59.100 (external)
> AUDIO: 44100 Hz, 1 ch, s16le, 110.0 kbit/15.59% (ratio: 13750->88200)
> Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis)
> ==========================================================================
> AO: [pulse] 44100Hz 1ch s16le (2 bytes per sample)
> Video: no video
> Starting playback...
> A: 254.0 (04:13.9) of 0.0 (unknown)  0.1% 21%
> Demuxer info Title changed to Danger in Old Tourian
> Demuxer info Artist changed to DoctorM64
> A: 240.6 (04:00.6) of 0.0 (unknown)  0.1% 23%
> Demuxer info Title changed to Earthroot
> Demuxer info Artist changed to VikingGuitar

Output with libavformat:

> libavformat version 54.29.104 (external)
> libavformat file format detected.
> [ogg @ 0x7fc5edf2cc40]Estimating duration from bitrate, this may be inaccurate
> [lavf] stream 0: audio (vorbis), -aid 0
> ==========================================================================
> Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
> libavcodec version 54.59.100 (external)
> AUDIO: 44100 Hz, 1 ch, s16le, 110.0 kbit/15.59% (ratio: 13750->88200)
> Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis)
> ==========================================================================
> AO: [pulse] 44100Hz 1ch s16le (2 bytes per sample)
> Video: no video
> Starting playback...
> A:  28.3 (28.3) of 0.0 (unknown)  0.2% 8%

There are occasions where libavformat gets the timing wrong (it seems to
happen when starting on a stream that had been paused at some point, but
I haven't tracked it down too much):

> libavformat version 54.29.104 (external)
> libavformat file format detected.
> [lavf] stream 0: audio (vorbis), -aid 0
> ==========================================================================
> Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
> libavcodec version 54.59.100 (external)
> AUDIO: 44100 Hz, 1 ch, s16le, 110.0 kbit/15.59% (ratio: 13750->88200)
> Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis)
> ==========================================================================
> AO: [pulse] 44100Hz 1ch s16le (2 bytes per sample)
> Video: no video
> Starting playback...
> A:  45.3 (45.2) of 6232573214720.0 (1731270279:10:04.8)  0.1% 30%

In addition, when the stream is paused, it plays silence which
libavformat buffers but does not play (so the cache just grows). When
the stream starts back up, it starts playing, but it starts with the
cache, playing the silence it had buffered causing the paused stream's
silence to be doubled in length.

The libogg handling plays the entire buffer and keeps streaming, keeping
the buffer at 0% and starts playback promptly when unpaused.

A redistributable[2] streamdumps are available as:

    http://benboeckel.net/files/mpd-ogg-stream.ogg
    http://benboeckel.net/files/mpd-libavformat-stream.ogg

The libavformat stream probably doesn't contain the tags in it due to
using an unpatched mpd[1]. Both stopped writing to the file when paused,
so that isn't in the dumps. I'm not sure how to capture that if
-dumpstream ignores it.

The mpd controls to get the stream were:

  % mpd-choose-playlist # Clears the playlist and populates it with a
                        # single album
  % mplayer -dumpstream ...
  % wait
  % mpc next
  % wait
  % mpc toggle
  % wait
  % mpc toggle
  % wait
  % mpc stop

Versions:

    mplayer-1.1-4.20121008svn.fc19.x86_64
    ffmpeg-libs-1.0.1-1.fc19.x86_64

--Ben

[1]http://article.gmane.org/gmane.comp.audio.musicpd.devel/2582
[2]http://www.shinesparkers.net/harmonyofahunter/



More information about the MPlayer-dev-eng mailing list