pyTivo Discussion Forum Forum Index pyTivo Discussion Forum
Answers and the development of pyTivo a TiVo transcoding server
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

pyTivo.bat missing quotes
Goto page 1, 2  Next
 
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> Support
 View previous topic :: View next topic  
Author Message
JonMikelV



Joined: 23 Feb 2008
Posts: 51

PostPosted: Sat Feb 23, 2008 5:55 am    Post subject: pyTivo.bat bug Reply with quote

Just a heads up that the 20080221 version's pyTivo.bat file is missing some quotes at line 39:
"C:\Program Files (x86)\Python25\python.exe" "C:\Program Files (x86)\pyTivo\pyTivo.py"

This causes an error when trying to start Console.

Oops - now I get:
Traceback (most recent call last):
File "C:\Program Files (x86)\pyTivo\pyTivo.py", line 3, in <module>
import beacon, httpserver, os, sys
File "C:\Program Files (x86)\pyTivo\beacon.py", line 3, in <module>
import config
ImportError: No module named config

Start and Stop of service seem to run OK...well, no errors reported at least. However, netstat shows nothing listening on port 9032.

OK - then. This was installed with the windows installer on a Windows 2003 Server (64 bit).

I do have a config.py and config.pyc in the same folder as pyTivo.py and beacon.py. And....that's about the extend of my Python knowledge. Smile

Thanks for all your work so far!

Jon-Mikel
Back to top
View user's profile Send private message
krkeegan
Site Admin


Joined: 04 Jan 2008
Posts: 458
Location: Los Angeles, CA

PostPosted: Sat Feb 23, 2008 6:30 am    Post subject: Reply with quote

Hmm, you are right with the quotes, that is my mistake. I was not prepared for people to have spaces in the directory name of python.

As for the config issue I am kinda baffled at the moment. What confuses me is that pyTivo.py is able to find and import beacon.py but beacon.py is not able to import config.py.

Very strange. I am looking into this right now.
Back to top
View user's profile Send private message Visit poster's website
krkeegan
Site Admin


Joined: 04 Jan 2008
Posts: 458
Location: Los Angeles, CA

PostPosted: Sat Feb 23, 2008 6:37 am    Post subject: Reply with quote

OK since you seem comfortable editing the batch file try this. Open the file and add the following below the first line which reads @ECHO OFF:
Code:

SETLOCAL
SET PYTHONPATH="C:\Program Files (x86)\pyTivo\"


Save and try running again.

Hopefully that will work.
Back to top
View user's profile Send private message Visit poster's website
JonMikelV



Joined: 23 Feb 2008
Posts: 51

PostPosted: Sat Feb 23, 2008 7:20 am    Post subject: Reply with quote

Yeah - I searched around and tried adding the path to my Environment (System -> Advanced -> Environment Variables) but that didn't seem to help.

However, taking my music share out of my config DID work. This is the first time I've tried a music share so I don't know if it's what I'm share or how that is the issue.

Once I got 20080207 working I tried going back to 20080222 without any luck. I really wanted a service running so copied the pyTivoService.* files into my 20080207 folder. It started, but didn't actually seem to be doing anything.

It's late here so I'm gonna give up for the night (well, morning now) and try variations tomorrow. I'll post what I figure out.

Thanks for the fast response!
Back to top
View user's profile Send private message
JonMikelV



Joined: 23 Feb 2008
Posts: 51

PostPosted: Sat Feb 23, 2008 9:36 pm    Post subject: Reply with quote

OK - well, now that I'm more awake I re-read your post and realized I put the path in the wrong place.

But I figured I've screwed things up enough I should start over so I tried to re-install 20080221. But it won't let me - says I must uninstall the current one first, I click "OK" then it tells me it wasn't uninstalled & quits. Unfortunately, I don't know what I screwed up that's making the uninstaller die.

Oh, wait - I've got a mix of the old & new ones in there, but no uninst.exe. OK - now it's uninstalling nicely...

