# iTiVo 1.2 for Tivo -> Mac -> iPhone



## Yoav (Jan 13, 2007)

Ok, just checked in a release 1.2 of the code. Sorry for the fast rollover, but there were some annoying file-length bugs. Hopefully this fixes some bugs people were seeing.

I also added the newest version of mencoder to the program...

You can get it from:
iTiVo googlecode page.

Or you can check for update if you have an older version...

Please report bugs you are seeing on the googlecode page


----------



## Tim Winders (Oct 5, 2007)

Yoav said:


> Ok, just checked in a release 1.2 of the code. Sorry for the fast rollover, but there were some annoying file-length bugs. Hopefully this fixes some bugs people were seeing.
> 
> I also added the newest version of mencoder to the program...
> 
> ...


I like! I like! Thank you.

I just wish transfers from the TiVo weren't so slow. 300 hours to transfer a 30 minutes (~3GB) show is crazy. (TiVo hard wired, Mac wireless-N @ 130MB).


----------



## Yoav (Jan 13, 2007)

Tim Winders said:


> I like! I like! Thank you.
> 
> I just wish transfers from the TiVo weren't so slow. 300 hours to transfer a 30 minutes (~3GB) show is crazy. (TiVo hard wired, Mac wireless-N @ 130MB).


Wow that *is* slow. Most likely the problem is actually the encoding you're doing. Try encoding to an iphone/low res file and see if it improves...

(mencoder is not the fastest monkey out there, and the bigger the resolution you encode to, with higher settings, the slower it is).

From my series-3, hard wired, a 3G show normally takes an hour...


----------



## Tim Winders (Oct 5, 2007)

Yoav said:


> Wow that *is* slow. Most likely the problem is actually the encoding you're doing. Try encoding to an iphone/low res file and see if it improves...
> 
> (mencoder is not the fastest monkey out there, and the bigger the resolution you encode to, with higher settings, the slower it is).
> 
> From my series-3, hard wired, a 3G show normally takes an hour...


I'll have to check out my cabling and network. Something is DEFINITELY wrong.

At this point, I wasn't doing an reencoding, just transferring as MPEG2.


----------



## Yoav (Jan 13, 2007)

Tim Winders said:


> I'll have to check out my cabling and network. Something is DEFINITELY wrong.
> 
> At this point, I wasn't doing an reencoding, just transferring as MPEG2.


First thing to try: download it directly from a web browser?

Make sure iTiVo and other tools are not running (you can only have one download going)...

connect to

https://<tivoip>/

(username: tivo / password : <your mak>)

And then select the file for download.. see how fast that goes.

Next, if it works fine, look at *~/.TiVoDL* while iTiVo is running (this is just the output from curl, which is the tool used to download the show).


----------



## Tim Winders (Oct 5, 2007)

Yoav said:


> First thing to try: download it directly from a web browser?
> 
> Make sure iTiVo and other tools are not running (you can only have one download going)...
> 
> ...


Ah! Only one download at a time. Grrr. That's just STUPID!  OK. That would explain the "too many connections" error I'm getting.

Downloading with https give the same slow result. I'm going to try wireless tonight and see what happens. That will eliminate the cable and switch as a possible issue. If that's better, I'll run a new network cable and try again.


----------



## ding (Feb 16, 2006)

Check this out:
http://code.google.com/p/etv-comskip/
It has an os x port of comSkip that automatically scans and cuts out commercials. It would be great if you could compile comSkip and included in the package resources and add this functionality to iTivo. That way you can choose to strip commercials from the downloads.


----------



## Tim Winders (Oct 5, 2007)

ding said:


> Check this out:
> http://code.google.com/p/etv-comskip/
> It has an os x port of comSkip that automatically scans and cuts out commercials. It would be great if you could compile comSkip and included in the package resources and add this functionality to iTivo. That way you can choose to strip commercials from the downloads.


Yeah, Yaov pointed to that in a different thread. I have it downloaded, but it seems it's intended to work with EyeTV.

How would I use this to work with the MPEG-TS files I get through iTiVo (assuming no transcoding done by iTiVo).


----------



## ding (Feb 16, 2006)

Sorry I didn't see that thread. I was writing to Yoav because he is the developer. I did not know he was aware of it. He would have to include comskip in his project like he includes memcoder or tivodecode. There is a makefile and a makefile xcode project for it there. Then he would just have to program in those features in iTivo. I am more a c++ objective c guy and iTivo is written in applescript so I could not say precisely what he needs to code but I can say for sure that the possibility is definitely there.

