SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development
Forum Rules FAQs Community Downloads Today's Posts Search

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 06-27-2016, 11:57 PM
Jabroni's Avatar
Jabroni Jabroni is offline
Sage Aficionado
 
Join Date: Mar 2006
Posts: 251
Placeshifter with transcoding resolutions/bitrate

After doing some tests, I just found out that it seems that the current Placeshifter is capped/maxed to 2mbit/480p resolution when the placeshifter needs transcoding. Was wondering if anyone has figured out a way to modify those settings? I tried manually setting and on the placeshifter its maxed to 2mbit, and if i try to let sagetv dynamic streaming to its job, it wont use more than that bw and the result is a blocky stream where I have about ~50mbit bandwith between the 2 networks (fios)

Wouldnt it be a good idea to revisit those parameters, since those were set in ~2005 where there were almost no HD encoders and/or enough WAN bandwith. Not sure if it would be a good idea to create some profiles like plex does it. ie 1.5mbps 480p, 2mbit 720p, 3mbit 720p, 4mbit 1080p, 6mbit 1080p etc.
__________________
SageTV 7.1.9 / Phoenix
Captures: 1x Genpix Skywalker DVB4Sage / 1x 7500 Prof DVBS2 Tunner DVB4Sage / 1x HD HomeRun / 1x Slingbox M1 / 1x Colossus HD
Extender: 2x HD200 / 1x HD300

Reply With Quote
  #2  
Old 06-28-2016, 04:03 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Some minor changes could be made to up the bitrates and resolution with not a lot of work in the code (I think), but the major issue is that the modified version of ffmpeg that sage uses to transcode, and be able to adjust the bitrate on the fly (one of the key modifications) is limited to vanilla MPEG-4 (h.264 was just too expensive at the time).
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #3  
Old 06-29-2016, 10:26 PM
Jabroni's Avatar
Jabroni Jabroni is offline
Sage Aficionado
 
Join Date: Mar 2006
Posts: 251
That could be a quick fix.. another, not sure how doable it would be, to maybe have another ffmpeg library (one current/updated) which could be used for placeshifting, and then use some regular transcoding to a specified bitrate/resolution and H264 (to maximize quality over the same bandwith).

Implementing dynamic bitrate on that would be a nightmare I suppose, since I havent seen any streaming plataform doing in (other than just using http with HLS and just make the next block to a new higher/lower bitrate, but i would guess that completly out of the current reach of how the placeshifter works)
__________________
SageTV 7.1.9 / Phoenix
Captures: 1x Genpix Skywalker DVB4Sage / 1x 7500 Prof DVBS2 Tunner DVB4Sage / 1x HD HomeRun / 1x Slingbox M1 / 1x Colossus HD
Extender: 2x HD200 / 1x HD300

Reply With Quote
  #4  
Old 06-30-2016, 01:33 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by Jabroni View Post
That could be a quick fix.. another, not sure how doable it would be, to maybe have another ffmpeg library (one current/updated) which could be used for placeshifting, and then use some regular transcoding to a specified bitrate/resolution and H264 (to maximize quality over the same bandwith).

Implementing dynamic bitrate on that would be a nightmare I suppose, since I havent seen any streaming plataform doing in (other than just using http with HLS and just make the next block to a new higher/lower bitrate, but i would guess that completly out of the current reach of how the placeshifter works)
I know that the h.264 encoder in ffmpeg can be modified to support variable bitrates, as i've seen it done, but there are other things that need to be implemented in there to make it deal with sage properly (including the ability to actually communicate with sage).
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #5  
Old 07-01-2016, 12:16 AM
tvmaster2's Avatar
tvmaster2 tvmaster2 is offline
SageTVaholic
 
Join Date: Jun 2005
Location: tarana
Posts: 4,240
Quote:
Originally Posted by Jabroni View Post
After doing some tests, I just found out that it seems that the current Placeshifter is capped/maxed to 2mbit/480p resolution when the placeshifter needs transcoding. Was wondering if anyone has figured out a way to modify those settings? I tried manually setting and on the placeshifter its maxed to 2mbit, and if i try to let sagetv dynamic streaming to its job, it wont use more than that bw and the result is a blocky stream where I have about ~50mbit bandwith between the 2 networks (fios)