And things are looking good. Even music is working now. There must have been an issue with the 20080221 install not recognizing the old install as an actual install and the mix of the two together caused problems.

Now the only issue I have is that the Service doesn't wanna work. Console is fine, but service SAYS it's started, but nothing is actually being served.

Since I'm here I better get these recorded before I forget:
1) Can "def infopage(self):" be tweaked to handle form submissions to provide a web interface for config editing & media info TXT files.
2) If no <file>.txt file found, can Folder names automatically be added to media info or some types of parsing rules be set up.
3) Can ffmpeg add closed captioning info to a stream.
4) In Windows can the ffmpeg process be given a lower priority so CPU isn't taxed so much (I mean, I don't NEED it to stream at 3x speed...)

But first I need to get the service working. Smile

Thanks again for all your work!

Jon-Mikel
Back to top
View user's profile Send private message
krkeegan
Site Admin


Joined: 04 Jan 2008
Posts: 458
Location: Los Angeles, CA

PostPosted: Sat Feb 23, 2008 11:10 pm    Post subject: Reply with quote

JonMikelV wrote:
1) Can "def infopage(self):" be tweaked to handle form submissions to provide a web interface for config editing & media info TXT files.
Yes! I am working on this. My beta-admin branch is a work in progress towards something exactly like this. I say another week or less and it should be decently funcational.

JonMikelV wrote:
2) If no <file>.txt file found, can Folder names automatically be added to media info or some types of parsing rules be set up.
Umm, I am not sure where you want this added. To the title? As the Series name? The other issue is not everyone labels their folders and files the same.


JonMikelV wrote:
3) Can ffmpeg add closed captioning info to a stream.
Unfortunately no. Or at least I don't think so. I have not had any luck with encoding subtitle info either to be rendered in the movie or as another stream that is read by tivo. If anyone has any ideas on how to do this I would love to add this feature.


JonMikelV wrote:
4) In Windows can the ffmpeg process be given a lower priority so CPU isn't taxed so much (I mean, I don't NEED it to stream at 3x speed...)
Yes, check out this

As for you service issues. You need to open pyTivoService.ini and put quotes around your python path there too.

Sorry about that. Like I said it was a complete oversight on my part I didnt think about people having spaces in the path to their python installs.

Kevin

Edit: Also what fixed the config.py issue?? Was setting the env variable the solution? If so I will add it to the batch file in the future.

Thanks
Back to top
View user's profile Send private message Visit poster's website
PaulS



Joined: 05 Jan 2008
Posts: 184

PostPosted: Sun Feb 24, 2008 12:45 am    Post subject: Reply with quote

To keep ffmpeg's CPU usage down, you could also try Process Lasso. See HERE.
Back to top
View user's profile Send private message
edtee



Joined: 08 Feb 2008
Posts: 19

PostPosted: Sun Feb 24, 2008 5:51 am    Post subject: Reply with quote

krkeegan wrote:

JonMikelV wrote:
2) If no <file>.txt file found, can Folder names automatically be added to media info or some types of parsing rules be set up.
Umm, I am not sure where you want this added. To the title? As the Series name? The other issue is not everyone labels their folders and files the same.


JonMikelV wrote:
3) Can ffmpeg add closed captioning info to a stream.
Unfortunately no. Or at least I don't think so. I have not had any luck with encoding subtitle info either to be rendered in the movie or as another stream that is read by tivo. If anyone has any ideas on how to do this I would love to add this feature.
Thanks


2) Might be usefull but I can't fully envision it off the top of my head. I usually have a structure of:
SeriesTitleIsDirName\SeriesTitle-XX-ShowTitle.ext
Where XX is the episode number. I don't use season numbers in my title filenames(this is all in a ".my" metadata file), so sometimes XX maybecome XXX for shows that have over 99 episodes.
I'm providing all of this info because I think his request could have use for people who do something like:
SeriesTitleIsDirName\XX-ShowTitle.ext
I know some people do this type of storage from my experience with SageTV. Although most seem to setle on the "SeriesTitle-SxxExx-ShowTitle.ext" format.
Anyway... I'm wondering if maybe there could be some kind of template that the user could build that could then be used to parse out the desired metadata in the users' desired way. This may tie back to what you are doing with #1. Note to self, ask about pytivo supporting parsing of .my files for metadata.

