SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Software

Notices

SageTV Software Discussion related to the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the SageTV software application should be posted here. (Check the descriptions of the other forums; all hardware related questions go in the Hardware Support forum, etc. And, post in the customizations forum instead if any customizations are active.)

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-05-2008, 07:38 AM
stryker stryker is offline
Sage Advanced User
 
Join Date: Dec 2007
Posts: 92
Does a network encoder actually encode?

I have a sagetv server and sagetv server setup as a network encoder. It all works fine however I notice that when my htpc sagetv client is viewing live tv fed from the card on the encoder, looking at both server's cpu usage it looks like the main sagetv server is doing the actual encoding of the stream and storing to the recording directory?

Am i right? is it not possible to make the network encoder actual encode the stream to spread the cpu usage?
Reply With Quote
  #2  
Old 10-05-2008, 08:21 AM
gplasky's Avatar
gplasky gplasky is offline
SageTVaholic
 
Join Date: Jul 2003
Location: Howell, MI
Posts: 9,203
My understanding is using a server as a newtwork just allows it to claim the tuner as its own, so to speak. It makes the tuner installed in the box seem as if it is installed in the main SageTV server, makes it a part of the guide and controls everything it does. I would think if you had defined a recording directory on that box it would record it there but it would be driven by the main SageTV server. The encoding of the recording (for analog tuners) should be done on the tuner card because they are hardware encoders (or should be). Any HD digital streams come across as the final format and requires no encoding. The HD-PVR encodes in h.264 in hardware and again should not cause much of a load on the CPU.

Gerry
__________________
Big Gerr
_______
Server - WHS 2011: Sage 7.1.9 - 1 x HD Prime and 2 x HDHomeRun - Intel Atom D525 1.6 GHz, Acer Easystore, RAM 4 GB, 4 x 2TB hotswap drives, 1 x 2TB USB ext Clients: 2 x PC Clients, 1 x HD300, 2 x HD-200, 1 x HD-100 DEV Client: Win 7 Ultimate 64 bit - AMD 64 x2 6000+, Gigabyte GA-MA790GP-DS4H MB, RAM 4GB, HD OS:500GB, DATA:1 x 500GB, Pace RGN STB.
Reply With Quote
  #3  
Old 10-05-2008, 09:41 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,607
A Sage network encoder is probably a misnomer for what it does. It's actually a "Network Tuner". The API is fairly generic, and it basically support changing channels and writing the vidoe output to a specified file location. There is nothing the API for actually performing an encode (although the tuner could and probably does encode as it writes the file).

Also, there is nothing in the API for transferring of video which means that either sage uses an undocumented way of moving the recorded file from server a to server b, or both server a and b share the same filesystem. (local or remote)

If sage is actually encoding the file again, on the local box, then it may be that a specific recording quality is set, and causing sage to re-encode the video again.
Reply With Quote
  #4  
Old 10-05-2008, 01:04 PM
stryker stryker is offline
Sage Advanced User
 
Join Date: Dec 2007
Posts: 92
Hi,

Yes on my network encoder... tuner :-) I set the tvrecord directory to be the tvrecord folder on the main sagetv server. While watching a channel served by the network tuner I ran a file util on the main sagetv server and it showed the local sagetv process on the main sagetv server was actually writing the file, so it seems the network tuner streams the raw data from the tuner card to the sagetv server where it is encoded (or maybe thats transcoded) to the set recording quality and written to file where the sagetv client picks it up for display.

I can see this being a limitaiton if all the processing power has to be on the main sagetv server.... I saw one thread on these forums where a user was talking about encoding the stream from 60 tuners.... no number of network tuners in that instance would help.

I only use a network tuner as the haupp s2 card will not work in my main sagetv server so I'm happy, I was just curious.

Thanks for the replies,

Jon
Reply With Quote
  #5  
Old 10-05-2008, 01:45 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,186
Quote:
Originally Posted by stryker View Post
Hi,

Yes on my network encoder... tuner :-) I set the tvrecord directory to be the tvrecord folder on the main sagetv server. While watching a channel served by the network tuner I ran a file util on the main sagetv server and it showed the local sagetv process on the main sagetv server was actually writing the file, so it seems the network tuner streams the raw data from the tuner card to the sagetv server where it is encoded (or maybe thats transcoded) to the set recording quality and written to file where the sagetv client picks it up for display.
You sure it was writing the file? I'm 99% sure the network encoder writes the file to the directory Sage specifies. For example SGraphRecorder uses normal Dshow filters and nothing special to record a file, it takes care of everything from tuning to writing.

