[Live-devel] Still working on a h264 framer

etienne etienne.bomcke at uclouvain.be
Wed Jan 28 10:01:54 PST 2009


Hi guys,

I'm trying to use Mike's code inside the live555MediaServer  
application in order to stream H.264 encoded file on demand. I created  
a H264VideoFileServerMediaSubsession, based on MPEG4's version, and I  
added a piece of code to parse the SPS/PPS and format it in the  
sprop_parameter_sets_str string. Right now this parsing is done inside  
H264VideoFileServerMediaSubsession, more specifically in the  
createNewStreamSource function. I'm aware that it's probably not the  
best place to do it, but given my limited knowledge of the live555  
library it was the quickest solution that I could think of.

I managed to get it working, but it's far from being perfect, so I  
thought I could ask you a few questions.

First of all : what would be the most elegant solution to parse the  
SPS/PPS in order to get the correct sprop_parameter_sets_str  
parameter ? I put it in H264VideoFileServerMediaSubsession because  
it's needed when the function createNewRTPSink is called, was it a  
good call?

Secondly : although the profile_level_id and sprop_parameter_sets_str  
parameters seem to be both correct (decoded the base64 result and  
checked it against the file bytestream), the stream is still not  
watchable with Quicktime. VLC can open the stream, however it freezes  
on the first frame for a few seconds, and than the playback continues  
smoothly. Does anyone have an idea on what could cause this behaviour?  
I didn't have the opportunity to test other files yet, I'll do it  
tomorrow and post if it solves anything.

Regards,

Etienne Bömcke


Le 27-juin-08 à 09:19, Ross Finlayson a écrit :

>> The reason why you're stream doesn't work in Quicktime is because  
>> QuickTime expects something called SDP Parameters - its text that  
>> describes the stream, and in the case of H.264,
>> Quicktime looks into this SDP list to find the SPS and PPS  
>> information (See RFC Spec section on sprop parameters)
>>
>> You will have to parse your H.264 file, find the SPS and PPS Nal  
>> units, (usually they're the first two units in the stream) and  
>> according to the RFC Spec, base64 encode and append it to your SDP  
>> Parameters
>
> More specifically, you should:
> 1/ Encode each of these NAL units into a text string, using Base-64.  
> (For this, you can use our own library function "base64Encode()".)
> 2/ Concatenate these strings together, using "," as a separator
> 3/ Pass the resulting string to "H264VideoRTPSink::createNew()", as  
> the "sprop_parameter_sets_str" parameter
> -- 
>
> 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



More information about the live-devel mailing list