#3 Can be done pretty easily(1 or 2 lines of code), but... I only know how to do it in Windows using avisynth feed into ffmpeg. The other caveats are... 1) It's a slower encode, since it goes thru avisynth and Directshow before being encoded to mpeg2 by ffmpeg. 2) There can be a quality drop compared to straight ffmpeg handling. This is due to the fact that the simple method I used(may and likely are better) is basically a full Directshow decode, in fact the .avs will play in WMP, Zoomplayer, etc. 3) The subs are hard coded into the mpeg2 video, itself. This may not be that big of a deal for many, like me, who almost always want hearing assistance.

You could setup pytivo to build a .avs for a transfer. The .avs could be based off a simple template that a user could even edit, or not. The only real thing pytivo would need to change from the template is the DirectShowSoure() parameter that points to the actual file. By having pytivo build the avs per transfer we avoid useless avs files left on the computer. More importantly maybe you guys could figure out a way to ask(some kind of dialog on the Tivo screen) a user if they wish to use avisynth proccessing for each individual tranfer. It would only need a simple A or B choice, but I don't know if this is possible on the Tivo. Maybe it could be faked with some kind of simulated directory choice. The Tivo would think it was navigating a Dir stucture(which it does easliy already) but the dir would be fake and the names would be the transfer options. That's a strange hack, I know, but I just thought I'd throw it out. At the very least you could have ffmpeg look at the file to see if subs are present, and then onyl use avisynth if a user set a config option in "pyTivo.conf". Like, "avisynthforsubs=true". This way any disadvantages of the extra processing could be avoided for files where it is useless, and the user would decide if the downside was worth it where subs do exist.

Ohh! One other thing about avisynth, not related to subs... It could be used as a optional fallback encode(at least where supported) if ffmpeg fails. If they file can be played on your computer then you can pass it thru avisynth to ffmpeg and onto your Tivo. I know this since I have a series for which ffmpeg is failing(don't know why as codecs are same as my others at quick glance). I simply built a Dshow based playback avisynth script and then dropped in the filename. This avs plays back great using pytivo. The only downside was I had to make one for each file in the series, since I lack the coding skill to do even a simple parse of a text file to replace a keyword with the filepath\filename of the video. The only possible problem I could see for this in pytivo, is making sure ffmpeg is actually running. But that is likely already handled and if not, it relates to my thread and krkeegan's response, already in this forum. So I'll stop here. Shocked

BTW, I'm looking forward to trying your admin branch.

_________________
Love my Tivo, but I love the independent developer's software over the "official" stuff.
Back to top
View user's profile Send private message
krkeegan
Site Admin


Joined: 04 Jan 2008
Posts: 458
Location: Los Angeles, CA

PostPosted: Sun Feb 24, 2008 4:40 pm    Post subject: Reply with quote

Unfortunately the avisynth option is not quite what I was looking for.
1. It would require the inclusion of another binary in addition to ffmpeg
2. It would not allow for realtime transcoding anymore. At least that is my understanding.

I suspect that those to complaints are pretty standard for anytype of solution to allow subtitles.

In the future i would certainly like to add such a feature. But currently my major focus is simplifying pyTivo and bug hunting to make it as easy to use for new users as possible. Adding another binary would only increase the bugs and issues.
Back to top
View user's profile Send private message Visit poster's website
JonMikelV



Joined: 23 Feb 2008
Posts: 51

PostPosted: Mon Feb 25, 2008 1:47 am    Post subject: Reply with quote

After I uninstalled then re-installed everything (and fixed the quotes issue) it all just worked, so (as far as I can tell) the path param wasn't needed.

However, even with quotes in the pyTivoService.ini file (both on CommandLine and WorkingDir - which has an extra space at the end, btw) I couldn't get the service to work. Here's the error fromt he pyTivoService.log file:
Failed to start program 'C:\Program Files (x86)\Python25\python.exe" "C:\Program Files (x86)\pyTivo\pyTivo.py', error code = 2

I don't (well, didn't) have the pyTivo debug enabled so don't have anything for you from there yet.

