PDA

View Full Version : tivostream - video streaming server for Series 3 Tivos


Pages : [1] 2

moyekj
08-22-2008, 01:05 PM
Thanks to excellent work by wmcbrine (see this thread (http://www.tivocommunity.com/tivo-vb/showthread.php?t=401163)) it was discovered that since the 9.4 software update and YouTube support, video streaming now works to Series 3 Tivos. I have built a Java based HME video streaming server which can serve up video files on your computer to your Series 3 Tivos. Note that this is different than the traditional TTCB servers which copy (and transcode to mpeg2 if needed) files to your Tivo. Some advantages of streaming over TTCB:
* No copy is made on the Tivo, so you don't have to worry about deleting it after watching
* For mpeg4/h.264 videos you can watch them in their native format without having to transcode to mpeg2 on the fly as Tivo Desktop (or other TTCB applications) currently does.
* Since the HME server is in complete control of remote control functions it's possible to define further navigation options than is possible with normal Tivo video playback such as arbitrary skip n minutes back or forwards and other interesting ideas.

Home Page:
http://code.google.com/p/tivostream/

StanSimmons
08-22-2008, 04:20 PM
Very nice.

Can this co-exist with pyTivo on a WinXP box, with both of them running?

moyekj
08-22-2008, 04:42 PM
Very nice.

Can this co-exist with pyTivo on a WinXP box, with both of them running? Haven't tried yet but don't see why not. pyTivo I believe uses port 9032 by default (but you can change that in the config). This application uses port 7288 (the default port for HME applications). I do run pyTivo once in a while (in console mode) so I can try it tonight, but I fully expect it to have no conflicts.

windracer
08-22-2008, 04:57 PM
* No copy is made on the Tivo, so you don't have to worry about deleting it after watching]
But on the flip side this means that if you say, drop to Live TV while watching the stream, you'll have to start it over again, right?

moyekj
08-22-2008, 07:22 PM
But on the flip side this means that if you say, drop to Live TV while watching the stream, you'll have to start it over again, right? Yes. There are some down sides too. This brings up a limitation I am trying to overcome that currently you cannot jump ahead of the buffer. For a true file stream of course you can jump arbitrarily anywhere into the stream regardless of the buffer. For this case, especially since this app is designed to stream a local file there should be a way to get the byte offset into the file associated with the specified time offset and then start the stream from that offset. It's on my to do list to look at but on the surface doesn't sound impossible.
Once/if I can fix the above limitation, then at least if you stop watching and later want to continue then you can jump back to where you were (and I could implement some bookmarking to remember last position of recent files).

Extending the above thought further, one could potentially also skip commercials automatically during playback by pre-processing the file and building a boomark list of the commercial segments which could be referenced during playback to skip over the commercial blocks. So short of editing out commercials yourself before streaming this could be an interesting option.

I haven't put too much thought into this yet but the more you think about this the more possibilities open up.

StanSimmons
08-22-2008, 08:11 PM
I'm getting "ERROR: Stream rejected by Tivo" when playing any of my mp4 files on my TiVoHD. The console has the following:

10.0.0.52 Comedy/Blazing Saddles (1974).mp4 HTTP GET - to factory /videostream/
10.0.0.52 I/O Exception handling HTTP GET Comedy/Blazing Saddles (1974).mp4: Co
nnection reset by peer: socket write error

jmemmott
08-22-2008, 08:22 PM
Very nice.

Can this co-exist with pyTivo on a WinXP box, with both of them running?

There doesn't appear to be any problem running both on the same box at the same time. However, I did find out that the two mechanisms handle captioning differently. A file sent through pyTivo will show the captioning it contains. The same file streamed back will not. This is mostly of interest to those who require closed captions or use that captioning mechanism to pick up English subtitles from foreign language media.

moyekj
08-22-2008, 08:24 PM
I'm getting "ERROR: Stream rejected by Tivo" when playing any of my mp4 files on my TiVoHD. The console has the following: Is "Comedy/Blazing Saddles (1974).mp4" the name of file in this example? If so the "/" spaces and/or parenthesis in the name are probably causing problems. As an experiment rename the file or choose one with a simple name without special characters to try. If still no go then it could be the particular .mp4 encoding is not liked by Tivo. Try choosing an mpeg2 file to stream to confirm the program does work. I haven't tested out a big variety of .mp4 files but several test clips I downloaded from the web have worked OK, though some of them don't fast forward or other trick functions very well.

EDIT: Come to think of it I didn't test out file names and folders with spaces and other special characters in them so it could be those are causing an issue right now too (which I can fix).

Da Goon
08-22-2008, 08:36 PM
:up::up: good stuff! works great streaming hd files to my THD. Much better than using the cumbersome TD software.

moyekj
08-22-2008, 08:36 PM
There doesn't appear to be any problem running both on the same box at the same time. However, I did find out that the two mechanisms handle captioning differently. A file sent through pyTivo will show the captioning it contains. The same file streamed back will not. This is mostly of interest to those who require closed captions or use that captioning mechanism to pick up English subtitles from foreign language media. That is interesting. Out of curiosity can you get captions with any YouTube files? Does YouTube even support closed captioning?

wmcbrine
08-22-2008, 09:32 PM
If you're talking about TiVo-rendered captions (as opposed to TV-rendered), you'd have to do them yourself in the HME app. They're rendered the same way as menus, etc.

For some reason, this app won't play a certain high-def file that works in my own player. (It's the episode of Systm that's referenced in the "Video Streaming in HME thread". I haven't tried others yet.) The bar appears, and advances, but the video never does.

jmemmott
08-22-2008, 09:45 PM
That is interesting. Out of curiosity can you get captions with any YouTube files? Does YouTube even support closed captioning?

I don't think it does. My motivation comes from a slightly different path. I am playing with T2Sami code extensions in house that allow me to dynamically convert English subtitled files (mkv anime files) for pyTivo.

I also have streaming to other platforms such as the Hauppauge MediaMVP boxes working. If Tivo had handled captioning in the same way in a stream as it handles captioning for the "Come Back" path, the ability to stream captioned mpegs or mp4's (such as movie rentals) would have been within an easy experimental reach...

StanSimmons
08-22-2008, 10:02 PM
Is "Comedy/Blazing Saddles (1974).mp4" the name of file in this example? If so the "/" spaces and/or parenthesis in the name are probably causing problems. As an experiment rename the file or choose one with a simple name without special characters to try. If still no go then it could be the particular .mp4 encoding is not liked by Tivo. Try choosing an mpeg2 file to stream to confirm the program does work. I haven't tested out a big variety of .mp4 files but several test clips I downloaded from the web have worked OK, though some of them don't fast forward or other trick functions very well.

EDIT: Come to think of it I didn't test out file names and folders with spaces and other special characters in them so it could be those are causing an issue right now too (which I can fix).

Same error. I changed the name to "BlazSadd.mp4" and dropped it into the same folder that I started the jar file in.
10.0.0.52 icon.png HTTP GET - to factory /videostream/
10.0.0.52 icon.png HTTP GET - to factory /videostream/
SDK debug level = 1. Will log: errors,warnings
To control HME SDK debugging, set the property com.tivo.hme.sdk.debug.level
The integer debug level is interpreted as follows:
0: Only errors logged (default, recommended for installed apps)
1: Level 0 + errors and warnings logged (recommended for development)
2: Level 1 + events from receiver logged
3: Level 2 + commands to receiver logged
Using vStrings!
10.0.0.52 BlazSadd.mp4 HTTP GET - to factory /videostream/
10.0.0.52 I/O Exception handling HTTP GET BlazSadd.mp4: Connection reset by pee
r: socket write error
Connection terminated by receiver
connection to receiver closed

Video Lan says that the file info is:

Stream 0
Codec: avc1
Type: Video
Resolution: 706x480
Frame Rate: 23.988005
Stream 1
Codec: mp4a
Type: Audio
Channels: 2
Sample Rate: 48000 Hz
Bits Per Sample: 16
Bitrate: 1536kb/s

moyekj
08-22-2008, 11:29 PM
If you're talking about TiVo-rendered captions (as opposed to TV-rendered), you'd have to do them yourself in the HME app. They're rendered the same way as menus, etc. That explains it, I'll have to look into it, thanks.

For some reason, this app won't play a certain high-def file that works in my own player. (It's the episode of Systm that's referenced in the "Video Streaming in HME thread". I haven't tried others yet.) The bar appears, and advances, but the video never does. I just tried the hi def version of the file: systm--0063--dolby--hd.h264.mp4 (http://www.podtrac.com/pts/redirect.mp4/bitcast-a.bitgravity.com/revision3/web/systm/0063/systm--0063--dolby--hd.h264.mp4) and it worked fine for me. Can you provide the link of the one you are talking about? The specs on the above file are:
Video: Codec=avc1, Resolution=1280x720, Frame Rate=24 fps
Audio: codec=mp4a, Channels=2, Rate=44100Hz, 16 bits per sample, 1411 kb/s bit rate

Chew
08-22-2008, 11:40 PM
The only way "videoserver" appears for me on the TiVo is when the cmd box remains open. As soon as I close it, it disappears.

Dumb question: is it supposed to be that way? Or did I install something incorrectly?

moyekj
08-22-2008, 11:45 PM
The only way "videoserver" appears for me on the TiVo is when the cmd box remains open. As soon as I close it, it disappears.

Dumb question: is it supposed to be that way? Or did I install something incorrectly? You are supposed to keep it open. As soon as you kill the "cmd" shell window you kill the program. It would be pretty easy to setup to run this program as a service in Windows (and hence no popup window) but that's not a priority for me right now. You can just minimize the cmd window instead of closing it to get it out of the way.

moyekj
08-22-2008, 11:50 PM
Same error. I changed the name to "BlazSadd.mp4" and dropped it into the same folder that I started the jar file in.


Video Lan says that the file info is:

Stream 0
Codec: avc1
Type: Video
Resolution: 706x480
Frame Rate: 23.988005
Stream 1
Codec: mp4a
Type: Audio
Channels: 2
Sample Rate: 48000 Hz
Bits Per Sample: 16
Bitrate: 1536kb/s By those specs it should work. Can you provide a link to the above file or a clip from it so I can try it out? Only thing I can think of is I don't provide a type hint to Tivo for the stream (i.e. "video/mpeg4"), but I haven't found an mpeg4 file that didn't at least start for me. If I can get hold of one that should work but doesn't then I can debug further.

P.S. I tried several files and paths with spaces, brackets etc. and had no problem, so no need to rename files as I originally expected could be causing a problem.

wmcbrine
08-23-2008, 12:40 AM
I just tried the hi def version of the file: systm--0063--dolby--hd.h264.mp4 (http://www.podtrac.com/pts/redirect.mp4/bitcast-a.bitgravity.com/revision3/web/systm/0063/systm--0063--dolby--hd.h264.mp4) and it worked fine for me. Can you provide the link of the one you are talking about?That's the one. I renamed it to "systm.mp4", but that's all.

StanSimmons
08-23-2008, 11:07 AM
By those specs it should work. Can you provide a link to the above file or a clip from it so I can try it out? Only thing I can think of is I don't provide a type hint to Tivo for the stream (i.e. "video/mpeg4"), but I haven't found an mpeg4 file that didn't at least start for me. If I can get hold of one that should work but doesn't then I can debug further.

P.S. I tried several files and paths with spaces, brackets etc. and had no problem, so no need to rename files as I originally expected could be causing a problem.

The full file is 1.03GB. I'm not sure how to get a clip from it. I'll see if I can find a smaller file that has the same problem.

rfryar
08-23-2008, 11:55 AM
EDIT: Nevermind.. My java on my HTPC was only 1.5. Will download 1.6 and see if that fixes the issue.

Just downloaded and tried to run the windows batch file and Java is throwing an unsupported class exception. Here is the stack trace. Any clues?

Rick

E:\Program Files\tivostream_v0p2>java -cp tivostream_v0p2.jar com.tivo.hme.host.
sample.Main com.hme.tivo.videostream.videostream
Instance ID = 0002dcbbfba7c4c1
hme-host-sample version: 1.4.1 threadsafe-experimental
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version n
umber in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

bluetex
08-23-2008, 12:12 PM
I/O Exception handling HTTP GET BlazSadd.mp4: Connection reset by peer: socket write error
Connection terminated by receiver
connection to receiver closed .

My guess. Software firewall, something blocking the port being requested (other services on the port) or similar.

The file request looks good, the problem seems to be in the connection/port negotiation

moyekj
08-23-2008, 01:26 PM
EDIT: Nevermind.. My java on my HTPC was only 1.5. Will download 1.6 and see if that fixes the issue.

Just downloaded and tried to run the windows batch file and Java is throwing an unsupported class exception. Here is the stack trace. Any clues?

Rick

E:\Program Files\tivostream_v0p2>java -cp tivostream_v0p2.jar com.tivo.hme.host.
sample.Main com.hme.tivo.videostream.videostream
Instance ID = 0002dcbbfba7c4c1
hme-host-sample version: 1.4.1 threadsafe-experimental
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version n
umber in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) Edit the run_win.bat script and put in the full path to the java.exe that matches your recent installation. My guess is that java.exe in your default path is an older one. For example, for one of my Java installations:
c:\Program Files\Java\jre1.6.0_01\bin\java.exe
So replace "java" in the run_win.bat script with the full path as in example above.

StanSimmons
08-23-2008, 02:39 PM
My guess. Software firewall, something blocking the port being requested (other services on the port) or similar.

The file request looks good, the problem seems to be in the connection/port negotiation

Windows XP Firewall disabled. No antivirus installed. Same symptoms.

pyTivo works fine on this same machine with the same file.

moyekj
08-23-2008, 03:17 PM
Windows XP Firewall disabled. No antivirus installed. Same symptoms.

pyTivo works fine on this same machine with the same file. Note that for mpeg4 videos pyTivo transcodes to mpeg2 first before sending to Tivo so the Tivo is not getting same thing in that case. I don't think it's a firewall issue as with firewall blocking you wouldn't be able to get to the initial file browser window either. Give systm--0063--dolby--hd.h264.mp4 (http://www.podtrac.com/pts/redirect.mp4/bitcast-a.bitgravity.com/revision3/web/systm/0063/systm--0063--dolby--hd.h264.mp4) file a go as it works for me.

Chew
08-23-2008, 03:39 PM
My videos stop playing after a certain number of minutes.

Tekzilla played for 10 minutes (twice) and the TiVo returned to live TV.
The Digg Reel played for 5 and did the same thing.

I have the port open and it's playing fine for the time it plays.

Anything else I can do?

BrianAZ
08-23-2008, 04:49 PM
I think I read somewhere that HME doesn't have access to the local video files on the Tivo, but assuming it did (or will in the future), is there any reason that this couldn't be used to get around the CCI protection which makes 2/3rds of my recordings off limits to MRV? Just so we're clear, I'm not talking about making a copy of it.. just streaming from Tivo2Tivo.

Also thinking perhaps the HME app could also write to a log of where it was in a specific stream so when you select it again, it asks if you want to resume from the point you stopped? That's how my D-Link DSM520 works. Seems to do the trick.

wmcbrine
08-23-2008, 05:59 PM
Chew: I wonder if you're seeing an idle timeout? That's something I fixed in my streamer; I don't know if it's handled in this one.

BrianAZ: In regard to your first question, there is no reason to ever expect such a capability in HME -- it doesn't really fit the HME model at all. But even if it did, there's even less reason to think that it would let you get around the DRM. The distinction between copying and streaming is pretty much imaginary. If TiVo won't support MRV of DRM'd programs, they're not likely to support transferring them in any other way.

moyekj
08-23-2008, 07:43 PM
My videos stop playing after a certain number of minutes.

Tekzilla played for 10 minutes (twice) and the TiVo returned to live TV.
The Digg Reel played for 5 and did the same thing.

I have the port open and it's playing fine for the time it plays.

Anything else I can do? wmcbrine is right, in the released version I'm not handling idle timeout properly, so after 5 minutes of inactivity you will be returned to Live TV. This will be fixed in next release.

BrianAZ
08-23-2008, 07:46 PM
Oh well. Hopefully DRM will evolve at some point to allow copying across Tivos owned by one person. Maybe they'll be able to allow it if the Tivo's in question are all on the same account, or perhaps have the same public IP showing they're likely to be in the same lan/house. Then again, maybe that's just more wishful thinking.

lrhorer
08-23-2008, 09:52 PM
I have some questions:


Will this app run under Linux? I need any video transfer application to run under Linux, because my video server is a Linux machine.
Will it co-exist with Galleon? I have both Galleon and pyTiVo running on the server.
Have you tried any high bandwidth videos? Of course a 20 Mbps MPEG-II video when converted to MPEG-IV probably streams at only 10 Mbps or so, but if the TiVo (S3 or THD) has a problem keeping up with the video content, this could mean trouble.
Do you have folder support built-in like pyTiVo?
Do you have Metafile support built-in?

windracer
08-23-2008, 10:17 PM
ill this app run under Linux? I need any video transfer application to run under Linux, because my video server is a Linux machine.
I got it to start on my Ubuntu machine, but kept getting http errors when connecting to it with my TiVo.
Will it co-exist with Galleon? I have both Galleon and pyTiVo running on the server.
Seems to, I've got Galleon and pyTiVo running on my server as well. I tried to get tivostreamer to run through Galleon (via launcher.txt) and had problems, though.

moyekj
08-23-2008, 10:19 PM
I have some questions:


Will this app run under Linux? I need any video transfer application to run under Linux, because my video server is a Linux machine.
Will it co-exist with Galleon? I have both Galleon and pyTiVo running on the server.
Have you tried any high bandwidth videos? Of course a 20 Mbps MPEG-II video when converted to MPEG-IV probably streams at only 10 Mbps or so, but if the TiVo (S3 or THD) has a problem keeping up with the video content, this could mean trouble.
Do you have folder support built-in like pyTiVo?
Do you have Metafile support built-in?

1. Yes. In fact a lot of my development is on a Linux server.
2. Yes, this app uses different ports than the default ports used by those apps.
3. Yes. I've served up some 1080i & 720p mpeg2 streams to my S3s as well as a few 720p h.264 streams. One issue of course is how fast the transfers happen. S3s do a better job than THD units but for high bit rates you will likely end up catching up to the buffer pretty quickly. h.264 files HD files since they are smaller than mpeg2 obviously transfer faster. This app automatically pauses when you catch up to the buffer (similar to MRV viewing while transferring). Haven't tried 1080p and I doubt the tivo decoder can even handle those never mind the transfer speed issue.
4. Yes, you browse for video files on your computer in any folder structure you want.
5. No. Currently pressing info button simply shows the name of the file being streamed. Parsing the metafile to grab more information about what's playing is a good idea and I'll put it on the to do list.

lrhorer
08-23-2008, 11:09 PM
I got it to start on my Ubuntu machine, but kept getting http errors when connecting to it with my TiVo.
I'm seeing something like that, as well. From the server:


RAID-Server:/RAID/Recordings# sh run_unix.sh
Instance ID = 000b143431bee13b
hme-host-sample version: 1.4.1 threadsafe-experimental
debug: Loaded factory: com.hme.tivo.videostream.videostream
debug: Class loader for com.hme.tivo.videostream.videostream: sun.misc.Launcher$AppClassLoader
debug: Context class loader: sun.misc.Launcher$AppClassLoader
added factory
MDNS ADD: http://192.168.0.56:0/videostream/
Contacting mDNS localhost daemon at 127.0.0.1:5354
Connection to mDNS localhost daemon failed: java.net.ConnectException: Connection refused
mDNS localhost daemon: service not found.
> java.net.ConnectException: Connection refused
jmdns library: register [start]: http://192.168.0.56:0/videostream/
jmdns library: register [done]: http://192.168.0.56:0/videostream/


On the TV:


An error occurred while running the application. HTTP failure (Http connection error. 0x50005).


Seems to, I've got Galleon and pyTiVo running on my server as well. I tried to get tivostreamer to run through Galleon (via launcher.txt) and had problems, though.
I'm just trying it directly from bash, at the moment.

Edit: The docs call for JRE 1.6.0_01-b06 or later. I'm running 1.6.0_03-b05, which I would think is later than 1.6.0_01-b06. I'm running the 64 bit JRE, if that makes a difference.

lrhorer
08-23-2008, 11:29 PM
1. Yes. In fact a lot of my development is on a Linux server.
See my post above.

3. Yes. I've served up some 1080i & 720p mpeg2 streams to my S3s as well as a few 720p h.264 streams. One issue of course is how fast the transfers happen. S3s do a better job than THD units but for high bit rates you will likely end up catching up to the buffer pretty quickly
They don't when I'm using pyTivo or galleon, except whenI am transferring the very highest bitrate programs. As long as the average bit rate is below around 16Mbps, I don't usually have any trouble:

http://fletchergeek.com/images/SN850039.JPG

As you can see, I'm usually able to get TTCB transfers above 16 Mbps, but some of the MPEG-II programs I have exceed that, requiring me to buffer as much as 5 minutes per hour of program time. That means waiting about 15 minutes before starting to watch Lawrence of Arabia or Judgment at Nuremberg, for example.

h.264 files HD files since they are smaller than mpeg2 obviously transfer faster.
Well, one would tend to think so, but not necessarily. If any extra overhead is involved between the TCP stack and the hard drive for h.264 content versus MPEG-II, it could slow down the transfer. Also, it's possible HMO transfers might tend to be faster than HME. I'd be interested in quantitative comparisons. For that matter, I'll do them myself, if I can get the app running.

I'm hoping for two things:

1. Smaller program files stored on the server, whihc obviously allows me to store more programs. I'm running out of room fast, and I didn't want to have to upgrade the RAID array until the 2T drives are released, and hopefully drop in price. Cutting the file sizes in half will take me a long, long way.

2. To have even the very highest bandwidth videos stream without bumping up against the buffer.

Haven't tried 1080p and I doubt the tivo decoder can even handle those never mind the transfer speed issue.
That's OK. Almost all the videos were transferred from the TiVos in the first place.

bradleys
08-24-2008, 12:18 AM
So now you have me wondering. Is this, or something similar now going to allow us to watch Netflix movies streamed through the PC?

moyekj
08-24-2008, 03:27 AM
jmdns library: register [start]: http://192.168.0.56:0/videostream/
jmdns library: register [done]: http://192.168.0.56:0/videostream/
It's not binding to the correct port. If it's working right it should be on port 7288 not port 0. Use ps to find and kill any stray java jobs and then try it again. Once it starts on port 7288 then it should work. I found on Linux once in a while a previous server run did not die correctly and was hogging port 7288 and subsequent runs wouldn't bind. That portion of the HME code is not in my control so I can't look for alternate available ports.

lrhorer
08-24-2008, 06:51 AM
It's not binding to the correct port. If it's working right it should be on port 7288 not port 0. Use ps to find and kill any stray java jobs and then try it again. Once it starts on port 7288 then it should work. I found on Linux once in a while a previous server run did not die correctly and was hogging port 7288 and subsequent runs wouldn't bind. That portion of the HME code is not in my control so I can't look for alternate available ports.
Well, there was a java job, but it wasn't a stray. It was clearly spawned by galleon. When I killed the child process, the parent spawned another one automatically, and I still could not launch tivostream. When I killed the parent process and then the child process, tivostream launched correctly, but galleon went crunch. I could neither launch the Galleon GUI on the server nor any Galleon apps on the TiVos.

I'll gather some greater detail later. In the mean time, I've started a TTCB session of pyTivo transferring an episode of Planet Earth I'm going to get some sleep and then transfer the same episode using tivostream and see how the transfer rates compare.

moyekj
08-24-2008, 11:26 AM
Well, there was a java job, but it wasn't a stray. It was clearly spawned by galleon. When I killed the child process, the parent spawned another one automatically, and I still could not launch tivostream. When I killed the parent process and then the child process, tivostream launched correctly, but galleon went crunch. I could neither launch the Galleon GUI on the server nor any Galleon apps on the TiVos.

I'll gather some greater detail later. In the mean time, I've started a TTCB session of pyTivo transferring an episode of Planet Earth I'm going to get some sleep and then transfer the same episode using tivostream and see how the transfer rates compare. Galleon uses a few ports, one of them being 7288 which would conflict with this app. According to this page Galleon should look for alternate ports if not available, but that doesn't seem to be happening in your case:
http://galleon.sourceforge.net/index.php?option=com_content&task=view&id=36&Itemid=47

windracer
08-24-2008, 12:10 PM
Ok, that would explain why I couldn't get tivostreamer to work either (through Galleon or alongside it). I see the same thing as lrhorher (the http error and tivostreamer is unable to bind to port 7288). The lack of an icon next to the app name should have been a giveaway to that. I guess I'll try starting tivostreamer first, and then Galleon.

edit: that worked. I started tivostream first, then Galleon grabbed 7289 instead so I have them running side-by-side now.

moyekj
08-24-2008, 12:47 PM
Download:
http://tivostream.googlecode.com/files/tivostream_v0p3.zip
(Documentation in HTML is included in zip file)

Release notes for this version:
v0p3 - August 24, 2008
----------------------
CHANGES
* Prevent idle timeout to Live TV during video playback
* Keep status bar up during pause (can be cleared with clear button)
* Added optional config.ini file where starting folder and desired video file
extensions can be specified.
* Added flexible n minute jump ahead/jump back during playback. For example:
1,-> jumps ahead 1 minute
1,1,-> jumps ahead 11 minutes
5,<- jumps back 5 minutes
etc.

NOTE: Because of timeout to live TV in previous versions this version is highly recommended.

StanSimmons
08-24-2008, 12:48 PM
Note that for mpeg4 videos pyTivo transcodes to mpeg2 first before sending to Tivo so the Tivo is not getting same thing in that case. I don't think it's a firewall issue as with firewall blocking you wouldn't be able to get to the initial file browser window either. Give systm--0063--dolby--hd.h264.mp4 (http://www.podtrac.com/pts/redirect.mp4/bitcast-a.bitgravity.com/revision3/web/systm/0063/systm--0063--dolby--hd.h264.mp4) file a go as it works for me.

Well, that file works.

Any idea on what settings I need when converting my MPG files to MP4 files for this streaming app?

wmcbrine
08-24-2008, 01:40 PM
Any idea on what settings I need when converting my MPG files to MP4 files for this streaming app?There's no reason to do that. It can stream both MPEG-2 (and MPEG-1, for that matter) and MPEG-4.

The MPEG-4 files that work (so far) are h.264 video, AAC audio, in a Quicktime (MOV) wrapper. There's some indication from the specs of the chips in the TiVo that it should handle some other types, but this is all that have been successfully tested, AFAIK.

moyekj
08-24-2008, 02:24 PM
For any developers out there right now there are 2 big hurdles I haven't figured out how to overcome:
1. How to serve up local files on different volumes/partitions? For example if server is running on volume c: then how can I serve up files on volume d:
2. How to override current behavior to allow one to skip ahead of the available buffer? A true stream allows one to jump anywhere in the stream. For this app in particular serving up from local drive it should be possible to do that, but I can't seem to find a way to override that behavior in hme_sdk_1.4 or hme_sdk_1.4.1.

The latest source corresponding to release v0p3 is posted in Source section of Google project:
http://code.google.com/p/tivostream/source/checkout
(If you need help with building full jar file from source send me an email)

StanSimmons
08-24-2008, 02:39 PM
There's no reason to do that. It can stream both MPEG-2 (and MPEG-1, for that matter) and MPEG-4.

The MPEG-4 files that work (so far) are h.264 video, AAC audio, in a Quicktime (MOV) wrapper. There's some indication from the specs of the chips in the TiVo that it should handle some other types, but this is all that have been successfully tested, AFAIK.

The main reason I've been converting my MPG2 movies to MP4 is space... Dropping from 4 to 8GB down to 1 to 2GB saved me from having to get a bigger NAS (yet). I have in the neighborhood of 400 movies. :eek:

pyTivo has been converting them back to MPG2 and playing them on my S2 and TiVoHD just fine, but I was hoping to be able to skip the reconvert (as it seems to be adding an occasional artifact/glitch.)

Any suggestions as to what Handbrake settings would be optimal would be appreciated.

fyodor
08-24-2008, 03:15 PM
I'm curious what type of streaming speeds people are getting. My old HD recordings from my computer PVR are too large to stream in real time, even though I have a network that is fast enough (NIM-100s). Between Tivos, my HD recordings usually transfer about 1.5 times as fast as the watched times (i.e. after 10 minutes, 15 minutes of show have transferred).

lrhorer
08-24-2008, 04:13 PM
I'm curious what type of streaming speeds people are getting. My old HD recordings from my computer PVR are too large to stream in real time, even though I have a network that is fast enough (NIM-100s). Between Tivos, my HD recordings usually transfer about 1.5 times as fast as the watched times (i.e. after 10 minutes, 15 minutes of show have transferred).
I've started some testing, and so far within the limit of uncertainty of the test, the transfer speeds with tivostream seem to be just about the same as TTCB using pyTivo from the same server. Transfer speeds can vary a lot depending on how busy the TiVo is with other things, particularly disk intensive operations. Setting the tuners to disabled channels helps a very significant amount, usually allowing real time or better transfers of moderately high bit rate MPEG-II HD material. The difference between doing a transfer just after a daily call when the tuners are sitting on two 1080i HD programs and waiting a couple of hours and tuning to disabled channels on both tuners is very significant. Last night I transferred a copy of Planet Earth: Great Plains at just over 20Mbps, which means it would have transferred fully in real time. Right after a daily call with both tuners active, that fell to 10.96 Mbps, meaning it would have taken over an hour and 45 minutes to transfer this 1 hour show. Activity on the server, and depending on the LAN topology the LAN as well can impact transfer speeds. The RAID array on my video server can transfer as much as 5600Mbps, but the link to the switch is limited to 1000Mbps. No other machine on the LAN can transfer at anything more than 300Mbps, and the most I have been able to transfer real world has been 500Mbps, but the point is the LAN and video server have no problems keeping up with a 17 - 18 Mbps video stream. Your situation may not be able to readily support such speeds on a regular basis.

moyekj
08-24-2008, 04:23 PM
I'm curious what type of streaming speeds people are getting. My old HD recordings from my computer PVR are too large to stream in real time, even though I have a network that is fast enough (NIM-100s). Between Tivos, my HD recordings usually transfer about 1.5 times as fast as the watched times (i.e. after 10 minutes, 15 minutes of show have transferred). FYI, transfers from this app to your Tivo show up under Network Diagnostics->Transfer History->Videos copied from remote device
Under normal conditions (both tuners tuned to HD channels and perhaps recording) and my laptop using 802.11g I get around 10-11 Mbps which is same as I get with normal Tivo To Go transfers. If I switch laptop to a wired connection and tune both tuners on my S3 to channels I don't receive then I can get it up to around 15 Mbps which is sufficient to keep up with or exceed bit rate of most of my mpeg2 HD recordings. From what I've gathered THD units are still a little slower than S3 units. HD mpeg2 kind of pushes the limit of typical transfer speeds but HD mpeg4 seems very viable - the few I've tried so far need much less than 10 Mbps for real time but of course you can find mpeg4 HD videos with much higher bit rates as well.

NOTE: I would have expected transfer speeds more on the order of MRV which I can get quite easily over 30 Mbps. With TTG there is CPU overhead with encryption and TS->PS conversion which MRV doesn't need to do. I suppose there still is PS->TS conversion going on when streaming to a Tivo? I think it goes back to the fact that this is not real streaming - seems to be using the same TTG/TTCB mechanism. Ideally the Tivo should just decode and display the stream without buffering to hard drive and any conversions it may be doing.
(PS=Program Stream, TS=Transport Stream)

lrhorer
08-24-2008, 04:30 PM
Release notes for this version:
v0p3 - August 24, 2008
----------------------
CHANGES
* Prevent idle timeout to Live TV during video playback
* Keep status bar up during pause (can be cleared with clear button)...

NOTE: Because of timeout to live TV in previous versions this version is highly recommended.
I'm going to give this build a try. As I mentioned, I was doing some testing. I had transferred an episode of Planet Earth using pyTiVo at just a bit above 20Mbps. The average bit rate of this program is 17.5 Mbps. I started up the transfer under tivostream, and it was almost, but not quite, keeping up. I paused the playback and allowed the system to buffer 45 seconds of video before pressing play. The stream kept up pretty well for a while, but then after several minutes it did exhaust the buffer and automatically pause. I left the program paused for several minutes while I munched on a snack, when suddenly the screen went black. Pressing Play brought up the progress bar, but the video would not start streaming again. It also did not apper to be buffering any more data. I tried FF, RR, Play, and while the transport icon changed, nothing happened to the video playback.

lrhorer
08-24-2008, 05:47 PM
I see the same thing as lrhorher (the http error and tivostreamer is unable to bind to port 7288). The lack of an icon next to the app name should have been a giveaway to that. I guess I'll try starting tivostreamer first, and then Galleon.

edit: that worked. I started tivostream first, then Galleon grabbed 7289 instead so I have them running side-by-side now.
That worked for me, too. I have a single startup script which now runs pyTivo, tivostream, and Galleon running under Debian "Etch" Linux and a 2.6 kernel on a Dual Core AMD Athlon 64.

wmcbrine
08-24-2008, 05:51 PM
Ideally the Tivo should just decode and display the stream without buffering to hard drive and any conversions it may be doing.I don't really agree there... although a faster start would be nice, the buffering is what makes all the trick play functions keep working.

(PS=Program Stream, TS=Transport Stream)Unfortunately I have so far been unable to get the TiVo to accept a transport stream.

lrhorer
08-24-2008, 06:04 PM
v0p3 - August 24, 2008
This build doesn't work for me. On the trivial side, you might fix your installation instructions. In both the syntax text and the sample config.ini file, you specify the target directory specifier to be <top>, but this does not work. In the discussion text, however, you list the specifier as <topdir>, which does work. When I put <topdir> in the config.ini file, tivostream finds the target directory.

It seems to work fine for programs in the <topdir> directory, but when I try to transfer a program in a subdirectory of <topdir> the TiVo gives me an error saying, "Error: stream rejected by Tivo".

For example, /RAID/Recordings/Used Cars (Recorded Mon, Mar 03, 2008, HDNETMV).mpg plays just fine, but /RAID/Recordings/IMAX/Aliens of the Deep (Recorded Sat Mar 01, 2008, HDNETMV).mpg does not. I've tried several files in the /RAID/Recordings/ directory and they all work, and several in various subdirectories and none of them do.

They all worked under build 02 when I had the .jar file in the /RAID/Recordings directory.

lrhorer
08-24-2008, 06:21 PM
4. Yes, you browse for video files on your computer in any folder structure you want.
Actually, that is only part of what I meant. In pyTiVo I can set up multiple shares. So for example, I have the main share, called "RAID Server" pointing to /RAID/Recordings, which is where all the hard links for the program's inodes reside with subdirectories for series like Star Wars and Harry Potter. I have another share, however, called "Videos Sorted by Genre" which is actually not even on the RAID server volume. Instead, it's top level directory only contains directories such as "Mystery", "Romance", "Comedy", "Western", "Sci-Fi", etc. In each of those subdirectories are symlinks to files in /RAID/Recordings. If I want to browse by Alpha with the series at the top, I select "RAID Server" If I want to browse by genre with no series subdirectories, I select "Videos Sorted by Genre". With your newest build, something like that should be possible.

moyekj
08-24-2008, 06:24 PM
I don't really agree there... although a faster start would be nice, the buffering is what makes all the trick play functions keep working. I came from the ReplayTV world where streaming is true streaming. You can use all the normal trick play functions while streaming and you can jump all the way to the end of a recording instantly without waiting for buffer to build. That's the case when you are playing back a show from a different Replay (i.e MRV) or if you are streaming the stream to your computer (i.e. TTG) and when serving back to the Replay (i.e. TTCB).

That to me would be the ultimate functionality in this kind of app. The down side with ReplayTV is the little buffer they do use is not enough to deal with even small network glitches, so streaming over wireless is hit or miss. Of course that was SD streams only and with the much higher HD streams it's good to have a much bigger buffer to avoid any playback glitches, but there's no reason the buffering needs to happen on the Tivo side. Let the server handle buffering.

lrhorer
08-24-2008, 06:32 PM
This may be premature, but I figured I would go ahead and put in my suggestions for a wishlist:

1. Subdirectories listed separately at the top, regardless of sort. Perhaps configurable via the config.ini file.

2. Sort by Alpha, as opposed to date. Really nice would be making this a switch available from the remote. Of course this presents a little problem as you are using the numeric keys for time jump codes, but the TiVo uses the numeric pad to change the sort order and turn on and off groups. OTOH, there is nothing absolutely requiring consistency between the TiVo UI and your application, but still...

3. Enable the jump key to jump to the end and then the top of whatever folder is being listed.

4. Configurable fonts (probably in config.ini), with commensurately more or less lines on screen. The smallest screen I have where I will be using this utility is 62". More lines on screen and more characters per line would be great.

Edit: strike through most of #2, which was posted because of my own obtuseness.

moyekj
08-24-2008, 06:39 PM
This build doesn't work for me. On the trivial side, you might fix your installation instructions. In both the syntax text and the sample config.ini file, you specify the target directory specifier to be <top>, but this does not work. In the discussion text, however, you list the specifier as <topdir>, which does work. When I put <topdir> in the config.ini file, tivostream finds the target directory.

It seems to work fine for programs in the <topdir> directory, but when I try to transfer a program in a subdirectory of <topdir> the TiVo gives me an error saying, "Error: stream rejected by Tivo".

For example, /RAID/Recordings/Used Cars (Recorded Mon, Mar 03, 2008, HDNETMV).mpg plays just fine, but /RAID/Recordings/IMAX/Aliens of the Deep (Recorded Sat Mar 01, 2008, HDNETMV).mpg does not. I've tried several files in the /RAID/Recordings/ directory and they all work, and several in various subdirectories and none of them do.

They all worked under build 02 when I had the .jar file in the /RAID/Recordings directory. Hmm yes I'm still not happy with the file browser structure. What I changed was to build paths relative to the starting directory. For example, if you start the app in /RAID/Recordings but want to play videos in /RAID then the URI would be:
URI=http://<ip>:7288/videostream/../RAID/file
For the case you describe your file is below the starting directory so the behavior is not supposed to be different. Can you check that the URI it spits out to the console looks right? It should be in this example:
URI=http://<ip>:7288/videostream/RAID/Recordings/IMAX/Aliens of the Deep (Recorded Sat Mar 01, 2008, HDNETMV).mpg

Regarding top vs topdir I realized the mistake soon after posting the version and I deleted and replaced the html document (with same name), but seems like Google must have cache that prevents the changes from being seen, since when I download from there it's still wrong (and missing a .gif file that is supposed to be part of the zip file I also replaced).

lrhorer
08-24-2008, 06:50 PM
I came from the ReplayTV world where streaming is true streaming. You can use all the normal trick play functions while streaming and you can jump all the way to the end of a recording instantly without waiting for buffer to build.
I see both sides of the argument for this. There are indeed times I wish I could jump past something whether the buffer is exhausted by the request or not. 'Mostly, this happens at the beginning of a program, when I might want to skip over the leader and intro credits. It's definitely low priority for me, however, and given a choice between stability and the ability to jump past the end of the buffer, I'll take stability.

it's good to have a much bigger buffer to avoid any playback glitches, but there's no reason the buffering needs to happen on the Tivo side. Let the server handle buffering.
Well, yeah, there is a reason for at least somewhat of a buffer on the TiVo side. Due to the nature of networking, even wired networking, and the fact the TiVo may vbe fairly busy doing other things, even if the network connection is on average sufficient to stream the program without pauses, in real time both the program data and the network utilization are going to be somewhat "bursty". Without at least several seconds of buffer, one is liable to run out of data even though the average data rate is lower than the average network performance. Of course with many of the programs I transfer, the LAN can't keep up, even with a very large buffer. Only by relying on at least a 15 minutes (about 2 gigabtes) of buffer, can I reliably expect to not have to sit and wait multiple times during the program. Doing so is very distracting. Of course, as I mentioned before, I hope h.264 encoding will eliminate the problem altogether.

moyekj
08-24-2008, 07:33 PM
This may be premature, but I figured I would go ahead and put in my suggestions for a wishlist:

1. Subdirectories listed separately at the top, regardless of sort. Perhaps configurable via the config.ini file.

2. Sort by Alpha, as opposed to date. Really nice would be making this a switch available from the remote. Of course this presents a little problem as you are using the numeric keys for time jump codes, but the TiVo uses the numeric pad to change the sort order and turn on and off groups. OTOH, there is nothing absolutely requiring consistency between the TiVo UI and your application, but still...

3. Enable the jump key to jump to the end and then the top of whatever folder is being listed.

4. Configurable fonts (probably in config.ini), with commensurately more or less lines on screen. The smallest screen I have where I will be using this utility is 62". More lines on screen and more characters per line would be great.

1. Yes that is my goal, have a list of individual shares at the top level that you can delve into. I'd like to resolve the Windows multiple volumes problem though before attempting that.
2. The numeric codes I implemented are only in effect during video playback. In file browser mode they currently do nothing. i.e. the remote control functions in file browser mode and playback mode are completely independent so no reason that type of thing could not be implemented.
3. Should be easy enough - in fact I'm surprised the default class I'm using in the bananas SDK doesn't already do that. Channel up and down at least work currently to skip up and down by page.
4. I programmed with that thing in mind to allow configuration of such things in long term by using variables everywhere instead of hard coded numbers. One annoying thing however is currently there's no easy way to get font size information (specifically how many pixels are occupied horizontally & vertically) on the fly thus making dynamic calculations based on font size very difficult. Via trial and error I can make a few different font sizes work but that's not a very appealing thing to work on right now.

lrhorer
08-24-2008, 07:51 PM
For the case you describe your file is below the starting directory so the behavior is not supposed to be different. Can you check that the URI it spits out to the console looks right? It should be in this example:
URI=http://<ip>:7288/videostream/RAID/Recordings/IMAX/Aliens of the Deep (Recorded Sat Mar 01, 2008, HDNETMV).mpg
No, it isn't. Here is the output to nohup.out:

Using vStrings!
>> Reading config file: config.ini
>>config: topdir=/RAID/Recordings
URI=http://192.168.0.56:7288/videostream/Aliens of the Deep (Recorded Sat Mar 01, 2008, HDNETMV).mpg
192.168.0.102 Aliens of the Deep (Recorded Sat Mar 01, 2008, HDNETMV).mpg HTTP GET - to factory /videostream/

As you can see, the directory structure is missing. This is what it looks like when I select one in the top directory:

URI=http://192.168.0.56:7288/videostream/../../..//RAID/Recordings/systm--0063--dolby--hd.h264.mp4
192.168.0.102 ../../..//RAID/Recordings/systm--0063--dolby--hd.h264.mp4 HTTP GET - to factory /videostream/

Regarding top vs topdir I realized the mistake soon after posting the version and I deleted and replaced the html document (with same name)
OK.

lrhorer
08-24-2008, 07:55 PM
1. Yes that is my goal, have a list of individual shares at the top level that you can delve into. I'd like to resolve the Windows multiple volumes problem though before attempting that.
Well, OK. Since I avoid Windows like the plague whenever possible, I don't care whether multiple volumes work on Windows, or not. :D

2. The numeric codes I implemented are only in effect during video playback. In file browser mode they currently do nothing. i.e. the remote control functions in file browser mode and playback mode are completely independent so no reason that type of thing could not be implemented.
Oh, duh! I realized my error a few minutes ago, but you had already posted this.

moyekj
08-24-2008, 10:04 PM
No, it isn't. Here is the output to nohup.out:

Using vStrings!
>> Reading config file: config.ini
>>config: topdir=/RAID/Recordings
URI=http://192.168.0.56:7288/videostream/Aliens of the Deep (Recorded Sat Mar 01, 2008, HDNETMV).mpg
192.168.0.102 Aliens of the Deep (Recorded Sat Mar 01, 2008, HDNETMV).mpg HTTP GET - to factory /videostream/

As you can see, the directory structure is missing. This is what it looks like when I select one in the top directory:

URI=http://192.168.0.56:7288/videostream/../../..//RAID/Recordings/systm--0063--dolby--hd.h264.mp4
192.168.0.102 ../../..//RAID/Recordings/systm--0063--dolby--hd.h264.mp4 HTTP GET - to factory /videostream/
Which directory are you running the app from? I've got a feeling the app is not getting the right initial CWD. Enabling more debug messages may shed more light on the problem. To enable debugging information, set shell variable DEBUG=1 before starting the app. Easy way to do that is add following in the run_unix.sh script before the app launch:
DEBUG=1; export DEBUG
That just spits out information about function calls and their arguments which may give me more information.
Then post what you see. You can P.M. me if you want to take this offline.

lrhorer
08-24-2008, 11:20 PM
Which directory are you running the app from?
/usr/share/TiVoStream. Here is a snippet of the script:

JAVA_HOME=/usr/lib/jvm/jre1.6.0_03
#JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun/jre
PATH=$PATH:$JAVA_HOME:$JAVA_HOME/bin

# Start tivostream
ps -ef | grep tivostream | grep java > /dev/null
if [ $? -gt 0 ];
then
cd /usr/share/TiVoStream
nohup java -cp tivostream_v0p3.jar com.tivo.hme.host.sample.Main com.hme.tivo.videostream.videostream & >> /var/log/tivostream.log
echo Starting tivostream;
fi

Then post what you see. You can P.M. me if you want to take this offline.
OK, I will.

moyekj
08-25-2008, 03:57 AM
New version posted. Previous version had a bad bug reported by Irhorer. Also added some of the easy stuff on Irhorer's wish list.
http://tivostream.googlecode.com/files/tivostream_v0p4.zip

RELEASE NOTES:
v0p4 - August 25, 2008
----------------------
CHANGES
* Fixed bug with incorrect http stream URI construction for certain
configurations.
* Skip ahead button on the remote now jumps to end of a list in file
browser mode and back to start of list if at end (just like Tivo
functionality).
* Changed default list sort order to alphanumeric and with folders always at
the top
* Added sort by file date option.
* Similar to Tivo Now Playing List sorting pressing 1 toggles between
alphanumeric and file date list sorting in file browser mode.

lrhorer
08-25-2008, 04:05 AM
New version posted. Previous version had a bad bug reported by Irhorer. Also added some of the easy stuff on Irhorer's wish list.
Thanks! Oh, just BTW, that's Lrhorer, not Irhorer.

moyekj
08-25-2008, 10:39 AM
P.S. Next version I'll make it so when you pop back left in file browser mode it remembers and returns to the file/folder you traversed into. (Currently it returns to 1st item in the list).

SMWinnie
08-25-2008, 10:47 AM
Has anyone tried tivostream with the output of a Hauppauge 1212 HD-PVR?

moyekj
08-25-2008, 10:55 AM
Has anyone tried tivostream with the output of a Hauppauge 1212 HD-PVR? If it's like other PC tuners it probably defaults to mpeg2 transport stream as an output. Some tuners allow you to save in mpeg2 program stream format instead. Currently I don't think anyone has figured out how to successfully feed an mpeg2 transport stream to Series 3 Tivos - they must be in mpeg2 program stream format.
HDTVtoMPEG2 (http://www.avsforum.com/avs-vb/showthread.php?s=&threadid=395744) is an example of freeware that can convert from transport stream to program stream (and edit out commercials). There are plenty of non-free tools such as VideoRedo that can do that too.

fyodor
08-25-2008, 04:28 PM
This is a new product that came out a few months ago. It captures HD component video and compresses it to a high definition h264 transport stream.

The transport streams are famously hard to play back correctly outside of applications that did not make a specific decision to support the HD-PVR so I'd be very surprised if this worked with Tivo.

F


If it's like other PC tuners it probably defaults to mpeg2 transport stream as an output. Some tuners allow you to save in mpeg2 program stream format instead. Currently I don't think anyone has figured out how to successfully feed an mpeg2 transport stream to Series 3 Tivos - they must be in mpeg2 program stream format.
HDTVtoMPEG2 (http://www.avsforum.com/avs-vb/showthread.php?s=&threadid=395744) is an example of freeware that can convert from transport stream to program stream (and edit out commercials). There are plenty of non-free tools such as VideoRedo that can do that too.

moyekj
08-25-2008, 04:59 PM
This is a new product that came out a few months ago. It captures HD component video and compresses it to a high definition h264 transport stream.

The transport streams are famously hard to play back correctly outside of applications that did not make a specific decision to support the HD-PVR so I'd be very surprised if this worked with Tivo.

F Interesting. Being a transport stream it would still at minimum require conversion to program stream before attempting to stream to Tivo.

moyekj
08-25-2008, 05:26 PM
A note for those running other HME based applications such as Galleon. This already is described in documentation of latest release: you can tell this application to use a different port than default port 7288 if you like by adding --port # at the end of the java command used to launch the application.

cleverdevil
08-25-2008, 06:01 PM
I have an older Mac Mini I'd like to run this on, and the newest version of the JRE available is Java 5 (1.5.x). Can you compile the jar with a 1.5 target, so that I can try it out?

I checked out the source, but it didn't seem to include any sort of build files or dependencies, so I gave up pretty quickly.

Thanks!

moyekj
08-25-2008, 06:51 PM
I have an older Mac Mini I'd like to run this on, and the newest version of the JRE available is Java 5 (1.5.x). Can you compile the jar with a 1.5 target, so that I can try it out?

I checked out the source, but it didn't seem to include any sort of build files or dependencies, so I gave up pretty quickly.

Thanks! Sent you a P.M. with build from source instructions.

windracer
08-25-2008, 07:56 PM
you can tell this application to use a different port than default port 7288 if you like by adding --port # at the end of the java command used to launch the application.
Nice. :up:

lrhorer
08-26-2008, 12:12 AM
A note for those running other HME based applications such as Galleon. This already is described in documentation of latest release: you can tell this application to use a different port than default port 7288 if you like by adding --port # at the end of the java command used to launch the application.
Thanks. I may do that just because. By running tivostream first and then Galleon, it seems to avoid the issue.

lrhorer
08-26-2008, 03:19 AM
OK, the next step is to convert my video library to MPEG-IV. I'm having some problems getting a playable mp4 stream, however. I can get a great looking conversion with about a 40% space savings using the following:

ffmpeg -i filename.mpg -b38810 -acodec copy filename.mp4

but ffmpeg warns about the file not being playable, and although Nero will play the file, it won't play audio. The TiVo rejects it entirely. I've tried various permutations of the -ac switch, but it usually just croaks saying the codec is unsupported. Most of the material is 5.1 Dolby, originally recorded on the Tivo. How do I get this to convert to a TiVo-friendly h.264 format with 5.1 audio?

djwilso
08-26-2008, 03:47 AM
I was able to download an MP4 video file from iTunes that this would play, but for some reason all of the files I've tried to create myself using CloneDVD Mobile using the Apple TV option all get an error on the TiVo saying they are rejected for some reason. All of the files play fine on the computer, in iTunes, Windows Media Player, Media Player Classic, Nero Showtime, etc.

The files transfer over using pyTiVo just fine, of course.

Any ideas what might be wrong with my files? I've tried various forms of naming conventions and have tried both large and very small files, but I get the same result.

Are there constraints with which audio or video codecs are allowed?

Not sure how I can create a compatible MP4 file that the TiVo will play.

What applications can I try if I want to convert a DVD into an MP4 file that will stream properly using this application? I have Nero 8 installed.

Thanks,
Dennis

moyekj
08-26-2008, 04:02 AM
Major breakthrough tonight - I finally figured out how to allow streaming from different file volumes/partitions in Windows. It's actually quite trivial - the trick was getting the right URI which I finally figured out in Java with File.toURL().toURI() functions. This will be very useful for anyone using Windows and storing video files on external drives (like me!).

Now I can focus on allowing multiple top directories to be specified in config.ini as a top screen starting point.

jtkohl
08-26-2008, 08:13 AM
A note for those running other HME based applications such as Galleon. This already is described in documentation of latest release: you can tell this application to use a different port than default port 7288 if you like by adding --port # at the end of the java command used to launch the application.

For Galleon, you can change the port in the properties panel (menu item) from the configuration tool.

Chew
08-26-2008, 08:17 AM
Would it be possible to include a sample "config.ini" file with the next release?

wmcbrine
08-26-2008, 09:12 AM
How do I get this to convert to a TiVo-friendly h.264 format with 5.1 audio?

The MPEG-4 files that work (so far) are h.264 video, AAC audio, in a Quicktime (MOV) wrapper.But I can't comment specifically on the issue of 5.1.

moyekj
08-26-2008, 11:10 AM
Too busy right now to play around with ffmpeg conversions to see what Tivo likes but I'm sure there are others familiar with ffmpeg here that can post what works for them (hopefully preserving 5.1 audio if present in original source).

moyekj
08-26-2008, 04:07 PM
Would it be possible to include a sample "config.ini" file with the next release? Will do. With the upcoming release there will be a little change in that under <topdir> now multiple top level directories can be specified (1 per line), but other than that no change to current syntax described in html doc.

windracer
08-26-2008, 04:22 PM
How about the ability to customize the name of the app on the menu instead of just 'videostream'? ;)

moyekj
08-27-2008, 03:24 AM
Some good stuff in this release as well as a fix to FF/REW.
NOTE: Very simple sample config.ini is now included with the installation. You should edit the file to add paths to your video files under the <topdir> line before starting the application. You can add any paths you like now from any file volume and it doesn't matter if they don't all exist at the time you run (non-existent paths are ignored).

http://code.google.com/p/tivostream/downloads/list

v0p5 - August 27, 2008
----------------------
* Added capability to stream files from any file volume.
* Added option to configure multiple top directories as starting point
for file browser (see documentation).
* Made file suffix checking case insensitive.
* When returning from a directory you are no longer thrown to the
top of the list.
* Switched to use the more stable (non-experimental) HME version 1.4.
* Added Tivo sounds where previously they were missing.
* Clear number display & buffer immediately after n min jump forwards/back
* Change application showing under Music, Photos, Products & More
to "Video Streamer"
* Added error text id & message display when video playback fails.
* Documentation updated

windracer
08-27-2008, 07:53 PM
I can get tivostream to run through Galleon, sharing port 7288, but there must be some conflicting functions in the jar because some of my Galleon apps will crash.

So for now I'm back to running it separately with the --port command-line parameter.

Sevenfeet
08-28-2008, 11:49 AM
First of all, thanks to Moyekj for working on this. Unfortunately, I've yet to be successful in getting a movie to play.

I have a small collection of movies from my DVD collection that I have converted via Handbrake using default options. A few of the movies were converted using Roxio's Toast for the Mac.

Getting an environment to play a movie wasn't easy. Although I have lots of hardware in the house, most of it is Mac hardware. In order to run a Java 1.6 app, I need a 64-bit Mac and only my wife's Macbook Pro fits the bill. She usually is using that machine for school so I didn't want to try to configure it.

I do have an ancient Sun Ultra 60 running Solaris 10, but I don't think I have Java 1.6 on it. I'm about to rebuild this machine so I'll make sure it's included when that happens.

That leaves my Thinkpad laptop running Windows XP SP2 that I use for work. After loading Java 1.6 on it, monkeying around with the config.ini file syntax and doing the upgrade to p5, I at least got to the point where error messages on the console ended. The fact that p5 can play movies from a network share helped since all of my movies sit on a file server in the house. But every time I tried to play something, I got an error from the Tivo screen saying the movie couldn't be played with an "0xffff" error.

I've read in this thread about the fact that the Tivo might be sensitive to how movies are converted for playback. The Sony PS3 is extremely sensitive to this versus my Macs that will pretty much play anything thrown at them. So assuming the error I'm seeing is a playback error, what should I be doing (or not doing) to properly convert a movie that the Tivo would like?

windracer
08-28-2008, 12:08 PM
How about the ability to customize the name of the app on the menu instead of just 'videostream'? ;)

* Change application showing under Music, Photos, Products & More to "Video Streamer"

Nice. :up:

PaulS
08-28-2008, 12:41 PM
I've had my first successes streaming video with this latest version. I had no luck with the previous versions (v0p3 and v0p4), but this newest build is up and running without issue. 720p H.264 content stream just fine, at slightly faster than realtime on my semi-clunky Athlon 3000+ (2.0GHz) machine over a longish 802.11g wireless network.

Thanks moyekj!

moyekj
08-28-2008, 12:54 PM
I've read in this thread about the fact that the Tivo might be sensitive to how movies are converted for playback. The Sony PS3 is extremely sensitive to this versus my Macs that will pretty much play anything thrown at them. So assuming the error I'm seeing is a playback error, what should I be doing (or not doing) to properly convert a movie that the Tivo would like? First I would establish that you can indeed play back a known to work video such as systm--0063--dolby--hd.h264.mp4 (http://www.podtrac.com/pts/redirect.mp4/bitcast-a.bitgravity.com/revision3/web/systm/0063/systm--0063--dolby--hd.h264.mp4) posted earlier in this thread which is a HD h.264 encoding. If that one works it establishes that your problem is indeed an encoding the Tivo can't handle.
NOTE: That one is a pretty big download, so if you have a decrypted mpeg2 from a Tivo to try instead that would be a good option too.
I've never used handbrake but I'm sure there are configuration options for the encoding that can be tweaked to make it work. One of these nights I'm going to have to play around with ffmpeg/mencoder/handbrake and figure out an encoding recipe that works starting from a small mpeg2 clip. Currently most of my videos are in mpeg2 format as they came mostly from my Tivos and I don't like to lose any quality by re-encoding and I haven't tried re-encoding them to mpeg4/h.264. If anyone else here has movies they have converted to mpeg4/h.264 please share your recipe.

moyekj
08-28-2008, 01:34 PM
How about the ability to customize the name of the app on the menu instead of just 'videostream'?
* Change application showing under Music, Photos, Products & More to "Video Streamer"
Nice. :up:
Original plan was to make the name configurable as well (in config.ini) but it's not possible as the name must be defined in the main class constructor which gets called before the parsing of the config.ini file happens.
For next release I've added some font customization capability (medium,large,small choices) to config.ini.

gonzotek
08-28-2008, 03:31 PM
Original plan was to make the name configurable as well (in config.ini) but it's not possible as the name must be defined in the main class constructor which gets called before the parsing of the config.ini file happens.Just a thought, but what about passing it as a commandline option, defaulting to "Video Streamer" if nothing is given?

Sevenfeet
08-28-2008, 03:54 PM
First I would establish that you can indeed play back a known to work video such as systm--0063--dolby--hd.h264.mp4 (http://www.podtrac.com/pts/redirect.mp4/bitcast-a.bitgravity.com/revision3/web/systm/0063/systm--0063--dolby--hd.h264.mp4) posted earlier in this thread which is a HD h.264 encoding. If that one works it establishes that your problem is indeed an encoding the Tivo can't handle.
NOTE: That one is a pretty big download, so if you have a decrypted mpeg2 from a Tivo to try instead that would be a good option too.
I've never used handbrake but I'm sure there are configuration options for the encoding that can be tweaked to make it work. One of these nights I'm going to have to play around with ffmpeg/mencoder/handbrake and figure out an encoding recipe that works starting from a small mpeg2 clip. Currently most of my videos are in mpeg2 format as they came mostly from my Tivos and I don't like to lose any quality by re-encoding and I haven't tried re-encoding them to mpeg4/h.264. If anyone else here has movies they have converted to mpeg4/h.264 please share your recipe.

I'm downloading it now. Can you also PM me the instructions to build this under a Java 1.5 release instead of 1.6?

And I guess I can always try DVD Shrink for my DVDs instead of handbrake.

moyekj
08-28-2008, 05:08 PM
Just a thought, but what about passing it as a commandline option, defaulting to "Video Streamer" if nothing is given? Not really feasible. I'm using Tivo's com.tivo.hme.host.sample.Main as the entry point to the application so can't define my own command line arguments to parse. So short of writing my own Main that's currently not possible.

jmemmott
08-28-2008, 07:36 PM
That is interesting. Out of curiosity can you get captions with any YouTube files? Does YouTube even support closed captioning?

I just thought I would update my response because You Tube has added supporting for captioning. I think that it still holds that the Tivo stream will not support this at this time. I plan to continue to follow events and do something when/if I can.

http://www.youtube.com/blog?entry=mi8D3ntPgFQ

moyekj
08-28-2008, 07:56 PM
I just thought I would update my response because You Tube has added supporting for captioning. I think that it still holds that the Tivo stream will not support this at this time. I plan to continue to follow events and do something when/if I can.

http://www.youtube.com/blog?entry=mi8D3ntPgFQ I would think if/when Tivo updates software to support closed captioning from YouTube streams that this application would automatically start working as well. i.e. If the CC data is part of the stream then Tivo should be able to display them. I don't think it's practical for the HME server (such as YouTube or this application) to generate the CC text because of the networking lags involved, the synchronization issues and the fact that the server would have to have it's own decoder doing CPU intensive work. It makes a lot more sense to pass the data to the Tivo and let it handle display just as it does for normal playback.

jmemmott
08-28-2008, 08:21 PM
I would think if/when Tivo updates software to support closed captioning from YouTube streams that this application would automatically start working as well. i.e. If the CC data is part of the stream then Tivo should be able to display them. I don't think it's practical for the HME server (such as YouTube or this application) to generate the CC text because of the networking lags involved, the synchronization issues and the fact that the server would have to have it's own decoder doing CPU intensive work. It makes a lot more sense to pass the data to the Tivo and let it handle display just as it does for normal playback.

In principal, I agree but it is the "if/when" that I don't care for. I have a mixed reaction to the support Tivo gives to captioning. When it is internal to their box, they have shown themselves to be responsive and even innovative such as the CC over HDMI on the Series 3 and the reasonably prompt inclusion of an easier way to toggle the caption on/off in the software. On the other hand, if I had waited for Tivo to do something on with the Tivo Desktop, I would still be waiting for the support T2Sami provides.

Simply including the CC data in the stream is not enough. It is already there in any mpegs that derive from a .tivo source. Additionally, there is no reason to believe that You Tube will adopt a protocol that is compatible with the one Tivo uses although that would be nice.

The part that is exciting for me is that You Tube /Google is one of the first prominent web player to do something about providing a mechanism to deliver captioned video. From that point on a final delivery solution can be created, convenient or not. It took time to for me to fully support normal Tivo captioning in both directions and knowing my schedule, it will take time to support captions in a You Tube steam. But the point is that it is now possible whether Tivo implements it or not.

wmcbrine
08-28-2008, 09:37 PM
It makes a lot more sense to pass the data to the Tivo and let it handle display just as it does for normal playback."just as it does for normal playback" means rendering it through an HME-like mechanism. There is zero chance that they're going to do it for you on streamed video.

moyekj
08-28-2008, 11:16 PM
"just as it does for normal playback" means rendering it through an HME-like mechanism. There is zero chance that they're going to do it for you on streamed video. Help me understand why that's the case? They already have a CC rendering mechanism built into the Tivo when displaying recorded videos, so why could that not be put to use? If it can't be done on the Tivo then if they want to implement it say for YouTube then the load of rendering will fall squarely on the YouTube HME servers? That seems like it could be a lot of horsepower required if so to support many users at a time if done on the fly (unless they pre-process videos they serve ahead of time or something of that nature).

One feasible way I could envision implementing this via HME is pre-processing a video file and generating a helper file that could be accessed during playback. In simplest form it would have time position & text+formatting instructions that can be consulted to do the rendering. This would be a lot simpler than trying to do it dynamically.

jmemmott
08-29-2008, 08:51 AM
One feasible way I could envision implementing this via HME is pre-processing a video file and generating a helper file that could be accessed during playback. In simplest form it would have time position & text+formatting instructions that can be consulted to do the rendering. This would be a lot simpler than trying to do it dynamically.

And early looks at the You Tube mechanism seem to lead to the implication that this is what they are doing. In part that is why they are supporting .sup and .srt formats which are basically your "helper file".

The issue on the Tivo is that the mechanism for ATSC captions is nothing like that. These captions have to be muxed into the video stream in a very specific format and the timing relies entirely on the timing of that stream including the timing anomalies created by B-frames. ATSC captions have been made to work with mpeg-2 and could be made to work mpeg-4 streams but to my knowledge aren't used that way for mpeg-4. Finally all this is handled in the Tivo by the hardware. There is little Tivo can do to alter it retroactively.

So the choice on that path is to get the stream to exactly mimic the formatting the Tivo expects which is what T2Sami does when it works to send close captioned video back through pyTivo. The other choice is to come up with an alternate mechanism geared to work well with the You Tube mpeg-4 streams. That in turn requires the ability to overlay text onto the video stream. So far it appears the suggested HME solution may be the only one available for that.

Could Tivo do this inside the box more effectively - certainly. Will they - As I noted, their track record in this area is not one I trust.

lrhorer
08-29-2008, 09:55 AM
I'm going to submit another suggestion and a question.

The suggestion is to allow the user to configure a name for each share. It's purely cosmetic, of course, but having shares of "Main" and "Videos Sorted by Genre" make more sense on the TiVo than /RAID/Recordings and /usr/share/pyTivo/wgw/pyshares, or at least look much nicer.

The question is this: Assuming TiVo comes up with support for streaming and / or h.264 in HMO applications, how difficult will it be to convert your application to HMO? I've glanced briefly at some HMO programming, but I haven't dug deeply into it, and I haven't looked at HME at all. Your application is really great, but it would be really nice if it showed up inthe NPL, rather than under Downloads, etc.

lrhorer
08-29-2008, 11:45 AM
How do I get this to convert to a TiVo-friendly h.264 format with 5.1 audio?


The MPEG-4 files that work (so far) are h.264 video, AAC audio, in a Quicktime (MOV) wrapper.


But I can't comment specifically on the issue of 5.1.
So far I can't get it to work with any switch for -acodec at all. I even tried the sample in the ffmpeg man page, and still no matter what I get:

Unsupported codec for output stream #0.1

wmcbrine
08-29-2008, 12:54 PM
The question is this: Assuming TiVo comes up with support for streaming and / or h.264 in HMO applications, how difficult will it be to convert your application to HMO?It would be impossible, since HMO and HME have nothing in common at all. However, it would (and will) be easy to support h.264 in pyTivo, if and when it can be done in HMO at all (and we can see how).

Streaming video will never be associated with HMO.

Unsupported codec for output stream #0.1So, you need to get or build a version of ffmpeg that supports it.

moyekj
08-29-2008, 02:58 PM
The suggestion is to allow the user to configure a name for each share. It's purely cosmetic, of course, but having shares of "Main" and "Videos Sorted by Genre" make more sense on the TiVo than /RAID/Recordings and /usr/share/pyTivo/wgw/pyshares, or at least look much nicer. Next version I'm working on already has something like that where you can optionally provide a name for each share in the config.ini file and the names are what you see at top level (if no name given then the full dir name is displayed as normal).
I've added several new configuration items to config.ini including control over instant replay/skip forwards times, status bar & info text timeout values, font size and a couple of others. I think there are enough changes in my development version to warrant another release soon.

lrhorer
08-29-2008, 05:38 PM
So, you need to get or build a version of ffmpeg that supports it.
I'm not sure how I woud go about that. More properly, I assumed it already would, and don't know why it doesn't. According to the notes in the Debian distro, I've got the most recent Deb package for ffmpeg on a 64 bit AMD processor, and I have the latest codec library. How would I go about compiling additional codecs into the application, and which ones?

moyekj
08-29-2008, 05:53 PM
I'm not sure how I woud go about that. More properly, I assumed it already would, and don't know why it doesn't. According to the notes in the Debian distro, I've got the most recent Deb package for ffmpeg on a 64 bit AMD processor, and I have the latest codec library. How would I go about compiling additional codecs into the application, and which ones? You can see list of codecs compiled into the binary you are using by executing "ffmpeg -formats". For missing codecs you have to obtain and build those and then when you build ffmpeg from source you have to include them.
For example if "libxvid" was missing you would obtain the codec from here (http://www.xvid.org/Downloads.43.0.html) and then compile it.
Then when building ffmpeg from source you would use the configure --enable-libxvid (along with --extra-cflags and --extra-ldflags to include the headers and libs of libxvid) option to add it.
The standard build of ffmpeg (and libxvid example above) from source is pretty easy and follows the GNU norms:
./configure
make
make install

As to which particular codecs you are missing first you should try and discover the codecs used in your source video that you are trying to convert. Which particular audio codecs the Tivo supports I don't know...

Rdian06
08-29-2008, 06:23 PM
I'm not sure how I woud go about that. More properly, I assumed it already would, and don't know why it doesn't. According to the notes in the Debian distro, I've got the most recent Deb package for ffmpeg on a 64 bit AMD processor, and I have the latest codec library. How would I go about compiling additional codecs into the application, and which ones?

If I'm reading this right, the only h264 video that works is in an MP4 container (MOV wrapper). From what I understand of the MP4 container, the only 5.1 audio it can contain according to spec is AAC 5.1. You can force AC3 5.1 (aka Dolby Digital) into the container (ala -acodec copy), but that violates spec.

So to remain within spec for MP4, you would need to convert the AC3 5.1 to AAC 5.1. To get ffmpeg to do that, your ffmpeg has to be compiled with libfaac support. ffmpeg itself doesn't have a native AAC encoder currently (it's in development, an initial AAC decoder was recently added to ffmpeg trunk), hence the need for the library.

However, even if you create an mp4 file with h264 video and AAC 5.1 audio and the Tivo will play it with tivostream, no one knows what will happen with the audio. If the Tivo just bitstreams the AAC 5.1 signal to your receiver, then chances are your receiver doesn't support AAC 5.1 and won't know what to do with the signal. If you happen to have an AAC 5.1 capable receiver, it just might work.

In my case, my receiver can't handle AAC 5.1 so I would have to hope that Tivo wrote a AAC 5.1 decoder and then set the Tivo unit to decode it to PCM and pass that out to my receiver. If they did that then maybe I could get 5.1 audio.

Has anyone tried playing an EVO or an Mpeg2 TS file with tivostream? Both those support h264 video and AC3 5.1 audio.

moyekj
08-29-2008, 06:40 PM
Has anyone tried playing an EVO or an Mpeg2 TS file with tivostream? Both those support h264 video and AC3 5.1 audio. I tried throwing a couple of mpeg2 transport streams (recorded from a PC QAM tuner) at my Tivo S3 via tivostream and no go. All mpeg2 program streams I've tried thus far seem to work OK. NOTE: Currently in tivostream I don't send any "hints" to the Tivo about video format. When setting up a stream there is an option to specify what kind of stream it is, for example "video/mpeg2". It could be that explicitly specifying the format you are sending could help make it work. One thing I may try is "video/x-tivo-raw-tts" for transport streams (which works to pull videos off Tivos in transport stream format - though they are still encrypted that way).

Rdian06
08-29-2008, 07:04 PM
One thing I may try is "video/x-tivo-raw-tts" for transport streams (which works to pull videos off Tivos in transport stream format - though they are still encrypted that way).

A little off topic, but do you mean encrypted as in .tivo file encrypted with the Tivo MAK, or encrypted some other way?

It would be nice to be able to pull video from non-copyprotected broadcasts off my Tivo S3 at something approaching MRV speed rather than the really slow TTG speed.

moyekj
08-29-2008, 07:25 PM
A little off topic, but do you mean encrypted as in .tivo file encrypted with the Tivo MAK, or encrypted some other way?

It would be nice to be able to pull video from non-copyprotected broadcasts off my Tivo S3 at something approaching MRV speed rather than the really slow TTG speed. [WAY OFF TOPIC] Some network sniffing I did with a hub revealed that when you initiate MRV between 2 S3 Tivos the URL used is same as a normal TTG URL except with a different format specification: "&Format=video%2Fx-tivo-raw-tts". Trying that from a web browser worked and allowed me to download a video at MRV speeds which was great news. The bad news is that it is encrypted in some format I don't know how to deal with (tivodecode doesn't know what to do with it so it's not the normal .TiVo encrypted format), so it's pretty worthless. I can only hope someone a lot more gifted at dealing with encryption can crack it, but I'm at a loss what to do with it. [/WAY OFF TOPIC]

lrhorer
08-29-2008, 07:34 PM
You can see list of codecs compiled into the binary you are using by executing "ffmpeg -formats".
Yeah, that I know. The ac3 codec is there, but not libfaac, assuming libfaac is the library I need. From suggestions elsewhere, it's possible I also may need libx264, although I'm not certain. The Debian build says it supports H.264 encoding without that codec. I surmise it might be needed for the Quicktime wrapper, however, if that is needed.

For missing codecs you have to obtain and build those and then when you build ffmpeg from source you have to include them.
I'm stumbling on this one. I can't seem to find a single tarball with the ffmpeg source code. The mplayer project has tons of individual source code files, but I'm a bit lost on which ones I need to compile ffmpeg manually.

For example if "libxvid" was missing you would obtain the codec from here (http://www.xvid.org/Downloads.43.0.html) and then compile it.
Then when building ffmpeg from source you would use the configure --enable-libxvid (along with --extra-cflags and --extra-ldflags to include the headers and libs of libxvid) option to add it.
Yeah, that much I also understand, but first I have to have all the files I need to compile ffmpeg itself.

The standard build of ffmpeg (and libxvid example above) from source is pretty easy
I'm sure it is once I have all the source files and directory structure in place. It also will be simple once I know which codecs I actually need. At this point I am uncertain.

As to which particular codecs you are missing first you should try and discover the codecs used in your source video that you are trying to convert. Which particular audio codecs the Tivo supports I don't know...
I'm not seeming to have any troubles with the source codecs. It recognizes the input video and audio just fine. It's the output with which I am having trouble, first of all in knowing which codecs I actually need, and then figuring out how to gather everything I need to compile ffmpeg.

lrhorer
08-29-2008, 07:46 PM
[WAY OFF TOPIC]Trying that from a web browser worked and allowed me to download a video at MRV speeds which was great news. The bad news is that it is encrypted in some format I don't know how to deal with (tivodecode doesn't know what to do with it so it's not the normal .TiVo encrypted format)
The .TiVo format is not really encrypted. I'm given to understand it's really just an MPEG-II transport stream file with some xml information embedded in it.

so it's pretty worthless. I can only hope someone a lot more gifted at dealing with encryption can crack it, but I'm at a loss what to do with it. [/WAY OFF TOPIC]
I don't believe anyone has broken TiVo's encryption scheme, and I doubt they ever will. Disabling encryption on the Tivo is fairly simple, though, and there are utilities to pull off the unencrypted ty streams and to convert from a ty stream to an ordinary MPEG-II transport stream. This all requires hacking the TiVo, however.

moyekj
08-29-2008, 07:50 PM
lrhorer, ffmpeg source I usually grab from here (which corresponds to very latest source code):
http://ffmpeg.mplayerhq.hu/ffmpeg-export-snapshot.tar.bz2

lrhorer
08-29-2008, 08:12 PM
lrhorer, ffmpeg source I usually grab from here (which corresponds to very latest source code):
http://ffmpeg.mplayerhq.hu/ffmpeg-export-snapshot.tar.bz2
Thanks! I'll check it out.

wmcbrine
08-29-2008, 08:34 PM
More properly, I assumed it already would, and don't know why it doesn't. According to the notes in the Debian distro, I've got the most recent Deb package for ffmpeg on a 64 bit AMD processor, and I have the latest codec library.The builds of ffmpeg included with Debian and Ubuntu are crap. Part of that might be patent issues; part of it is that they're just out of date.

lrhorer
08-29-2008, 08:43 PM
Well, I'm getting closer. I really appreciate all the help. Assuming I needed libx264 and libfaac, I went into the libavcodec directory from the tarball and ran 'make libx264' and 'make libfaac', but both failed with a number of compile errors, the most obvious being both source files call for header files (x264.h and faac.h, respectively) that aren't there. I don't see them on the ffmpeg download page, either.

moyekj
08-29-2008, 08:57 PM
Well, I'm getting closer. I really appreciate all the help. Assuming I needed libx264 and libfaac, I went into the libavcodec directory from the tarball and ran 'make libx264' and 'make libfaac', but both failed with a number of compile errors, the most obvious being both source files call for header files (x264.h and faac.h, respectively) that aren't there. I don't see them on the ffmpeg download page, either. You should use the "configure script" to prepare for compile:
./configure --enable-libx264 --enable-libfaac
(look in the configure script itself for all available switches)
After a successful configure (where it can get all dependencies) then it's a simple make:
make
make install
(you may also want to use the --prefix=/custom/path with configure to install in non-standard location)

lrhorer
08-29-2008, 09:13 PM
You should use the "configure script" to prepare for compile:
./configure --enable-libx264 --enable-libfaac
Yeah, I did that, and those switches are indeed listed, but the attempt yields errors saying libfaac and x264 are not found. (One needs GPL enabled as well for libx264, but I did that.) I presumed the failure was due to libfaac and libx264 not being compiled, so I went into the libavcodec directory and tried compiling libx264 and libfaac.

After a successful configure (where it can get all dependencies) then it's a simple make:
make
make install
(you may also want to use the --prefix=/custom/path with configure to install in non-standard location)
I'm not using a custom path, and ./configure with no options works fine, but it fails for libx264 and libfaac.

moyekj
08-29-2008, 09:25 PM
New tivostream version just released:
http://tivostream.googlecode.com/files/tivostream_v0p6.zip

v0p6 - August 29, 2008
----------------------
* Added capability to customize font size in config.ini:
large, medium (default), small
* Added capability to give friendly names to top level directories
in the config.ini file.
* Added capability to customize instant replay, skip forwards, info timeout,
status bar timeout and slow speed in config.ini.
* Comment lines are now allowed in config.ini (lines starting with #)
* Sample config.ini includes all new settings and comments with descriptions
* Updated documentation to document the new config.ini options.
* Added automatic parsing of pyTivo metadata files. i.e. If you have a
file with same name as video file but with .txt extension at the end in
pyTivo syntax then the file is parsed and information is shown on screen
when you press Info button.

NOTE: For the metadata information display it's very crude right now with plenty of room for improvement, but at least the infrastructure is in place for easy future updates.

lrhorer
08-29-2008, 09:27 PM
Oh, way cool! Now if I can just get ffmpeg working to transcode to h.264...

moyekj
08-29-2008, 09:47 PM
Oh, way cool! Now if I can just get ffmpeg working to transcode to h.264... You have to build libx264 and libfaac separately before building ffmpeg. I haven't tried yet but the corresponding builds you can get here:
http://downloads.sourceforge.net/faac/faac-1.26.tar.gz
ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20080829-2245.tar.bz2

lrhorer
08-29-2008, 10:00 PM
NOTE: For the metadata information display it's very crude right now with plenty of room for improvement, but at least the infrastructure is in place for easy future updates.
Yeah, the first thing on my list is the program names in the main list. For example, the file name might be "2 Harry Potter and the Chamber of Secrets (Recorded Sat Apr 12, 2008, KSATDT).mpg, but in the metafile the title is "Harry Potter and the Chamber of Secrets" and the episode title is "...and the Chamber of Secrets". Since I'm in the "Harry Potter" directory, the "Harry Potter" is not absolutely necessary, although now with the smaller fonts, it will all fit. So it would be nice if the main program display were either the title field (great now with the smaller fonts) or the episode title filed from the metafile, rather than the filename. Of course pyTivo utilizes the episode title, which is why I put the truncated name there, but with the smaller fonts the full title is actually preferable, since some of the shares don't separate by folder that way.

I've got to say, man, you're doing a fabulous job with this utility.

moyekj
08-29-2008, 10:17 PM
Yeah, the first thing on my list is the program names in the main list. For example, the file name might be "2 Harry Potter and the Chamber of Secrets (Recorded Sat Apr 12, 2008, KSATDT).mpg, but in the metafile the title is "Harry Potter and the Chamber of Secrets" and the episode title is "...and the Chamber of Secrets". Since I'm in the "Harry Potter" directory, the "Harry Potter" is not absolutely necessary, although now with the smaller fonts, it will all fit. So it would be nice if the main program display were either the title field (great now with the smaller fonts) or the episode title filed from the metafile, rather than the filename. Of course pyTivo utilizes the episode title, which is why I put the truncated name there, but with the smaller fonts the full title is actually preferable, since some of the shares don't separate by folder that way.

I've got to say, man, you're doing a fabulous job with this utility. Thanks, I think a lot of the low-hanging fruit type stuff is now out of the way. There are plenty of harder challenges to tackle yet, such as:
* bookmarking location where you last left off viewing a file so you can resume viewing from that point (I think this is possible with some more investigation/work. It sounds easy on the surface but though I have the time point where you stopped viewing I need the corresponding location in bytes of the file)
* ability to jump beyond available buffer (this may not be possible but a worthwhile endeavor)
* some kind of closed captioning support

moyekj
08-29-2008, 10:23 PM
You have to build libx264 and libfaac separately before building ffmpeg. I haven't tried yet but the corresponding builds you can get here:
http://downloads.sourceforge.net/faac/faac-1.26.tar.gz
ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20080829-2245.tar.bz2
I got ffmpeg to build with libx264 & libfaac after building the libs given above. One spot of trouble I had is you need to pass -lpthread as an extra ldflag option for ffmpeg configure:

./ffmpeg -formats | grep lib
FFmpeg version SVN-r15018, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/home/moyekj/linux/src/ffmpeg --enable-gpl --enable-libx264 --enable-libfaac --extra-cflags=-I/home/moyekj/linux/src/ffmpeg/include --extra-ldflags=-L/home/moyekj/linux/src/ffmpeg/lib -lpthread
libavutil 49.10. 0 / 49.10. 0
libavcodec 51.70. 0 / 51.70. 0
libavformat 52.21. 0 / 52.21. 0
libavdevice 52. 1. 0 / 52. 1. 0
built on Aug 29 2008 19:15:09, gcc: 3.4.6 20060404 (Red Hat 3.4.6-3)
EA libfaac libfaac AAC (Advanced Audio Codec)
EV libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
DEV D zlib LCL (LossLess Codec Library) ZLIB

lrhorer
08-29-2008, 11:19 PM
You have to build libx264 and libfaac separately before building ffmpeg.
I'm still not quite getting there, I'm afraid. I ran the configure utility for the x264 library which completes just fine, but the make spits out tons of errors if I include the --enable-mp4-output, which I think I need. If not, then I think I'm OK with that codec, as I can configure it into ffmpeg. Don't I need the mp4 output, though, or will ffmpeg take care of that?

The ffmpeg configure utility seems to work OK with both libx264 and libfaac enabled, but I can't get ffmpeg to make. Even with nothing enabled but the defaults for configure, make errors out. There are lots of undefined references, and the linker exits with various errors depending on what I specify in the configure command line.

Rdian06
08-29-2008, 11:32 PM
I'm still not quite getting there, I'm afraid. I ran the configure utility for the x264 library which completes just fine, but the make spits out tons of errors if I include the --enable-mp4-output, which I think I need. If not, then I think I'm OK with that codec, as I can configure it into ffmpeg. Don't I need the mp4 output, though, or will ffmpeg take care of that?

The ffmpeg configure utility seems to work OK with both libx264 and libfaac enabled, but I can't get ffmpeg to make. Even with nothing enabled but the defaults for configure, make errors out. There are lots of undefined references, and the linker exits with various errors depending on what I specify in the configure command line.

What version of the x264 library did you get? I just looked at the configure script in git and it doesn't have an --enable-mp4-output option:


echo "Usage: ./configure [options]"

6 echo ""

7 echo "available options:"

8 echo ""

9 echo " --help print this message"

10 echo " --disable-avis-input disables avisynth input (win32 only)"

11 echo " --disable-mp4-output disables mp4 output (using gpac)"

12 echo " --disable-pthread disables multithreaded encoding"

13 echo " --disable-asm disables assembly optimizations on x86"

14 echo " --enable-gtk build GTK+ interface"

15 echo " --enable-debug adds -g, doesn't strip"

16 echo " --enable-gprof adds -pg, doesn't strip"

17 echo " --enable-visualize enables visualization (X11 only)"

18 echo " --enable-pic build position-independent code"

19 echo " --enable-shared build libx264.so"

20 echo " --extra-asflags=EASFLAGS add EASFLAGS to ASFLAGS"

21 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS"

22 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS"

23 echo " --host=HOST build programs to run on HOST"

24 echo ""


Maybe you got confused with the --disable-mp4-output option?

After you compiled the libx264 and libfaac, did you do a make install to actually put them into your systems lib and include paths?

Also, here is the configure information for my Windows ffmpeg build. Not exactly the same, but might help a little:


FFmpeg version SVN-r14196-rdian06-0.93, Copyright (c) 2000-2008 Fabrice Bellard,
et al.
configuration: --enable-memalign-hack --enable-postproc --enable-swscale --enable-gpl --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libxvid --disable-ffserver --disable-vhook --enable-avisynth --enable-pthreads

lrhorer
08-29-2008, 11:37 PM
I got ffmpeg to build with libx264 & libfaac after building the libs given above. One spot of trouble I had is you need to pass -lpthread as an extra ldflag option for ffmpeg configure:
I tried it and it didn't fix the problem. There are still a lot of unresolved references, and the linker exits with an error.

lrhorer
08-29-2008, 11:49 PM
What version of the x264 library did you get?
x264-snapshot-20050824-2219 I looked a little cross-eyed at the tar file monkeyj specified, and thought it was a bit older, so I'll update the version.

Maybe you got confused with the --disable-mp4-output option?
No, it was definiitely enable. I'll get the newer codec, though.

After you compiled the libx264 and libfaac, did you do a make install to actually put them into your systems lib and include paths?
Yes, and the ffmpeg configure command finds them just fine, but the make command croaks even with no configure options.

Rdian06
08-30-2008, 12:07 AM
Yes, and the ffmpeg configure command finds them just fine, but the make command croaks even with no configure options.

Did you do a make distclean before re-running configure with no options and doing the subsequent make?

If so, what is the compile error it's reporting?

lrhorer
08-30-2008, 01:42 AM
Did you do a make distclean before re-running configure with no options and doing the subsequent make?
No, I hadn't thought of that. I'm downloading the new version of the h.264 codec right now. I'll give it a shot after I compile the new codec.

lrhorer
08-30-2008, 02:27 AM
Hoboy. Well, another stumble. When I try to compile the new x264, it trips over yasm. I have yasm installed, but the assembler check looks like this:

$AS conftest.asm $ASFLAGS $2 -o conftest.o 2>$DEVNULL
In this environment, this translates to:

yasm conftest.asm -o conftest.o 2>DEVNULL
The contents of conftest.asm are

pabsw xmm0, xmm0
When I run this externally, yasm complains:

conftest.asm:1: label or instruction expected at start of line
by which I take it yasm doesn't like the instruction "pabsw".

If I disable assembly compilation via the --disable-asm switch, it compiles, but I would much rather have optimized code. Any ideas, anyone?

I can compile ffmpeg with the result of disabling assembly in the x264 ibrary, but I get a segmentation fault when I try to use the -vcodec libx264 option of ffmpeg. The libfaac audio seems to work, however. I tried transcoding using the mp4 codec, and it plays fine in Nero Showtime, but the Tivo rejects it, both with the -ac 2 option and with -acodec libfaac.

moyekj
08-30-2008, 04:40 AM
Somehow it seems ffmpeg screws things up for Tivo. I tried lots of things that didn't work. Finally, I decided to take a small test.mp4 file that works and just run it through in copy mode via ffmpeg:
ffmpeg test.mp4 -vcodec copy -acodec copy copy.mp4
You guessed it, copy.mp4 does not play back!

djwilso
08-30-2008, 05:44 AM
Somehow it seems ffmpeg screws things up for Tivo. I tried lots of things that didn't work. Finally, I decided to take a small test.mp4 file that works and just run it through in copy mode via ffmpeg:
ffmpeg test.mp4 -vcodec copy -acodec copy copy.mp4
You guessed it, copy.mp4 does not play back!I am also still having trouble creating my own mp4 files that will play back. CloneDVD Mobile, HandBrake, and Nero 8 Recode all create files that give the 0xffff error. I tried multiple settings with each of the programs.

However, sample mp4 files I can get from iTunes and even the HD H.264 mp4 files from Diggnation work fine.

Does anyone know what tool Revision3 uses to create the Diggnation mp4 files? They play perfectly.

Does anyone have Quicktime Pro that could try to see if that will create a compatible mp4 file? I don't want to waste the $30 if it won't work.

Thanks!
Dennis

Sevenfeet
08-30-2008, 09:26 AM
I am also still having trouble creating my own mp4 files that will play back. CloneDVD Mobile, HandBrake, and Nero 8 Recode all create files that give the 0xffff error. I tried multiple settings with each of the programs.

However, sample mp4 files I can get from iTunes and even the HD H.264 mp4 files from Diggnation work fine.

Does anyone know what tool Revision3 uses to create the Diggnation mp4 files? They play perfectly.



An update from me.

First, the updates to this program keep coming fast and furious. It's really taking shape. I also have been successful with the sample Revision 3 clip that was mentioned earlier. So at least I know I can play some clips using this software.

That being said, I'm seeing the same problems with MP4s that I had previously encoded via Handbrake or Toast using default settings. Clearly this is an encoding issue. I'm assuming that this program can't change what MP4s that a Tivo can play successfully, so it's up to us to figure out what encoding options work, and what don't.

wmcbrine
08-30-2008, 10:48 AM
When I built my own ffmpeg on Ubuntu, I found it sufficient to use the x264, etc., libraries from the repositories. It was only ffmpeg itself that I had to build. Of course you also need the "-dev" packages that correspond to the libraries (they contain the header files).

I haven't yet tried to make an MP4 file for the TiVo...

moyekj
08-30-2008, 01:03 PM
Somehow it seems ffmpeg screws things up for Tivo. I tried lots of things that didn't work. Finally, I decided to take a small test.mp4 file that works and just run it through in copy mode via ffmpeg:
ffmpeg test.mp4 -vcodec copy -acodec copy copy.mp4
You guessed it, copy.mp4 does not play back! Using GSpot I see that the copy is missing headers and timestamp and perhaps that is sufficient to mess up the Tivo decoder...

moyekj
08-31-2008, 02:42 AM
Eureka! Took a lot of trial and error and many different tools but perseverance finally paid off. I ran into this tool I'd never heard of called SUPER which is really just a GUI around x264/ffmpeg/mencoder and after a lot of playing around got some encodings that worked:

http://www.erightsoft.com/SUPER.html

SUPER SETTINGS FOR TIVO-COMPATIBLE H.264 ENCODING
=================================================
Output Container = mp4
Output Video Codec = H.264/AVC
Output Audio Codec = AAC LC

H264 Profile:
BaseLine (CABAC off)
H.264 levels: 2.1 or 3.1 (maybe others I didn't try yet)

Other Opts: (VERY IMPORTANT! THIS WAS THE BREAKTHROUGH SETTING)
Enable "Streamable H.264"

For Video
Pretty flexible, I tried several bit rates and both 29.97 or 24 fps work fine.

For Audio
Also seems flexible, settings I tried:
Sampling Freq = 44100 or 48000, 2 channel, various bit rates
Sampling Freq = 48000, 6 channel, various bit rates

Would be nice to figure out what the above settings translate into for x264 batch encoder.
Not sure exactly what enabling "streamable h.264" does, but the encodings don't work on Tivos without that setting.

Rdian06
08-31-2008, 12:14 PM
Haven't done it myself, but check this out to try to fix the ffmpeg mp4.

ffmpeg MP4 does not stream qt-faststart
http://www.saiweb.co.uk/linux/ffmpeg-mp4-does-not-stream-qt-faststart

moyekj
08-31-2008, 01:24 PM
For example, something like the following seems to work (mostly):
ffmpeg -y -i test.mpg -vcodec libx264 -coder 0 -level 31 -r 29.97 -b 1008k -g 300 -bug +autodetect+ms -me epzs -trellis 2 -mbd 1 -maxrate 1008k -bufsize 450k -vol 150 -acodec libfaac -profile aac_low -ac 2 -ar 48000 -ab 64k -f mp4 temp.mp4

qt-faststart temp.mp4 test.mp4

EDIT: After more experimentation the ffmpeg generated .mp4 files while they do play normally on the Tivo some of the trick functions such as REW/FF don't work very well, so looks like some further tweaks are needed in the recipe. I have noticed also that playing back some YouTube videos Tivo doesn't handle trick play functions very well either so this may be more a Tivo problem than anything else.

Sevenfeet
08-31-2008, 11:54 PM
One thing that I have noticed is that both Handbrake (Mac version) and Roxio Toast both have settings for streamable videos. For Handbrake, its a HTTP checkmark setting. The strange thing is that Handbrake doesn't end up saving a file when this setting is used...it's written to but it disappears when the final information is written. This is probably a bug since it occurred on two different Macs in the house.

For Roxio Toast, there is a streaming setting which has a lot of tweaks. So far, I have gotten it to write files, but not something the Tivo + Videostreamer will play (same xFFFF error). One strange bit...the streamable MP4 file I created with Toast will not play via a Quicktime movie player. It's possible it only works from a web browser.

Still trying to find something that works.

lrhorer
09-01-2008, 01:10 AM
Well, the fact Super is a Windows program doesn't thrill me, especially since all the fast machines are running Linux, but there seems to be some bigger issues. First of all, while I've been playing with some of the settings, none of the results play reliably on the TiVo. What's more, even when I select 6 channel audio, I only get stereo on my receivers. The real killer, though, is that all the resultant files are at least six times larger than the original. The whole point of this exercise is to reduce the file size, not increase it.

moyekj
09-01-2008, 02:35 AM
Well, the fact Super is a Windows program doesn't thrill me, especially since all the fast machines are running Linux, but there seems to be some bigger issues. First of all, while I've been playing with some of the settings, none of the results play reliably on the TiVo. What's more, even when I select 6 channel audio, I only get stereo on my receivers. The real killer, though, is that all the resultant files are at least six times larger than the original. The whole point of this exercise is to reduce the file size, not increase it. The ffmeg line above I got from running Super and then finding out what jobs it spawned off. There is an extra re-mux step Super does at the end I'm not sure about yet but the above is a good starting point and probably just needs a little tweaking and no need for Super anymore. Either way (through Super or ffmeg) most of the files produced do not work very reliably with REW/FF and jumps back and forwards but work OK at normal play speed, but as I mentioned that's also the case with YouTube.
Personally most of my recordings are mpeg2 and they work great so I'm not too bothered about it for now, though HD mpeg2 streaming I sometimes catch up to buffer so a good mpeg4 HD encoding would certainly be a benefit for streaming and space reasons.

Another development today is I think I've uncovered a way to make bookmarking possible (play starting from where you last left off streaming). That should be a handy addition for next release if I can get it fully working and integrated - need to figure out a good, easy way to choose between play from start or play from last saved position.

Sevenfeet
09-01-2008, 08:32 AM
I'm pleased to report that I've had my first success in encoding a MPEG-2 video to MPEG-4 and playing it on my Tivo through Tivostream. I managed to get Roxio's Toast 9 Titanium for Mac to do the job through a customer setting. I'm currently encoding another video now so I can't list every thing I did but here's the basics.

The first thing I did was looked a little closer at the sample Revision 3 video that we all use for testing. According to the Apple Quicktime player, this is a 720p video that is encoded for H.264. The data rate is 2164 kbits and uses a standard 2 channel AAC soundtrack. Outside of that, nothing about it seems that remarkable.

Test video was the Pixar short "Jack Jack Attacks" from "The Incredibles" Bonus DVD. It was originally ripped with Mac The Ripper to my central Leopard Server in my home.

Custom setting:
1. Use the generic H.264 player instead of the pre-made settings for Apple products, like Apple TV.

2. I used a 2000 kbits data rate

3. I just had it optimized for download, not streaming.

4. Single pass encoding (I'm testing a multipass encode right now and will report if it works or not)

5. Optimized for server (there's a special "video" button that reveals this feature"

6. Audio. Two channel AAC, 48kbits.

7. Resolution. At first I tried to match the native resolution of the DVD, which is a 720 x 580 setting (anamorphic widescreen). But for reasons I don't understand, that setting, while it played on the Tivo, had a weird jutter problem in playback that made watching the video difficult. So I tried upscaling to 1080p. This looked and played far better, both on my 1080i RPTV and my 480i standard def bedroom television.

Today, I'll experiment with my more settings (whether encoding for streaming makes a difference or not, other encoding tweaks). One thing that would be nice to do is 5.1 sound (required for me to be happy with doing it for my home theater) but even though it's possible to encode AC3 audio in a H.264 video, whether the Tivo willl play it back properly is a big mystery. Handbrake has a setting for this but I'm not sure that Toast does. Also, I'm not sure the data rate is going to be optimal for a 1080p encode...I have some 1080p movie trailers which I will look at again to check what their data rate is. And I'm sure that 480p trailers of the same movie trailers have a lesser rate.

Sevenfeet
09-01-2008, 11:33 AM
One minor update... 2 mbits/sec for 1080p is a pretty lousy bit rate, even for upscaled standard def. It looks ok on a standard def TV (32") but it's pretty lousy to my eyes on the 1080i RPTV I have. Compare that to 10 mbits/sec for a Wall-E trailer I have from Pixar (also 1080p). Broadcast HDTV (which is Mpeg-2) is anywhere from 12-19 mbits/sec or 1080i.

I'll try some better rates and see what looks good to the eye.

moyekj
09-01-2008, 03:28 PM
Sevenfeet, how do trick play functions like FF/REW work with your encodings?
With ffmeg there's an option for 6 channel AAC that I've used and it worked (with TV speakers), but I don't have surround sound system to test it.

Sevenfeet
09-01-2008, 06:32 PM
Sevenfeet, how do trick play functions like FF/REW work with your encodings?
With ffmeg there's an option for 6 channel AAC that I've used and it worked (with TV speakers), but I don't have surround sound system to test it.

Fast forward and Rewind work pretty well with the Toast encodings.

Toast doesn't seem to have a setting to do 6 channel soundtracks with H.264 encodings (at least the generic ones...still haven't looked at the Apple ones). I know Handbrake can do this in the form of attaching AC3 5.1 soundtracks (Apple starting doing this with their own encodings for Apple TV rentals). Even if you could do 6 channel AAC, I don't know many home theater receivers that could decode that and it would only work over HDMI. My Denon 3805 receiver is too old and doesn't do HDMI.

RaGINaR
09-01-2008, 09:06 PM
So, is there a nice wrapper that makes this work on my mac? :)

Rdian06
09-02-2008, 04:00 AM
I know Handbrake can do this in the form of attaching AC3 5.1 soundtracks (Apple starting doing this with their own encodings for Apple TV rentals). Even if you could do 6 channel AAC, I don't know many home theater receivers that could decode that and it would only work over HDMI. My Denon 3805 receiver is too old and doesn't do HDMI.

Apple is putting AC3 5.1 in their rental files? Are they using mp4 container for this or something else?

moyekj
09-02-2008, 11:58 AM
So, is there a nice wrapper that makes this work on my mac? :) I would think the run_unix.sh wrapper probably works no?

cleverdevil
09-02-2008, 12:47 PM
I would think the run_unix.sh wrapper probably works no?

Well, sort of...

Currently, Apple only provides the Java 1.6 runtime as a beta, in a fairly hard to find developer-only area of their website, and only for 64-bit intel Macs.

If the released version were compiled with the "-target 1.5" command line option, then it would work out of the box on Macs, and prevent people like me (with older, 32-bit Mac Minis) from having to compile this by hand every time a new release is out. Alternatively, a script to download dependancies, and build the project from scratch would also do the trick.

I've been playing with this since its release, and really like the idea, but have gotten bored of having to go through the compile process each time, and will likely not bother until there is a way for me to download and install new released *quickly* and *easily* on my Mac Mini. Note, I am not complaining, and I appreciate the work thats been done on this project thus far, I am just saying that my time is very limited, and the current setup is a huge barrier for me personally :)

moyekj
09-02-2008, 01:04 PM
Well, sort of...

Currently, Apple only provides the Java 1.6 runtime as a beta, in a fairly hard to find developer-only area of their website, and only for 64-bit intel Macs.

If the released version were compiled with the "-target 1.5" command line option, then it would work out of the box on Macs, and prevent people like me (with older, 32-bit Mac Minis) from having to compile this by hand every time a new release is out. Alternatively, a script to download dependancies, and build the project from scratch would also do the trick.

I've been playing with this since its release, and really like the idea, but have gotten bored of having to go through the compile process each time, and will likely not bother until there is a way for me to download and install new released *quickly* and *easily* on my Mac Mini. Note, I am not complaining, and I appreciate the work thats been done on this project thus far, I am just saying that my time is very limited, and the current setup is a huge barrier for me personally :) Point taken. There's no real reason that Java 1.6 is needed instead of 1.5 but at the time I started development I had an ancient JDK installed and needed to update and 1.6 was what was available easily at the time. For next update I'll see if I can revert back to JDK 1.5 when compiling and preparing the jar file.

Sevenfeet
09-03-2008, 02:29 PM
Point taken. There's no real reason that Java 1.6 is needed instead of 1.5 but at the time I started development I had an ancient JDK installed and needed to update and 1.6 was what was available easily at the time. For next update I'll see if I can revert back to JDK 1.5 when compiling and preparing the jar file.

Excellent. That means I can run this off of my Leopard Server (PowerPC) where this program belongs.

Sevenfeet
09-03-2008, 04:22 PM
Apple is putting AC3 5.1 in their rental files? Are they using mp4 container for this or something else?

It's an MP4 container of some kind. Handbrake will actually create a file that will do this.

lrhorer
09-03-2008, 04:32 PM
Well, I'm perfectly willing to run down where the failure is in the compile for libx264, but I don't want to take the time if it's not going to gain me anything - specifically if it won't then produce mp4 files smaller than the original mp3 with little or no noticeable loss in PQ. So far everything I have tried under Super has resulted in a much larger output file, not a smaller one. I'm starting t think perhaps ffmpeg isn't capable of the level of compression available to commercial codecs, or at least not when transcoding. I wonder if one of you who have the H.264 conversion working would try to convert the test clip I've put on my website here (http://fletchergeek.com/images/TestClip1.mpg), and see if you can get a file no larger than about 85M or so without objectionable artifacts? I would really appreciate it.

Allanon
09-03-2008, 04:58 PM
Yes. There are some down sides too. This brings up a limitation I am trying to overcome that currently you cannot jump ahead of the buffer. For a true file stream of course you can jump arbitrarily anywhere into the stream regardless of the buffer. For this case, especially since this app is designed to stream a local file there should be a way to get the byte offset into the file associated with the specified time offset and then start the stream from that offset. It's on my to do list to look at but on the surface doesn't sound impossible.
Once/if I can fix the above limitation, then at least if you stop watching and later want to continue then you can jump back to where you were (and I could implement some bookmarking to remember last position of recent files).

Extending the above thought further, one could potentially also skip commercials automatically during playback by pre-processing the file and building a boomark list of the commercial segments which could be referenced during playback to skip over the commercial blocks. So short of editing out commercials yourself before streaming this could be an interesting option.

I haven't put too much thought into this yet but the more you think about this the more possibilities open up.

I've been thinking about this problem and realized you can use VLC much like what wmcbrine did with his HME/VLC video streamer but instead of sending streams your program would just stream video files through VLC. The benefits would be transcoding almost any video file and you can use the VLC JavaScript API (http://wiki.videolan.org/Documentation:Play_HowTo/Advanced_Use_of_VLC#Building_HTML_pages_for_Mozilla.2FFirefo x.2FInternet_Explorere.2FSafari_.28VLC_version_0.8.6_and_abo ve.29), Mozilla plugin (http://wiki.videolan.org/Documentation:Play_HowTo/Advanced_Use_of_VLC#The_Mozilla_plugin), or maybe write your own plugin to control VLC's playback of the file. You can then control the video's position and other attributes by sending commands to VLC instead of having the Tivo do the work. The one draw back might be the buffering that Tivo does, this will make all commands be delayed but if you jump to the end of Tivos buffer then it should be almost real time. You can also adjust the stream so it plays in real time by adjusting the transcoding in VLC.

moyekj
09-03-2008, 08:46 PM
I've been thinking about this problem and realized you can use VLC much like what wmcbrine did with his HME/VLC video streamer but instead of sending streams your program would just stream video files through VLC. The benefits would be transcoding almost any video file and you can use the VLC JavaScript API (http://wiki.videolan.org/Documentation:Play_HowTo/Advanced_Use_of_VLC#Building_HTML_pages_for_Mozilla.2FFirefo x.2FInternet_Explorere.2FSafari_.28VLC_version_0.8.6_and_abo ve.29), Mozilla plugin (http://wiki.videolan.org/Documentation:Play_HowTo/Advanced_Use_of_VLC#The_Mozilla_plugin), or maybe write your own plugin to control VLC's playback of the file. You can then control the video's position and other attributes by sending commands to VLC instead of having the Tivo do the work. The one draw back might be the buffering that Tivo does, this will make all commands be delayed but if you jump to the end of Tivos buffer then it should be almost real time. You can also adjust the stream so it plays in real time by adjusting the transcoding in VLC. One problem with using VLC though (or ffmpeg) to transcode on the fly is for HD streams typically they won't be fast enough for real time transcoding. It's possible perhaps by tweaking things to get a sub-standard transcode that is real time or faster, but then that kind of defeats the purpose. Certainly things like 2-pass encoding are not feasible either. Ideally I don't like any transcoding, but if I do have to transcode I want very high quality.

lrhorer
09-03-2008, 08:59 PM
One problem with using VLC though (or ffmpeg) to transcode on the fly is for HD streams typically they won't be fast enough for real time transcoding.
I wouldn't say it is one problem, I would say it is THE problem.

Ideally I don't like any transcoding, but if I do have to transcode I want very high quality.
Absolutely. Assumng I can get the H.264 transcoding working, I'm expecting it will take the better part of a day or more to transcode a 2 hour movie.

Allanon
09-03-2008, 09:46 PM
One problem with using VLC though (or ffmpeg) to transcode on the fly is for HD streams typically they won't be fast enough for real time transcoding. It's possible perhaps by tweaking things to get a sub-standard transcode that is real time or faster, but then that kind of defeats the purpose. Certainly things like 2-pass encoding are not feasible either. Ideally I don't like any transcoding, but if I do have to transcode I want very high quality.

I understand that, those files can be converted like you normally would and then played through VLC without transcoding to allow for video position changing without waiting for the entire movie to be buffered. But transcoding is useful for videos that you get off the web that are not super high quality and are not in the a format Tivo can use.

PaulS
09-03-2008, 10:37 PM
I understand that, those files can be converted like you normally would and then played through VLC without transcoding to allow for video position changing without waiting for the entire movie to be buffered. But transcoding is useful for videos that you get off the web that are not super high quality and are not in the a format Tivo can use.

It should be possible to transcode low quality videos to MPEG-2 on the fly in better than real-time, no ? There's no need to take the H.264 encoding performance hit if it isn't warranted.

beady
09-03-2008, 10:46 PM
Anyone figure out how to create an mp4 using Pinnacle Studio Plus? I have version 11 and I can create an Mpeg-2 file that plays just fine but cannot make an mp4 work. I did not see a "streamable" option in Pinnacle Studio. I have an SR11 camera and want to be able to take the HD video from the camera and watch it on the Tivo.

Allanon
09-03-2008, 11:36 PM
It should be possible to transcode low quality videos to MPEG-2 on the fly in better than real-time, no ? There's no need to take the H.264 encoding performance hit if it isn't warranted.

Yes, VLC can easily transcode video to low quality MPEG-2 in real time. It can even transcode to normal to high quality MPEG-2 pretty fast.

Also, correct me if I'm wrong but doesn't transcoding to h.264 take a lot more time and CPU than transcoding to MPEG-2 due to more compression? Plus is there a visual reason to use H.264 over MPEG-2? If not then I would suggest transcoding to MPEG-2 because it would take less time to transcode and there should be enough bandwidth to support the transfers of high quality MPEG-2 from your computer to the Tivo in real time.

But again, if you want the best looking HD video do format conversion before sending.

moyekj
09-04-2008, 01:59 AM
I understand that, those files can be converted like you normally would and then played through VLC without transcoding to allow for video position changing without waiting for the entire movie to be buffered. But transcoding is useful for videos that you get off the web that are not super high quality and are not in the a format Tivo can use. There's definitely some merit to using VLC if nothing else as you mentioned useful for web streaming of incompatible formats. I haven't looked into it but I'm not sure if it's possible to fork off VLC from Java and then have full control over playback, trick functions, etc controlled from Tivo/HME side? How would one send messages to VLC to do those things? If that is possible then it certainly opens up interesting opportunities.

Allanon
09-04-2008, 04:30 AM
I haven't looked into it but I'm not sure if it's possible to fork off VLC from Java and then have full control over playback, trick functions, etc controlled from Tivo/HME side? How would one send messages to VLC to do those things? If that is possible then it certainly opens up interesting opportunities.

VLC has a Java API that will allow this, Look at this link:

http://trac.videolan.org/jvlc/

And if you look at this diagram (http://jvlc.ihack.it/images/jvlc-uml-diagram.png), which is outdated, you can see it has all the functions needed to operate VLC. You can also look at the link in my previous post to see how to operate VLC using Javascript. I also noticed they have a Python API for VLC so I might try this using wmcbrine HME/VLC video streamer program. I don't know Java but I did learn some Python.

moyekj
09-04-2008, 05:15 PM
Well, I'm perfectly willing to run down where the failure is in the compile for libx264, but I don't want to take the time if it's not going to gain me anything - specifically if it won't then produce mp4 files smaller than the original mp3 with little or no noticeable loss in PQ. So far everything I have tried under Super has resulted in a much larger output file, not a smaller one. I'm starting t think perhaps ffmpeg isn't capable of the level of compression available to commercial codecs, or at least not when transcoding. I wonder if one of you who have the H.264 conversion working would try to convert the test clip I've put on my website here (http://fletchergeek.com/images/TestClip1.mpg), and see if you can get a file no larger than about 85M or so without objectionable artifacts? I would really appreciate it.
Just tried your test clip. Resulting encoding wasn't too bad (but of course never as good as original) considering it's about half the size:
TestClip1.mpg 121,821,184 bytes
TestClip1.mp4 70,210,768 bytes
Here's the script I used for that encoding (with all relevant settings):

#!/bin/csh -f
set ffmpeg = /home/moyekj/linux/src/ffmpeg/ffmpeg
set input = /tmp/TestClip1.mpg
set output = /tmp/TestClip1.mp4

set bitrate = "7700k"
set bufsize = "14745k"
set maxrate = "16000k"
set achannels = 2
set arate = 48000
set abitrate = "192k"

set level = 31
set framerate = 29.97
set gop_size = 300
set volume = 150

$ffmpeg -y -i $input -vcodec libx264 -coder 0 -level $level \
-r $framerate -sameq -g $gop_size -bufsize $bufsize \
-maxrate $maxrate -b $bitrate -bug +autodetect+ms \
-me epzs -trellis 2 -mbd 1 -vol $volume -acodec libfaac \
-profile aac_low -ac $achannels -ar $arate \
-ab $abitrate -f mp4 $output

lrhorer
09-05-2008, 08:27 PM
Just tried your test clip. Resulting encoding wasn't too bad (but of course never as good as original) considering it's about half the size:
TestClip1.mpg 121,821,184 bytes
TestClip1.mp4 70,210,768 bytes
Thanks. 'Sounds like there's some real possibilities. I'll have to get libx264 working.

moyekj
09-07-2008, 05:04 PM
Update
I've got bookmarking capability (so one can resume where you left off watching) working pretty well for mpeg2 recordings. However, for mpeg4 recordings it looks like Tivo needs to see the start of the recording and the header information or it doesn't work, so for mpeg4 if I try and start playback anywhere other than the start of the file it errors out.

So at this point I'm not sure what to do with mpeg4 and bookmarking. There are probably other tricks to try such as start playing a recording and then skipping to bookmarked point but certainly not elegant or easy. For 1st release of this capability I may just release it with mpeg2 support only for now...

moyekj
09-10-2008, 01:09 PM
v0p7 - September 10, 2008
-------------------------
* Now compatible with Java Runtime Environment 1.5 or later.
* Added bookmarking capability (currently only for mpeg2 files) such that
you can resume from where you left off viewing. There are a few caveats:
- You must use Play button to resume viewing from bookmarked location.
Right arrow or Select will start playback from beginning. This gives
you the choice of starting from where you left off or beginning.
- Only implemented for mpeg2 files currently
- Cannot bookmark close to initial playback - video that is buffered
by Tivo before playback begins cannot be bookmarked. Thus, for example
if buffer is at 30 secs when playback begins bookmarking will not work
until after 30 secs.
- You must exit playback using the Left arrow in order to save/bookmark
your position. If you use the Tivo button or some other means of
exiting playback the position will not be saved.
* When resuming to file browser mode from video playback the directory you
return to is now fully refreshed (in case any changes happened during
playback).

Sevenfeet
09-10-2008, 06:20 PM
Thanks! Let's see if we can get this running on our Macs now...

Working...

Sevenfeet
09-10-2008, 07:10 PM
OK, I'm pleased to report that I've gotten Tivostream v0p7 up and running properly on a Mac. The Mac in this case is an old machine...an 8 year old Powermac G4 hacked to run Leopard Server. It's this server that is the primary server in my house and houses all my video and audio files, among others. Since this is while the video sits, it's an ideal computer to run this program.

Setting up the config file was pretty easy. One thing to remember for Mac users and this program is that since I launched it as a Unix process via the Terminal window, you have to setup the <topdir> variable in something that makes sense for a Unix machine and not necessarily a Mac. So in this case, use Unix-style "/" delimiters instead of ":" delimiters that you would use for most Mac programs. Example:

/Users/sevenfeet/movies/tivostream/

If you have your movie directory on a separate drive like I do, make sure you use "/Volumes" ahead of the name of your hard drive. Example:

/Volumes/myexternaldrive/movies/tivostream/

I just ran the "run_unix.sh" shell script to get it started. I haven't tried to create a double clickable application icon which you can do with the Java VM on the Mac. That will be my next task later this evening.

beady
09-10-2008, 07:56 PM
Moyekj,

Just wanted to say thanks for the program. I've been converting all my VHS-C tapes to digital and now I can just stick the mpeg files on the server and watch them from my Tivo. Tivostream makes it easy to organize them and my family is getting a kick out of watching old tapes.

Sevenfeet
09-10-2008, 08:41 PM
BTW, this is probably an obvious question but is there any reason why you couldn't stream .tivo files that have been transferred with either Tivo Desktop (Windows) or Tivo Transfer (Mac)?

moyekj
09-10-2008, 09:02 PM
BTW, this is probably an obvious question but is there any reason why you couldn't stream .tivo files that have been transferred with either Tivo Desktop (Windows) or Tivo Transfer (Mac)? I don't think I've tried but I think Tivo will reject them as it's expecting unencrypted mpeg2 or mpeg4 files. The .TiVo files have the metadata information up front + encryption that probably messes things up. You can give it a shot by adding .TiVo as a file extension in tivostream config but I doubt it will work.
Personally I don't find .TiVo format too convenient to keep that way. Decoding to a regular mpeg2 program stream is quick enough and allows you to then use the file with any mpeg2 editor/player. With pyTivo metadata you can always keep the metadata information around if you want to send it back to Tivo (via pyTivo or tivostream) and still have the program information.

moyekj
09-10-2008, 09:21 PM
Moyekj,

Just wanted to say thanks for the program. I've been converting all my VHS-C tapes to digital and now I can just stick the mpeg files on the server and watch them from my Tivo. Tivostream makes it easy to organize them and my family is getting a kick out of watching old tapes. Thanks. Yes a big advantage of not having the files on the Tivos themselves is that you can organize them however you want and across multiple file volumes instead of dealing with Tivo's limited organization capabilities.

wmcbrine
09-10-2008, 10:05 PM
Yes, .TiVo files don't stream.

Sevenfeet
09-11-2008, 09:55 AM
I've run into a a problem with tivostream v0p7. I can get it up on my Mac Leopard Server. I can get it to stream a movie just like my PC laptop running WinXP. But I can't get the program to stay running. Eventually, it crashes with the same error.

Exception in thread "JmDNS.SocketListener" java.lang.ArrayIndexOutOfBoundsException: 7 >= 7
at java.util.Vector.elementAt(Vector.java:432)
at javax.jmdns.DNSRecord.suppressedBy(Unknown Source)
at javax.jmdns.DNSOutgoing.addAnswer(Unknown Source)
at javax.jmdns.JmDNS.handleQuery(Unknown Source)
at javax.jmdns.JmDNS$SocketListener.run(Unknown Source)
at java.lang.Thread.run(Thread.java:613)

I'm not sure just what is going on here. I'm not sure why the program is throwing what seems to be a problem with the DNS routines. Sometimes the OutofBoundsException is "6 >= 6", other times it's 7. You don't have to do anything to generate this error...eventually it will come on its own whether you have streamed a movie or not. When this error throws, "Videostream" disappears from the Tivo menus.

Any idea what might be happening here? And for the record, the server in question does function as the DNS server for my network.

Sevenfeet
09-11-2008, 09:58 AM
I don't think I've tried but I think Tivo will reject them as it's expecting unencrypted mpeg2 or mpeg4 files. The .TiVo files have the metadata information up front + encryption that probably messes things up. You can give it a shot by adding .TiVo as a file extension in tivostream config but I doubt it will work.
Personally I don't find .TiVo format too convenient to keep that way. Decoding to a regular mpeg2 program stream is quick enough and allows you to then use the file with any mpeg2 editor/player. With pyTivo metadata you can always keep the metadata information around if you want to send it back to Tivo (via pyTivo or tivostream) and still have the program information.

OK, what's the best way to turn a .tivo file into a regular mp2 file? Sorry if this is a stupid question but a google search isn't as obvious as I would like on this subject.

Rdian06
09-11-2008, 11:53 AM
Tivodecode is the original tool to convert .tivo to an mpeg file.

http://tivodecode.sourceforge.net/

moyekj
09-11-2008, 01:01 PM
I've run into a a problem with tivostream v0p7. I can get it up on my Mac Leopard Server. I can get it to stream a movie just like my PC laptop running WinXP. But I can't get the program to stay running. Eventually, it crashes with the same error.

Exception in thread "JmDNS.SocketListener" java.lang.ArrayIndexOutOfBoundsException: 7 >= 7
at java.util.Vector.elementAt(Vector.java:432)
at javax.jmdns.DNSRecord.suppressedBy(Unknown Source)
at javax.jmdns.DNSOutgoing.addAnswer(Unknown Source)
at javax.jmdns.JmDNS.handleQuery(Unknown Source)
at javax.jmdns.JmDNS$SocketListener.run(Unknown Source)
at java.lang.Thread.run(Thread.java:613)

I'm not sure just what is going on here. I'm not sure why the program is throwing what seems to be a problem with the DNS routines. Sometimes the OutofBoundsException is "6 >= 6", other times it's 7. You don't have to do anything to generate this error...eventually it will come on its own whether you have streamed a movie or not. When this error throws, "Videostream" disappears from the Tivo menus.

Any idea what might be happening here? And for the record, the server in question does function as the DNS server for my network.
Not sure, but maybe with more information logged the problem may become clearer, though you said just sitting there it will eventually crash which seems to imply nothing to do with tivostream itself but more with the HME server side. You can generate a lot more information from console by running HME server in debug mode (-d switch) and from my program by setting DEBUG variable. Easy way to do this is change run_unix.sh script to the following (which will capture all information in debug.log file):
DEBUG=1; export DEBUG
java -cp tivostream_v0p7.jar com.tivo.hme.host.sample.Main -d com.hme.tivo.videostream.videostream >debug.log 2>&1

Sevenfeet
09-11-2008, 03:32 PM
OK, I've added the debug line. A debug.log file hasn't shown up in the same directory. It might be somewhere else...

moyekj
09-11-2008, 04:31 PM
OK, I've added the debug line. A debug.log file hasn't shown up in the same directory. It might be somewhere else... Make sure you copy the code I posted above, including the stdout/stderr re-direct portion (> debug.log 2>&1). Then the directory where you execute this run_unix.sh script is where debug.log will go (assuming the Mac behaves like normal unix).

Sevenfeet
09-11-2008, 08:03 PM
Make sure you copy the code I posted above, including the stdout/stderr re-direct portion (> debug.log 2>&1). Then the directory where you execute this run_unix.sh script is where debug.log will go (assuming the Mac behaves like normal unix).

D'oh! And I call myself a former Unix sysadmin. Shoulda known... :)

windracer
09-13-2008, 11:23 AM
I'm trying to run tivostream through Galleon again (I know, what is it with me and running apps through Galleon, right?) via the launcher.txt file. The app starts, and I can see it on the TiVo menu, but it crashes when I select it and the log shows it can't find config.ini.

I've put the tivostream jar file in Galleon's hme directory (which is in the classpath) and the config.ini is there as well. I've also tried putting it in a few other places. I'm not sure if it's crashing because it can't find the file or due to a conflict with Galleon's jars. It runs just fine standalone.

I'll keep poking at it, just wondering what piece I was missing.

edit: hmm, maybe I'll try that debug thing.

moyekj
09-13-2008, 11:43 AM
windracer, yes with these most recent versions tivostream will crash when config.ini file is not present in startup dir - something I will have to fix in next release. While doing so I will also have tivostream print out the current directory when starting to make it easier to identify.

windracer
09-13-2008, 05:03 PM
Ok, cool. So I just need to figure out what is considered the startup directory when it's running through Galleon. Strange that it wouldn't be the location of the jar file in this case. :confused:

menos
09-13-2008, 07:54 PM
Has anybody had this crash your HD yet? I have a directory with about 25 .mp4 vids. After watching about 15 of them, I got an application error. It said something to the effect of 'out of memory'. The background of the Tivo was then set to the last frame of the last video that was successfully streamed. A few seconds later the Tivo stopped responding to remote commands and I had to pull the power to reset it.

I didn't see anything specifically in the tivostream console regarding this error but here's the console output anyway.


C:\Program Files\tivostream>java -cp tivostream_v0p7.jar com.tivo.hme.host.sampl
e.Main com.hme.tivo.videostream.videostream
null null (null)
LOG: added factory
MDNS: http://192.168.1.75:4263/videostream/
LOG: 192.168.1.50 icon.png HTTP GET - to factory /videostream/
>> Reading config file: config.ini
>>config: topdir=Baby Videos == C:\docs\My Videos\Girls MP4
>>config: topdir=Movies == r:\tivo_movies
>>config: extensions=.mpg .mpeg2 .mp2 .mp4 .mpeg4 .vob
>>config: font=medium
>>config: timeout_status_bar=5
>>config: timeout_info=10
>>config: skip_back=8
>>config: skip_forwards=30
>>config: slow_speed=0.125
>> Reading bookmarks file: bookmarks
LOG: HME receiver connected
LOG: unknown event opcode : 8
LOG: 192.168.1.50 MVI_2007.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_2007.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1849.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1849.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1848.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1848.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1848.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1848.mp4
LOG: 192.168.1.50 MVI_1848.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1848.mp4
LOG: 192.168.1.50 MVI_1848.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1848.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1787.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1787.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1787.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1787.mp4
LOG: 192.168.1.50 MVI_1787.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1787.mp4
LOG: 192.168.1.50 MVI_1682.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1682.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1682.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1682.mp4
LOG: 192.168.1.50 MVI_1682.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1682.mp4
LOG: 192.168.1.50 MVI_1666.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1666.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1665.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1665.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1665.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1665.mp4
LOG: 192.168.1.50 MVI_1665.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1665.mp4
LOG: 192.168.1.50 MVI_1633.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1633.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1630.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1630.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1627.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1627.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1415.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1415.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1415.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1415.mp4
LOG: 192.168.1.50 MVI_1415.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1415.mp4
LOG: 192.168.1.50 MVI_1336.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1336.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1336.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1336.mp4
LOG: 192.168.1.50 MVI_1336.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1336.mp4
LOG: 192.168.1.50 systm--0063--dolby--hd.h264.mp4 HTTP GET - to factory /videost
ream/
url=file:/r:/tivo_movies/systm--0063--dolby--hd.h264.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 I/O Exception handling HTTP GET systm--0063--dolby--hd.h264.m
p4: Connection reset by peer: socket write error
LOG: 192.168.1.50 MVI_1232.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1232.mp4
ERROR code=4 Message: view -1 not found
ERROR code=4 Message: view -1 not found
LOG: 192.168.1.50 MVI_1232.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1232.mp4
LOG: 192.168.1.50 MVI_1232.mp4 HTTP GET - to factory /videostream/
url=file:/C:/docs/My%20Videos/Girls%20MP4/MVI_1232.mp4
LOG: connection to receiver closed
LOG: HME receiver disconnected
LOG: 192.168.1.50 icon.png HTTP GET - to factory /videostream/
>> Reading config file: config.ini
>>config: topdir=Baby Videos == C:\docs\My Videos\Girls MP4
>>config: topdir=Movies == r:\tivo_movies
>>config: extensions=.mpg .mpeg2 .mp2 .mp4 .mpeg4 .vob
>>config: font=medium
>>config: timeout_status_bar=5
>>config: timeout_info=10
>>config: skip_back=8
>>config: skip_forwards=30
>>config: slow_speed=0.125
>> Reading bookmarks file: bookmarks
LOG: HME receiver connected
LOG: unknown event opcode : 8
LOG: connection to receiver closed
LOG: HME receiver disconnected
LOG: 192.168.1.50 icon.png HTTP GET - to factory /videostream/


So far I've been pretty impressed with this, and if all the bugs get ironed out, it may replace my pytivo usage.

wmcbrine
09-14-2008, 12:03 AM
Has anybody had this crash your HD yet?The other day my TiVo spontaneously rebooted -- not while streaming, but when entering WordGrid, of all things. But for a while before that, I'd been using, not tivostream, but my own HME/VLC, and I figured that might be the problem. It motivated me to eliminate all the resource leaks. I haven't had a crash since then, but it hasn't been that long, and the crash was as likely to be due to the video streaming itself as due to leaking resources.

Still, I noticed in the simulator that tivostream is leaking a lot of resources, too.

moyekj
09-14-2008, 03:17 AM
Still, I noticed in the simulator that tivostream is leaking a lot of resources, too. Yes I should look into that sometime soon...

Rdian06
09-14-2008, 12:26 PM
I've been following the thread but it wasn't clear whether anyone ever got h264 video and AC3 5.1 audio in an mp4 container working with tivostream.

Has anyone done it with Handbrake or something similar?

moyekj
09-14-2008, 08:12 PM
I don't think AC3 audio is part of official mpeg4 container spec (at least ffmpeg doesn't allow it). I did try encoding a video using 6-channel AAC and that did play on the Tivo but I just use TV speakers (stereo) for sound so not sure what happens with surround sound systems. Would be an interesting experiment though if someone can find an encoder that does allow AC3 in mpeg4 container to see what happens on a Tivo.

moyekj
09-14-2008, 09:03 PM
I've been following the thread but it wasn't clear whether anyone ever got h264 video and AC3 5.1 audio in an mp4 container working with tivostream.

Has anyone done it with Handbrake or something similar? Well color me shocked. :eek: I did get mpeg4 container with H.264 video & AC3 audio working on a Tivo. Here's what I did:
Handbrake
XBOX 360 profile
Encoder=H.264, Audio Encoder = AC3
Start

(NOTE: You can't check "HTTP Optimized MP4" option since that doesn't work)

The resulting encoding doesn't play as is on Tivo. However, if you run the handbrake encoded file through the qt-faststart executable then it works!

NOTE: I used 2 30 sec clips as sources for this testing (both originated from a Tivo S3):
1. 480i mpeg2 video with 2-channel AC3 audio
2. 720p mepg2 video with 6-channel AC3 audio
In both cases handbrake just used passthrough for AC3 encoding.

I've already done some code cleanup to fix crashing problem with no config.ini file present and to fix the resource leakages that wmcbrine pointed out. That combined with some documentation on H.264 encoding options that work with Tivo will make a good next release.

Dan203
09-15-2008, 02:13 AM
I don't think AC3 audio is part of official mpeg4 container spec

It's not, but the people in charge of the AC3 standard just released a new specification on Aug 22nd which outlines a standardized way to store AC3/EAC3 audio in an MP4 container. Based on what I've read the newest versions of Handbrake and FFMPEG can encode files using the standard, and both the AppleTV and v0.9.2 of VLC can play them. However with an official standard available I suspect a lot more companies will start to support this combination in the near future.

Dan

moyekj
09-16-2008, 04:04 AM
New version just released:

v0p8 - September 16, 2008
-------------------------
* Added documentation sections on supported video types, the use
of qt-faststart and encoding of H.264 with AC3 audio.
* Added qt-faststart.exe and qt-faststart.c to distribution
* Fixed crashing issue if starting tivostream with no config.ini file
* Resource leaking issues cleaned up

Rdian06
09-16-2008, 04:30 PM
Well color me shocked. :eek: I did get mpeg4 container with H.264 video & AC3 audio working on a Tivo. Here's what I did:
Handbrake
XBOX 360 profile
Encoder=H.264, Audio Encoder = AC3


Are you running on Windows? If so can you try using my custom ffmpeg for Windows build to see if it can handle putting AC3 audio into an mp4 container? The build (rdian06-0.95) is based on SVN 15216 with some minor tweaks to fix 5.1 channel mapping issues when transcoding DTS or AAC to AC3. It also is recent enough to have EAC3 (Dolby Digital Plus) and MLP (TrueHD) decoder support (useful for transcoding to AC3.)

The builds are housed on the pyTivo forum here:

http://pytivo.krkeegan.com/rdian06-s-ffmpeg-builds-t468.html

Also, is qt-faststart something that is pipeable? Or does it need to sort the full file?

I'm just trying to envision how we would integrate this into pyTivo if/when Tivo activates h264 for HMO.

Rdian06
09-16-2008, 04:56 PM
Ah, ffmpeg as of SVN 15184 is supposed to have "ac3 muxing support in mov/mp4/m4v". So my Windows build should be able to do it.

If you happen to have an mkv with h264 and AC3 (384kbps or less), you might be able to do:

ffmpeg -i my.mkv -vcodec copy -acodec copy new.mp4

Probably still need to run it through qt-faststart to sort the atoms for streaming.

moyekj
09-16-2008, 05:16 PM
Also, is qt-faststart something that is pipeable? Or does it need to sort the full file?

I'm just trying to envision how we would integrate this into pyTivo if/when Tivo activates h264 for HMO. You can look at the qt-faststart.c code now part of tivostream distribution. It's main function is to scan through the whole stream & look for an moov atom (which can be at the end of the stream) and then re-arrange it's location, so it won't help to pipe it to anything but the entire stream before presenting it to Tivo. i.e. you can't really use it during real time transcoding. However, if you already have a completed encoding and just want to pipe a stream with re-arranged atoms then this could work OK (just need to update the code to allow use of stdout & stdin). However it would probably mean a long delay doing that way (since it scans whole file before writing anything), especially for big streams, so not really practical.

Rdian06
09-16-2008, 06:45 PM
It's main function is to scan through the whole stream & look for an moov atom (which can be at the end of the stream) and then re-arrange it's location, so it won't help to pipe it to anything but the entire stream before presenting it to Tivo. i.e. you can't really use it during real time transcoding. However, if you already have a completed encoding and just want to pipe a stream with re-arranged atoms then this could work OK (just need to update the code to allow use of stdout & stdin).

That's unfortunate. I guess the only other alternative to combine h264 and AC3 would be an EVO or MPEG2 TS.

moyekj
09-16-2008, 07:00 PM
That's unfortunate. I guess the only other alternative to combine h264 and AC3 would be an EVO or MPEG2 TS. Haven't explored it too much but it sure would be nice if Tivo could handle MPEG2 TS container playback via HMO/HME (for both mpeg2 & mpeg4 encodings). Obviously we know it can handle MPEG2 TS with native MPEG2 QAM/ATSC recordings.

gilbreen
09-17-2008, 12:11 AM
I am transitioning from ReplayTVs to TivoHDs (I think I recognize moyekj from the RTV avs forum). Can tivostream work with ReplayTV mpeg files? I would love to be able to still use my DVArchive library that I have accumulated over the years.

Look forward to installing tivostream once I get a Windows box up and running.

Thanks.

moyekj
09-17-2008, 02:45 AM
I am transitioning from ReplayTVs to TivoHDs (I think I recognize moyekj from the RTV avs forum). Can tivostream work with ReplayTV mpeg files? I would love to be able to still use my DVArchive library that I have accumulated over the years.

Look forward to installing tivostream once I get a Windows box up and running.

Thanks. Yup that's me from the RTV forums (the good 'ole days of auto commercial skip). Last time I tried medium quality ReplayTV 55xx files they did play and pause OK on my Tivo S3, however other trick functions (FF/REW/SKIP) didn't work at all if I recall correctly. That was the behavior using TiVo To Come Back, but I would expect streaming to have same behavior.
P.S. You don't need a Windows box to run tivostream - pretty much any computer that is networked and can run Java 1.5 or later will work.

wmcbrine
09-17-2008, 10:00 AM
Last time I tried medium quality ReplayTV 55xx files they did play and pause OK on my Tivo S3, however other trick functions (FF/REW/SKIP) didn't work at all if I recall correctly.I see this on MPEG1 muxed streams -- VCD files, or streams with mux=mpeg1 in VLC. It's the muxing rather than the video encoding that's key, which is why I use mux=ps in HME/VLC even with vcodec=mp1v (and even though mux=mpeg1 is recommended in the VLC manual). I'm guessing the Replay files could be remuxed without reencoding, and would become trick-playable.

Rdian06
09-17-2008, 01:16 PM
Mac users may be able to use Lostify (http://www.versiontracker.com/dyn/moreinfo/macosx/28916) to move the moov atom to the front of their mpeg4 videos. I asked Lostify's developer and here's his reply, Does anyone want to test Lostify on a file with the moov atom in the wrong place? All of my MP4s have the moov atom first already.

Here's the source for Atomic Parsley (http://atomicparsley.sourceforge.net/) (Linux/Mac/Windows). I can't find sufficiently-complete man pages to determine the flags to move the moov atom. I suppose installing AP would install complete man pages.

There is also a qt-faststart.py python implementation. It was submitted to the ffmpeg developers for inclusion in ffmpeg's utils alongside the C code version of qt-faststart.

You can grab it from this mailing list post:

http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-September/052952.html

moyekj
09-17-2008, 01:44 PM
Perhaps I should have mentioned that Lostify and Atomic Parsley (and MetaX (http://www.versiontracker.com/dyn/moreinfo/macosx/32519)) are metataggers, not extensions to ffmeg. There's no encoding going on.

Lostify and MetaX are GUI applications built on top of the CLI Atomic Parsley. Just drag your MP4 to the app, and it will re-embed the metatags (i.e., the moov atom) -- reportedly to the front of the MP4, as tivostream requires. That sounds far easier to me than compiling my own ffmeg with qt-faststart.c.

There are similar Windows programs built on top of Atomic Parsley. Note that qt-faststart.c is a self-contained c program that doesn't need anything from ffmpeg, so you only need to compile qt-faststart.c by itself to generate an executable. It is also not an encoder but simply re-arranges contents of the input mp4 file if it deems necessary. For convenience I included the binary for windows with tivostream and the qt-faststart.c file for others running on different platforms.

Rdian06
09-17-2008, 01:53 PM
And since qt-faststart.py is a python script, it doesn't need to be compiled. It will run anywhere that has python installed. Mac OS X has python preinstalled. Though there isn't a nice GUI, just bring up Terminal and type: python qt-faststart.py <filename>

moyekj
09-17-2008, 02:09 PM
I see this on MPEG1 muxed streams -- VCD files, or streams with mux=mpeg1 in VLC. It's the muxing rather than the video encoding that's key, which is why I use mux=ps in HME/VLC even with vcodec=mp1v (and even though mux=mpeg1 is recommended in the VLC manual). I'm guessing the Replay files could be remuxed without reencoding, and would become trick-playable. I think that's right. At the time I believe I de-muxed and re-muxed with Womble and that fixed the trick play problem but I think it introduced audio/video sync problem. Since I wasn't that bothered about it and don't watch anything recorded from RTVs anymore I left it at that.

moyekj
09-17-2008, 05:52 PM
For those that may need to build qt-faststart there are a couple of defines needed for gcc in order for it to work properly:
gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o qt-faststart qt-faststart.c

(I will add this as a comment in qt-faststart.c file included with tivostream).

windracer
09-17-2008, 09:01 PM
Ok, cool. So I just need to figure out what is considered the startup directory when it's running through Galleon. Strange that it wouldn't be the location of the jar file in this case. :confused:
I'm able to run v0p8 through Galleon now. The config.ini needs to be in Galleon's bin directory (where Galleon is started from) so I just created a symlink to the file located elsewhere.

So the steps are:

- drop tivostream*.jar into galleon/hme/
- put config.ini into galleon/bin (or galleon/hme and then create a symlink on Linux)
- add the following line to galleon/hme/launcher.txt: com.hme.tivo.videostream.videostream
- restart galleon
- tivostream's log will be written into galleon/logs/wrapper.log

YMMV of course.

Sevenfeet
09-18-2008, 09:59 AM
Wow, I take a week off due to my workload and it looks like a lot has moved on the tivostream front. I was still having issues with tivostream having the strange DNS crash on a Mac. I tried it both on my PPC based server and an Intel based desktop with the same result. I'll try v8 today but since the latest versions also work on Java 1.5, I might also try it on my Solaris 10 server which doesn't have Java 1.6 installed yet.

I mean, if a Java app doesn't work on Solaris... ;-)

Sevenfeet
09-18-2008, 07:27 PM
OK, I downloaded v8 and have tried it both on Solaris 10 and on Mac OS X Leopard Server. The good news is that it works on both. And so far I haven't seen the strange DNS error from earlier. The bad news is that I'm seeing a large amount of macroblocking with the picture. At first I thought it was just some of the previous rips that I had done, but it also does it with the Revision3 720p clip we all use as a control. So I'm not sure what's going on.

And I haven't had a chance to do any of the mp4 + 5.1 sound hacking that's been discussed since I'll have to add an extra step of the Python script. I'll work on that later.

moyekj
09-18-2008, 07:46 PM
OK, I downloaded v8 and have tried it both on Solaris 10 and on Mac OS X Leopard Server. The good news is that it works on both. And so far I haven't seen the strange DNS error from earlier. The bad news is that I'm seeing a large amount of macroblocking with the picture. At first I thought it was just some of the previous rips that I had done, but it also does it with the Revision3 720p clip we all use as a control. So I'm not sure what's going on. That is odd. I don't have that problem with any of my clips including the Revision3 one (and I'm using streaming across a wireless network). A few things I might suspect:
1. A network issue of some sort
2. Your server(s) being overloaded (check CPU & I/O resources on your server)
3. A Tivo issue. Perhaps rebooting your Tivo may help.

Sevenfeet
09-19-2008, 09:48 AM
That is odd. I don't have that problem with any of my clips including the Revision3 one (and I'm using streaming across a wireless network). A few things I might suspect:
1. A network issue of some sort
2. Your server(s) being overloaded (check CPU & I/O resources on your server)
3. A Tivo issue. Perhaps rebooting your Tivo may help.

1. Network: My Tivos, the Leopard Server and the Solaris server are all on the household wired gigabit network. I have bandwidth for days.

2. Server overloaded. That is a possibility. Both the Leopard Server and the Solaris box are not modern boxes (8+ years old for both). The Leopard Server specifically does a lot of things on my network and the Solaris server gets all its movie files from the Leopard Server via NFS. Still, it doesn't take much horsepower to through a video file around.

3. A Tivo issue. Also a possibility. Well, for some reason, I'm not having this problem anymore. Go figure.

Well, I did get a chance to try out the Handbrake using the Xbox setting plus AC3 passthru sound. For a test video, I chose another Pixar short "For The Birds" found on the Monster's Inc. bonus DVD. It's less than 4 minutes and which makes it an easy Handbrake rip, and it has AC3 5.1 sound.

The video ripped nicely to a 58 MB file and then I washed it through the qt-faststart.python script on one of my Macs. Then I attempted to play it through either tivostream server I have going (Leopard Server and Solaris server).

The video DID PLAY, so thanks to Moyekj for figuring out which major Handbrake setting would finally work. So that should be it, huh? Rip all my movies this way, wash them through qt-faststart.py and everything should be wonderful, right?

Well, not so fast. There is one major problem. The video and audio aren't synced when played this way. The delay is enormous...about 2-3 second with the audio being behind the video. I tried this on both Tivo S3s which each feed a AC-3 capable receiver. Same result and the same resule with both servers I'm running.

Now I'm not sure just why I'm seeing this. I suppose I could try a faster machine but I have to openly wonder why a faster server would make a difference. I will try my PC laptop later this morning and see if it makes a difference. I'm so close to getting a final solution I can taste it. But I gotta wonder what's happening here.

One last bug report...I am still seeing the DNS issue on both the Leopard Server and the Solaris server, but it happens far less frequently. I'm wondering if the issue might be the DNS server I run on the Leopard Server. I used to have the Solaris machine be the primary DNS box in the house, but I changed that a month ago. This could also be a by-product of Java 1.5 since I haven't run tivostream on a Java 1.6 machine in a while (the Win XP SP2 PC laptop has 1.6).

Rdian06
09-19-2008, 02:22 PM
Well, not so fast. There is one major problem. The video and audio aren't synced when played this way. The delay is enormous...about 2-3 second with the audio being behind the video. I tried this on both Tivo S3s which each feed a AC-3 capable receiver. Same result and the same resule with both servers I'm running.


It's probably the Handbrake profile you're using. The darn thing has so many knobs you can fiddle with. Maybe start with one of the Apple TV profiles and manually override the audio selection to passthrough the AC3. There are Handbrake forums threads dedicated to fine tuning the encodes for different types of devices.

Alternately, you could try demuxing and remuxing the file with ffmpeg (as referenced in my previous posts) and then passing it through qt-faststart again. When remuxing you can introduce a fixed delay between the audio and video to get them back into sync IF you have a constant delay throughout the whole clip (though it does suck to have to do this empirically.)

kas25
09-19-2008, 03:07 PM
I would love to try this but how user friendly is it to get this up and running? Should a novice try to download and install? Thanks.

moyekj
09-19-2008, 05:32 PM
I would love to try this but how user friendly is it to get this up and running? Should a novice try to download and install? Thanks. Really is not much to it:
1. Make sure you have Java Runtime Environment 1.5 or later installed
2. Download and unpack the zip file
3. Edit the config.ini to add paths where to find your video files
4. In windows double click on the run_win.bat file to start the server (for Linux/Mac/Solaris or all other unix flavors you run run_unix.sh from command line)
5. On your Tivo(s) now go find "Video Streamer" under Music, Photos & More and start it and you are off and running.
(The included html documentation has more details on all the above steps)

moyekj
09-20-2008, 08:30 PM
There is one major problem. The video and audio aren't synced when played this way. The delay is enormous...about 2-3 second with the audio being behind the video. I tried this on both Tivo S3s which each feed a AC-3 capable receiver. Same result and the same resule with both servers I'm running.

Now I'm not sure just why I'm seeing this. I suppose I could try a faster machine but I have to openly wonder why a faster server would make a difference. I will try my PC laptop later this morning and see if it makes a difference. I'm so close to getting a final solution I can taste it. But I gotta wonder what's happening here. I've tried several re-encodes from DVD sources so far this weekend and while I didn't have the audio/video sync problems I found the Handbrake encodes (with Xbox 360 profile) resulted in "jumpy" video - not smooth at all from frame to frame. I tried a few other profiles that mostly either did not work or were no better.

Finally I gave up on Handbrake and switched to ffmpeg and the result was a HUGE improvement. I've now settled on a ffmpeg profile where just by varying the bitrate I get good SD and HD H.264+AC3 encodes that play well on Tivos and look almost as good as the original DVD. I have a Perl script that handles the encode and the qt-faststart run all in 1 shot. I post it here mostly for the benefit of others to see the kind of ffmpeg recipe that seems to work pretty well (being in Perl makes this easily portable to different architectures):

# perl tivo_mp4_encode.pl [-h] inputFile.mpg
# NOTE: Audio is not re-encoded (expect AC3)

use Getopt::Std;

$ffmpeg = "c:\\home\\ffmpeg\\ffmpeg.exe";
$qt_faststart = "c:\\home\\ffmpeg\\qt-faststart.exe";

$bitrate = "2000k";
$bufsize = "14745k";
$maxrate = "16000k";
$level = 31;
$framerate = 29.97;
$gop_size = 300;
$extension = ".mp4";

# Command line options: Use -h for hd encodes (increases video bitrate)
getopts('h', \ my %opts );
if ( $opts{h} ) {
# Set higher bitrate for HD encodes
$bitrate = "8000k";
}

# Get input file from command line argument
$input = $ARGV[0];
die "File not found: $input" if ! -f $input;

# Define output file
$output = $input;
$output =~ s/^(.+)\..+$/$1/;
$output = $output . $extension;
$output_tmp = $output . ".tmp";

# ffmpeg run
$command = qq#$ffmpeg -y -i $input -vcodec libx264 -coder 0 -level $level -r $framerate -sameq -g $gop_size -bufsize $bufsize -b $bitrate -maxrate $maxrate -bug "+autodetect+ms" -me epzs -trellis 2 -mbd 1 -acodec copy -f mp4 $output#;
&run($command);

# qt-faststart run
$command = qq#$qt_faststart $output $output_tmp#;
&run($command);

# Replace original encoding with qt-faststart version
print "Renaming $output_tmp to $output\n";
unlink($output);
rename($output_tmp, $output);

sub run {
my $command = shift;
print "$command\n";
my $result = system($command);
if ($result != 0) {
die "*ERROR* command failed: $command\n";
}
}

Tico
09-21-2008, 07:01 PM
What am I missing? I cannot get it to start, I get errors attached below

I am running Vista 64 bit latest Java reinstalled today
Tried latest 2 builds

moyekj
09-21-2008, 07:22 PM
What am I missing? I cannot get it to start, I get errors attached below

I am running Vista 64 bit latest Java reinstalled today
Tried latest 2 builds Looks like you don't have java in your windows path. Either add Java to your path or edit the run_win.bat script to give the full path to java.exe. For example, on my Vista system Java Runtime Environment is installed at:
c:\Program Files (x86)\Java\jre1.6.0_05
Thus the full path to the java.exe binary is:
c:\Program Files (x86)\Java\jre1.6.0_05\bin\java.exe

(On my system c:\Program Files (x86)\Java\jre1.6.0_05\bin is part of my windows path)

Tico
09-21-2008, 07:28 PM
Looks like you don't have java in your windows path. Either add Java to your path or edit the run_win.bat script to give the full path to java.exe. For example, on my Vista system Java Runtime Environment is installed at:
c:\Program Files (x86)\Java\jre1.6.0_05
Thus the full path to the java.exe binary is:
c:\Program Files (x86)\Java\jre1.6.0_05\bin\java.exe

(On my system c:\Program Files (x86)\Java\jre1.6.0_05\bin is part of my windows path)

Thanks for the reply, I edited the run_win,bat with exactly that and that is the TS2.jpg attachment above. Still no go.... Does the path need quotes or anything around it?

And what do you mean by "Either add Java to your path " Is that different than editing the run_win.bat?

moyekj
09-21-2008, 07:38 PM
Thanks for the reply, I edited the run_win,bat with exactly that and that is the TS2.jpg attachment above. Still no go.... Does the path need quotes or anything around it?

And what do you mean by "Either add Java to your path " Is that different than editing the run_win.bat? Yes, if the path has any spaces in it you should surround the whole thing in quotes. So in my example above in the run_win.bat file substitute java for:
"c:\Program Files (x86)\Java\jre1.6.0_05\bin\java.exe"

Alternately Y\you can edit your windows path as follows:
Control Panel->System->Advanced System Settings...
On System Properties select Advanced tab and click on Environment Variables...
In System Variables section find Path click on Edit... and at end of list add another semi-colon followed by full path to Java bin folder.

By adding java to your windows path then you can just leave the run_win.bat script alone as "java" would be found by the batch script.

P.S. If I recall correctly as part of Java installation it asks you if you want to add java to your windows path somewhere in installation process.

Tico
09-21-2008, 07:45 PM
Yes, if the path has any spaces in it you should surround the whole thing in quotes. So in my example above in the run_win.bat file substitute java for:
"c:\Program Files (x86)\Java\jre1.6.0_05\bin\java.exe"

Alternately Y\you can edit your windows path as follows:
Control Panel->System->Advanced System Settings...
On System Properties select Advanced tab and click on Environment Variables...
In System Variables section find Path click on Edit... and at end of list add another semi-colon followed by full path to Java bin folder.

By adding java to your windows path then you can just leave the run_win.bat script alone as "java" would be found by the batch script.

P.S. If I recall correctly as part of Java installation it asks you if you want to add java to your windows path somewhere in installation process.

Bingo, adding the path worked... Thanks....

beady
09-21-2008, 08:32 PM
I used Pinnacal Studio 11 to create a 1 minute MPEG2 video of some HD footage I took with my Sony HDR-SR11. It seems like the server can't stream fast enough to keep up with the video. Could the file be too big or is something else wrong? I'm running Windows Vista. Is there a program I can run to give me information about the file? I'm running Tivo Stream Vp06.

moyekj
09-21-2008, 10:09 PM
I used Pinnacal Studio 11 to create a 1 minute MPEG2 video of some HD footage I took with my Sony HDR-SR11. It seems like the server can't stream fast enough to keep up with the video. Could the file be too big or is something else wrong? I'm running Windows Vista. Is there a program I can run to give me information about the file? I'm running Tivo Stream Vp06. GSpot (http://www.headbands.com/gspot/) is an application to look at program information. You could also install VideoLAN VLC which can display information about the stream it's playing.
What kind of speeds do you get for Tivo To Come Back? (NOTE, you can check speeds you are getting under network diagnostics on your Tivos). The streaming speeds seem to be comparable to that. THD units are a little slower than S3 units for some reason and I think max out around 10 Mbits/sec or so which doesn't cut it for the higher bitrate HD mpeg2 streams which for 1080i high quality streams can go as high as 19 Mbits/sec or so.
Of course the other alternative is to encode to H.264 instead of mpeg2. Being a more efficient encoding you can get about same quality with about half the bitrate of mpeg2.

For my case I've streamed lots of episodes of Lost (720p mpeg2) to my S3s and the stream just about keeps up slightly faster than real time. I get around 11-12 Mbits/sec rate during streaming (wireless connection on laptop side). I can get a little faster than that with a wired connection.

NOTE: It also can help to tune both tuners of the Tivo you are streaming to to channels you don't receive - that takes a lot of load off the Tivo to allow it to devote more resources to the video stream.

SamD
09-22-2008, 11:05 AM
All my files come from single source, my Tivo HD. I download them with T2Sami and convert to mpeg with either T2Sami or Tivo Decoder. SD material plays with no problems. However, two HD shows that I tried (Ratatouille and Earth Biography) freeze after 15-20 seconds, green strip at the bottom of screen comes up (buffer image?), shortens for about two minutes and finally freezes as well. I'm running Windows XP Home and Tivostream Vp08. What could be wrong?

beady
09-22-2008, 11:49 AM
THD units are a little slower than S3 units for some reason and I think max out around 10 Mbits/sec or so which doesn't cut it for the higher bitrate HD mpeg2 streams which for 1080i high quality streams can go as high as 19 Mbits/sec or so.

Of course the other alternative is to encode to H.264 instead of mpeg2. Being a more efficient encoding you can get about same quality with about half the bitrate of mpeg2.


That makes sense. I have an S3 but I encoded the video at a High Quality 1080i format. I'm using Pinnacle Studio 11 and have not had any luck encoding the video using H.264 and then using Tivo Stream.

I'll play around with some of the other formats to see what works.

moyekj
09-22-2008, 01:39 PM
All my files come from single source, my Tivo HD. I download them with T2Sami and convert to mpeg with either T2Sami or Tivo Decoder. SD material plays with no problems. However, two HD shows that I tried (Ratatouille and Earth Biography) freeze after 15-20 seconds, green strip at the bottom of screen comes up (buffer image?), shortens for about two minutes and finally freezes as well. I'm running Windows XP Home and Tivostream Vp08. What could be wrong? If you catch up to the stream buffer while playing (which can easily happen with HD mpeg2 streaming) then tivostream automatically pauses which allows for the stream buffer to build up again. However if you stay paused you should see the buffer continue to build up (and hence the green position indicator continue to shrink). It sounds like after a couple of minutes something happens and the stream is stopping completely.

It would help to see the console messages that are printed when you stream the HD shows.

SamD
09-22-2008, 11:42 PM
Reporting my "research" results. First, when playback freezes no new messages come up in console window. Found that pressing Play key unfreezes streaming. First run of Ratatouille ran uninterrupted about 10 minutes, then I left the room for about half an hour. When I came back Tivo switched to Live TV. Second run demanded Play pressing almost every minute. Still no new console messages. Then playback went smoothly for about fifteen minutes and suddenly freezed (no buffer indicator) due to console message "LOG: 192.168.1.6 I/O Exception handling HTTP GET Ratatouille.mpg: Connection reset by peer: socket write error."
In three minutes connection self restored (!), buffer indicator came up, I pressed Play and playback went on. In five minutes new socket write error and I killed connection.

moyekj
09-23-2008, 12:35 AM
Reporting my "research" results. First, when playback freezes no new messages come up in console window. Found that pressing Play key unfreezes streaming. First run of Ratatouille ran uninterrupted about 10 minutes, then I left the room for about half an hour. When I came back Tivo switched to Live TV. Second run demanded Play pressing almost every minute. Still no new console messages. Then playback went smoothly for about fifteen minutes and suddenly freezed (no buffer indicator) due to console message "LOG: 192.168.1.6 I/O Exception handling HTTP GET Ratatouille.mpg: Connection reset by peer: socket write error."
In three minutes connection self restored (!), buffer indicator came up, I pressed Play and playback went on. In five minutes new socket write error and I killed connection. What kind of network do you have? Wired ethernet, wireless, homeplug, other? As I mentioned if you catch up to the buffer (green bar all the way to the end) then this program intentionally freezes because your network stream is not fast enough to keep up with real time playback and needs to be paused to let buffer build up. However, for cases where you are seeing the I/O Exception errors in the console that means something happened to your network connection and the stream was dropped, or Tivo is rejecting the stream. You should try moving that show to your Tivo using Tivo Desktop (or one of the many programs supporting Tivo To Come Back) to see how that goes.

I've watched several SD shows and HD episodes of Lost via streaming method without any issues. On occasion on the HD feeds I have caught up to buffer and needed to sit at pause a couple of minutes to let buffer build up, but I have not seen the I/O errors you are seeing.

SamD
09-23-2008, 11:25 AM
My network is wired and Tivo is connected via Linksys SD205 switch to Verizon FIOS Actiontec router. This morning I connected Tivo directly to router and the streaming worked about thirty minutes but after this I again got this socket write error.
Looks as I need to upgrade my network to gigabit speed...

By the way, may I again return to subtitles question, because I badly need subtitles in playback (at least for SD material that works for me). T2Sami easily allows to extract subtitles in srt text file. Is it possible to use this file in tivostreamer?

wmcbrine
09-23-2008, 11:50 AM
Looks as I need to upgrade my network to gigabit speed...That won't help -- the TiVo's port is only 100 Mbps, and is underutilized as it is.

moyekj
09-23-2008, 12:52 PM
My network is wired and Tivo is connected via Linksys SD205 switch to Verizon FIOS Actiontec router. This morning I connected Tivo directly to router and the streaming worked about thirty minutes but after this I again got this socket write error.
Looks as I need to upgrade my network to gigabit speed...

By the way, may I again return to subtitles question, because I badly need subtitles in playback (at least for SD material that works for me). T2Sami easily allows to extract subtitles in srt text file. Is it possible to use this file in tivostreamer? As already mentioned above, Gigabit network won't help. THD units for TTG/streaming purposes max out around 10 Mb/sec anyway. You could try wmcbrine's video streamer application (http://www.tivocommunity.com/tivo-vb/showthread.php?t=403174) instead to see if that works any better for you.
As far as captions: Tivo doesn't support reading captions from video streams at the moment, so it would have to be up to the HME application to implement them. Currently I don't believe any HME application that I know of supports captions, including Tivo's own YouTube application. It's been discussed a little in this thread but I haven't looked into it at all yet as I don't foresee it being an easy thing to implement.
One final thought on captions: If Videolan VLC supports captions in any form then it's possible that wmcbrine's application may be an easy way to get captions working for video streaming.

Sevenfeet
09-25-2008, 02:00 PM
Well I'm still working on getting ffmpegX up and working on one of my Macs. I should have all the components installed hopefully by tomorrow.

In the meantime, Apple has just released updates for Java 1.4, 1.5 and 1.6. In the case of 1.4 and 1.5, it has finally been updated to the last stable release from Sun respectively for each version. For 1.6, I believe it is release 07 (also latest release from Sun). This puts Apple in a rare position to having Java completely up to date on the Mac for the first time in who-knows-when.

That being said, the DNS crash i have with tivostream still happens with this release. I haven't had time to swap our DNS servers on my network to see if this problem goes away with my Solaris version (versus the Leopard version of BIND). I'll see if I can do it over the weekend.

moyekj
09-26-2008, 06:51 PM
FYI. With latest release of kmttg (just released) I've now included encoding profiles to generate Tivo streamable mpeg4 files. The encoding profiles handle both the encoding with ffmpeg and the qt-faststart post-processing automatically.

jebbbz
09-26-2008, 11:34 PM
Does anyone if the output from a Hauppauge 1212 HD-PVR component capture box would stream to an HD TiVo? (I don't have one but have read that its hardware encoder generates H.264 in a .TS container but includes software to convert to an .MP4.)

moyekj
09-27-2008, 01:26 AM
Does anyone if the output from a Hauppauge 1212 HD-PVR component capture box would stream to an HD TiVo? (I don't have one but have read that its hardware encoder generates H.264 in a .TS container but includes software to convert to an .MP4.)TS container won't work but MP4 container should, but probably only after running through qt-faststart.

beady
09-27-2008, 10:48 PM
I ran qt_faststart.exe against one of my pinnacle generated mp4 files. I originally created the file to emai so it was pretty small. When I tried to stream it, the Tivo rebooted! Gpot tells me the following about the file:

mp42: MP4 v2
isom MP4 Base Media v1
Recommended Display size 512 x 288
Codec mp4a: MPEG-4 AAC LC
Info 48000Hz 128kb/s tot,sterso (2/0)
kbps 450
Pic/s 29.940 Frame/s 29.940

Any suggestions on what I should change so that the Tivo doesn't crash?

moyekj
09-27-2008, 11:24 PM
I ran qt_faststart.exe against one of my pinnacle generated mp4 files. I originally created the file to emai so it was pretty small. When I tried to stream it, the Tivo rebooted! Gpot tells me the following about the file:

mp42: MP4 v2
isom MP4 Base Media v1
Recommended Display size 512 x 288
Codec mp4a: MPEG-4 AAC LC
Info 48000Hz 128kb/s tot,sterso (2/0)
kbps 450
Pic/s 29.940 Frame/s 29.940

Any suggestions on what I should change so that the Tivo doesn't crash? Tivo currently only seems to accept H.264 (and of course mpeg2) for video. MP4 V2 is not supported. The AAC audio portion should be fine.

halfsheep
09-28-2008, 11:01 AM
Thank you for the app and all the work!

I have an issue with files not playing until the end. They happen to be .mpg files (created as vobs with dvdshrink and renamed to .mpg) I had a movie that DVD shrink split into 5 vobs. I then combined them back into 1 vob about 4 gigs in size. When I played it, only the first 28 minutes of the 1.5 hour file played.

When I played each of the individual 5 mpg files, the first 4 played fine, in their entirety, but the last one stops after 20 seconds (it's only about 4 minutes long in total but won't play past 20 seconds via streamer.)

Both the files that cut off in streamer - play fine in total on my PC. I.e. the files are complete.

Any ideas/suggestions?

moyekj
09-28-2008, 11:17 AM
Thank you for the app and all the work!

I have an issue with files not playing until the end. They happen to be .mpg files (created as vobs with dvdshrink and renamed to .mpg) I had a movie that DVD shrink split into 5 vobs. I then combined them back into 1 vob about 4 gigs in size. When I played it, only the first 28 minutes of the 1.5 hour file played.

When I played each of the individual 5 mpg files, the first 4 played fine, in their entirety, but the last one stops after 20 seconds (it's only about 4 minutes long in total but won't play past 20 seconds via streamer.)

Both the files that cut off in streamer - play fine in total on my PC. I.e. the files are complete.

Any ideas/suggestions? You are not the first to report streams that just stop for no apparent reason in this thread and I actually saw the same thing happen just last night (during playback of 1 of my HD mpeg2 files). Haven't figured out why yet but I don't have a reproducible case to experiment with.
Is the problem with your last 4 min clip reproducible? If so that would be a great clip for me to get hold of for debugging purposes. Please PM or email me (moyekj@yahoo.com) and I can arrange an upload location for your clip so I can get hold of it. (Or if you already can upload to somewhere I can get access to that would be great).

moyekj
09-28-2008, 07:11 PM
Thank you for the app and all the work!

I have an issue with files not playing until the end. They happen to be .mpg files (created as vobs with dvdshrink and renamed to .mpg) I had a movie that DVD shrink split into 5 vobs. I then combined them back into 1 vob about 4 gigs in size. When I played it, only the first 28 minutes of the 1.5 hour file played.

When I played each of the individual 5 mpg files, the first 4 played fine, in their entirety, but the last one stops after 20 seconds (it's only about 4 minutes long in total but won't play past 20 seconds via streamer.)

Both the files that cut off in streamer - play fine in total on my PC. I.e. the files are complete.

Any ideas/suggestions? Update on this. I obtained the clip from halfsheep and was able to reproduce the problem while streaming to my Tivos. However I tried to transfer the clip to my Tivos using pyTivo and it chokes at exactly the same point. So clearly there are some mpeg2 files that Tivo simply can't handle and this problem is not related to tivostream itself.

What's interesting is it's not the decoder itself as with pyTivo I was transferring without viewing and it fails. Similarly while streaming the stream buffer ends at the 20 sec point since that is where it is cut off by the Tivo. So it seems the demuxing phase is what is failing.

moyekj
09-28-2008, 07:32 PM
Update on this. I obtained the clip from halfsheep and was able to reproduce the problem while streaming to my Tivos. However I tried to transfer the clip to my Tivos using pyTivo and it chokes at exactly the same point. So clearly there are some mpeg2 files that Tivo simply can't handle and this problem is not related to tivostream itself.

What's interesting is it's not the decoder itself as with pyTivo I was transferring without viewing and it fails. Similarly while streaming the stream buffer ends at the 20 sec point since that is where it is cut off by the Tivo. So it seems the demuxing phase is what is failing. Another update with a quick solution. I ran the offending clip through VideoRedo Quickstream fix and the problem went away: both via pyTivo and tivostream I played back the stream without issue. So obviously some glitch in the mpeg2 stream that Tivo can't handle that can be fixed with VRD.

rfryar
09-29-2008, 08:51 PM
How did you combine the 5 clips into one? If you did not use a MPG tool to piece them together it will have some invalid data that causes many programs to think it is over.

Video Redo will correct this as previously stated.

Rick

beady
09-30-2008, 10:18 AM
Is it possible to use ffmpeg to convert AVCHD to H.264? As far as I can tell Pinnacle Studio 11 doesn't output to H.264. I found a program called Badaboom that is in beta but it requires an Nvidia G84 or higher chipset to work wiht AVCHD.

bohbot16
10-01-2008, 11:20 AM
the DNS crash i have with tivostream still happens with this release. I haven't had time to swap our DNS servers on my network to see if this problem goes away with my Solaris version (versus the Leopard version of BIND). I'll see if I can do it over the weekend.

It appears to be an issue with the JmDNS used in tivostream. I noticed this in the Galleon changelog:

"Update JmDNS package to 1.0 (not using JmDNS from hme-host-sample-1.4.jar anymore); seems to help on Mac OS X 10.5"

I followed windracer's instructions for launching tivostream through Galleon, and the mDNS issue went away on my OS X 10.5 (Leopard) machine.

cahoon
10-01-2008, 11:45 PM
I just wanted to say that tivostream is one of the coolest apps that I've seen in a while. It was very easy to use. It's great to just stream my mp4 files to my Tivo rather than copy. Great job.

Also, since I'm a Java guy, I like that it's written in Java :)

-- Brendon

Ely105
10-02-2008, 12:22 PM
With tivostream mp4's does the audio have to be AAC or can it be AC3? I thought i read somewhere that the mp4 spec doesn't allow for AC3 but that you could use handbrake to get around.

If AC3 is ok then, does anyone know of a good remuxer for combining x264 and AC3 streams? I used TsMuxer to split out the .264 and AC3 streams from a MKV file but I need a tool (windows) to recombine them in an .mp4 container. I am trying to avoid reencoding the audio and video, although if I have to I can reencode AC3 to AAC, but i think it would save me a bunch of time to not have to reencode the video portion.

On another streaming topic, i'd like to get tivostream, or similar to run on my ReadyNAS NV+ box. pytivo would be ok for just transferring .tivo files and no encoding but if I could stream directly that would be great for the the .mp4 files. But I have read that the little ReadyNas doesn't have the HP to run Java, so i'm wondering if wmcbrines Python based HME project would do that? It seems that it might be doable with python on that platform, but then again i'm only smart enough to be dangerous. :)

moyekj
10-02-2008, 01:37 PM
With tivostream mp4's does the audio have to be AAC or can it be AC3? I thought i read somewhere that the mp4 spec doesn't allow for AC3 but that you could use handbrake to get around.

If AC3 is ok then, does anyone know of a good remuxer for combining x264 and AC3 streams? I used TsMuxer to split out the .264 and AC3 streams from a MKV file but I need a tool (windows) to recombine them in an .mp4 container. I am trying to avoid reencoding the audio and video, although if I have to I can reencode AC3 to AAC, but i think it would save me a bunch of time to not have to reencode the video portion.

On another streaming topic, i'd like to get tivostream, or similar to run on my ReadyNAS NV+ box. pytivo would be ok for just transferring .tivo files and no encoding but if I could stream directly that would be great for the the .mp4 files. But I have read that the little ReadyNas doesn't have the HP to run Java, so i'm wondering if wmcbrines Python based HME project would do that? It seems that it might be doable with python on that platform, but then again i'm only smart enough to be dangerous. :)
As shown in table in tivostream documentation the Tivo accepts both AC3 & AAC for audio along with H.264 in an mpeg4 container.
You may be able to use ffmpeg to change containers while not re-encoding audio or video. Something like:
ffmpeg -i inputFile.mkv -vcodec copy -acodec copy -f mp4 outputFile.mp4
(i.e. copy video and audio stream but output in mp4 container)
NOTE: You will probably also have to run the resulting mp4 file through qt-faststart before you can stream it to Tivo.

Ely105
10-02-2008, 01:54 PM
Thanks Moyekj!

Sorry for maybe a noob question, i've been reading too many posts that the bits fall out as quick as they go in!

I will try ffmpeg to combine the streams tonight and see how that goes.

I tried running your example ffmpeg command line on your tivostream web site (code.google) and i kept getting errors, but there were so many options on that one who knows what was going on...

Ely105
10-02-2008, 09:57 PM
As shown in table in tivostream documentation the Tivo accepts both AC3 & AAC for audio along with H.264 in an mpeg4 container.
You may be able to use ffmpeg to change containers while not re-encoding audio or video. Something like:
ffmpeg -i inputFile.mkv -vcodec copy -acodec copy -f mp4 outputFile.mp4
(i.e. copy video and audio stream but output in mp4 container)
NOTE: You will probably also have to run the resulting mp4 file through qt-faststart before you can stream it to Tivo.

bummer, unfortunately that command doesn't work. It says "codec frame size not set" and then " could not write header for output file "

maybe i can reencode the audio to aac and see if that helps....

cmontyburns
10-02-2008, 11:54 PM
I hope you all will forgive a VERY newbie question, but I am just starting to look at HME stuff for the first time tonight. Do I need to install TiVo Desktop to make this and other HME apps work? I see there is a set of HME classes required and I don't know where to get them.

moyekj
10-03-2008, 12:58 AM
I hope you all will forgive a VERY newbie question, but I am just starting to look at HME stuff for the first time tonight. Do I need to install TiVo Desktop to make this and other HME apps work? I see there is a set of HME classes required and I don't know where to get them. No, everything needed as far as HME classes is in the jar file that is part of the zip package and you don't need anything from Tivo Desktop (I personally don't like or use Tivo Desktop software at all as I find 3rd party apps are much better). As stated in the documentation just run (double click) on run_win.bat script to run (on Windows, for other operating systems you can use run_unix.sh script). You do need to have Java Runtime Environment 1.5 or later installed.

cmontyburns
10-03-2008, 10:15 AM
Thanks, moyekj. I ran the shell script and got a NoClassDefFound (looking for com/tivo/hme/host/sample/Main) so I wondered if I needed something else that provided the HME classes. I suppose I need to set my classpath somewhere. It has been a loooooooong time since I did any programming, but I'll get it worked out.

Ely105
10-03-2008, 08:42 PM
Hi moyekj,

On one of the streams I created using handbrake I am experiencing the stream dropping after around 17 minutes of playback. not in the same place.

here is the output from server screen:

>> Reading metadata file: V:\\Seinfeld - The Calzone.mp4.txt
LOG: 192.168.0.90 Seinfeld - The Calzone.mp4 HTTP GET - to factory /videostream/

url=file:/V:/Seinfeld%20-%20The%20Calzone.mp4
LOG: 192.168.0.90 I/O Exception handling HTTP GET Seinfeld - The Calzone.mp4: Connection reset by peer: socket write error

Any ideas?

Thanks

moyekj
10-03-2008, 09:57 PM
Hi moyekj,

On one of the streams I created using handbrake I am experiencing the stream dropping after around 17 minutes of playback. not in the same place.

here is the output from server screen:

>> Reading metadata file: V:\\Seinfeld - The Calzone.mp4.txt
LOG: 192.168.0.90 Seinfeld - The Calzone.mp4 HTTP GET - to factory /videostream/

url=file:/V:/Seinfeld%20-%20The%20Calzone.mp4
LOG: 192.168.0.90 I/O Exception handling HTTP GET Seinfeld - The Calzone.mp4: Connection reset by peer: socket write error

Any ideas?

Thanks There are glitches in some video files that Tivo just plain rejects and hence the stream halts. A few posts up a user with an mpeg2 file was having the same problem and it turned out it failed in both tivostream and pyTivo, so obviously something the Tivo didn't like. The fix for that problem was to run it through VideoRedo Quickstream fix. For mpeg4 files I don't know of a Quickstream fix like tool however. If the source of that mp4 file is an mpeg2 file then I would suggest running Quickstream fix on it before encoding it to mp4.
Also, personally I found encodings came out better with ffmpeg than with Handbrake, so you may want to try that.
If you like P.M. me and perhaps I can get hold of the offending (and perhaps the source) video file to investigate further.