Project

General

Profile

Einfache Live-TV + EPG Seite

Added by Mario Senska almost 5 years ago

Nabend Mädels und Jungs,

ich habe eine Einfache Seite gebastelt wo man Live-TV und EPG Daten von sein Tvheadend Server abgreift. Es läuft soweit gut. Test Systeme sind ein Mac Mini, Ipad und Ps4 Pro. Bei mir läuft Live-TV nicht unter den Browsern Google Ghrome und FireFox auf den Mac Mini. Auf den Safari zu 100% Auf dem Ipad läuft Live-Tv und Epg und den Browsern Safari und Google Ghrome. Leider geht unter Google Ghrome kein Vollbild. Auf der PS4 Pro läuft es zu 100% Es muss nur die Index.html bearbeitet werden für LiveTV und EPG. ist sehr einfach gehalten Für EPG Daten kann es über ein Script gemacht werden oder ein Link von de EPG Daten Beispiel. http://tvheadend:9981/api/epg/events/grid?channel=Das%20Erste. Ich mache es über ein Script da durch die Sicherheit von den Browsern über den Link nur Lokal läuft. Wenn es über Apache Webserver mache dann kommt dieser "[Error] Origin http://streaming-server is not allowed by Access-Control-Allow-Origin."

Leider muss man mehre Server haben um die TV Sender Zu Transcoden. Test Systeme sind 2 Raspberry PI 3. Einer wo Tvheadend läuft und mit Apache Webserver. Auf beide läuft auch ffmpeg aber zum Transcoden reicht die Power nicht aus sondern nur mit "copy" . Dadurch kann ich TV nur am Mac-Mini unter Safari kucken. Mit libx264 läuft es nur kurzzeitig dann stürzt ffmpeg ab. Wenn einer eine Alternative für libx264 hat dann raus damit.

Beispiel Script für ffmepg Transcoding

#!/bin/bash
cd /var/www/html/streams/kabeleins/

ffmpeg -i "http://admin:admin@tvheadend:9981/stream/channelid/1171664690?ticket=052D51AD0F841279B90070FB5C48C2180A17FC11&profile=htsp" \
    -map v:0 -c:v:0 copy \
    -map a:0 -c:a copy \
    -f hls -hls_time 4 -hls_flags delete_segments \
    -master_pl_name master.m3u8 \
    -var_stream_map "v:0,a:0" index.m3u8

#ffmpeg -i "http://admin:admin@tvheadend:9981/stream/channelid/1171664690?ticket=052D51AD0F841279B90070FB5C48C2180A17FC11&profile=htsp" \
#    -map v:0 -c:v:0 libx264 -crf 25 -preset veryfast \
#    -map a:0 -c:a aac -b:a 128k -ac 2 \
#    -f hls -hls_time 4 -hls_flags delete_segments \
#    -master_pl_name master.m3u8 \
#    -var_stream_map "v:0,a:0" index.m3u8

Beispiel EPG über ein Script Abgreifen von TVheadend.

#! /bin/sh

# Privat
wget http:/tvheadend:9981/api/epg/events/grid?channel=VOX --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_vox.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=SAT.1 --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_sat1.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=SAT.1%20Gold --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_sat1gold.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=RTL%20Television --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_rtl.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=RTL2 --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_rtl2.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=RTLplus --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_rtlplus.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=NITRO --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_nitro.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=SUPER%20RTL --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_superrtl.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=ProSieben --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_prosieben.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=Pro7%20MAXX --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_pro7maxx.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=kabel%20eins --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_kabeleins.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=TOGGO%20plus --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_toggoplus.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=SIXX --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_sixx.xml
wget http://tvheadend:9981/api/epg/events/grid?channel=ANIXE%2B --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_anixesd.xml
wget http://tvheadend:9981/api/epg/events/grid?channel=TELE%205 --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_tele5.xml

# Narichen
wget http:/tvheadend:9981/api/epg/events/grid?channel=WELT --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_welt.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=n-tv --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_ntv.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=phoenix --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_phoenix.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=phoenix%20HD --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_phoenixhd.xml

# Dokumentation
wget http:/tvheadend:9981/api/epg/events/grid?channel=DMAX --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_dmax.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=N24%20DOKU --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_n24doku.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=kabel%20eins%20Doku --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_kabeleinsdoku.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=TLC --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_tlc.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=arte --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_arte.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=arte%20HD --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_artehd.xml

# Öffentliche
wget http:/tvheadend:9981/api/epg/events/grid?channel=Das%20Erste --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_daserste.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=ZDF --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_zdf.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=Das%20Erste%20HD --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_daserstehd.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=ZDF%20HD --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_zdfhd.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=3sat --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_3sat.xml
wget http:/tvheadend:9981/api/epg/events/grid?channel=3sat%20HD --user=admin --password=admin -O https://streaming-server/epg/tvheadend_epg_3sathd.xml

Index.html

