Skip to content

Commit

Permalink
Minimal working version
Browse files Browse the repository at this point in the history
- gstreamer command line in config directory
  • Loading branch information
Dirk P. Janssen committed Apr 18, 2017
1 parent ae79510 commit 18b7184
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.#*
*~
segment*ts
playlist.m3u8
node_modules/
tt
1 change: 1 addition & 0 deletions 50x.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
something went very wrong! 50x
9 changes: 9 additions & 0 deletions config/gstreamer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

rm -f playlist.m3u8 segment000*.ts

gst-launch-1.0 \
videomixer name=mix sink_0::alpha=1 sink_1::ypos=460 sink_1::xpos=620 sink_1::alpha=.5 ! videoconvert ! x264enc tune=zerolatency ! \
mpegtsmux ! hlssink max-files=5 async-handling=true target-duration=5 \
avfvideosrc device-index=0 ! video/x-raw , width=800 ! mix. \
avfvideosrc device-index=1 ! videoscale method=0 ! video/x-raw, width=160 ! mix.
47 changes: 47 additions & 0 deletions config/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

worker_processes 1;


events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;


sendfile on;
keepalive_timeout 65;


server {
listen 8080;
server_name 0.0.0.0;


location / {
root html;
index index.html index.htm;
}

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

location ~ /\. {
deny all; return 404; }

location ~ /config {
deny all; return 404; }



}

include servers/*;
}
5 changes: 5 additions & 0 deletions crossdomain.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>
1 change: 1 addition & 0 deletions hlsjs
35 changes: 35 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to Ping Pong Cam</h1>


<script src="hlsjs/hls.light.min.js"></script>
<video id="video" controls></video>
<script>
if(Hls.isSupported()) {
var video = document.getElementById('video');
var hls = new Hls();
hls.loadSource('http://warroom.local:8080/playlist.m3u8');
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED,function() {
video.play();
});
}
</script>




</body>
</html>
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"hls.js": "^0.7.5"
}
}

0 comments on commit 18b7184

Please sign in to comment.