[Live-devel] [MediaServer] Streaming mp3 file issues

Guillaume Ferry guiluge at gmail.com
Tue Dec 8 08:35:52 PST 2009


Hi Ross,

I'm still stuck into this mp3 streaming case : I must be missing something,
but here are some details.

1) A standard mp3 is being streamed by liveMedia server, works just fine
(checked with VLC)
2) I have a sink client (a really simple MediaSink subclass), in which I
grab & store frames, through callback 'afterGettingFrame', with a specific
framesize.
3) I'm using FFmpeg API (libavformat / libavcodec) to decode this frame,
using provided framesize, and I inject it into a sample player, for instance
PortAudio.

FFmpeg decoding seems ok (no errors), but when I feed PortAudio with those
samples, I can hear nothing but noise, and after a few seconds, an app
crash.

This client / audio player works really fine with remote PCM files, but MP3
files won't play.

Could you give me some insights about received RTP frames ? Do I need some
specific processing before decoding ?

Thanks in advance,
Guillaume.


2009/12/1 Guillaume Ferry <guiluge at gmail.com>

> Thanks Ross.
> By the way, I assume the 'numChannels' parameter is unrelated too ?
> I mean, a stereo mp3 file wouldn't have 'numChannels=2' set.
>
> I'll dive further into libavformat to probe those values (if you have an
> idea...you're welcome ;-) )
>
> Thanks again,
>
> Best regards,
> Guillaume.
>
> 2009/12/1 Ross Finlayson <finlayson at live555.com>
>
>  I'm currently using mediaServer to stream various media on a local
>>> network.
>>> Next, I implemented a small RTSP client to receive & play that stream.
>>>
>>> It works really great with WAV/PCM files, but I experience some issues
>>> with MP3 files.
>>> After some investigation, I found out what is going on : I use
>>> systematically provided samplerate (rtpTimeStampFrequency), which is set to
>>> 90khz for mP3 files (RTP payload :14)...
>>> Incorrect value of course, and it messes up all my playback routines
>>> afterwards...
>>>
>>> Is it possible to obtain an accurate sample rate value through liveMedia
>>> classes, or do I need to do some computing ?
>>>
>>
>> The latter.  The sampling frequency for MPEG-1 or 2 audio (which includes
>> 'MP3') is encoded in the data's MPEG audio header.  It has nothing to do
>> with the RTP timestamp frequency.
>> --
>>
>> Ross Finlayson
>> Live Networks, Inc.
>> http://www.live555.com/
>> _______________________________________________
>> live-devel mailing list
>> live-devel at lists.live555.com
>> http://lists.live555.com/mailman/listinfo/live-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20091208/273d6266/attachment.html>


More information about the live-devel mailing list