<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title id="text0"></title>
<body onload="set_style_from_cookie()">
<link rel="stylesheet" type="text/css" title="white" href="Live-TV/Skins/white.css">
<link rel="alternate stylesheet" type="text/css" title="orange" href="Live-TV/Skins/orange.css">
<link rel="alternate stylesheet" type="text/css" title="blue" href="Live-TV/Skins/blue.css">
<link rel="alternate stylesheet" type="text/css" title="green" href="Live-TV/Skins/green.css">
<link rel="alternate stylesheet" type="text/css" title="red" href="Live-TV/Skins/red.css">
<div id="notmark">
<div class="dragBoxLeft" onmousedown="dragStart(this);">
<h3 id="text00"></h3>
<div class="skin-container">
<div class="cleanPlayer">
<video preload="none" title="Vox" descr="LiveTV from Dreambox"><source src="http://XXX.XXX.X.XXX/streams/vox/master.m3u8"></video>
<video preload="none" title="RTL" descr="LiveTV from Dreambox"><source src="http://XXX.XXX.X.XXX/streams/rtl/master.m3u8"></video>
<video preload="none" title="Nitro" descr="LiveTV from Dreambox"><source src="http://XXX.XXX.X.XXX/streams/nitro/master.m3u8"></video>
<video preload="none" title="Kabeleins" descr="LiveTV from Tvheadend"><source src="http://XXX.XXX.X.XXX/streams/kabeleins/master.m3u8"></video>
<video preload="none" title="Kabeleins Doku" descr="LiveTV from Tvheadend"><source src="http://XXX.XXX.X.XXX/streams/kabeleinsdoku/master.m3u8"></video>
<video preload="none" title="Sat1" descr="LiveTV from Tvheadend"><source src="http://XXX.XXX.X.XXX/streams/sat1/master.m3u8"></video>
<video preload="none" title="Welt" descr="LiveTV"><source src="https://live2weltcms-lh.akamaihd.net/i/Live2WeltCMS_1@444563/master.m3u8"></video>
<video preload="none" title="Arte" descr="LiveTV"><source src="http://artelive-lh.akamaihd.net/i/artelive_de@393591/master.m3u8"></video>
<video preload="none" title="Das Erste" descr="LiveTV "><source src="https://mcdn.daserste.de/daserste/de/master_1960.m3u8"></video>
<video preload="none" title="ZDF" descr="LiveTV"><source src="http://zdf-hls-01.akamaized.net/hls/live/2002460/de/high/master.m3u8"></video>
<video preload="none" title="3sat" descr="LiveTV"><source src="http://zdfhls18-i.akamaihd.net/hls/live/744751/dach/high/master.m3u8"></video>
<video preload="none" title="one" descr="LiveTV"><source src="http://onelivestream-lh.akamaihd.net/i/one_livestream@568814/master.m3u8"></video>
<video preload="none" title="Phoenix" descr="LiveTV"><source src="http://zdfhls19-i.akamaihd.net/hls/live/744752/de/high/master.m3u8"></video>
</div> <!-- cleanPlayer -->
<div id="cleanEPG" class="active">
<button tooltip="Vox" class="btn" onclick="Container('Show'); Address('epg/tvheadend_epg_vox.xml');">EPG</button>
<button tooltip="RTL" class="btn" onclick="Container('Show'); Address('epg/tvheadend_epg_rtl.xml');">EPG</button>
<button tooltip="Nitro" class="btn" onclick="Container('Show'); Address('epg/tvheadend_epg_nitro.xml');">EPG</button>
<button tooltip="Kabeleins"class="btn" onclick="Container('Show'); Address('epg/tvheadend_epg_kabeleins.xml');">EPG</button>
<button tooltip="Kabeleins Doku" class="btn" onclick="Container('Show'); Address('epg/tvheadend_epg_kabeleinsdoku.xml');">EPG</button>
<button tooltip="Sat1" class="btn" onclick="Container('Show'); Address('epg/tvheadend_epg_sat1.xml');">EPG</button>
<button tooltip="Welt" class="btn" onclick="Container('Show'); Address('epg/tvheadend_epg_welt.xml');">EPG</button>
<button tooltip="Arte" class="btn" onclick="Container('Show'); Address('epg/tvheadend_epg_arte.xml');">EPG</button>
<button tooltip="Das Erste" class="btn" onclick="Container('Show'); Address('http://tvheadend:9981/api/epg/events/grid?channel=Das%20Erste','admin','admin');">EPG</button>
<button tooltip="ZDF" class="btn" onclick="Container('Show'); Address('epg/tvheadend_epg_zdf.xml');">EPG</button>
<button tooltip="3sat" class="btn" onclick="Container('Show'); Address('epg/tvheadend_epg_3sat.xml');">EPG</button>
<button tooltip="one" class="btn" onclick="Container('Show'); Address('epg/tvheadend_epg_one.xml');">EPG</button>
<button tooltip="Phoenix" class="btn" onclick="Container('Show'); Address('epg/tvheadend_epg_phoenix.xml');">EPG</button>
<div class="skin-controls">
<span class="ButtonSkinWhite"><button onclick="switch_style('white');return false;">White</button></span>
<span class="ButtonSkinBlue"><button onclick="switch_style('blue');return false;">Blue</button></span>
<span class="ButtonSkinOrange"><button onclick="switch_style('orange');return false;">Orange</button></span>
<span class="ButtonSkinGreen"><button onclick="switch_style('green');return false;">Green</button></span>
<span class="ButtonSkinRed"><button onclick="switch_style('red');return false;">Red</button></span>
</div> <!-- skin-controls --> </div> <!-- cleanEPG --> <!-- active --> </div> <!-- skin-container --> </div> <!-- dragBoxLeft -->
<div id="Show" style="display: none;">
<div class="dragBoxRight" onmousedown="dragStart(this);">
<h3 id="text000"></h3>
<span class="ButtonExit"><a class="inactive active" tooltip="Beenden" onclick="ContainerClose('Show');">X</a></span>
<div id="result_epg"></div>
</div> <!-- dragBoxRight --> </div> <!-- Show --> </div> <!-- notmark -->
</body>
<script src="Live-TV/jquery-1.12.4.min.js"></script>
<script src="Live-TV/clean-html-player.js"></script>
</html>

Replies (1)

RE: Einfache Live-TV + EPG Seite - Added by saen acro almost 5 years ago

Translate to English so everyine to understand.
Read for persistent authentication it is not good idea to send credentials in url.

you can embed to tvh interface
ex
http://tvh:9981/webplay

    (1-1/1)