Page 1 of 4

[App] libStreamTV E/F/H

Posted: Sat May 28, 2016 9:10 pm
by zoelechat
That lib allows to get TV signal (internal tuners (digital!) only, no external source) as HLS stream (m3u8 blah).

Notes:
  • Usage of libNoDRM is strongly advised on E/F-MST (matter of resources consumption) and mandatory on H-MST
  • Lib doesn't work on H non-MST
  • Timeshifting or recording has to be running for stream to be alive
Usage:
  • First install latest samyGOso as usual, if needed.
  • Extract attached archives
  • Copy libStreamTV.so to /mnt/opt/privateer/usr/libso
  • Copy 99_91_StreamTV.init to /mnt/etc/init.d and set execute permissions:

    Code: Select all

    chmod +x /mnt/etc/init.d/99_91_StreamTV.init
  • Reboot TV
Launch (live) timeshifting or recording, wait few seconds buffer, then you can catch stream with any (decent) media player at:

Code: Select all

http://YOUR_TV_IP:81/stream.m3u8
(of course replace YOUR_TV_IP by... your TV IP ! :p)

Dynamically generated playlist and TS chunks are to be found into /dtv/www

*Changelog:

Code: Select all

1/6/2016
v0.1.6 - Added E/F non-MST support
28/5/2016
v0.1.3 - First public release

Re: [App] libStreamTV E/F/H (MST only)

Posted: Sun May 29, 2016 9:18 pm
by greenhorn
nice... Hope will get it on NON MST too :D

Re: [App] libStreamTV E/F/H (MST only)

Posted: Sun May 29, 2016 9:37 pm
by zoelechat
Actually you can try it, it already works on non-MST, but you'll get encrypted stream due to No-NoDRM :)
Maybe one day I'll try to play with some DRMdecrypt code inside...

Btw, I've heard that HLS could handle AES encrypted streams, I wonder if something could be doable since we know the key...

Re: [App] libStreamTV E/F/H (MST only)

Posted: Tue May 31, 2016 8:43 am
by sectroyer
zoelechat wrote:Actually you can try it, it already works on non-MST, but you'll get encrypted stream due to No-NoDRM :)
Maybe one day I'll try to play with some DRMdecrypt code inside...

Btw, I've heard that HLS could handle AES encrypted streams, I wonder if something could be doable since we know the key...
on E/F you should use PVRtoTS.... ;)

Re: [App] libStreamTV E/F/H (MST only)

Posted: Tue May 31, 2016 8:58 am
by zoelechat
sectroyer wrote:on E/F you should use PVRtoTS.... ;)
Sure, let's write encrypted, decrypt, write decrypted at the same time, then read file, predict timestamps, cut chunks, and write chunks while they're being read through webserver... I hope some resources will remain to at least watch TV on TV :P

Re: [App] libStreamTV E/F/H

Posted: Wed Jun 01, 2016 8:31 pm
by zoelechat
New version posted, added E/F non-MST support (greenhorn ;) ). Sorry H remains MST only.

Re: [App] libStreamTV E/F/H

Posted: Mon Jun 06, 2016 4:56 pm
by Bensson
Doesen't work reliable for me on UE48H6270 - T-MST14DEUC 2781.
Chunks are createt, but often stream could not be opened, because of unknown file format. Sometimes it works, but it makes my TV stutter, so you can't watch TV anymore. Stream also stutters. Maybe my 6270 is too weak.
Tried iMac,iPad,iPhone,and Windows PC. But thanks for workand sharing this Tweak.
Are there any useless services in backgorund that can be stoped by scipt?

Re: [App] libStreamTV E/F/H

Posted: Mon Jun 06, 2016 5:19 pm
by zoelechat
About stopping services... I don't think so, you can at least flush caches using that command:

Code: Select all

sync; echo 3 > /proc/sys/vm/drop_caches
It's quite efficient (you can verify using "free" command), but TV generally doesn't take long to fill them again :)

Otherwise, know that from few feedback I had, it looks that it works VERY badly on Apple devices (or even: not at all, nfi why). Also you say "Windows PC", it depends on which player you're using, my first advice would be: don't use VLC :D

For info, best (well-working with lib) tried (by myself) players non-exhaustive list: Kodi (all platforms), mpv, MPC-HC (Windows), MX Player (Android)...

Re: [App] libStreamTV E/F/H

Posted: Wed Jun 08, 2016 12:30 pm
by JanneP
Thanks for this! This is something I wanted to do for a long time.

Unfortunately the stream stops almost directly. When recording directly to USB same thing happens, maximum recording time seems to be around 18-19s. Tried with and without libNoDRM, different USB memories and harddrives. It's DVB-C with Conax contego if that matters. Any ideas? Not entirely related to this lib but any help is appreciated. Running T-MST12DEUC 1119.0 on F6475.

Re: [App] libStreamTV E/F/H

Posted: Wed Jun 08, 2016 12:53 pm
by zoelechat
I don't know which player you're using (that's the first info users should give here) but it's probably related somewhere to "not enough buffer". You should first check if lib is continuing to create chunks and update playlist when playback stops: If so, problem is player related. To increase buffer you can use these 2 args (at the end of samyGOso (-T) commandline in startup script):
  • NUMOFCHUNK:number - Number of chunks currently parsed in playlist (max:10). Default is 3 which means: 1 previous chunk (out of playlist) kept, 3 full/active chunks, and the next one being written. 1+3+1=5 so you need permanent room for 5 chunks.
  • KEEPCHUNKS:number - Number of previous chunks (=past, henceforth out of playlist) to keep before they're deleted. Default is 1 as I just told above.
Beware that /dtv space is limited!! I know it's 40Mb on E and 100Mb on H, no idea on F (surely between E and H). Each chunk is 4,620,288 bytes so be careful to not overflow /dtv (crash guaranteed!), and think that not only current lib is using that "workspace". You can check total/used/free space using command:

Code: Select all

df -h | grep dtv | grep tmpfs
Lib uses 22Mb by default (5 chunks) so there's still some margin left anyway.

? For reference, needed space (in bytes) is: (NUMOFCHUNK + KEEPCHUNKS + 1) * 4620288

Otherwise if you still need some bigger buffer, change WEBROOT value on top of startup script to something different than /dtv/www, for example on usb: /dtv/usb/sda1/www. No more worry about free space then.
Also know that for most players and the way they handle HLS: bigger is the buffer, greater is offset between stream and live.
...and definitely better use libNoDRM if you're "lucky MST owner" :)