<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I have some videostreams that are H.264 which needs to be converted
to MPEG2 for instance. I think that is the media transcoding you
mention and therefore I wanted to use the libAV library. If I test
this as a standalone application besides the proxy server, it would
be something like:<br>
<br>
<tt> libvlc_instance_t *libvlc;</tt><tt><br>
</tt><tt> libvlc_media_t *m;</tt><tt><br>
</tt><tt> libvlc_media_player_t *mp;</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> char const *vlc_argv[] =</tt><tt><br>
</tt><tt> {</tt><tt><br>
</tt><tt>
"--sout=#rtp{sdp=rtsp://192.168.1.101:5678/mjpeg/axis-media/media.amp}",</tt><tt><br>
</tt><tt> };</tt><tt><br>
</tt><tt><br>
</tt><tt> int vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv);</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> /* Load the VLC engine */</tt><tt><br>
</tt><tt> libvlc = libvlc_new (vlc_argc, vlc_argv);</tt><tt><br>
</tt><tt><br>
</tt><tt> /* Create a new item */</tt><tt><br>
</tt><tt> m = libvlc_media_new_location (libvlc,
"rtsp://192.168.1.101:1235/axis-media/media.amp");</tt><tt><br>
</tt><tt><br>
</tt><tt> /* Create a media player playing environement */</tt><tt><br>
</tt><tt> mp = libvlc_media_player_new_from_media(m);</tt><tt><br>
</tt><tt><br>
</tt><tt> /* No need to keep the media now */</tt><tt><br>
</tt><tt> libvlc_media_release(m);</tt><tt><br>
</tt><tt><br>
</tt><tt><tt> /* play the media_player */</tt><tt><br>
</tt><tt> <b>libvlc_media_player_play(mp);</b></tt><tt><br>
</tt><br>
for (int i = 0; i < 60; i++) {</tt><tt><br>
</tt><tt> printf(".");</tt><tt><br>
</tt><tt> sleep(1);</tt><tt><br>
</tt><tt> fflush(stdout);</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt><br>
</tt><tt> /* Stop playing */</tt><tt><br>
</tt><tt> libvlc_media_player_stop (mp);</tt><tt><br>
</tt><tt><br>
</tt><tt> /* Free the media_player */</tt><tt><br>
</tt><tt> libvlc_media_player_release (mp);</tt><tt><br>
</tt><tt><br>
</tt><tt> libvlc_release (libvlc);</tt><tt><br>
</tt><br>
This works only if the original stream (<tt>rtsp://192.168.1.101:1235/axis-media/media.amp</tt>)
is already started before the transcoded stream (<tt>rtsp://192.168.1.101:5678/mjpeg/axis-media/media.amp</tt>)
is played.<br>
<br>
The above code needs to be integrated in my application which uses
the LIVE555 library in such a way that the user can directly play
the "transcoded camerastream" (<tt>rtsp://192.168.1.101:5678/mjpeg/axis-media/media.amp</tt>).<br>
<br>
Best regards,<br>
<br>
Frank van Eijkelenburg<br>
<br>
<div class="moz-cite-prefix">On 02-09-15 09:34, Ross Finlayson
wrote:<br>
</div>
<blockquote
cite="mid:DE4BA44A-EEA5-4E26-B5BE-FFBDAB593B86@live555.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<div>
<blockquote type="cite" class="">
<div class="">
<div bgcolor="#FFFFFF" text="#000000" class="">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”?</div>
</div>
</blockquote>
<div><br class="">
</div>
You create (using “ProxyServerMediaSession::createNew()”) a
single “ProxyServerMediaSession” object, with the “<a
moz-do-not-send="true" href="rtsp://%93" class="">rtsp://“</a>
URL for the ‘back-end’ stream, as usual.</div>
<div><br class="">
</div>
<div>However, you also pass - as the last parameter to
“ProxyServerMediaSession::createNew()” - a pointer to a
“MediaTranscodingTable” object. See
“liveMedia/include/MediaTranscodingTable.hh”.</div>
<div><br class="">
</div>
<div>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):</div>
<div><br class="">
</div>
<div>//////////</div>
<div>FramedFilter*
MyMediaTranscodingTable::lookupTranscoder(MediaSubsession& inputCodecDescription, char*& outputCodecName)
{<br class="">
if (strcmp(inputCodecDescription.codecName(), "MP4V-ES") ==
0) {<br class="">
outputCodecName = strDup("VP8");<br class="">
return myMPEG4toVP8VideoTranscoder::createNew(envir(),
inputCodecDescription.readSource());<br class="">
} else {<br class="">
outputCodecName = NULL;<br class="">
return NULL;</div>
<div> }<br class="">
}<br class="">
<div>//////////</div>
<div><br class="">
</div>
<div>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.</div>
<div class=""><br class="">
</div>
</div>
<div>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.)</div>
<br class="">
<br class="">
<div apple-content-edited="true" class="">
<span class="Apple-style-span" style="border-collapse: separate;
border-spacing: 0px;"><span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0);
font-family: Helvetica; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-align: -webkit-auto;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width:
0px; ">Ross Finlayson<br class="">
Live Networks, Inc.<br class="">
<a moz-do-not-send="true" href="http://www.live555.com/"
class="">http://www.live555.com/</a></span></span>
</div>
<br class="">
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
live-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:live-devel@lists.live555.com">live-devel@lists.live555.com</a>
<a class="moz-txt-link-freetext" href="http://lists.live555.com/mailman/listinfo/live-devel">http://lists.live555.com/mailman/listinfo/live-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>