Commit c7e07ba6 authored by root's avatar root
Browse files

Initial commit

parents
#!/bin/bash
gst-launch-1.0 --gst-debug-level=2 -e compositor name=mix \
sink_0::xpos=0 sink_0::ypos=0 sink_0::alpha=50 \
sink_1::xpos=180 sink_1::ypos=0 \
sink_2::xpos=320 sink_2::ypos=0 \
sink_3::xpos=0 sink_3::ypos=180 \
sink_4::xpos=320 sink_4::ypos=180 \
! queue ! videoconvert ! x264enc ! h264parse \
! video/x-h264 ! queue ! flvmux name=mux \
! rtmpsink location='rtmp://nginx/stream live=true' \
videotestsrc pattern=2 is-live=1 \
! video/x-raw, width=640, height=360 ! timeoverlay \
! mix.sink_1 \
videotestsrc pattern=3 is-live=1 \
! video/x-raw, width=640, height=360 \
! mix.sink_2 \
videotestsrc pattern=4 is-live=1 \
! video/x-raw, width=640, height=360 \
! mix.sink_3 \
videotestsrc pattern=ball is-live=1 \
! video/x-raw, width=640, height=360 \
! mix.sink_0 \
souphttpsrc location="http://156.67.224.3/cgi-bin/faststream.jpg?stream=full&fps=12&rand=1231234534" timeout=5 do-timestamp=true \
! multipartdemux ! jpegdec ! video/x-raw \
! mix.sink_4 \
# ! xvimagesink \
# rtspsrc location=... ! decodebin \
# ! videoconvert ! videoscale \
# ! video/x-raw,width=320,height=180 \
# ! mix.sink_1 \
# ! rtmpsink location='rtmp://nginx/live live=true' \
# ! rtmpsink location='rtmp://nginx/live live=true' \
# videotestsrc pattern=1 is-live=1 \
# ! video/x-raw, width=640, height=360 \
# ! mix.sink_0 \
daemon off;
error_log /dev/stdout info;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
chunk_size 4000;
application stream {
live on;
hls on;
hls_fragment_naming system;
hls_fragment 5;
hls_playlist_length 10;
hls_path /opt/data/stream;
}
}
}
http {
access_log /dev/stdout combined;
server {
listen 80;
location /stream {
# Disable cache
add_header Cache-Control no-cache;
# CORS setup
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length';
# allow CORS preflight requests
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /opt/data;
}
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet static/stat.xsl;
}
location /static {
alias /www/static;
}
location = /crossdomain.xml {
root /www/static;
default_type text/xml;
expires 24h;
}
location /player {
root /www/static;
}
}
}
<html>
<head>
<link href="video-js.min.css" rel="stylesheet">
</head>
<body>
<video-js id=vid1 width=600 height=300 class="vjs-default-skin" controls>
<source
src="../stream/.m3u8"
type="application/x-mpegURL">
</video-js>
<script src="video.min.js"></script>
<script src="videojs-http-streaming.min.js"></script>
<script>
var player = videojs('vid1');
player.play();
</script>
</body></html>
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
version: "3"
services:
gst:
image: restreamio/gstreamer:latest-prod
volumes:
- ./data/gst:/srv
command: sh /srv/launch.sh
nginx:
# image: nginx:latest
# build: nginx
image: alfg/nginx-rtmp
volumes:
- ./data/nginx/nginx.conf:/etc/nginx/nginx.conf.template:ro
- ./data/nginx/player:/www/static/player:ro
ports:
- 80:80
# nginx:
# image: "nginx:latest"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment