SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-01-2018, 08:51 AM
ojones ojones is offline
Sage User
 
Join Date: Dec 2005
Posts: 33
Transcoding for miniclient users

I am cross-posting a comment I made in the Sage Github Issues list to see if anyone has any input. In order to make the android miniclient fully functional across fast WAN links (VPNs are easy these days...) changes to a few default assumptions would be enormously useful.

(1) If sage detects bandwidth <10Mbps it forces transcoding. I attempted to contribute some code to bypass this behavior but doesn't appear to be effective.

(2) The bandwidth test doesn't appear to be fully effective (especially over VPN links on asymmetric connections - fails on a 150/25 client-side link and detects bandwidth at ~ 18Mbps).

(3) If forced into transcoding the default ffmeg assumptions result in CIF @ 352x240 and produce a stream at ~0.5 to 1Mbps (~160-200KB/s). Whether or not we can tame the bandwidth forced transcoding it would be very useful to step up the resolution to at least 720p. I know this portion of the plumbing is fairly deep in the bowels of the sage code but hoping tweaking the resolution might be more feasible than switching codecs which I understand is prohibitively complicated.

Any thoughts or votes on priority? I use plex for previously recorded content but for live TV and comskip nothing beats Sage!

https://github.com/google/sagetv/issues/340
Reply With Quote
  #2  
Old 01-01-2018, 09:46 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,937
Good suggestions. It would also be nice if you didn't get asked for username and password when connected via VPN over WAN. I really like the solution to step up to 720p. When you are watching over a WAN what is your client - an extender, AndroidTV or PlaceShifter? The 1080i bug when streaming to PlaceShifters also needs to be fixed.

I don't mean to highjack the thread but while some thought is being put into transcoding it might also be wise to think about the implications of 4K files streaming to miniclients that can't handle 4K files. I presume that 4K content will start to become more prevalent in the next year or two, especially if ATSC 3.0 tuners start to be adopted. It might be nice to keep source files in 4K but then transcode them when streaming to 1080 clients. That may require a bit of horsepower in the server though so it would be useful to use hardware acceleration like QS where possible.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #3  
Old 01-01-2018, 10:06 AM
ojones ojones is offline
Sage User
 
Join Date: Dec 2005
Posts: 33
Thanks wayner! I agree 4K will be the future but my gut says the nvidia shield / miniclient will be the prevalent player as HD 200/300's expire given the codec support for playback will likely stay ahead of sage.

Across the WAN link I use nvidia shield's (the tablet one) for testing but for production we have four sony screens with built in Android TV. I can stream the original files from Plex (no transcode) but can't wait until I can demonstrate comskip/sage live TV at full resolution. Best part is the TV's remote control mapping is near perfect so great WAF once I can get the trascoding killed off or resolution increased...

I've tested the full pc client across the link as well but lag seems to introduce bad audio (stutter)...
Reply With Quote
  #4  
Old 01-01-2018, 10:52 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,937
Do you have SageTV installed in AndroidTV on the Sony TVs? How does it work and what model TVs are these? I am considering buying a Sony with AndroidTV.

I have an AndroidTV client but I still find the HD200s and HD300s to be more reliable, especially since some of my content is still MPEG-2. These units also seem very durable - I have yet to have an HD200 fail on me although I have one HD300 that acts flakey and they seem to run hotter.

Speaking of your last point - do you also need to worry about latency over the connection as well as bitrate?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #5  
Old 01-01-2018, 10:18 PM
ojones ojones is offline
Sage User
 
Join Date: Dec 2005
Posts: 33
Re latency - on one link i have about 60ms to deal with which isn't pretty but should be acceptable once a stream starts playing. My other link is <10ms. Server side I am on fiber (gigabit / symmetric) and I'm running my sage server in a commercial grade server (dual processor; 3+ghz; 12 virtual cores allocated to sage). I agree the HD300's are almost unstoppable. The android player (in my shield) is frankly quite flakey. Lots if jumping around in the time scale of a video - notwithstanding stuckless's excellent work I get the feeling the environment is pretty rough.