At most, the network encoder streams the encoded stream back to the server to be written, but I don't think even that is the case. The server doesn't have any knowledge of the capabilities of the network tuners, beyond they exist.

Are you sure the server is writing the file? Not just reading it? The main server does monitor the recording file to make sure it's recording and restart the capture if necessary.

Also you don't mention which tuner(s) you have. Almost all of the supported tuners either have hardware encoders or are digital tuners which require no encoding.

Quote:
I only use a network tuner as the haupp s2 card will not work in my main sagetv server so I'm happy, I was just curious.
You're talking DVB-S2 right? There's no encoding going on with that, it's just a pure bitstream capture.
Reply With Quote
  #6  
Old 10-06-2008, 01:40 AM
stryker stryker is offline
Sage Advanced User
 
Join Date: Dec 2007
Posts: 92
Hi, thanks for your thoughts on this. I thought given you set the recording quality in sage then there is some encoding going on, in fact I would of thought in the recording quality option there should be one that states "use source".

I ran a file util that did show the locate sagetv process with the file open, however given what you've said I will check if its open for read or write.

However I can't dismiss the fact I noticed the main sagetv server was using around 20% cpu while the client was watching a channel from the net encoder. I'll do some tests and double check.

I have a haupp nova dual dvbt card in the main sagetv server and yes the haupp dvb-s2 in the network encoder/tuner??

Jon
Reply With Quote
  #7  
Old 10-06-2008, 07:06 AM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,186
Quote:
Originally Posted by stryker View Post
Hi, thanks for your thoughts on this. I thought given you set the recording quality in sage then there is some encoding going on, in fact I would of thought in the recording quality option there should be one that states "use source".
Recording quality is sort of a fallback, it's ignored for digital tuners, and only used if Sage has to fall back to an encoder that supports bitrate selection.

Quote:
I ran a file util that did show the locate sagetv process with the file open, however given what you've said I will check if its open for read or write.
Are you using SageTV as an encoding server, or a 3rd party network encoder? It's possible that Sage does stream the (encoded) data back to the main server and writes it there. But I know 3rd party network encoders don't work like that.

Quote:
However I can't dismiss the fact I noticed the main sagetv server was using around 20% cpu while the client was watching a channel from the net encoder. I'll do some tests and double check.
For some reason, my server seems to run a "noticable" CPU usage most of the time.
Reply With Quote
  #8  
Old 10-06-2008, 07:38 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,607
one intersing apect of the network encoder api is that there is a command "get file size" that is called from the sever to the the encoder server. basically the encoding server tells how large the file is getting..... In my experience, i've seen where the sage server gets overly agressive in calling "get file size" so much to the point that I was receiving about 30+ requests per second. In my network encoding server, I had to write some code to "block" and hold the connection so that I could "tame" the server. I basically put in code that said, if the time between this request and the previous is less than a specified # of seconds, then block and hold, and the reply.

I wonder if the cpu spike is related to this "get file size" command??
Reply With Quote
  #9  
Old 10-06-2008, 12:09 PM
stryker stryker is offline
Sage Advanced User
 
Join Date: Dec 2007
Posts: 92
I ran the test, funny, I noticed cpu usage was only at around 5% while watching a SD channel that was served by the encoding server.

In answer to your question I have a sagetv server with a haupp nova dual tuner and a sagetv server acting as network encoder with a haupp dvb-s2 tuner (I have to do it like this as the s2 tuner will not work in the main sagetv server).

I ran the file util on the sagetv server while the client (a third pc with sagetv-client installed) was watching a channel served by the network encoder... it showed the main sagetv server doing writes to the file, so it is the main server writing the file, not the encoding server. As previously stated the network encoding server is using the main sagetv server's tvrecord folder over a network share.... although it looks like thats not neccessary.

So, stuckless, given my original question and what you've said; am I right in saying its the master sagetv server that writes the file for live tv?
Reply With Quote
  #10  
Old 10-06-2008, 12:15 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,607
Quote:
So, stuckless, given my original question and what you've said; am I right in saying its the master sagetv server that writes the file for live tv?
I could very be true... but if they are, then sage is using a proprietary undocumented means of transfering the file from server a to server b. The network encoder api does not provide the ability to do this, but that doesn't mean that Sage isn't doing it
Reply With Quote
  #11  
Old 10-06-2008, 12:52 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,186
Well, we pretty much know the encoding server protocol is slightly different than the "normal" network encoder protocol, for example encoding servers are automatically discovered and enabled, while "network encoders" require manual file editing.