If you download the dmg file and show pkg content on the MarkCommercials app and go in contents/resources you should find the comskip app that will run as a command line tool. Here is the usage...



> Usage:
> comskip [-h|--help] [-w|--debugwindow] [-n|--playnice] [--zpcut] [--zpchapter] [--videoredo] [--csvout] [--plist] [-m|--demux] [-p|--pid=<string>] [-t|--ts] [-d|--detectmethod=<int>] [-v|--verbose=<int>] [-u|--dump=<int>] [-s|--play] [--ini=<file>] [--logo=<file>] [--cut=<file>] <file> [<file>]
> 
> -h, --help Display syntax
> ...


Let me know if it works.


----------



## Tim Winders (Oct 5, 2007)

ding said:


> Sorry I didn't see that thread. I was writing to Yoav because he is the developer. I did not know he was aware of it. He would have to include comskip in his project like he includes memcoder or tivodecode. There is a makefile and a makefile xcode project for it there. Then he would just have to program in those features in iTivo. I am more a c++ objective c guy and iTivo is written in applescript so I could not say precisely what he needs to code but I can say for sure that the possibility is definitely there.
> 
> If You download the dmg file and show pkg content on the MarkCommercials app and go in contents/resources you should find the comskip app that will run as a command line tool.


Perfect. Thanks!

I would encourage you, Yaov, to include comskip as an option. This is really cool!

I found it and sucked it out. Now to play with it!


----------



## Yoav (Jan 13, 2007)

ding said:


> Check this out:
> http://code.google.com/p/etv-comskip/
> It has an os x port of comSkip that automatically scans and cuts out commercials. It would be great if you could compile comSkip and included in the package resources and add this functionality to iTivo. That way you can choose to strip commercials from the downloads.


Hey ding!

Yeah I've been looking at comskip. My big fear is that I want iTiVo to be 'easy and automatic' to use, and looking at the comskip information, I worry that it could make mistakes (and since I intend to automatically remove the commercials based on the info from it, people would be rather 'displeased').