On the other suggestions front I agree, we're still pretty new to the game to be adding frills like that, I just wanted to get 'em out there before I forgot. I'm an idea guy - unfortunately, my old ideas get forgotten making room for new ones. Smile

I hadn't really thought out the full "folder name" thing yet but I was thinking with/without subtitles could be done with different shares & share specific settings.

After I get the service thing figured out [ well, after you guys do all the work and I test it Smile ] I'm hoping to figure out why my TiVo won't group the stuff that I bring over. (In other words I have some forum reading to do.)

Jon-Mikel
Back to top
View user's profile Send private message
krkeegan
Site Admin


Joined: 04 Jan 2008
Posts: 458
Location: Los Angeles, CA

PostPosted: Mon Feb 25, 2008 2:53 am    Post subject: Reply with quote

Ok seriously I think I got it this time. You can download a new windows installer with the changes we have talked about plus a few more fixes to make pyTivo more stable.
Windows Installer

Or if you just want to edit the pyTivoService.ini file to read like this:
CommandLine = '"C:\Program Files (x86)\Python25\python.exe" "C:\Program Files (x86)\pyTivo\pyTivo.py"'
WorkingDir= "C:\Program Files (x86)\pyTivo"

Notice: the command line parameter is surrounded by single quotes as well. So the parameter starts '"(single quote double quote). And the reverse for the end of the line.

I think that should solve it FINGERS CROSSED
Back to top
View user's profile Send private message Visit poster's website
JonMikelV



Joined: 23 Feb 2008
Posts: 51

PostPosted: Mon Feb 25, 2008 4:02 am    Post subject: Reply with quote

I expect I didn't get the single quotes correct but for some reason the service still isn't doing anything.

This is what shows in the service log:
02/24/2008, 21:46:53
C:\Program Files (x86)\pyTivo\pyTivoService.exe
02/24/2008, 21:46:53
C:\Program Files (x86)\pyTivo\pyTivoService.ini
02/24/2008, 21:46:53
C:\Program Files (x86)\pyTivo\pyTivoService.log
02/24/2008, 21:46:53
pyTivo

I figured out my NPL folder groups don't work 'cause I'm using a series ID of a non-showing series. As soon as the Oscars are over I'll test overloading SH000001 (Paid Programming) and SH843175 (TiVo Broadcast) as generic ones that are likely always available.

I did mention I'm running this on a 64bit version of W2k3 Server, right? I expect there's something in that which is causing the problem.

[edit] I confirmed that using SH000001 (Paid Programming) did "folderize" my pyTivo streams into "Paid Programming" on the NPL. Maybe there should be an option to specify a default series ID. A share specific override might make sense too... I think I'll start a new discussion for this one, though.

Jon-Mikel
Back to top
View user's profile Send private message
edtee



Joined: 08 Feb 2008
Posts: 19

PostPosted: Mon Feb 25, 2008 7:25 am    Post subject: Reply with quote

Quote:
Unfortunately the avisynth option is not quite what I was looking for.
1. It would require the inclusion of another binary in addition to ffmpeg
2. It would not allow for realtime transcoding anymore. At least that is my understanding.

I suspect that those to complaints are pretty standard for anytype of solution to allow subtitles.

In the future i would certainly like to add such a feature. But currently my major focus is simplifying pyTivo and bug hunting to make it as easy to use for new users as possible. Adding another binary would only increase the bugs and issues.
Can't agrue with point 1, and I understand keeping distro simple and the size down is important. As for #2... it does transfer in realtime(barely) on my system AMD Athlon XP 2100+, with 1 GB ram. These are pretty modest specs by most setups these days, heck I have 2 other computers that are at least twice as fast as this old setup. Laughing Still I get the overall point. Still if I find a way to add subs using just ffmpeg I will be sure to let you know.

