[Live-devel] KLV metadata support in live555

Ross Finlayson finlayson at live555.com
Mon Jun 4 16:01:15 PDT 2018



> On Jun 4, 2018, at 2:11 AM, JEBARAJ SELVAPETER <jebaraj at tonboimaging.com> wrote:
> 
> Hi,
> I have been using live555 for streaming. Now I am looking in to the possibility of adding KLV metadata for every H264 video frame and then streaming. My question is,
> 
> 1. Is live555 supports KLV metadta with video frames?

Yes.  The "RTP Payload Format" for ‘KLV metadata’ is defined in RFC 6597 <https://tools.ietf.org/html/rfc6597>, which we can implement (when transmitting) using the “SimpleRTPSink” class.  (RTP receivers can also implement this payload format, using the “SimpleRTPSource” class.)

Specifically: I assume that you have a “FramedSource” subclass that delivers - in real time - individual “KLVunits” (i.e., one “KLVunit” at a time), each with an appropriate “presentationTime” (aligned with ‘wall-clock time’, i.e., the time that you’d get by calling “gettimeofday()”).  I assume also that you’re familiar with <http://live555.com/liveMedia/faq.html#liveInput-unicast>, and, in particular, that you know how to define a subclass of “OnDemandServerMediaSubsession” for ‘KLV metadata’, including reimplementing the “createStreamSource()” and “createNewRTPSink()” virtual functions.

Your “createNewRTPSink()” implementation would then implement this RTP payload format as follows:
RTPSink* YourOnDemandServerMediaSubsessionSubclassForKLVMetadata
::createNewRTPSink(Groupsock* rtpGroupsock,
                   unsigned char rtpPayloadTypeIfDynamic,
                   FramedSource* /*inputSource*/) {
	return SimpleRTPSink::createNew(envir(), rtpGroupsock, rtpPayloadTypeIfDynamic,
                        90000, // rtpTimestampFrequency
                         “application”, // sdpMediaTypeString,
                         “smpte336m”, // rtpPayloadFormatName,
                         1, // numChannels,
                         0, // allowMultipleFramesPerPacket
                         1 // doNormalMBitRule (see the comments in “liveMedia/include/SimpleRTPSink.hh”)
			);
}


Similarly, you could implement a RTP *receiver* for this stream with code something like:
	SimpleRTPSource::createNew(*env, &rtpGroupsock, rtpPayloadFormatCode,
							90000, // rtpTimestampFrequency
							“application/smpte336m” // mimeTypeString
							0, // offset
							1 // doNormalMBitRule
							);


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/




More information about the live-devel mailing list