Videolan TV-Streaming and remote channel changing SUCCESSFUL
Posted: 31 Jan 2005 11:55
hi there! i just made it to use videolan as streaming server with remote channel changing without remote desktop, vnc or other remote desktop software:
what i did:
i've taken the latest nightly build (why: it supports the channel settings using the commandline, it's not implemented in 0.8.1 yet).
i've installed a webserver (e.g. http://www.jana-server.de (freeware)) and a scripting engine ([url]www.php.net[url]).
the webserver now can start the videolan client remotely using the commandline parameters for streaming and channel selection.
the webserver can stop the vlc using kill.exe (included in nt-resource kitt, search for kill.exe in google).
what it supports:
enable localplay / only streaming
set audio/video coded and bitrate
file streaming
udp streaming
what you have to do:
install server (web+php)
edit pages (use your path settings, set channels, directshow device (tv-card))
download nighly build or 0.8.?? (where the commandline options --dshow-tuner-channel and --dshow-tuner-country are supported
a sample commandline-call:
i hope to give all of your hungry people for remote channel changing a clue how to do this. if you have any additionaly questions, feel free to ask. i'll answer here in the forum. my mailadress is: thomas _at _ familie _hyphen_ hofer _dot_ net
but please dont ask me questions about installing and running a webserver and/or php or accessing it from out of your lan. just see the other threads or newsgroups for this or ask your sysadmin
have fun, yours, thomas
i will attach the source codes in the following:
control.php
this is the main html page. it's in php for enabling the script to sniff the client's ip adress, so it can already fill it in the input field for udp-streaming
stop.php
it stops the vlc by killing it's task:
start.php
it starts the vlc using the parameters in passed from control.php
[/code]
what i did:
i've taken the latest nightly build (why: it supports the channel settings using the commandline, it's not implemented in 0.8.1 yet).
i've installed a webserver (e.g. http://www.jana-server.de (freeware)) and a scripting engine ([url]www.php.net[url]).
the webserver now can start the videolan client remotely using the commandline parameters for streaming and channel selection.
the webserver can stop the vlc using kill.exe (included in nt-resource kitt, search for kill.exe in google).
what it supports:
enable localplay / only streaming
set audio/video coded and bitrate
file streaming
udp streaming
what you have to do:
install server (web+php)
edit pages (use your path settings, set channels, directshow device (tv-card))
download nighly build or 0.8.?? (where the commandline options --dshow-tuner-channel and --dshow-tuner-country are supported
a sample commandline-call:
Code: Select all
start c:\Programme\VideoStream\VLC\vlc.exe --intf=http --http-host=127.0.0.1:9001 dshow:// --dshow-vdev="TV Capture Card Capture" --dshow-adev="SB Live! Wave Device" --dshow-tuner-channel=44 --dshow-tuner-country=43 --dshow-tuner-input=1 --dshow-chroma=I420 :sout=#transcode{vcodec=DIV3,vb=192,acodec=mp4a,ab=16,channels=2,scale=1}:duplicate{dst=std{access=udp,mux=ts,url="192.168.1.247:1234"}}
but please dont ask me questions about installing and running a webserver and/or php or accessing it from out of your lan. just see the other threads or newsgroups for this or ask your sysadmin
have fun, yours, thomas
i will attach the source codes in the following:
control.php
this is the main html page. it's in php for enabling the script to sniff the client's ip adress, so it can already fill it in the input field for udp-streaming
Code: Select all
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<base target="status">
</head>
<body>
<p>
<form name="start" action="start.php" method="post">
</p>
<img src="televisiontuner.gif" align="left" height="50" width="52"><H1>Steuerung</H1>
<p>
<select name="vdevice" size="1">
<option value="TV Capture Card Capture">TV Capture Card Capture</option>
</select>
<select name="adevice" size="1">
<option value="SB Live! Wave Device">SB Live! Wave Device</option>
</select>
<input type="checkbox" name="localplay" value="yes" checked="checked">lokal
<hr>
</p>
<img src="channels.gif" align="left" height="50" width="54"><H1>Kanal</H1>
<p>
<select name="channel" size="1">
<option value="41">ORF 1</option>
<option value="44">ORF 2</option>
<option value="51">ATV+</option>
<option value="85">ARD</option>
<option value="76">ZDF</option>
<option value="72">RTL</option>
<option value="63">RTL2</option>
<option value="131">Super-Rtl</option>
<option value="80">Sat1</option>
<option value="94">Pro7</option>
<option value="112">VOX</option>
<option value="122">Kabel1</option>
<option value="0"></option>
<option value="38">3Sat</option>
<option value="89">SF1</option>
<option value="0"></option>
<option value="57">LT 1</option>
<option value="54">Liwest Info</option>
<option value="0"></option>
<option value="119">MTV</option>
<option value="133">GO!</option>
<option value="0"></option>
<option value="102">DSF</option>
<option value="106">Eurosport</option>
<option value="0"></option>
<option value="127">CNBC</option>
<option value="60">CNN</option>
<option value="98">BBC</option>
<option value="0"></option>
<option value="91">BR3</option>
<option value="117">BW</option>
<option value="129">n-tv</option>
<option value="141">NDR</option>
<option value="143">MDR</option>
<option value="109">Kinderkanal</option>
<option value="0"></option>
<option value="145">AstroTV????</option>
<option value="0"></option>
<option value="135">9-live</option>
<option value="124">Home Shopping</option>
<option value="137">TV5</option>
<option value="139">Rai-Uno</option>
</select>
<hr>
</p>
<img src="streaming.jpg" align="left" width="59" height="50"><H1>Streaming</H1>
<p>
<table border="0">
<tr><td><input type="radio" name="streaming" value="none" onClick="document.start.filename.disabled=true;document.start.udptargethost.disabled=true;document.start.udptargetport.disabled=true;"> kein</td><td></td></tr>
<tr><td><input type="radio" name="streaming" value="file" onClick="document.start.filename.disabled=false;document.start.udptargethost.disabled=true;document.start.udptargetport.disabled=true;"> in Datei</td><td>Dateiname <input type="text" name="filename" size="20" value="default.temp" disabled="disabled"> (Freigabe: \\zwettl\streaming\)</td></tr>
<tr><td><input type="radio" name="streaming" value="udp" checked="checked" onClick="document.start.filename.disabled=true;document.start.udptargethost.disabled=false;document.start.udptargetport.disabled=false;"> zu Computer</td><td>IP-Adresse <input type="text" name="udptargethost" size="20" value="<?php echo (getenv ("REMOTE_ADDR"));?>"> Port <input type="text" name="udptargetport" size="5" value="1234"></td></tr>
</table>
<hr>
</p>
<img src="icon_configure.jpg" align="left" height="50" width="45"><H1>Quality Settings</H1>
<p>
<table border="1">
<tr>
<td>
Video: Bitrate
</td><td>
<select name="vbr" size="1">
<option>64</option>
<option>128</option>
<option selected="selected">192</option>
<option>256</option>
<option>384</option>
<option>512</option>
<option>768</option>
<option>1024</option>
<option>1536</option>
<option>2048</option>
<option>4096</option>
<option>8192</option>
<option>16384</option>
</select>
</td><td>
Codec
</td><td>
<select name="vcodec" size="1">
<option>mp3v</option>
<option>DIV2</option>
<option selected="selected">DIV3</option>
</select>
</td></tr>
<tr><td>
Audio: Bitrate
</td><td>
<select name="abr" size="1">
<option>4</option>
<option>8</option>
<option selected="selected">16</option>
<option>32</option>
<option>64</option>
<option>128</option>
<option>192</option>
<option>256</option>
</select>
</td><td>
Codec
</td><td>
<select name="acodec" size="1">
<option selected="selected">mp4a</option>
<option>a52</option>
</select>
</td></tr>
<tr><td>
Skalierung
</td><td>
<select name="scale" size="1">
<option value="1" selected="selected">100%</option>
<option value="0.75">75%</option>
<option value="0.5">50%</option>
<option value="0.25">25%</option>
</select>
</td><td>
</td><td>
</td></tr>
</table>
<hr>
</p>
<table border="0" align="center">
<tr>
<td>
<button type="submit" style="width:120px;height:50px">
<p align="center" style="font-size:8pt"><img src="play.gif" width="20" height="20"><br>start</p>
</button>
</form>
</td>
<td>
<form action="stop.php" method="post">
<button type="submit" style="width:120px;height:50px">
<p align="center" style="font-size:8pt"><img src="stop.gif" width="20" height="20"><br>stop</p>
</button>
</form>
</td>
</tr>
</table>
<hr>
</p>
</body>
</html>
it stops the vlc by killing it's task:
Code: Select all
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<?php
//first kill running vnc process
exec("kill.exe vlc.exe");
?>
<p class="status">gestoppt...</p>
</body>
</html>
it starts the vlc using the parameters in passed from control.php
Code: Select all
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p class="status">Parameter:
<?php
$streamdir = "c:\\Programme\\VideoStream\\Streaming\\";
$dir = "c:\\Programme\\VideoStream\\VLC\\";
$command = "vlc.exe";
$httpserver = "";
$directshow = "";
$stream = "";
//first kill running vnc process
exec("kill.exe vlc.exe");
if (isset($_POST['localplay'])) {
echo ("lokal:ja ");
// $httpserver = "--extraintf=http --http-host=127.0.0.1:9001";
$httpserver = "";
} else {
echo ("lokal: nein ");
$httpserver = "--intf=http --http-host=127.0.0.1:9001";
}
$directshow = "dshow:// --dshow-vdev=\"" . $_POST['vdevice'] ."\" --dshow-adev=\"". $_POST['adevice'] . "\" --dshow-tuner-channel=" . $_POST['channel'] . " --dshow-tuner-country=43 --dshow-tuner-input=1 --dshow-chroma=I420";
if ($_POST['streaming'] == "none") {
echo ("stream: kein");
} else {
//:sout=#transcode{vcodec=mp4v,vb=1024,scale=1,acodec=mp3,ab=192,channels=2}:duplicate{dst=std{access=file,mux=ts,url="c:\temp\file.txt"}}
//:sout=#transcode{vcodec=DIV3,vb=1024,scale=1,acodec=mp3,ab=192,channels=2}:duplicate{dst=std{access=file,mux=ts,url="c:\temp\file.txt"}}
//:sout=#transcode{vcodec=DIV3,vb=1024,scale=1,acodec=mp4a,ab=192,channels=2}:duplicate{dst=std{access=file,mux=ts,url="c:\temp\file.txt"}}
//:sout=#transcode{vcodec=DIV3,vb=256,scale=1,acodec=mp4a,ab=64,channels=2}:duplicate{dst=std{access=file,mux=ts,url="c:\temp\file.txt"}}
//:sout=#transcode{vcodec=DIV3,vb=256,scale=1,acodec=mp4a,ab=64,channels=2}:duplicate{dst=std{access=file,mux=raw,url="c:\temp\file.txt"}}
//:sout=#transcode{vcodec=mp4v,vb=1024,scale=1,acodec=mpga,ab=192,channels=2}:duplicate{dst=display,dst=std{access=file,mux=ts,url="c:\temp\aa.avi"}}
//:sout=#transcode{vcodec=mp4v,vb=1024,scale=1,acodec=mpga,ab=192,channels=2}:duplicate{dst=std{access=udp,mux=ts,url=192.168.1.1:1234}}
$stream = ":sout=#transcode{vcodec=" . $_POST['vcodec'] .",vb=" . $_POST['vbr'] . ",acodec=" . $_POST['acodec'] .",ab=" . $_POST['abr'] . ",channels=2,scale=". $_POST['scale'] ."}";
$stream = $stream . ":duplicate{";
if (isset($_POST['localplay'])) {
$stream = $stream . "dst=display,";
}
if ($_POST['streaming'] == "file") {
echo ("file " . $_POST['filename'] . " ");
$stream = $stream . "dst=std{access=file,mux=ts,url=\"";
$stream = $stream . $streamdir;
$stream = $stream . $_POST['filename'];
$stream = $stream . "\"}}";
} else
if ($_POST['streaming'] == "udp") {
echo ("udp (".$_POST['udptargethost'] . ":" .$_POST['udptargetport'].") ");
$stream = $stream . "dst=std{access=udp,mux=ts,url=\"";
$stream = $stream . $_POST['udptargethost'] . ":" .$_POST['udptargetport'];
$stream = $stream . "\"}}";
}
}
$commandline = "start " . $dir . $command . " " . $httpserver . " " . $directshow . " " . $stream;
echo ("<br><b>" . $commandline . "</b>");
pclose(popen($commandline, "r"));
?>
</p>
</body>
</html>
[/code]