As for the near future of pytivo... I'll try to keep my comments on bugs. For instance I'm going to DL your new Win installer and test it out on my trouble WMV. I'll also do some research and see how to enable wmcbrine's 1 second ffmeg encode test. I don't know if you merged that into your build but if not don't worry, I've had multiple forks setup on this machine in the past.

As for your build specifically... Did you intend the installer to setup the serivce mode to be able to access UNC Windows shares? I know the last build, haven't run your newest yet, worked great as a service except for my network shares(these same network shares work fine if pytivo is not run as a service). I know this is a quirk of Windows and it's handling of service accounts and networks. I just didn't know if you wished you installer to support this. What I do now is, after install I go to Windows' manage services console and change pytivo properties. I have it use a password protected(my main/default account has no password) hidden account I setup just for running apps as servies. Once I change pytivo's setting from the management console to this account and restart the pytivo service, pytivo shows my network shares too. Is there something I should change or be doing in the "pyTivoService.ini" file. It seems to me I should be able to do all I'm doing from that file, but I'm not sure what to enter. Or this this something(setting up "pyTivoService.ini" to allow network access) you intended the installer to handle automatically? I don't know if you consider this a bug or not, but... You know me, I'm always thinking. Wink

Seriously, I will try to keep posts/threads on the bug topic. But I'm that type of personality that is always thinking of something and going "hay that would be cool!". Please feel free to totally ignore me when I do wander. If nothing else at least the ideas will be recorded, for my own thoughts. Maybe after pytivo is fully stable and newbie friendly, someone can come back and look at them. Still if i do go too far off track, please feel free to delete/move my posts. I'm not just trying to be melodramitic, seriously. I used to help mod a forum and know numorous posts like mine can be distracting to the forum/thread. You'd think I be able to control myself knowing this, but I can't. As this post likely shows. Embarassed

peace

_________________
Love my Tivo, but I love the independent developer's software over the "official" stuff.
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2009
Location: Maryland

PostPosted: Mon Feb 25, 2008 8:34 am    Post subject: Reply with quote

edtee wrote:
I'll also do some research and see how to enable wmcbrine's 1 second ffmeg encode test.

That's wgw's, not mine. But it's merged into both the others AFAIK.

Quote:
Maybe after pytivo is fully stable and newbie friendly, someone can come back and look at them.

I'm happy to look at them now. I'm certainly interested in these ".my files" of which you spoke. I hadn't heard of them, and I don't think any of the other pyTivo developers had either. (?) It looks like we may have been reinventing the wheel. But I haven't been able to find much more about them since you posted.

_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
JonMikelV



Joined: 23 Feb 2008
Posts: 51

PostPosted: Mon Feb 25, 2008 1:52 pm    Post subject: Reply with quote

I KNEW there was a reason I try not to use the computer when I'm tired!

I am using a \\192.168.x.x\Share Name UNC in my .conf file. I even remember being concerned that I should have something in the user/pwd settings of the pyTivoService.ini file or update the server, like you did, but blew it off 'cause my share SHOULD be open to anybody on the local network.

I changed my shares so I've only got one local one...oh, wait - that's got a password on it. OK - local folder with Everyone permissions and test avi file with Everyone permissions....still nothing.

BTW - I'm testing by hitting with localhost:9032 in my browser and I don't even get the "This is a pyTivo server" response. And netstat -a doesn't show anything on on the port. I guess that's why I didn't bother tweaking the shares before - I figured the server wasn't even running.

Jon-Mikel
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> Support All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Site is in NO WAY affiliated with TiVo Inc

Powered by phpBB © 2001, 2005 phpBB Group
phpBB SEO

Get pytivo at SourceForge.net. Fast, secure and Free Open Source software downloads
[ Time: 0.1826s ][ Queries: 12 (0.0128s) ][ GZIP on - Debug on ]