The other concern is that comskip needs to run through the whole mpeg2 stream before deciding on where the commercials are (unless I'm mistaken?). That would mean that encoding WHILE the download is going on (streaming) would be impossible. Instead I would have to download the entire mpeg2 stream, run comskip/comcut, and then run the result through the encoder.

I guess I can put it in as a 'BE CAREFUL/this will slow the download a lot AND you may lose some of the actual show' in the option for it.. hmmm...

Since you've used it: how often does it make mistakes? What are the best options to pass (safe options that is) to it?


----------



## Yoav (Jan 13, 2007)

I had to quickly upload a 1.2.1 release. My apologies.

I forgot to build the underlying tools as universal binaries, so anyone who had a powerpc-based mac was complaining. I *hope* this fixes it, although I don't have a powerpc-mac to test it on.


----------



## Tim Winders (Oct 5, 2007)

ding said:


> Let me know if it works.


I gave it a run on an existing show I had transferred from the TiVo and ran through tivodecode. This is the output. Of course, I have no idea what I'm doing...

tim-winderss-macbook-pro-17:bin twinders$ ./comskip -t -d 255 $HOME/Movies/AGT.mpg
Comskip 0.79.126, made using:
comskip-0.4.1-cvs - by Michel Lespinasse <[email protected]> and Aaron Holtzman
The commandline used was:
./comskip -t -d 255 /Users/twinders/Movies/AGT.mpg

Opening /Users/twinders/Movies/AGT.mpg
No INI file found in current directory. Searching PATH...
INI file found at comskip.ini
No INI file found anywhere!!!!
Setting detection methods to 255 as per command line.
Auto selecting the PID.
Video PID not found, available video PID's 19c2, 1ed8, 1660, 404, ee3, a61, 1945, eed, 126e, 226, f98, 1dd7, 606, 1772, 124d, 1be1,

0 frames decoded in 0.00 seconds (0.00 fps)


----------



## ding (Feb 16, 2006)

Yoav,

I know simple is good but an extra hidden drawer that can be activated in the preferences would be out of the way but still allow advanced functionality. I agree with you that it would be a no-no to do it on the fly. The way I had envisioned it is in a queue similar to your download queue but a comskip queue. In there you could add shows you already have downloaded that you want to strip commercials from. Also once you know that you like it you can also have a button to strip all commercials automatically and re-encode the file to something like "DoctorWho_comfree.mpg" or something similar. In the future if it doesn't get to confusing you can have a button (all within the comskip queue) that will delete all duplicates. Once clicked it can ask "delete originals or comfree" that way you can batch delete stuff.


----------



## ding (Feb 16, 2006)

Tim Winders,

you have to tell it where the comskip.ini file is. This file is located in the same folder. If you drag both files to your desktop it might be easier.



> --ini=<file> Ini file to use


BTW: I think that if they are in the same directory that is good enough.


----------



## ding (Feb 16, 2006)

Yoav,

I have been so wishing for something like iTivo as a plugin for plex/osxbmc
http://www.plexapp.com/
Unfortunately for me the only way to write a plugin for it is thru python. I really don't have the time to learn a new coding language right now but maybe in the future I might get desperate enough to do it. How hard do you think this would be? 
BTW If anyone is a good python programer and is interested here is a good link on how to do it:
http://xbmc.org/wiki/?title=HOW-TO_write_Python_Scripts


----------



## Tim Winders (Oct 5, 2007)

ding said:


> Tim Winders,
> 
> you have to tell it where the comskip.ini file is. This file is located in the same folder. If you drag both files to your desktop it might be easier.


I pulled the ini out of MarkCommercials.app and got the same result:

tim-winderss-macbook-pro-17:bin twinders$ ./comskip -t $HOME/Movies/AGT.mpgComskip 0.79.126, made using:
comskip-0.4.1-cvs - by Michel Lespinasse <[email protected]> and Aaron Holtzman
The commandline used was:
./comskip -t /Users/twinders/Movies/AGT.mpg

Opening /Users/twinders/Movies/AGT.mpg
Using comskip.ini for initiation values.
Auto selecting the PID.
Video PID not found, available video PID's 19c2, 1ed8, 1660, 404, ee3, a61, 1945, eed, 126e, 226, f98, 1dd7, 606, 1772, 124d, 1be1,

0 frames decoded in 0.00 seconds (0.00 fps)


----------



## ding (Feb 16, 2006)

I am leaving work but
http://www.kaashoek.com/comskip/viewtopic.php?f=5&t=562
and
http://www.kaashoek.com/files/manual.htm#_Toc128549932
will try at home.


----------



## Tim Winders (Oct 5, 2007)

ding said:


> I am leaving work but
> http://www.kaashoek.com/comskip/viewtopic.php?f=5&t=562
> and
> http://www.kaashoek.com/files/manual.htm#_Toc128549932
> will try at home.


Good find. From the manual:



> Comskip can operate on 3 types of files. The first file type is an MPEG file. The extension must be mpg, mpeg (for mpeg Program Streams), ts (for mpeg Transport Streams) or dvr-ms for DVR-MS).


I changed the command line, removed the -t and changed the file extension from .mpg to .mpeg. I believe the -t was saying "transport stream" but the file is really a program stream?

This runs for about 3% of the file, then I get a Segmentation fault.

Ooooh! So close!


----------



## Tim Winders (Oct 5, 2007)

Tim Winders said:


> Ah! Only one download at a time. Grrr. That's just STUPID!  OK. That would explain the "too many connections" error I'm getting.
> 
> Downloading with https give the same slow result. I'm going to try wireless tonight and see what happens. That will eliminate the cable and switch as a possible issue. If that's better, I'll run a new network cable and try again.


I didn't have a USB wireless adapter, so I tried a different cable (I had several running to the equipment) and it's MUCH better! Now getting 1.5MB/s. Tranferred 3.8GB in about 30-40 minutes so far (lost track of time). This is through the web interface.

When that is done, I'll try iTiVo again.

I'm getting happy!


----------



## Yoav (Jan 13, 2007)

ding said:


> Yoav,
> 
> I have been so wishing for something like iTivo as a plugin for plex/osxbmc
> http://www.plexapp.com/
> ...


Well, Plex is pretty  (XBMC ftw!).

Anyways, I'm not the go-to guy here. I just learned applescript on-the-fly for this code (iTiVo is a continuation of tivodecodemanager which was written as a giant applescript script). But it does seem like an interesting project for someone to toy with?...


----------



## Yoav (Jan 13, 2007)

Tim Winders said:


