[Live-devel] MP3 streaming problem
Ross Finlayson
finlayson at live555.com
Fri Apr 15 13:46:56 PDT 2016
> I tried some other things:
> 1 - In the method createNewStreamSource return my FramedSource
> subclass instead of MPEG1or2AudioStreamFramer::createNew (I think that
> hears better but with errors)
Does your “FramedSource” subclass deliver discrete MP3 frames - i.e., one at a time - rather than an unstructured MP3 byte stream? If so, then you should *not* use a “MPEG1or2AudioStreamFramer”. (Sorry, I missed this before.)
Instead, your “createNewStreamSource()” implementation should return just an instance of your “FramedSource” subclass - so that your “FramedSource” subclass feeds directly to a “MPEG1or2AudioRTPSink". (A “MPEG1or2AudioStreamFramer” is used only when parsing an unstructured MPEG audio byte stream - e.g., as you would get from a “.mp3” file.)
> 3 - I tried to change fMaxSize in order to not truncate bytes in my
> implementation of deliverFrame
No! “fMaxSize” is an ‘in’ parameter. It’s not something that you change.
If your “FramedSource” subclass is delivering discrete MP3 frames - i.e., one at a time - and you are feeding this directly to a “MPEG1or2AudioRTPSink” (i.e., *without* using a “MPEG1or2AudioStreamFramer”), then you should not be running into truncation problems, because “fMaxSize” should always be around 1200 bytes or so (i.e., the size available for a RTP packet), and your MP3 frames should all be much smaller than this. (But if your “FramedSource” subclass is delivering *multiple* MP3 frames at a time, then you can still deliver these, provided that you are always delivering complete (not partial) MP3 frames, and are never truncating any of them.)
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list