Re: Re: MMS stream

Home › Forums › Third Party Enhancements › VLC Shares › MMS stream › Re: Re: MMS stream

#30155
zany130
Member
$thread->log("Spawning RTMPDump (rtmpgw)...");

This simply add a new line in the log file…….

This patch should work for you (not tested)


Index: library/X/Streamer/Engine/RtmpDump.php
===================================================================
--- library/X/Streamer/Engine/RtmpDump.php (revision 706)
+++ library/X/Streamer/Engine/RtmpDump.php (working copy)
@@ -73,12 +73,33 @@
*/
public function startEngine(X_Threads_Thread $thread) {
// assume all parameters are ready
- $thread->log("Spawning RTMPDump (rtmpgw)...");
+ $thread->log("Spawning RTMPDump (rtmpdump | vlc)...");
$source = $this->getParam('source');
- $command = (string) X_RtmpDump::getInstance()->parseUri($source)->setStreamPort(X_VlcShares_Plugins::helpers()->rtmpdump()->getStreamPort());
- X_Env::execute($command, X_Env::EXECUTE_OUT_NONE, X_Env::EXECUTE_PS_WAIT);
- //$this->vlc->spawn();
- $thread->log("RTMPDump execution finished");
+
+ if ( X_VlcShares_Plugins::helpers()->streamer()->isRegistered('vlc') ) {
+
+ $command = (string) X_RtmpDump::getInstance()->parseUri($source)
+ /*->setStreamPort(X_VlcShares_Plugins::helpers()->rtmpdump()->getStreamPort())*/
+ ;
+
+ $streamPort = X_VlcShares_Plugins::helpers()->rtmpdump()->getStreamPort();
+
+ // try to get reference to vlc-streamer
+ /* @var $vlcStreamer X_Streamer_Engine_Vlc */
+ $vlcStreamer = X_VlcShares_Plugins::helpers()->streamer()->get('vlc');
+
+ $vlcStreamer->getVlcWrapper()->setPipe($command);
+ $vlcStreamer->setSource('-');
+ $vlcStreamer->setParam('profile', "#std{access=http{mime=video/x-flv},mux=ffmpeg{mux=flv},dst=0.0.0.0:{$streamPort}/}");
+
+ //X_Env::execute($command, X_Env::EXECUTE_OUT_NONE, X_Env::EXECUTE_PS_WAIT);
+ $vlcStreamer->getVlcWrapper()->spawn();
+ //$this->vlc->spawn();
+ $thread->log("RTMPDump execution finished");
+
+ } else {
+ $thread->log("RTMPDump cannot be started without vlc streamer");
+ }

}

Index: library/X/RtmpDump.php
===================================================================
--- library/X/RtmpDump.php (revision 761)
+++ library/X/RtmpDump.php (working copy)
@@ -221,7 +221,7 @@
if ( !X_Env::isWindows() ) {
X_Env::execute("kill -9 `ps aux | grep {$this->path} | grep -v grep | awk '{print $2}'`", X_Env::EXECUTE_OUT_NONE, X_Env::EXECUTE_PS_WAIT);
} else {
- X_Env::execute("taskkill /IM rtmpgw.exe /F", X_Env::EXECUTE_OUT_NONE, X_Env::EXECUTE_PS_WAIT);
+ X_Env::execute("taskkill /IM rtmpdump.exe /F", X_Env::EXECUTE_OUT_NONE, X_Env::EXECUTE_PS_WAIT);
}

}

After you apply this patch to the code, go inside vlc-shares configurations, rtmpdump helper configs (http://localhost/vlc-shares/gconfigs/index/filter/helpers%3Artmpdump) and set Path to RTMPDump rtmpgw to the path to the rtmpdump.exe file (not rtmpgw.exe)

This work only for vlc-shares 0.5.5 and vlc 2.0+

This is my last advice about this