> I didn't have a USB wireless adapter, so I tried a different cable (I had several running to the equipment) and it's MUCH better! Now getting 1.5MB/s. Tranferred 3.8GB in about 30-40 minutes so far (lost track of time). This is through the web interface.
> 
> When that is done, I'll try iTiVo again.
> 
> I'm getting happy!


I think that's about as fast as you're going to get. TiVos intentionally limit their network bandwidth (TivoHD is about half the speed of a TiVo S3 btw). I think it's to make sure it can always record two shows and play a third while downloading over the internet...

I've used a 802.11g network at home and got 'respectable' speeds. Sorry you had a crappy cable before 

- - yoav


----------



## Yoav (Jan 13, 2007)

Ok, I'm a little annoyed with comskip.

It's 'free' but he wants you to pay to get the latest code?


----------



## Tim Winders (Oct 5, 2007)

Yoav said:


> I think that's about as fast as you're going to get. TiVos intentionally limit their network bandwidth (TivoHD is about half the speed of a TiVo S3 btw). I think it's to make sure it can always record two shows and play a third while downloading over the internet...
> 
> I've used a 802.11g network at home and got 'respectable' speeds. Sorry you had a crappy cable before
> 
> - - yoav


Ah! So there *IS* a real reason to get an S3! Will have to consider that for my next TiVo. I'm happy with the HD, but never did any TTG because it took days and days. Now, I may actually put stuff on a desktop! Mostly, I just want to be able to share the show with my brother when he misses a show and such. I only have broadcast TV, no cable subscription. I believe this is OK.


----------



## Tim Winders (Oct 5, 2007)

Yoav said:


> Ok, I'm a little annoyed with comskip.
> 
> It's 'free' but he wants you to pay to get the latest code?


I haven't gotten that far... ugh. :down:


----------



## ding (Feb 16, 2006)

> I just learned applescript on-the-fly for this code (iTiVo is a continuation of tivodecodemanager which was written as a giant applescript script).


Thank you!!!


----------



## ding (Feb 16, 2006)

I am on a ppc powerbook and when I try to download I get a finished message and a 0MB file.

[edit]never mind


----------



## ding (Feb 16, 2006)

> Ok, I'm a little annoyed with comskip.
> 
> It's 'free' but he wants you to pay to get the latest code?


The last comskip is comskip79_144.zip and it was uploaded Aug 18 2008 thats not that bad.

[edit] never mind thats the exe not the source code. 
[edit2]svn checkout seems to have been updated september 14 2008


----------



## ding (Feb 16, 2006)

Tim,

I just tried the comskip comand line tool from etvComskip with a 30 min episode of the simpsons using the mpg extension and it gave me no problems. I just put comskip, comskip.ini and the movie file in a folder. Then dragged the comskip app to the terminal and followed it by dragging the movie file to the terminal, pressed return and it did it's thing. It took about 2 min to do it on a 1.5ghz g4 powerbook running leopard.


----------



## Tim Winders (Oct 5, 2007)

ding said:


> Tim,
> 
> I just tried the comskip comand line tool from etvComskip with a 30 min episode of the simpsons using the mpg extension and it gave me no problems. I just put comskip, comskip.ini and the movie file in a folder. Then dragged the comskip app to the terminal and followed it by dragging the movie file to the terminal, pressed return and it did it's thing. It took about 2 min to do it on a 1.5ghz g4 powerbook running leopard.


Thanks. That seemed to work. Well, I used the command line, but leaving the file named .mpg and not passing any parameters but the filename, I got through a 60 minute file. But, I can't figure out how to make comskip write out a new file. I want to actually REMOVE the commercials.

I do get several "audio error, skipping bad input frame", but I don't think that's a big deal. Then at the end, I get the "Commercials were found." message.

I'm not sure what I can do to actually create a new mpg file with the commercials GONE.


----------



## ding (Feb 16, 2006)

Tim,

I just did some googling and found this.

You need to change comskip.ini to export edls. So go into comskip.ini with text edit and change


> output_edl=0


to read


> output_edl=1


Then you can use this edl as a cutlist with mencoder. Download mencoder
http://sourceforge.net/project/showfiles.php?group_id=62947
and tell it to use the edl. I found these commands that seem to work


> video.mpg -edl video.edl -of mpeg -ovc copy -mpegopts format=dvd:tsaf -oac copy -o output.mpg