I'd not surprised if Sage uses a more sophisicated interface privately, one that would eliminate the troubles that can be associated with recording paths on different machines.
Reply With Quote
  #12  
Old 10-06-2008, 02:15 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,607
Quote:
...while "network encoders" require manual file editing...
Yes and no.... there is no out of the box api for discovery, but sage uses a udp discovery packet... i added it my code once and my sage server picked up and used my encoder without a manual configure.
Reply With Quote
  #13  
Old 10-08-2008, 12:32 PM
Nightrader_ Nightrader_ is offline
Sage User
 
Join Date: Dec 2005
Posts: 33
Quote:
Originally Posted by stryker View Post

I ran the file util on the sagetv server while the client (a third pc with sagetv-client installed) was watching a channel served by the network encoder... it showed the main sagetv server doing writes to the file, so it is the main server writing the file, not the encoding server. As previously stated the network encoding server is using the main sagetv server's tvrecord folder over a network share.... although it looks like thats not neccessary.
If your encoder is saving to a network share, then of course the server will be doing the writes to the file, as the client machine is only passing the file data to the SMB service (file sharing service), but this is not anything thing to do with SageTV. Anytime you write to a share, the server is the one actually writing to disk.

Cheers,

Gene Reeves
Reply With Quote
  #14  
Old 10-09-2008, 05:56 AM
stryker stryker is offline
Sage Advanced User
 
Join Date: Dec 2007
Posts: 92
No, the fileutil showed the master server's sagetv process doing the writing.
Reply With Quote
  #15  
Old 10-09-2008, 11:35 AM
phelme's Avatar
phelme phelme is offline
Sage Icon
 
Join Date: Dec 2006
Posts: 1,048
hmm. I thought the only file size call was the 5 minute "are we still communicating?" check the master server does to the network encoding box to see if everything has gone to heck. that's what I thought I was seeing when trying to debug a problem I was having with the HD-PVR as a network encoder.

(a problem which neither i nor Sage support every did figure out BTW. I gave up and moved the DirecTV box to the server room. As far as I know, the HD-PVR, with current software, flat out won't function well as a network encoder.)

Quote:
Originally Posted by stuckless View Post
one intersing apect of the network encoder api is that there is a command "get file size" that is called from the sever to the the encoder server. basically the encoding server tells how large the file is getting..... In my experience, i've seen where the sage server gets overly agressive in calling "get file size" so much to the point that I was receiving about 30+ requests per second. In my network encoding server, I had to write some code to "block" and hold the connection so that I could "tame" the server. I basically put in code that said, if the time between this request and the previous is less than a specified # of seconds, then block and hold, and the reply.

I wonder if the cpu spike is related to this "get file size" command??
__________________
Server: AMD 9600 Phenom on XP, Gigabyte GA-MA78GPM, 2GB RAM, 320+250+500 GB SATA drives, HDHomeRun Prime, HD-PVR x.5.1, Paterson serial
Client/Encoder:AMD 3800+ X2, 512 MB RAM, ATI X1650 XT, nMediaPC case, Hauppauge HD-PVR, Cyberlink/ArcSoft decoders, USB-UIRT
Client/Encoder: AMD 3800+ X2, 512 MB RAM, 6150 graphics, nMediaPC case, ArcSoft decoders
Client: HD300, Asus Pundit P1-AH1, AMD 3800+ X2 CPU, 1 GB RAM, 6150 graphics, ArcSoft decoders
Backup: Synology
SageTV version: FINAL
Reply With Quote
  #16  
Old 10-10-2008, 12:24 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
By the way, it is extremely unlikely that the network encode is passing raw video to the server because, firstly it would require a huge amount of sustained network bandwidth (raw SDTV = ~30MBytes/s, which is stretching the limits of a Gigabit LAN), and secondly, because your tuner card can not actually get raw video from an already-encoded DVB stream!
The 'recording quality' is also ignored for digital tuners for this reason.

What is the actual CPU usage that you see on the 3 computers?
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #17  
Old 10-10-2008, 05:36 AM
stryker stryker is offline
Sage Advanced User
 
Join Date: Dec 2007
Posts: 92
Oh processor usage is fine on all three... they are all below/around 10%. I was only asking as I was curious, although this has turned into an interesting thread.

And yes of course all my streams are digital so now I know the "quality" setting is only used for analogue encoding I guess no machine is encoding anything...

although I stick by my guns in stating it seems the master server writes the actual file to disk, at least thats what filemon showed me.

I am planning on using a spare 100GB partition on my encoding server to add to the list of shares used for recording TV..... (formatted 64K of course)... I'll let you know whats writing what when I have a show received by my encoding server and also stored on my encoding server... I'd be a little disappointed if the show was streamed to the master server then written to the local share on the encoding server by the master server.... I'm sure that won't happen though :-)