I will try to look up the TV specs and forward them - I believe they were purchased Spring 2017 if that helps.
Reply With Quote
  #6  
Old 01-05-2018, 10:27 PM
ojones ojones is offline
Sage User
 
Join Date: Dec 2005
Posts: 33
#[1] Above Fixed!

Quote:
Originally Posted by ojones View Post
I am cross-posting a comment I made in the Sage Github Issues list to see if anyone has any input. In order to make the android miniclient fully functional across fast WAN links (VPNs are easy these days...) changes to a few default assumptions would be enormously useful.

(1) If sage detects bandwidth <10Mbps it forces transcoding. I attempted to contribute some code to bypass this behavior but doesn't appear to be effective.

(2) The bandwidth test doesn't appear to be fully effective (especially over VPN links on asymmetric connections - fails on a 150/25 client-side link and detects bandwidth at ~ 18Mbps).

(3) If forced into transcoding the default ffmeg assumptions result in CIF @ 352x240 and produce a stream at ~0.5 to 1Mbps (~160-200KB/s). Whether or not we can tame the bandwidth forced transcoding it would be very useful to step up the resolution to at least 720p. I know this portion of the plumbing is fairly deep in the bowels of the sage code but hoping tweaking the resolution might be more feasible than switching codecs which I understand is prohibitively complicated.

Any thoughts or votes on priority? I use plex for previously recorded content but for live TV and comskip nothing beats Sage!

https://github.com/google/sagetv/issues/340
It appears that the commit to disable the 10Mbps threshold for no transcoding didn't make it into the windows installer until 9.1.8!!! I was on 9.1.7. On Narflex's advice I checked the version and suddenly this works!. Note - this doesn't help on slow connections and it would be fabulous if we could get transcoding working at a higher bandwidth/resolution than 352x240 but it does provide a bandaid if fast connections were testing incorrectly as I had run into repeatedly.
Reply With Quote
  #7  
Old 01-07-2018, 11:23 AM
jm9843 jm9843 is offline
Sage Aficionado
 
Join Date: Oct 2003
Posts: 288
Re: the new 'miniplayer/wan_prevent_push' property for client over VPN without transcoding

What kind of upload bandwidth is required for this (assuming a single client with broadcast 1080i MPEG2)? Comcast caps my upstream to 11 Mbps on the Blast tier.
Reply With Quote
  #8  
Old 01-07-2018, 11:44 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,937
Quote:
Originally Posted by jm9843 View Post
What kind of upload bandwidth is required for this (assuming a single client with broadcast 1080i MPEG2)? Comcast caps my upstream to 11 Mbps on the Blast tier.
Placeshifter doesn't appear to handle 1080i content on your LAN - but broadcast MPEG-2 uses 19Mbps, although it can be less if split amongs sub-channels as well. So you couldn't stream over the internet without transcoding. But MPEG-2 is a very old codec.

Would transcoding fix the 1080i issue, even when doing it on a LAN rather than a WAN.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #9  
Old 01-07-2018, 12:01 PM
ojones ojones is offline
Sage User
 
Join Date: Dec 2005
Posts: 33
My fix is to transcode ALL recordings during recording via OpenDCT... before Sage gets it the stream is already 1080p h264 in a mpeg2 TS wrapper. This makes the stream digestible by the android miniclient/placeshifter and cuts bandwidth down to <16mps. 16mbps seams to be the magic number for adequate streaming without further transcoding BUT that is at 1-3ms lag and no packet loss (simulating wan by routing between subsets on my lan in a lab environment). My Fios is 940mb/s upload so gating issue is on the receiving side. Further caveat, it takes some real horsepower to make the opendct trick work... i’m Using a latest generation dual processor Xeon at 3.4ghz with 12 physical cores (24 wHT).
Reply With Quote
  #10  
Old 01-07-2018, 12:04 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,937
Why does the transcoded file have a bitrate of about 16Mbps? Surely you can get a 19Mbps MPEG-2 file transcoded to about 6Mbps without quality loss given the superior efficiency of H.264 codec.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #11  
Old 01-07-2018, 02:11 PM
ojones ojones is offline
Sage User
 