Wouldnt it be a good idea to revisit those parameters, since those were set in ~2005 where there were almost no HD encoders and/or enough WAN bandwith. Not sure if it would be a good idea to create some profiles like plex does it. ie 1.5mbps 480p, 2mbit 720p, 3mbit 720p, 4mbit 1080p, 6mbit 1080p etc.
I used Placeshifter a lot initially while travelling. I don't believe it could ever handle 1080, so I set my cable box and sat receiver to output 720p instead, and haven't had many problems since.
__________________
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
  #6  
Old 07-01-2016, 01:07 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by tvmaster2 View Post
I used Placeshifter a lot initially while travelling. I don't believe it could ever handle 1080, so I set my cable box and sat receiver to output 720p instead, and haven't had many problems since.
older versions of SageTVTranscoder had an issue decoding 1080i MPEG-2 content that would cause hiccups transcoding it for placeshifter. That was fixed a few years ago, however, so 1080i input should still be viewable just fine in placeshifter.

I have actually been using placeshifter a lot more often lately from my office - I had always used plex - and the quality is definitely better - but I do like that placeshifter is in the sagetv ui, and easily tracks watched status (the stuff I'm watching - mostly listening to - at work doesn't really depend on quality).
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #7  
Old 07-01-2016, 09:40 AM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
I think it would definitely be worthwhile to upgrade the transcoding technology used in Placeshifter. At least the resolution anyway. That's the main reason I mostly use Plex from work and elsewhere. That and mobile as I'm an iOS guy.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #8  
Old 07-01-2016, 10:49 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Upping the resolution should be relatively easy, it's a selection of hard-coded options in the sagetv core, and the placeshifter launcher, just keep in mind that it cannot change resolution on the fly, just bitrate, so if you bump the resolution up, then the quality will likely end up suffering. Regular MPEG-4 is just not that good.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #9  
Old 07-01-2016, 10:54 AM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Quote:
Originally Posted by Fuzzy View Post
Upping the resolution should be relatively easy, it's a selection of hard-coded options in the sagetv core, and the placeshifter launcher, just keep in mind that it cannot change resolution on the fly, just bitrate, so if you bump the resolution up, then the quality will likely end up suffering. Regular MPEG-4 is just not that good.
Does the dynamic streaming system change resolution on the fly or just bitrate? Does it have a max bitrate?
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #10  
Old 07-01-2016, 11:14 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by Taddeusz View Post
Does the dynamic streaming system change resolution on the fly or just bitrate? Does it have a max bitrate?
Just bitrate. It's really easy to change bitrate on the fly, resolution is not. It's set as either D1 (720x480/576) or CIF (352x240/288).
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room

Last edited by Fuzzy; 07-01-2016 at 11:21 AM.
Reply With Quote
  #11  
Old 07-01-2016, 12:47 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Quote:
Originally Posted by Fuzzy View Post
Just bitrate. It's really easy to change bitrate on the fly, resolution is not. It's set as either D1 (720x480/576) or CIF (352x240/288).
I've not looked at the code so I don't know how it picks resolution but I've noticed that whenever I use dynamic streaming it always seems to pick 352x240. I never automatically get 720x480. I manually set mine to 720x480 at 1000kb/s and it works fine. I regularly use Plex at 2Mb 720p so there's some headroom.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #12  
Old 07-01-2016, 01:18 PM
tvmaster2's Avatar
tvmaster2 tvmaster2 is offline
SageTVaholic
 
Join Date: Jun 2005
Location: tarana
Posts: 4,240
Quote:
Originally Posted by Fuzzy View Post
older versions of SageTVTranscoder had an issue decoding 1080i MPEG-2 content that would cause hiccups transcoding it for placeshifter. That was fixed a few years ago, however, so 1080i input should still be viewable just fine in placeshifter.

I have actually been using placeshifter a lot more often lately from my office - I had always used plex - and the quality is definitely better - but I do like that placeshifter is in the sagetv ui, and easily tracks watched status (the stuff I'm watching - mostly listening to - at work doesn't really depend on quality).
I'll change my output and do some tests. I seem to remember it still sucked when Google bought Sage, so I didn't think there would be any improvements after that...
__________________
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
  #13  
