Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung Letzte Überarbeitung Beide Seiten der Revision | ||
streaming-server [2011/02/24 14:09] admin |
streaming-server [2011/06/09 13:10] admin |
||
---|---|---|---|
Zeile 3: | Zeile 3: | ||
*Maxdata silber, Intel P4 | *Maxdata silber, Intel P4 | ||
*openSUSE 11.3 32-Bit | *openSUSE 11.3 32-Bit | ||
+ | * Benutzer: stream (wichtig für vlc!!!) | ||
*40 GB HDD | *40 GB HDD | ||
*2GB RAM | *2GB RAM | ||
+ | |||
+ | ====== Für Maturaball ====== | ||
+ | |||
+ | *Videokammerl: Raum 114, Netzwerkdose auf A gepatcht | ||
+ | *Strom für Kamera: Steckdose hinter Scheinwerfer 1. OG auf Höhe Chemiekammerl | ||
+ | * **Anschaffung für Maturaball 2012: 1 langes Kabel!!!** | ||
====== Vorbereitungen ====== | ====== Vorbereitungen ====== | ||
+ | |||
+ | *Packman-Repository | ||
+ | |||
+ | zypper ar -f http://packman.inode.at/suse/11.3 packman | ||
+ | |||
+ | *Software | ||
+ | |||
+ | zypper in ffmpeg vlc mplayer flash-player x11vnc xawtv | ||
*Canon Kamera | *Canon Kamera | ||
*Ausgang Canon-Klinke <-> Cinch (RCA) <-> S-Video | *Ausgang Canon-Klinke <-> Cinch (RCA) <-> S-Video | ||
- | * **Anschaffung für Maturaball 2012: 1 langes Kabel!!!** | ||
*Medion TV Karte | *Medion TV Karte | ||
- | */etc/init.d/boot.local | ||
- | <code bash> | + | <code bash /etc/init.d/boot.local> |
modprobe bttv card=54 | modprobe bttv card=54 | ||
</code> | </code> | ||
Zeile 25: | Zeile 38: | ||
xawtv | xawtv | ||
+ | |||
+ | *Beim ersten Mal funktioniert xawtv nie, mit q beenden. Dann beim zweiten Mal die Videoquelle und das Bildformat umstellen (rechte Maustaste, PAL, S-Video) | ||
===== LIVE Video und Audio ===== | ===== LIVE Video und Audio ===== | ||
Zeile 51: | Zeile 66: | ||
===== Streamen ===== | ===== Streamen ===== | ||
- | *http://bgweiz.at:31337 | + | *Extern ins Internet: vlc -> Netzwerkstream öffnen -> http://bgweiz.at:31337 |
- | *http://192.168.100.40:8080 | + | *Auf Einstein Port-Forwarding aktivieren, siehe /etc/init.d/iptables.sh |
+ | |||
+ | *Hausintern: vlc -> Netzwerkstream öffnen -> http://192.168.100.40:8080 | ||
<code bash stream.sh> | <code bash stream.sh> | ||
Zeile 77: | Zeile 94: | ||
* Am Client TightVNC Server installieren | * Am Client TightVNC Server installieren | ||
* Zusätzlich Remote-Desktop erlauben | * Zusätzlich Remote-Desktop erlauben | ||
+ | |||
+ | ---- | ||
+ | =====Videostreaming===== | ||
+ | ==== Servervoraussetzungen ==== | ||
+ | |||
+ | *openSUSE 11.1 | ||
+ | *root, uS.... | ||
+ | *Kartenname: Bt878 | ||
+ | *Treiber bttv | ||
+ | *Soundkarte: Intel ICH6 | ||
+ | *[[http://wiki.ubuntuusers.de/BT878|Link]] | ||
+ | |||
+ | dmesg | grep bttv => card=54 | ||
+ | | ||
+ | rmmod bt878 bttv | ||
+ | |||
+ | modprobe bttv card=54 | ||
+ | |||
+ | */etc/modprobe.d/tv_bttv | ||
+ | |||
+ | options bttv card=54 | ||
+ | |||
+ | ==== Video Kanäle ==== | ||
+ | |||
+ | *0 = Television | ||
+ | *1 = Composite | ||
+ | *2 = s-video | ||
+ | |||
+ | ==== Port-Weiterleitung ==== | ||
+ | |||
+ | <code bash iptables.sh> | ||
+ | #!/bin/bash | ||
+ | |||
+ | iptables -F | ||
+ | iptables -X | ||
+ | iptables -t nat -F | ||
+ | iptables -t nat -X | ||
+ | iptables -t mangle -F | ||
+ | iptables -t mangle -X | ||
+ | iptables -P INPUT ACCEPT | ||
+ | iptables -P FORWARD ACCEPT | ||
+ | iptables -P OUTPUT ACCEPT | ||
+ | |||
+ | echo 1 > /proc/sys/net/ipv4/ip_forward | ||
+ | iptables -F -t nat | ||
+ | iptables -t nat -A PREROUTING -p tcp --dport 31337 -j DNAT --to 192.168.100.40:31337 | ||
+ | iptables -t nat -A POSTROUTING -j MASQUERADE | ||
+ | </code> | ||
+ | |||
+ | ==== Alter Gentoo-Server (2008) ==== | ||
+ | |||
+ | *Gentoo 2009 | ||
+ | *PW: TW... | ||
+ | *Wenn nötig X installieren : [[http://www.gentoo.org/doc/en/xorg-config.xml|http://www.gentoo.org/doc/en/xorg-config.xml]] | ||
+ | |||
+ | */etc/modules.autoload.d/kernel-2.6 | ||
+ | |||
+ | bttv card=54 | ||
+ | |||
+ | *ffmpeg installieren: | ||
+ | |||
+ | emerge ffmpeg | ||
+ | |||
+ | <code /etc/ffserver.conf> | ||
+ | Port 8090 | ||
+ | BindAddress 0.0.0.0 | ||
+ | MaxHTTPConnections 1000 | ||
+ | MaxClients 1000 | ||
+ | MaxBandwidth 2000 | ||
+ | CustomLog - | ||
+ | NoDaemon | ||
+ | |||
+ | ################################################################## | ||
+ | |||
+ | <Feed feed1.ffm> | ||
+ | File /tmp/feed1.ffm | ||
+ | FileMaxSize 50M | ||
+ | ACL allow 127.0.0.1 | ||
+ | </Feed> | ||
+ | |||
+ | ################################################################## | ||
+ | |||
+ | # JPEG | ||
+ | |||
+ | <Stream test.jpg> | ||
+ | Feed feed1.ffm | ||
+ | Format jpeg | ||
+ | VideoFrameRate 2 | ||
+ | VideoIntraOnly | ||
+ | VideoSize 480x384 | ||
+ | #NoAudio | ||
+ | Strict -1 | ||
+ | </Stream> | ||
+ | |||
+ | #Flash | ||
+ | |||
+ | <Stream stream.swf> | ||
+ | Feed feed1.ffm | ||
+ | VideoBitRate 256 | ||
+ | VideoFrameRate 25 | ||
+ | VideoBufferSize 80000 | ||
+ | Format swf | ||
+ | VideoFrameRate 25 | ||
+ | VideoSize 480x384 | ||
+ | VideoQMin 3 | ||
+ | VideoQMax 5 | ||
+ | VideoCodec flv | ||
+ | #NoAudio | ||
+ | PreRoll 0 | ||
+ | </Stream> | ||
+ | |||
+ | ################################################################## | ||
+ | # Special streams | ||
+ | |||
+ | # Server status | ||
+ | |||
+ | <Stream stat.html> | ||
+ | Format status | ||
+ | |||
+ | # Only allow local people to get the status | ||
+ | ACL allow localhost 192.168.100.0 | ||
+ | #ACL allow 10.0.0.0 10.0.0.255 | ||
+ | #ACL allow 0.0.0.0 | ||
+ | |||
+ | #FaviconURL http://pond1.gladstonefamily.net:8080/favicon.ico | ||
+ | </Stream> | ||
+ | |||
+ | <Redirect index.html> | ||
+ | URL http://www.ffmpeg.org/ | ||
+ | </Redirect> | ||
+ | |||
+ | </code> | ||
+ | |||
+ | *ffserver starten | ||
+ | |||
+ | ffmpeg -y -v 9 -f video4linux2 -vc 2 -tvstd PAL -s 480x384 -r 25 -i /dev/video0 -vcodec flv http://localhost:8090/feed1.ffm | ||
+ | |||
+ | === Stream speichern === | ||
+ | |||
+ | *ffmpeg und Download müssen mehr oder weniger gleichzeitig gestartet werden: | ||
+ | |||
+ | *ffserver und ffmpeg ganz normal wie oben erwähnt ausführen | ||
+ | *In den Ordner wechseln, in den man den Stream speichern will | ||
+ | |||
+ | w3m http://localhost:8090/stat.html | ||
+ | |||
+ | *stream.swf mit ENTER auswählen, Download starten | ||
+ | |||
+ | |||
+ | ==== Streaming mit ffmpeg (Ausgabe = Flash-Film = gute Qualität) ==== | ||
+ | |||
+ | <code /etc/ffserver.conf> | ||
+ | Port 31337 | ||
+ | #8090 | ||
+ | # bind to all IPs aliased or not | ||
+ | BindAddress 0.0.0.0 | ||
+ | # max number of simultaneous clients | ||
+ | MaxClients 1000 | ||
+ | # max bandwidth per-client (kb/s) | ||
+ | MaxBandwidth 10000 | ||
+ | # Suppress that if you want to launch ffserver as a daemon. | ||
+ | NoDaemon | ||
+ | |||
+ | <Feed feed1.ffm> | ||
+ | File /tmp/feed1.ffm | ||
+ | FileMaxSize 50M | ||
+ | </Feed> | ||
+ | |||
+ | <Stream stream.swf> | ||
+ | Feed feed1.ffm | ||
+ | Format swf | ||
+ | VideoCodec flv | ||
+ | VideoFrameRate 24 | ||
+ | VideoBufferSize 80000 | ||
+ | VideoBitRate 256 | ||
+ | #VideoQMin 1 | ||
+ | #VideoQMax 5 | ||
+ | VideoSize 352x288 | ||
+ | PreRoll 0 | ||
+ | Noaudio | ||
+ | </Stream> | ||
+ | |||
+ | </code> | ||
+ | |||
+ | *ffserver starten und laufen lassen | ||
+ | |||
+ | nb02:/etc # ffserver | ||
+ | |||
+ | *ffmpeg starten und laufen lassen | ||
+ | |||
+ | nb02:/etc # ffmpeg -r 24 -s 352x288 -f video4linux2 -i /dev/video0 http://localhost:31337/feed1.ffm | ||
+ | |||
+ | <code html stream.html> | ||
+ | <file> | ||
+ | <html> | ||
+ | <head><title>Live-Übertragung - Maturaball BG/BRG Weiz</title></head> | ||
+ | <body> | ||
+ | <embed src="http://84.119.8.108:31337/stream.swf" width=352 height=288 type="application/x-shockwave-flash"></embed> | ||
+ | </body> | ||
+ | </html> | ||
+ | </code> | ||
+ | |||
+ | ==== Streaming mit VLC (Ausgabe = Windows Media Stream = Schlechtere Qualität) ==== | ||
+ | |||
+ | *vlc -> Medien -> Streaming -> Aufnahmegerät öffnen (Einstellungen durchführen) -> Stream -> | ||
+ | *Outputs: Lokal wiedergeben, HTTP: ip-adresse PORT: 8080 | ||
+ | *Profil: windows (wmv,asf) | ||
+ | *Stream (bzw. ALT+S) | ||
+ | |||
+ | *Anschauen etwa mit: | ||
+ | |||
+ | mplayer http://ip-adresse:8080 | ||
+ | |||
+ | * oder im Internet in HTML eingebunden: | ||
+ | |||
+ | <code html stream.html> | ||
+ | <html> | ||
+ | <head><title>Live-Übertragung - Maturaball BG/BRG Weiz</title></head> | ||
+ | <body> | ||
+ | |||
+ | <object id="Player1" width="426" height="305" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" type="application/x-mplaye | ||
+ | r2"> | ||
+ | <param name="url" value="http://localhost:8080" /> | ||
+ | <param name="FileName" value="http://localhost:8080" /> | ||
+ | <param name="ShowControls" value="1" /> | ||
+ | <param name="ShowDisplay" value="0" /> | ||
+ | <param name="ShowStatusBar" value="1" /> | ||
+ | <param name="AutoSize" value="1" /> | ||
+ | <param name="stretchToFit" value=0 /> | ||
+ | <param name="AutoStart" value="1" /> | ||
+ | <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" | ||
+ | src="http://localhost:8080" Name="NSPlayer1" ShowControls="1" ShowDisplay="0" ShowStatusBar="1" AutoSize="0" AutoStart="1" wi | ||
+ | dth="426" height="305" /> | ||
+ | </object> | ||
+ | |||
+ | <a href="">Windows Media Player</a> bzw. <a href="">VLC</a> werden benötigt. | ||
+ | </body> | ||
+ | </html> | ||
+ | </code> |