Join Date: Dec 2005
Posts: 33
I have no doubt I could get more compression out of my file - to be honest I haven't played with the source files yet. My primary reason for running the real time transcode on the OpenDCT side of things is to clean up the files so they play in the miniclient. Sounds like a good next step for me to play around with. And a point of clarification - a half hour program runs 3.3GB or 1.833MB/s or 15MB/s. Streaming seems to like an extra mbps of cushion to make the audio sound right
Reply With Quote
  #12  
Old 01-07-2018, 02:30 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,937
Files from my HD-PVR, which are H.264, appear to be about 3.6GB/hr - and that is on the Great-H.264 setting of the HD-PVR.

Keep us posted on your results, I wouldn't mind doing what you are doing as I have had trouble trying to lock my STBs to 720p. Of course it would be better if we could just get PS fixed.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #13  
Old 01-07-2018, 11:20 PM
ojones ojones is offline
Sage User
 
Join Date: Dec 2005
Posts: 33
Wayner - I think we share an interest in getting opendct to compress 1080P a little more than the opendct defaults. Any suggestions on ffmpeg settings for me to try? Ifiddled with some obvious ones to no avail.
Reply With Quote
  #14  
Old 01-08-2018, 07:33 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,937
I haven't really used OpenDCT - however it increasingly looks like the future for SageTV. I think I installed it to try to get some IP camera streams into SageTV but I never got that working. I just use HD-PVRs and HD-HR tuners directly.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #15  
Old 01-08-2018, 01:44 PM
trk2 trk2 is online now
Sage Aficionado
 
Join Date: Jan 2006
Location: Maine
Posts: 418
I think ideally the transcoding would be done by Sage's internal ffmpeg rather then force everyone to use OpenDCT. However unless/until Sage's ffmpeg is updated OpenDCT is probably the easiest option.
Reply With Quote
  #16  
Old 01-10-2018, 12:06 PM
ojones ojones is offline
Sage User
 
Join Date: Dec 2005
Posts: 33
I am on day #3 after moving to ‘very fast’ and CRF 20 for OpenDCT /ffmpeg reatime transcoding settings. Reduction in file-size is 30-50% 7-11Mbps on average down from 12-16mbps. I am running my OpenDCT instance in a Ubuntu VM on my hyperv box and so far have’t had any known bad recordings. One recording appears to load several vcpu’s to 50-60% with the balance (12 total at 1:1 cores including HT all on one numa) at 15-30%. Tonight I have four simultaneous recordings - crossing my fingers!
Reply With Quote
  #17  
Old 01-13-2018, 03:30 PM
EnterNoEscape's Avatar
EnterNoEscape EnterNoEscape is offline
SageTVaholic
 
Join Date: Jun 2010
Location: Harrisburg, PA
Posts: 2,638
Quote:
Originally Posted by trk2 View Post
I think ideally the transcoding would be done by Sage's internal ffmpeg rather then force everyone to use OpenDCT. However unless/until Sage's ffmpeg is updated OpenDCT is probably the easiest option.
I completely agree with this. I really want SageTV to have better built in abilities in this area so that all network encoders would benefit and the placeshifter experience could be improved. One could produce a new transcoding engine for SageTV without replacing the one that's already there. This would allow for people to use the old trusted engine and more adventurous people to use the new one to find issues to fix.
__________________
SageTV v9 Server: ASRock Z97 Extreme4, Intel i7-4790K @ 4.4Ghz, 32GB RAM, 6x 3TB 7200rpm HD, 2x 5TB 7200rpm HD, 2x 6TB 7200rpm HD, 4x 256GB SSD, 4x 500GB SSD, unRAID Pro 6.7.2 (Dual Parity + SSD Cache).
Capture: 1x Ceton InfiniTV 4 (ClearQAM), 2x Ceton InfiniTV 6, 1x BM1000-HDMI, 1x BM3500-HDMI.