video.mpg being the name of your source. video.edl being the name of you edl and output.mpg being the name of your output.

let me know how that goes. I still haven't found out how to do it with ffmpeg.


----------



## Tim Winders (Oct 5, 2007)

ding said:


> let me know how that goes.


Testing now. Thanks!


----------



## Tim Winders (Oct 5, 2007)

Got that to work, but the audio and video got way out of sync. Ugh. Will do some more googling and try some different options. Thanks for giving me the general direction...


----------



## ding (Feb 16, 2006)

Tim,

Ok, I was getting the same out of sync problem so I did some more googling and I found a solution. It seems like the file created by iTivo has alot of skipped frames. This is most definitely due to the original .tivo file and not something iTivo is doing but it causes it to go out of sync every time there is a cut. The fix is "-noskip", thats it. So the command would be


> video.mpg -edl video.edl -noskip -of mpeg -ovc copy -mpegopts format=dvd:tsaf -oac copy -o output.mpg


This worked for me perfect. There might be a better way so if you find it post it.

Hopefully this could be an option for the next iTivo.


----------



## Tim Winders (Oct 5, 2007)

I finally had a chance to try the -noskip option and got the same results. I'll do some more googling and see what I can figure out. But, this is promising for a possibility as an "Advanced" option for the future.


----------



## preeble (Jul 16, 2003)

On a totally different note, I am having issues downloading the shows - it appears that the downloads keep repeating themselves. For example, I will start downloading a show and perhaps I will walk away from the computer an hour later and the show will be 25% downloaded. When I return in a few hours, the show will only be, say 10% downloaded. 

Either the connection/download reset or once it finishes, it tries to download again. I'm trying to catch it right at the end, but just haven't been able to time it yet, but will keep trying to see what happens. In the meantime, any thoughts or places I can look?
Thanks.


----------



## Yoav (Jan 13, 2007)

preeble said:


> On a totally different note, I am having issues downloading the shows - it appears that the downloads keep repeating themselves. For example, I will start downloading a show and perhaps I will walk away from the computer an hour later and the show will be 25% downloaded. When I return in a few hours, the show will only be, say 10% downloaded.
> 
> Either the connection/download reset or once it finishes, it tries to download again. I'm trying to catch it right at the end, but just haven't been able to time it yet, but will keep trying to see what happens. In the meantime, any thoughts or places I can look?
> Thanks.


The show is downloaded via a regular http download (by a program named curl). You can try to manually download the program by connecting to

https://<tivoip>/

with username 'tivo', password <your MAK>

iTiVo tries to download the show, and then compares the size of what it got to the size that tivo claims it should be. If it doesn't get at least 85% of the show, it will retry (up to 4 times) before giving up (next version will actually do something more like 85, 70, 55, 40 in each attempt)...

One possible reason for regular truncation is another 'fetch' running. the tivo will only let you download one show at a time. So make sure no other program is trying to download from the tivo.


----------



## fatespawn (Oct 14, 2007)

I run into the same problems with iTivo as I did with TivoDecodeManager. It hangs after 1.67&#37; and won't continue. 

It's not another 'fetch' because NowPlaying 2.51 works perfectly. I just wish I could covert to mp4 and edit commercials on the fly, get subscriptions, and queue downloads. 

-fate


----------



## Yoav (Jan 13, 2007)

fatespawn said:


> I run into the same problems with iTivo as I did with TivoDecodeManager. It hangs after 1.67% and won't continue.
> 
> It's not another 'fetch' because NowPlaying 2.51 works perfectly. I just wish I could covert to mp4 and edit commercials on the fly, get subscriptions, and queue downloads.
> 
> -fate


I would love to help debug this, but I haven't been able to reproduce this yet. (You are not alone, others have reported this problem, and yet for the majority it works).

With 1.3 there should be an 'advanced' preferences option to turn on logging. Can you turn on logging and look at <homedir>/iTiVo.log and /tmp/iTiVoDL-<username> 
is there anything interesting in there?


----------



## fatespawn (Oct 14, 2007)

When I press "pref" and go to the "advanced" tab, all I see is "update with beta software" and "run when download completes." I don't see an "enable logging."

I see multiple growl notifications about incomplete download, then it hangs for a while, then it finally just stops. 

-fate


----------



## fatespawn (Oct 14, 2007)

Ok, I downloaded the non-beta version and see the log button. I have duplicated the same results. Where should I send them?

-fate


----------