Old 07-01-2016, 05:02 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by Taddeusz View Post
I've not looked at the code so I don't know how it picks resolution but I've noticed that whenever I use dynamic streaming it always seems to pick 352x240. I never automatically get 720x480. I manually set mine to 720x480 at 1000kb/s and it works fine. I regularly use Plex at 2Mb 720p so there's some headroom.
Yeah, it's entirely possible that it defaults to 240 for dynamic streaming. It does seem like CIF is the default on the fixed property at least. That can likely be overridden and played with in the FFMPEGTranscoder.java class.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #14  
Old 07-02-2016, 05:27 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
As Fuzzy mentioned, FFMPEGTranscoder.java is where it does most of this.

It does currently always default to 352x240 resolution for dynamic rate transcoding. Around line 877 is where all the selection logic for this is in the server; it clearly can use an update since that code has the highest range being >900 Kbps, which is way lower than what most people have nowadays. It looks like its limiting the dynamic bitrate to be 1.5Mbps; this is in MiniPlayer.java (there's 3 references to 1500 in that code which control this max; that REALLY should be a constant...there may be other external things controlling it; but I think that is it).

The limits on the fixed rates you set on the Placeshifter can be changed in sage.miniclient.MiniClientManagerFrame....but for resolution, you'll also need to make changes on the server side where it parses that which is in FFMPEGTranscoder.java at line 598.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #15  
Old 07-02-2016, 10:49 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Yeah, I had thought about adding more 'standard' resolutions than just D1 and CIF (namely 720p and 1080i). That combined with upping the bitrates might provide some improvements, but at some point we're going to hit the limit of what MPEG4 can do. And the code for ffmpeg scares me, so I don't even know where to start with bringing that up to speed.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #16  
Old 07-11-2016, 10:33 AM
Jabroni's Avatar
Jabroni Jabroni is offline
Sage Aficionado
 
Join Date: Mar 2006
Posts: 251
Nice to see it went to a discussed topic

Another thing ive noticed is that it seems that when it transcodes it leaves the same codec used and just changes bitrate, so a OTA MPEG2 15-20mbit stream looks like crap on a remote placeshifter ~1.5mbit rather than a H264 3-4mbit 1080i stream running with the same capped 1.5mbit. Not sure if it would be a good idea to force sage to transcode all to H264 (i know it would tax the cpu doing more on the fly compression) but maybe for mobile networks + Android clients + MPEG2 captures it would play more nicely.

For now im thinkin in replacing my old HDHomeRun OTA which outputs as MPEG2 to HDHomerun Extend (since those transcode to H264 on hardware). Ill just wait for them to release the new revision which should come out early next month
__________________
SageTV 7.1.9 / Phoenix
Captures: 1x Genpix Skywalker DVB4Sage / 1x 7500 Prof DVBS2 Tunner DVB4Sage / 1x HD HomeRun / 1x Slingbox M1 / 1x Colossus HD
Extender: 2x HD200 / 1x HD300

Reply With Quote
  #17  
Old 07-11-2016, 03:46 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
Quote:
Originally Posted by Jabroni View Post
Nice to see it went to a discussed topic

Another thing ive noticed is that it seems that when it transcodes it leaves the same codec used and just changes bitrate, so a OTA MPEG2 15-20mbit stream looks like crap on a remote placeshifter ~1.5mbit rather than a H264 3-4mbit 1080i stream running with the same capped 1.5mbit. Not sure if it would be a good idea to force sage to transcode all to H264 (i know it would tax the cpu doing more on the fly compression) but maybe for mobile networks + Android clients + MPEG2 captures it would play more nicely.

For now im thinkin in replacing my old HDHomeRun OTA which outputs as MPEG2 to HDHomerun Extend (since those transcode to H264 on hardware). Ill just wait for them to release the new revision which should come out early next month
It always uses MPEG4 for video compression when placeshifting....so something else must have been going on.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
Reply


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

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
Transcoding HD-PVR files for placeshifter problems Ericft SageTV Placeshifter 10 02-20-2010 08:07 PM
Faster Internet connections at home, time to support HD resolutions in placeshifter mkanet SageTV Placeshifter 20 11-13-2009 09:06 AM
Placeshifter not displaying bitrate info on Vista Steerpike SageTV Placeshifter 0 02-03-2008 11:34 PM
Linux Placeshifter on LAN transcoding? zoop SageTV Linux 6 09-19-2007 07:35 AM
Placeshifter Hardware transcoding pschweig SageTV Beta Test Software 6 03-14-2006 10:15 AM


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


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