Clients: 1x HD300 (Living Room), 1x HD200 (Master Bedroom).
Software: OpenDCT :: WMC Live TV Tuner :: Schedules Direct EPG
Reply With Quote
  #18  
Old 10-30-2019, 07:31 AM
phantomii phantomii is offline
Sage Advanced User
 
Join Date: Mar 2009
Location: North Carolina
Posts: 161
So this is an old thread, and I never used the PlaceShifter before this week and now have some questions. I own two houses, one of which is set up as a partial/part time AirBNB. With Cable bills climbing through the roof and I cancelled my Cable TV in my non AirBNB house. Then I attempted to use the Placeshifter to connect to my AIRBNB (where I will keep cable for guests) to watch television from that house. Got it working from my NVidia Shield quickly and works pretty well. However the Picture quality was lees than I would like to see. The AirBNB house has HDHomerun Prime devices and most channels are read freely so I am using OpenDCT.

Having read through this thread it appears others were looking for ways to improve Placeshifter Quality or maybe disable or improve the transcoding. This said the thread does not look like a solution was reached?

So is there a way to disable the transcoding or improve the picture Quality when using the Placeshifter??? Would love to get this working if it is at all possible.

John
Reply With Quote
  #19  
Old 10-30-2019, 09:08 AM
tvmaster2's Avatar
tvmaster2 tvmaster2 is offline
SageTVaholic
 
Join Date: Jun 2005
Location: tarana
Posts: 3,820
Quote:
Originally Posted by phantomii View Post
So this is an old thread, and I never used the PlaceShifter before this week and now have some questions. I own two houses, one of which is set up as a partial/part time AirBNB. With Cable bills climbing through the roof and I cancelled my Cable TV in my non AirBNB house. Then I attempted to use the Placeshifter to connect to my AIRBNB (where I will keep cable for guests) to watch television from that house. Got it working from my NVidia Shield quickly and works pretty well. However the Picture quality was lees than I would like to see. The AirBNB house has HDHomerun Prime devices and most channels are read freely so I am using OpenDCT.

Having read through this thread it appears others were looking for ways to improve Placeshifter Quality or maybe disable or improve the transcoding. This said the thread does not look like a solution was reached?

So is there a way to disable the transcoding or improve the picture Quality when using the Placeshifter??? Would love to get this working if it is at all possible.

John
Reduce your source output (cable box, satellite receiver) to 720p. I found Placeshifter is mostly crap trying to move 1080 material. .02 cents
__________________
Sage 9 server = Gigabyte AMD quad-core - 4 gigs - integrated ATI HD4200 chipset - SSD boot, Hitachi Deskstar show drives. HD-PVR - Colossus - Win7 32 bit. HD200/300ís networked. HDHomerun tuner. "If you've given up on Weird Al, you've given up on life" - Homer Simpson
Reply With Quote
  #20  
Old 10-30-2019, 10:50 AM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 1,933
Quote:
Originally Posted by tvmaster2 View Post
Reduce your source output (cable box, satellite receiver) to 720p. I found Placeshifter is mostly crap trying to move 1080 material. .02 cents
Doesnít apply to the HDHR devices he is using.
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM
Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2)
,USBUIRT (multi-zone)
Source:
Comcast/Xfinity X1 Cable
Primary Client: Server Other Clients: (1) HD200, (1) HD300
Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE,
HDHR, HVR-2250, HD-PVR
Reply With Quote
Reply

Tags
miniclient, opendct, streaming, transcoding, wan


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Miniclient 101 smdl SageTV Clients Development 5 11-28-2017 02:47 AM
Android Miniclient and UK TV rickgillyon SageTV Clients Development 6 12-01-2016 05:58 PM
Android miniclient; fuzzy/corrupt video when remote transcoding redondo_se SageTV Clients Development 12 11-10-2016 12:14 PM
SageTV miniclient - transcoding? dmelnyk SageTV Clients Development 1 10-02-2016 05:01 AM
Miniclient? BobbyDing General Discussion 3 09-08-2015 11:53 AM


All times are GMT -6. The time now is 11:42 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.