Last edited by stryker; 10-10-2008 at 05:39 AM.
Reply With Quote
  #18  
Old 10-10-2008, 12:19 PM
phelme's Avatar
phelme phelme is offline
Sage Icon
 
Join Date: Dec 2006
Posts: 1,048
Quote:
Originally Posted by nielm View Post
By the way, it is extremely unlikely that the network encode is passing raw video to the server because, firstly it would require a huge amount of sustained network bandwidth (raw SDTV = ~30MBytes/s, which is stretching the limits of a Gigabit LAN), and secondly, because your tuner card can not actually get raw video from an already-encoded DVB stream!
...?
I'm not familiar with the Hauppauge Nova Dual, but the HDHomeRun, in it's current incarnation, I think unleashes the largest stream at about 40 mbps. The SageTV server process has to spend some cycles on that converting it to an MPEG, but for my PC it's usually under 7% of the CPU (AMD 3600+ X2). When both tuners on the HDHR are going with HD material though, it averages around 9% with occasional spikes to 20%.
__________________
Server: AMD 9600 Phenom on XP, Gigabyte GA-MA78GPM, 2GB RAM, 320+250+500 GB SATA drives, HDHomeRun Prime, HD-PVR x.5.1, Paterson serial
Client/Encoder:AMD 3800+ X2, 512 MB RAM, ATI X1650 XT, nMediaPC case, Hauppauge HD-PVR, Cyberlink/ArcSoft decoders, USB-UIRT
Client/Encoder: AMD 3800+ X2, 512 MB RAM, 6150 graphics, nMediaPC case, ArcSoft decoders
Client: HD300, Asus Pundit P1-AH1, AMD 3800+ X2 CPU, 1 GB RAM, 6150 graphics, ArcSoft decoders
Backup: Synology
SageTV version: FINAL
Reply With Quote
  #19  
Old 10-10-2008, 02:29 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,186
It's not "converting" to MPEG, it already is MPEG from the HDHR. What the Sage server does (or maybe the HDHR, I'm not exactly sure about the data flow) is parse the MPEG Transport Stream, which contains multiple programs, and save the desired program as an MPEG Program Stream.
Reply With Quote
  #20  
Old 10-10-2008, 04:50 PM
phelme's Avatar
phelme phelme is offline
Sage Icon
 
Join Date: Dec 2006
Posts: 1,048
Quote:
Originally Posted by stanger89 View Post
It's not "converting" to MPEG, it already is MPEG from the HDHR. What the Sage server does (or maybe the HDHR, I'm not exactly sure about the data flow) is parse the MPEG Transport Stream, which contains multiple programs, and save the desired program as an MPEG Program Stream.
that's what I meant... albeit lamely.
__________________
Server: AMD 9600 Phenom on XP, Gigabyte GA-MA78GPM, 2GB RAM, 320+250+500 GB SATA drives, HDHomeRun Prime, HD-PVR x.5.1, Paterson serial
Client/Encoder:AMD 3800+ X2, 512 MB RAM, ATI X1650 XT, nMediaPC case, Hauppauge HD-PVR, Cyberlink/ArcSoft decoders, USB-UIRT
Client/Encoder: AMD 3800+ X2, 512 MB RAM, 6150 graphics, nMediaPC case, ArcSoft decoders
Client: HD300, Asus Pundit P1-AH1, AMD 3800+ X2 CPU, 1 GB RAM, 6150 graphics, ArcSoft decoders
Backup: Synology
SageTV version: FINAL
Reply With Quote
Reply


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
Comcast, Big Ten Network Reach Broad Multimedia Agreement For Big Ten Network Content eopian The SageTV Community 1 06-21-2008 08:16 AM
Dropped favorite recording -- with debug logs Surtr SageTV Software 4 02-19-2008 10:48 AM
Network Encoder Questions AtariJeff SageTV Software 3 02-08-2008 04:50 PM
Sage network Encoder and Sage failure? nyplayer SageTV Software 1 09-27-2006 06:47 AM
EXETunerPlugin, Sage 4 and network encoder vuego SageTV Software 0 12-11-2005 02:47 PM


All times are GMT -6. The time now is 09:15 PM.


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