TV video stream to web page?
Added by Scott Hather almost 9 years ago
Hi all, I have everything set up and working, but I'm trying to figure out how I can stream a TV channel to an intranet web page. If I open a (Linux) terminal and paste:
mplayer http://192.168.1.2:9981/play/stream/channel/960b0a5146f2144c6458cf804379950b
mplayer will play the stream just fine. On the intranet web page I'm currently using jPlayer (javascript/flash) to play videos from the 192.168.1.2 server just fine, so I tried feeding in the above URL too, no go.
Also tried HTML5 video:
<video width=800px height=600px controls><source src='http://192.168.1.2:9981/play/stream/channel/960b0a5146f2144c6458cf804379950b' type='video/webm'></video>
Nothing, no errors that I can see either. As far as I can see tvheadend's stream is set to webm.
Any help please?
Using Tvheadend 4.1-361~gd9cf931
Replies (24)
RE: TV video stream to web page? - Added by Prof Yaffle almost 9 years ago
Looking at the TV player in the web interface, I suspect you're missing a profile directive at the end of the URL. For example, while it's playing, if I look at the URL of a stream I get this:
... while if I call up the Chrome debugger, I can see this source code on that page:
<video id="ext-gen3698" style="width: 682px; height: 381px; visibility: visible;"> Your browser doesn't support html5 video <source id="ext-gen3699" src="stream/channel/386760a881473c853162c62faf5ff57e?profile=webtv-h264-aac-matroska"> </video>
You of course need to have any profile defined before you can use it.
RE: TV video stream to web page? - Added by Scott Hather almost 9 years ago
Thanks for your help. I tried putting the profile name in the url, but still nothing. One thing I didn't mention on my post was tvheadend's own live TV player doesn't work for me either, I just get "An unknown error occurred" in the video window. (but mplayer <url> streams live tv just fine).
I've found a log file that seems say what the problem is, but I'm not sure how I'd fix it:
Nov 29 11:48:16 scottsraspberry tvheadend[2060]: subscription: 0028: "HTTP" subscribing on channel "BBC NEWS", weight: 150, adapter: "DiBcom 7000PC : DVB-T #0", network: "test", mux: "698MHz", service: "BBC NEWS", profile="matroska", hostname="192.168.1.1", client="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
Nov 29 11:48:17 scottsraspberry tvheadend[2060]: mkv: WEBM format supports only VP8+VORBIS streams (detected MPEG2VIDEO)
Nov 29 11:48:17 scottsraspberry tvheadend[2060]: mkv: WEBM format supports only VP8+VORBIS streams (detected MPEG2AUDIO)
Nov 29 11:48:17 scottsraspberry tvheadend[2060]: mkv: WEBM format supports only VP8+VORBIS streams (detected DVBSUB)
So is this saying that the TV adapter itself is putting out MPEG2 or is there a configuration option I can change?
It would make sense why mplayer works, as mplayer seems to accept pretty much anything you throw at it :-)
RE: TV video stream to web page? - Added by Prof Yaffle almost 9 years ago
Exactly that - Freeview SD (which is what you're looking at since the DiBcom is a DVB-T stick) is MPEG-2, versus the H.264 (MPEG4) that's used for the HD channels.
Now, why you can't immediately watch it in a browser, I can't say... I know that different browsers have hell and all trouble with different codecs, so it could be that, but MPEG2 is pretty universal. It looks like you're trying to push it to WEBM, which can't hold an MPEG2 stream...
FWIW, on Chrome/Windows as a client (as that's what's in front of me as I type), I can watch BBC NEW SD by using the webtv-h264-aac-matroska profile or the webtv-vp8-vorbis-webm profile; others choke. I suspect that it's transcoding quietly in the background, but that's all a bit of a closed book to me as I use tvh for recording rather than live streaming.
RE: TV video stream to web page? - Added by ulrich 2012 over 8 years ago
I'm facing the same problem ,all about video is ok but no audio no sound(is mute)
<video width="720" height="480" autoplay="true" controls><source src="http://127.0.0.1:9981/stream/channel/a2c0883513107f65371acf0338c8c9dc?ticket=3517CAE0B690E00B5C3245A218311F9F61D7C417" type="video/webm" /></video>
this is my code in html
please help me
this is a stream file from tvheadend with url"http ..."
I'm not a french speaking hopping that you have understud me.
RE: TV video stream to web page? - Added by Scott Hather over 8 years ago
If it's a similar problem to mine, maybe the audio that your DVB stick is streaming is not compatible with the web browser?
On the Linux box running TVheadend, open up a terminal and type:cat /var/log/syslog | grep tvheadend
this will show all logs from tvheadend,look for something similar to the one I posted above where it mentions the problem with the stream.
RE: TV video stream to web page? - Added by Jonathan Thomson over 8 years ago
Choice of codecs (in your streaming profile) are VERY important, especially if you're using HTML5 video tags - the HTML5 standard does not support every codec and it works best with webm profiles.
I've just knocked up this code snippet which works on my server (4.1-2130~g55fec0f) in Google Chrome.
<html>
<head><title>TVHeadend Streaming Example</title></head>
<body>
<video width="720" height="567" autoplay="true" controls>
<source src="http://your.server.address:9981/stream/channel/d81ea595a635fb31958d7ae853c7448d?profile=webtv-h264-aac-matroska" type="video/webm">
Your browser does not support the video tag.
</video>
</body>
</html>
...notice how the URL is appended with the profile AND the HTML5 tags are populated with the matching codec.
Try this and see how you get on.
p.s. the webtv-h264-aac-matroska is the default profile that the TVH web player uses. The only time I've seen the "An unknown error occurred" error is when you try and use a streaming profile (such as HTSP, pass and even matroska/MKV for which only audio works for me) which is not supported by the HTML5 video extensions.
RE: TV video stream to web page? - Added by ulrich 2012 over 8 years ago
Thanks guys for answers , i've not yet solve my problem ,still no audio
when i'm typing cat /var/log/syslog | grep tvheadend i have this screenhot.
me i'm missing something in my configuration.
please a look.
i dont nkown what happen
thanks in advance
iptvhd00.png (286 KB) iptvhd00.png | |||
iptvhd01.png (275 KB) iptvhd01.png | |||
iptvhd02.png (267 KB) iptvhd02.png |
RE: TV video stream to web page? - Added by Jonathan Thomson over 8 years ago
Did you try what the log files were telling you? Try changing the audio codec to Vorbis.
EDIT: In fact it's specifically telling you to use the VP8 video codec and the Vorbis audio codec.
I was playing around with the streaming profiles last night and there are wild variances in compatibility between browsers - I've found Google Chrome to support more audio and video codecs whilst Safari on the Mac is more fussy about container format and codecs.
RE: TV video stream to web page? - Added by ulrich 2012 over 8 years ago
yes +Jonathan Thomson
i'm using chromium browser
i have 4(pass ,htsp ,cx and matroska) 3 of them is working without sound only pass don't work("An unknown error occurred"in thd player)
me be is my conf
i'm confuse
RE: TV video stream to web page? - Added by Jonathan Thomson over 8 years ago
"Pass" will not work as no browser can natively play MPEG2 (which most DVB broadcasts are).
If you don't have the profile (attached to this post) set up, try setting it up and/or enabling it. This is the profile that my HTML code snippet above calls by default and this works in Chrome on macos and Windows 10. Conversely, this profile does not work with Internet Explorer or Edge on Windows 10.
matroska.PNG (38.8 KB) matroska.PNG |
RE: TV video stream to web page? - Added by ulrich 2012 over 8 years ago
i dont have this profile and i can't add a profile
RE: TV video stream to web page? - Added by Jonathan Thomson over 8 years ago
Are you the administrator of your server? Are you logged in with the admin account? Have you set your view level to 'Expert'?
RE: TV video stream to web page? - Added by ulrich 2012 over 8 years ago
i was on a different server , now i m in the administrator server , i create the profile but i can't see the transcoding part to setup.
i don't nkown something about setting level to expert ,where should change it?
it's still no audio
RE: TV video stream to web page? - Added by Jonathan Thomson over 8 years ago
OK here's a step by step;
Log into your TVH server as an admin user
Click on the configuration tab - whilst here, ensure the 'User interface level' is set to 'Expert' and click the 'Save' button
Click on the 'Stream' tab then the 'Add' button
In the 'Type' drop down, select 'Transcode/av-lib'
Fill out the rest of the form like my picture attached above then click 'Create'
A quick restart of TVH and the profile should be used automatically by the web player and also my code snippet.
I'm confused as to why this profile, which is configured by default on installation is missing - did you delete it?
RE: TV video stream to web page? - Added by ulrich 2012 over 8 years ago
I dont have the "User interface level" on this version
i'm using this version HTS Tvheadend 4.0.9-5~g4749320~wily
which version do you use?
no i didn'nt delete nothing
RE: TV video stream to web page? - Added by Jonathan Thomson over 8 years ago
I'm on 4.1-2130~g55fec0f.
Can you provide screenshots of the UI for the Stream tab, dialog box and form?
RE: TV video stream to web page? - Added by ulrich 2012 over 8 years ago
this are them
Capture du 2016-06-24 16-50-12.png (244 KB) Capture du 2016-06-24 16-50-12.png | |||
muxes.png (251 KB) muxes.png | |||
screenshot.png (317 KB) screenshot.png | |||
THD.png (184 KB) THD.png |
RE: TV video stream to web page? - Added by Jonathan Thomson over 8 years ago
You are "missing" large chunks of the user interface which I can only put down to permissions - check the 'Access entries' tab for your current (admin) user and see if there's anything in there, or towards the bottom of the 'General' tab. Something is restricting your access to the advanced settings in the web UI.
RE: TV video stream to web page? - Added by ulrich 2012 over 8 years ago
there is nothing in access entries.
can you provide screenhot of thd (network ,muxes, channels,profile stream)?
RE: TV video stream to web page? - Added by Jonathan Thomson over 8 years ago
How competent/confident are you in the linux bash?
That looks like a Ubuntu to me;
sudo nano /home/hts/.hts/tvheadend/profile/09494e37f964f3ec3d6a536da73d2d59
providing nano opens with no text in the editor (it should be blank), copy/paste the following into the editor
{ "container": 1, "resolution": 384, "channels": 2, "vcodec": "libx264", "vcodec_preset": "faster", "vbitrate": 0, "acodec": "aac", "abitrate": 0, "scodec": "copy", "class": "profile-transcode", "enabled": true, "default": false, "name": "webtv-h264-aac-matroska", "comment": "WEBTV profile H264/AAC/Matroska", "priority": 3, "fpriority": 0, "timeout": 0, "restart": false, "contaccess": true, "svfilter": 0, "shield": true }
Save the file (ctrl+o, ctrl+x)
Fix the file permissions
sudo chown hts:video /home/hts/.hts/tvheadend/profile/09494e37f964f3ec3d6a536da73d2d59
Restart tvheadend
The new profile should show up.
This assumes that TVHeadend is installed in the default location with the default user account - should be a safe assumption if you've installed through apt/aptitude.
RE: TV video stream to web page? - Added by ulrich 2012 over 8 years ago
Thanks very much Jonathaan for all your answers :),i will test it on monday.
thanks for your time ,i will give you the issue
RE: TV video stream to web page? - Added by ulrich 2012 over 8 years ago
i HAVE MAKE IT BUT NO CHANGE IN MY STREAM TABLE
RE: TV video stream to web page? - Added by Jonathan Thomson over 8 years ago
Then all I can suggest is that you take a leap of faith and upgrade to the 4.1 beta/nightly branch - I'm running nightly with no issues at all, a lot has changed from the 4.0 branch so I think it'd be worth it for you.
RE: TV video stream to web page? - Added by ulrich 2012 over 8 years ago
Great ,it's working now ,i've update 4.1 and i have video and audio.
Thanks guys.