Showing tvheadend stream in web app

Added by ilja leiko 7 days ago

Hey all.

Now:
The way it all works now: tvheadend is receiving digital TV using usb dongle. I can click "play" button and it downloads jebrish-named file to my laptop, which i can open with vlc and watch.

Question:
Has anyone made it work on custom build web app? I have a locally deployed web server written on Flask (it is deployed on the same machine, where tvheadend+dongle are installed). Is there anyway i can make the video play from my web app? So my users could just navigate to http://localhost:5000/video and see channels from tvheadend and play those, without downloading vlc or any other files?

Thank you in advance!
Any help is highly appreciated!


Replies (14)

RE: Showing tvheadend stream in web app - Added by saen acro 7 days ago

You need web player with support HTTP-TS streams
with also support play list.

aka user open page with player
player take playlist with or without autentification
from http://tvh_addres:9981/playlist
/rewrite playlist if authentication used/
play stream

RE: Showing tvheadend stream in web app - Added by ilja leiko 6 days ago

Hey, saen acro. Thank you for your reply.

Is the output stream from tvheadend falls under HTTP-TS stream category? I have very limited knowledge in different streaming profiles, but I could not find any information about HTTP-TS streams while googling.

Do you by any chance know any web players(with playlist support) to play HTTP-TS streams? I have tried looking online, but unfortunately couldn't find any.

The only one i came across was JWplayer, but it's super pricey. And at this point, i would like to go with any possible free solution.

Thank you.

RE: Showing tvheadend stream in web app - Added by ilja leiko 6 days ago

Hey all.

I have found a similar problem here - https://tvheadend.org/boards/5/topics/18851
And using the suggestions made in that thread I was able to import video stream in my flask web app.
Hopefully it will keep working.

Thanks all!

RE: Showing tvheadend stream in web app - Added by ilja leiko 4 days ago

Thank you, saen acro for the links.

I have tried both player - none of them worked.
I m stuck to make it work on Android/iOS devices now.

It works perfectly fine on windows/mac computer under chrome browser if I just use simple html video tag as this:

<video id="player1" width="640" height="360" preload="none" controls playsinline webkit-playsinline>
<source src=""http://192.168.1.72:9981/stream/channelid/2013555866?ticket=388550710ddf21ad5c6ffd61fcd3d0dc24cf46d2&profile=matroska type="video/webm">
</video>

But that doesn't work neither on Android tablet nor on iOS.
I have tried installing multiple different JS player, such as mediaelement, plyr, video.js, mpegts... And i have installed like all three browsers on Android tablet - Chrome, Opera, Mozilla for testings. Every single JS player works fine if i watch the video from my laptop(Chrome), but none of them works when i access from Android device. And the furthest I can get is using Opera+plyr(or video.js) is having an audio playing fine, but just a black screen with no video.

Could you please help me out? :/

RE: Showing tvheadend stream in web app - Added by saen acro 4 days ago

There is a lot of programs as TVHClient for mobile OS

RE: Showing tvheadend stream in web app - Added by ilja leiko 3 days ago

I know, I know, but there is a particular reason the video stream has to be implemented on the web. It is a part of a much bigger "Information Access Project" picture. And TV part of that should be limiting user to the amount of time they can watch TV streams. If the stream is shown of a web there would be simple authentication logic implemented as well as session time limited.

Thank you

RE: Showing tvheadend stream in web app - Added by saen acro 3 days ago

When HLS implementation will arrive this problem will gone.

webtv-vp8-vorbis-webm profile work on almost any device, but transcoding used.

RE: Showing tvheadend stream in web app - Added by ilja leiko 2 days ago

Is there any way I can switch my stream to "webtv-vp8-vorbis-webm" profile and make work on almost any device? :/ How can I do that? Will i need to implement transcoding myself?

Haha, i m pretty much desperate at thus point

RE: Showing tvheadend stream in web app - Added by saen acro 2 days ago

ilja leiko wrote:

<video id="player1" width="640" height="360" preload="none" controls playsinline webkit-playsinline>
<source src=""http://192.168.1.72:9981/stream/channelid/2013555866?ticket=388550710ddf21ad5c6ffd61fcd3d0dc24cf46d2&profile=matroska type="video/webm">
</video>

replace profile=matroska with webtv-vp8-vorbis-webm
also cutoff ticket part from url

http://www.bogotobogo.com/VideoStreaming/ffmpeg_http_live_streaming_hls.php

RE: Showing tvheadend stream in web app - Added by ilja leiko about 24 hours ago

Thank you, saen acro, for your continues help.

I am using tvheadend 4.3-1234~g78081ea on Raspberry Pi 3 and under Configurations-Stream-Stream Profiles i just have three basic profiles (see screenshoot - https://i.imgur.com/melQNbj.png), do you think replacing matroska profile with webtv-vp8-vorbis-webm would still work for me?

If so, following your guidance, I would make URL as this:
http://192.168.1.72:9981/stream/channelid/2013555866?webtv-vp8-vorbis-webm
Am i right?

P.S. While fighting with raw TS stream i can across on-the-go transoding app(https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=123876&p=1305839&hilit=multiple&sid=3f8d74bbcc1b8b578a047b5b4f069559#p1305839), and i have tried it. Unfortunately, it can only transcode one channel at a time due to poor RPi GPU performance. But what's interesting, that I was able to play perfectly trasncoded video stream(inserting as html5 video tag on my local web server) from Android tablet(using Chrome). Which is already a good result. Sadly, I have 6 channels which i need to provide through local web server and they all have to work individually (so a few ppl would be able to watch different streams), so this transcoding approach would not work for me :(

RE: Showing tvheadend stream in web app - Added by saen acro about 23 hours ago

Forget about 5 coins stuff use some real x86_64 with intel or nvidia GPU

RE: Showing tvheadend stream in web app - Added by ilja leiko about 6 hours ago

Thank you, saen acro.

Do you know any good(within 150$) device i could use?
And know, when I am looking for a better solution to my problem, do you think I could use something as:
https://www.amazon.com/dp/B07BLXVLCV/ref=sspa_dk_detail_4?pd_rd_i=B075SS1YX4&pd_rd_wg=9p6C9&pd_rd_r=RJV98DRMEY0HP3K7GAVK&pd_rd_w=KAO0R&th=1

Only thing i need is to be able to decode, trascode and stream to the local web server like 6 channels. Taking into account that I need multiple users to be able to stream different channel from local web server.

RE: Showing tvheadend stream in web app - Added by saen acro about 3 hours ago

At less i5 4xxx ebay second hand ;)
my personal choice will be 24-27" AiO, tuner on usb + Open/LibreElec or Linux with auto-login Kodi and remote

(1-14/14)