[Live-devel] transcoding a videostream
Ross Finlayson
finlayson at live555.com
Wed Sep 2 00:34:00 PDT 2015
> I am sorry if Iitwasn't clear enough. Your suggestion is exactly what I want to do: implement my own LIVE555 transcoding filter (based on libAV). My confusion is about the registering of urls and where to put the libAV play command. Do I need to register two urls: the "normal camerastream" and the "transcoded camerastream", or should it be enough to just use the "transcoded camerastream”?
You create (using “ProxyServerMediaSession::createNew()”) a single “ProxyServerMediaSession” object, with the “rtsp://“ URL for the ‘back-end’ stream, as usual.
However, you also pass - as the last parameter to “ProxyServerMediaSession::createNew()” - a pointer to a “MediaTranscodingTable” object. See “liveMedia/include/MediaTranscodingTable.hh”.
I.e., you would define your own subclass of “MediaTranscodingTable”, and reimplement - in this subclass - the “lookupTranscoder()” virtual function. Your “lookupTranscoder()” implementation would look something like the following (e.g., this is what I do in my new WebRTC demo to transcode from MPEG-4 to VP8 video):
//////////
FramedFilter* MyMediaTranscodingTable::lookupTranscoder(MediaSubsession& inputCodecDescription, char*& outputCodecName) {
if (strcmp(inputCodecDescription.codecName(), "MP4V-ES") == 0) {
outputCodecName = strDup("VP8");
return myMPEG4toVP8VideoTranscoder::createNew(envir(), inputCodecDescription.readSource());
} else {
outputCodecName = NULL;
return NULL;
}
}
//////////
In this example, “myMPEG4toVP8VideoTranscoder” is a “FramedFilter” subclass that transcodes MPEG-4 video frames to VP8 video frames. You would write a similar “FramedFilter” subclass for whatever pair(s) of codecs you want to transcode. And, of course, you have to implement the transcoding yourself.
In your email, you refer to a “libAV play command”. I’m not sure what you mean by this, but perhaps you’re referring to the fact that the ‘libAV’ library has its own RTSP client functionality. Ignore that; it’s crap. We do all of the RTSP/RTP (at both the back and front ends of our proxy server); you'd use ‘libAV’ (formerly FFMPEG) merely for media transcoding. (Or, if you have some other way to do transcoding (e.g., in hardware), then you’d use that instead.)
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20150902/4abf6189/attachment.html>
More information about the live-devel
mailing list