TiVo Community
TiVo Community
TiVo Community
Go Back   TiVo Community > Main TiVo Forums > TiVo Home Media Features & TiVoToGo
TiVo Community
Reply
Forum Jump
 
Thread Tools
Old 01-22-2009, 06:58 PM   #91
Yoav
Registered User
 
Join Date: Jan 2007
Posts: 1,048
Quote:
Originally Posted by kearygriffin View Post
The symlnik is probably the problem, as it looks like it is going into endless recursion trying to clean out the cache directory (which I actually thought was disabled by default, but I could be wrong)

Could you check your streambaby.ini file and see if you see a line:
autogenerate.delete=true

And if so, setting it false should work-around problem.
Oh that's probably my bad.. I set it to true by default assuming that it cleans up garbage... should it be set to false?
__________________
Don't pay for Tivo Desktop / Roxio on the mac:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
and
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Yoav is offline   Reply With Quote
Old 01-22-2009, 07:01 PM   #92
moyekj
Registered User
 
Join Date: Jan 2006
Location: Mission Viejo, CA
Posts: 9,186
Quote:
Originally Posted by windracer View Post
Looks like you don't have java installed ... which is weird because aren't you also running Galleon?
It could be that java is installed but it's just not in his path. For that case you need to find where java.exe is installed and edit the streambaby.bat file to add the full path to java.exe OR fix your windows path to include java.
__________________
Roamio Pro, Elite, Premiere
Cox - Motorola CableCards & TAs
Slingbox 350 via TiVo Mini & TiVo Stream for remote viewing

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
moyekj is offline   Reply With Quote
Old 01-22-2009, 07:24 PM   #93
ajayabb
Registered User
 
ajayabb's Avatar
 
Join Date: Jan 2007
Location: Moorestown NJ
Posts: 429
looks like my java.exe is in the following folder c:\I386. How do I edit this into the .bat file.
__________________
A.J.


2 Roamio Plus Tivos
1 Tivo Mini
Running Pytivo and Streambaby
ajayabb is offline   Reply With Quote
Old 01-22-2009, 07:28 PM   #94
moyekj
Registered User
 
Join Date: Jan 2006
Location: Mission Viejo, CA
Posts: 9,186
Quote:
Originally Posted by ajayabb View Post
looks like my java.exe is in the following folder c:\I386. How do I edit this into the .bat file.
Just edit streambaby.bat file with notepad or some other editor and change java to c:\I386\java.exe
You also may want to check that it's the right version of java.
* Open a "cmd" window and type the following:
cd I386 <enter>
java -version <enter>

If it reports 1.5.x or later then it's fine.
__________________
Roamio Pro, Elite, Premiere
Cox - Motorola CableCards & TAs
Slingbox 350 via TiVo Mini & TiVo Stream for remote viewing

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
moyekj is offline   Reply With Quote
Old 01-22-2009, 07:32 PM   #95
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,243
Quote:
Originally Posted by ajayabb View Post
looks like my java.exe is in the following folder c:\I386.
That's a strange place for it. Usually C:\i386 is where PC manufacturers dump the Windows installation files (i.e., a copy of the CD).

I would recommend downloading a JRE from Sun and installing fresh, unless you're worried about it breaking Galleon. Have you looked at the Galleon startup script to see where it's getting java from?
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis, 758~Premiere XL4 (TA, MoCA)
S/old: 746~S4, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 01-22-2009, 07:50 PM   #96
kearygriffin
Registered User
 
Join Date: Jan 2008
Posts: 346
Quote:
Originally Posted by Yoav View Post
Oh that's probably my bad.. I set it to true by default assuming that it cleans up garbage... should it be set to false?
It does cleanup garbage, but because of they way I implemented the cache, it is difficult to look at the cached file and figure out if the original movie the cached file is for still exists. (The cached file is the movie name + file length + pvw extension, so it's impossible to tell which dir it came from). So instead of looking through the cache and then seeing if the movie exists, I do the opposite, going through all the videos.

I disabled it by default because for people with large collections of videos, it could take a long time (and it looks like recursive symlinks will cause issues also). People can then clean the cache manually by running:
streambaby --cleancache
(which will also break for recursive symlinks at the moment..)

So bottom line is, it's probably best for the moment to leave it disabled, until I come up with a more sane way to handle lots of videos and symlinks.
kearygriffin is offline   Reply With Quote
Old 01-22-2009, 08:12 PM   #97
Yoav
Registered User
 
Join Date: Jan 2007
Posts: 1,048
Quote:
Originally Posted by kearygriffin View Post
So bottom line is, it's probably best for the moment to leave it disabled, until I come up with a more sane way to handle lots of videos and symlinks.
Sounds good (my only worry is that this is gonna be in pyTivoX, so your average user won't know to ever clean their cache...). On the plus side, I put the cache in tmp, so it will get cleaned for them after reboots at least...

Also, on the mac front. I seem to have made some progress.. Looks like the libraries were not built right in terms of dependencies.. I manually made some libs to check and things look good now, so rebuilding everything and will see how that works <crossing fingers>
__________________
Don't pay for Tivo Desktop / Roxio on the mac:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
and
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Yoav is offline   Reply With Quote
Old 01-22-2009, 09:00 PM   #98
Sicklybutsexy
Registered User
 
Join Date: May 2007
Posts: 179
I can't get any mkv to transfer. Doesn't matter what codec, container, etc...AVI's, mpeg, mp4 no problem.
Sicklybutsexy is offline   Reply With Quote
Old 01-22-2009, 09:01 PM   #99
herbman
Registered User
 
Join Date: Apr 2008
Posts: 106
Quote:
Originally Posted by kearygriffin View Post
The symlnik is probably the problem, as it looks like it is going into endless recursion trying to clean out the cache directory (which I actually thought was disabled by default, but I could be wrong)

Could you check your streambaby.ini file and see if you see a line:
autogenerate.delete=true

And if so, setting it false should work-around problem.
It's working now, thanks. I was able to stream one video, but another gave me trouble. This log shows the troubled one first, and then a successful one.

Code:
01/22/09 21:47:07 Listener: added factory
01/22/09 21:47:07 Main: streambaby ready & listening.
01/22/09 21:47:19 Listener: 192.168.0.11 icon.png HTTP GET - to factory /streambaby/
log after close : initContext version=47
01/22/09 21:47:25 Factory: HME receiver connected
StreamBabyStream[#1,uri=null] warning: resource 2057 not found.
StreamBabyStream[#1,uri=null] warning: resource 2057 not found.
java.lang.ArrayIndexOutOfBoundsException: 41099
	at com.unwiredappeal.mediastreams.mp4.StreamableMP4.trak_write_index(StreamableMP4.java:1250)
	at com.unwiredappeal.mediastreams.mp4.StreamableMP4.moov_seek(StreamableMP4.java:2115)
	at com.unwiredappeal.mediastreams.mp4.StreamableMP4.processMP4Headers(StreamableMP4.java:415)
	at com.unwiredappeal.mediastreams.mp4.StreamableMP4.<init>(StreamableMP4.java:94)
	at com.unwiredappeal.mediastreams.MP4StreamingModule.openStreamableVideo(MP4StreamingModule.java:164)
	at com.unwiredappeal.tivo.videomodule.VideoModuleHelper.openStreamableVideo(VideoModuleHelper.java:112)
	at com.unwiredappeal.tivo.videomodule.VideoModuleHelper.openVideo(VideoModuleHelper.java:203)
	at com.unwiredappeal.tivo.streambaby.ViewScreen.finishGoto(ViewScreen.java:338)
	at com.unwiredappeal.tivo.streambaby.ViewScreen.tick(ViewScreen.java:985)
	at com.tivo.hme.sdk.util.Ticker.run(Ticker.java:143)
01/22/09 21:47:53 Listener: 192.168.0.11 642d7195-0bc4-4e32-9cde-13b07d7cdd49.stream HTTP GET - to factory /streambaby/
StreamBabyStream[#1,uri=null] warning: resource 2551 not found.
StreamBabyStream[#1,uri=null] warning: resource 2551 not found.
01/22/09 21:48:12 Listener: 192.168.0.11 I/O Exception handling  HTTP GET 642d7195-0bc4-4e32-9cde-13b07d7cdd49.stream: Broken pipe
01/22/09 21:48:21 Listener: connection to receiver closed
01/22/09 21:48:21 Factory: HME receiver disconnected
01/22/09 21:48:26 Listener: 192.168.0.11 icon.png HTTP GET - to factory /streambaby/
The one that didn't work was mp4, and the one that did was .avi. What can I run to post more info for you?
herbman is offline   Reply With Quote
Old 01-22-2009, 09:25 PM   #100
Sicklybutsexy
Registered User
 
Join Date: May 2007
Posts: 179
This is what I seem to get for any mkv file:

01/22/09 20:51:40 Listener: Unexpected error: java.lang.NumberFormatException: For input string: ""
Sicklybutsexy is offline   Reply With Quote
Old 01-22-2009, 10:34 PM   #101
kearygriffin
Registered User
 
Join Date: Jan 2008
Posts: 346
Quote:
Originally Posted by herbman View Post
It's working now, thanks. I was able to stream one video, but another gave me trouble. This log shows the troubled one first, and then a successful one.
..
StreamBabyStream[#1,uri=null] warning: resource 2057 not found.
java.lang.ArrayIndexOutOfBoundsException: 41099
..
The one that didn't work was mp4, and the one that did was .avi. What can I run to post more info for you?
This is a problem I have seen before with a couple of MP4 files. I actually have one that causes this issue, and plan on trying to decipher what causes it, but it may take some time-- I spent a while on it already and didn't really get anywhere yet. Sorry.

Quote:
Originally Posted by Sicklybutsexy View Post
This is what I seem to get for any mkv file:
01/22/09 20:51:40 Listener: Unexpected error: java.lang.NumberFormatException: For input string: ""
I think I know what this probably is. If I'm right, the next version should take care of it.
kearygriffin is offline   Reply With Quote
Old 01-23-2009, 12:01 AM   #102
Yoav
Registered User
 
Join Date: Jan 2007
Posts: 1,048
Hmm.. Interesting. When I build the code myself, it loads the dynamic libraries fine.

When I use the precompiled distribution you have, it doesn't.

I guess for now I'll just manually build releases as they come.. I'm really not that java-clueful. The good news is it's working now. So uploading a new beta of pyTivoX.

__________________
Don't pay for Tivo Desktop / Roxio on the mac:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
and
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Yoav is offline   Reply With Quote
Old 01-23-2009, 12:58 AM   #103
cahoon
Registered User
 
Join Date: Nov 2007
Posts: 19
Quote:
Originally Posted by herbman View Post
It's working now, thanks. I was able to stream one video, but another gave me trouble. This log shows the troubled one first, and then a successful one.

Code:
01/22/09 21:47:07 Listener: added factory
01/22/09 21:47:07 Main: streambaby ready & listening.
01/22/09 21:47:19 Listener: 192.168.0.11 icon.png HTTP GET - to factory /streambaby/
log after close : initContext version=47
01/22/09 21:47:25 Factory: HME receiver connected
StreamBabyStream[#1,uri=null] warning: resource 2057 not found.
StreamBabyStream[#1,uri=null] warning: resource 2057 not found.
java.lang.ArrayIndexOutOfBoundsException: 41099
	at com.unwiredappeal.mediastreams.mp4.StreamableMP4.trak_write_index(StreamableMP4.java:1250)
	at com.unwiredappeal.mediastreams.mp4.StreamableMP4.moov_seek(StreamableMP4.java:2115)
The one that didn't work was mp4, and the one that did was .avi. What can I run to post more info for you?
I've run into this problem on a couple of mp4 files. Looks like there's an off-by-one error in trak_write_index method. I changed the code at line 1248 to use end - 1 and at line 1252 to end - 2.

Code:
			for (s = start; s != end - 1; ++s) {
				long sample_count = 1;
				long sample_duration = trak.samples_[(int) (s + 1)].pts_
						- trak.samples_[(int) s].pts_;
				while (s != end - 2) {
There is a similar issue in the loop at line 1303 and 1306.
Code:
				for (s = start; s != end - 1; ++s) {
					long sample_count = 1;
					long sample_offset = trak.samples_[(int) s].cto_;
					while (s != end - 2) {
After those changes, it worked for me. I need to think about this a little to be 100% sure that it's the correct fix. I think the problem occurs when the sample count of the last stts or ctts entry is 1.

BTW, this is a fantastic app - great job!
cahoon is offline   Reply With Quote
Old 01-23-2009, 03:12 AM   #104
westside_guy
Annoyingly ephemeral
 
westside_guy's Avatar
 
Join Date: Mar 2005
Location: The soggy part of the Pacific NW
Posts: 454
Video/Audio synch issues

Hey,

I was watching a .m4v file (h.264 mp4 w/ ac3 passthrough - 2500kbps framerate) that I'd ripped from DVD, and noticed that the sound was out of synch with the characters lip movements to varying degrees. I didn't think this had happened with tivostream, so I stopped streambaby, ran qt-faststart on the m4v file and then watched it via tivostream - no synch issues. Then, since this technically wasn't the same file as I'd first watched (cuz of qt-faststart), I went back to streambaby and watched it - again, there were synch issues for a good bit of the show.

I watched a second video with streambaby, and again noticed synch issues - sometimes things were in synch, but most of the time they were off by at least a small amount (and in places it was quite bad).

Any ideas?

Last edited by westside_guy : 01-23-2009 at 03:20 AM.
westside_guy is offline   Reply With Quote
Old 01-23-2009, 10:06 AM   #105
kearygriffin
Registered User
 
Join Date: Jan 2008
Posts: 346
Quote:
Originally Posted by cahoon View Post
I've run into this problem on a couple of mp4 files. Looks like there's an off-by-one error in trak_write_index method. I changed the code at line 1248 to use end - 1 and at line 1252 to end - 2.
Thanks Cahoon! I made the changes and tried some of my problematic MP4's and they seem to work great. I'll do some more testing, but I expect that I won't find any issues and will include this in the next release.

It's really nice to go to sleep worrying about trying to debug an issue, and wake up to find it solved!
kearygriffin is offline   Reply With Quote
Old 01-23-2009, 10:13 AM   #106
kearygriffin
Registered User
 
Join Date: Jan 2008
Posts: 346
Quote:
Originally Posted by Yoav View Post
Hmm.. Interesting. When I build the code myself, it loads the dynamic libraries fine.
That really is strange (I think...) I really can't imagine why building a java app one the mac (or your machine in particular) as opposed to a linux build of a java app would make any difference for something like this. Are you still using the standard ant build.xml to build streambaby, or are you compiling it through some other environment and putting it together yourself?

One question-- In some of your earlier posts you were printing stack traces & debug information that it looks like you put into the code yourself, and you were still having an issue. I am assuming those builds were builds you made on your machine. Is there any difference between those test builds that didn't work and the new builds that seem to work?
kearygriffin is offline   Reply With Quote
Old 01-23-2009, 10:19 AM   #107
cahoon
Registered User
 
Join Date: Nov 2007
Posts: 19
Quote:
Originally Posted by westside_guy View Post
Hey,

I was watching a .m4v file (h.264 mp4 w/ ac3 passthrough - 2500kbps framerate) that I'd ripped from DVD, and noticed that the sound was out of synch with the characters lip movements to varying degrees. I didn't think this had happened with tivostream, so I stopped streambaby, ran qt-faststart on the m4v file and then watched it via tivostream - no synch issues. Then, since this technically wasn't the same file as I'd first watched (cuz of qt-faststart), I went back to streambaby and watched it - again, there were synch issues for a good bit of the show.

I watched a second video with streambaby, and again noticed synch issues - sometimes things were in synch, but most of the time they were off by at least a small amount (and in places it was quite bad).

Any ideas?
Hmm, I'm wondering if adding mp4module.interleave=false to the config file will help.

I think that streambaby performs some processing on the mp4 file even when playing from the start. As part of the processing, streambaby re-interleaves the movie data. So, the file sent to Tivo from streambaby could be different than the file sent from tivostream. I'm guessing that after disabling the interleaving, the file sent by streambaby is the same as the original (and the same as the one sent by tivostream) when starting the movie from the beginning.
cahoon is offline   Reply With Quote
Old 01-23-2009, 10:22 AM   #108
kearygriffin
Registered User
 
Join Date: Jan 2008
Posts: 346
Quote:
Originally Posted by westside_guy View Post
I watched a second video with streambaby, and again noticed synch issues - sometimes things were in synch, but most of the time they were off by at least a small amount (and in places it was quite bad).

Any ideas?
Were the sync issues there both when watching from the beginning of the video and when you jump/start from a position somewhere inside the video?

I don't have any ideas off the top of my head, but it could be the pseudo-streaming MP4 code (the movies get run through it even when starting from the beginning)

One thing that may be useful to try is to process the MP4 through the pseudo-streaming code and then try it in tivostream. This should tell us whether or not the pseudo-streaming code is responsible for the synch issues. You can run a movie through the pseudo-streaming code with the following command:
streambaby --test mp4copy src.mp4 dst.mp4 startposition

Where src.mp4 is the original mp4, dst.mp4 will be the video after it has been processed through the pseudo-streaming code, and startposition is a time in milliseconds to start the copy from. (so seconds*1000. 3000000 would be 50 minutes into the video for example)

If you then try to stream dst.mp4 through tivostream I'd be interested in the results.

EDIT: Just saw cahoon's message about the reinterleaving and thats definitely a possibility. Also note the mp4copy command from above always uses reinterleaving (so acts like mp4module.interleave=true, regardless of what it is set to) and doesn't adhere to the streambaby.ini interleave setting.

And just to give an explanation for why the reinterleaving is there, for some reason a lot of my MP4's were interleaved OK in the beginning of the file, but would drift as you got further into the movie. So after positioning to say 50 minutes into the movie, the first video sample might be right at the beginning of the file, but the first audio sample might be 45 megabytes after that. Tivo really didn't like this. (It was OK if you started from the beginning, I am assuming because it would have enough buffered to handle the 45 megabyte difference)

Last edited by kearygriffin : 01-23-2009 at 10:32 AM.
kearygriffin is offline   Reply With Quote
Old 01-23-2009, 10:49 AM   #109
Yoav
Registered User
 
Join Date: Jan 2007
Posts: 1,048
Quote:
Originally Posted by kearygriffin View Post
That really is strange (I think...) I really can't imagine why building a java app one the mac (or your machine in particular) as opposed to a linux build of a java app would make any difference for something like this. Are you still using the standard ant build.xml to build streambaby, or are you compiling it through some other environment and putting it together yourself?

One question-- In some of your earlier posts you were printing stack traces & debug information that it looks like you put into the code yourself, and you were still having an issue. I am assuming those builds were builds you made on your machine. Is there any difference between those test builds that didn't work and the new builds that seem to work?
I build using ant, I did have to make one 'tiny' change to the custom-build.xml file that you had in ffmpeg-java (add
Code:
                               <pathelement location="build/classes"/>
                                <pathelement location="lib/jna.jar"/>
                                <pathelement location="../lib/bcel-5.2.jar"/>
to the classpath javac target (otherwise it wouldn't find a bunch of the classes it needed to build). No other changes from your source code.

Yes earlier I did make changes to the source code to print a bunch of debugging info (that was to the .17 code), which helped me track down a problem with the actual shared libraries I was using. But then I downloaded the clean source tree, rebuilt it, and watched it work. Yes I also found it strange.. but just in case I did something wrong, here's what I did:

1) download the .zip file you have. Open it up, edit streambaby.ini and simplelog.properties. Run streambaby -- wouldn't load the shared libs.
2) build it from the source (using ant in the toplevel). Copy the zip file that is generated in dist/, open it up, do the same edits to streambaby.ini and simplelog.properties. Run streambaby -- loaded the shared libs...

So yeah, seems odd to me too. for what it's worth, when I use dtrace to track what files it is trying to open, your version isn't even trying ANY file with libavutil in the name. it's almost like it's ignoring the preferences in streambaby.ini .. I dunno.. but I have a workaround, so for now don't worry about this behavior/bug...

Thanks for the program btw!
__________________
Don't pay for Tivo Desktop / Roxio on the mac:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
and
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Yoav is offline   Reply With Quote
Old 01-23-2009, 11:23 AM   #110
kearygriffin
Registered User
 
Join Date: Jan 2008
Posts: 346
Quote:
Originally Posted by Yoav View Post
So yeah, seems odd to me too. for what it's worth, when I use dtrace to track what files it is trying to open, your version isn't even trying ANY file with libavutil in the name. it's almost like it's ignoring the preferences in streambaby.ini .. I dunno.. but I have a workaround, so for now don't worry about this behavior/bug...

Thanks for the program btw!
No problem, and thanks for the all of the Mac work. It's really nice to have someone making builds available for Mac users-- I've actually tried to get the last open source darwin dist that Apple released going over the last couple of days so I could try to help out, but wasn't able to get it running under Virtualbox or qemu so eventually gave up.

As far as the builds go, it's possible I had some kind of problem in my build process. When you mentioned you had an issue with ffmpeg-java it occured to me that at some point in the last couple of days I had the same issue about the javac classpath, and it seemed a little strange to me since it started occuring all of a sudden for me without changing custom-build.xml. It's possible I had some kind of issue in my build process at some point, so if you don't mind trying one more time with my build next go-around (next version), that would be great. (Then I'll try to stop worrying about it... I can be a bit obsessive when it comes to unexplainable behavior, always afraid that even if it seems inconsequential it's masking some larger earth shattering problem ;-)
kearygriffin is offline   Reply With Quote
Old 01-23-2009, 11:50 AM   #111
Yoav
Registered User
 
Join Date: Jan 2007
Posts: 1,048
Quote:
Originally Posted by kearygriffin View Post
As far as the builds go, it's possible I had some kind of problem in my build process. When you mentioned you had an issue with ffmpeg-java it occured to me that at some point in the last couple of days I had the same issue about the javac classpath, and it seemed a little strange to me since it started occuring all of a sudden for me without changing custom-build.xml. It's possible I had some kind of issue in my build process at some point, so if you don't mind trying one more time with my build next go-around (next version), that would be great. (Then I'll try to stop worrying about it... I can be a bit obsessive when it comes to unexplainable behavior, always afraid that even if it seems inconsequential it's masking some larger earth shattering problem ;-)
Sure.. glad to help... Just post when it's ready (or put up your code in svn or something ...)
__________________
Don't pay for Tivo Desktop / Roxio on the mac:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
and
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Yoav is offline   Reply With Quote
Old 01-23-2009, 01:11 PM   #112
westside_guy
Annoyingly ephemeral
 
westside_guy's Avatar
 
Join Date: Mar 2005
Location: The soggy part of the Pacific NW
Posts: 454
Quote:
Originally Posted by kearygriffin View Post
Were the sync issues there both when watching from the beginning of the video and when you jump/start from a position somewhere inside the video?
I haven't done any jumping around, just watched from the start to the end - these were ~ 30 minute TV shows I'd ripped from one of my DVDs. I'll try out what you've said + cahoon's idea as soon as I get a chance.
westside_guy is offline   Reply With Quote
Old 01-23-2009, 05:30 PM   #113
cahoon
Registered User
 
Join Date: Nov 2007
Posts: 19
Quote:
Originally Posted by kearygriffin View Post
Thanks Cahoon! I made the changes and tried some of my problematic MP4's and they seem to work great. I'll do some more testing, but I expect that I won't find any issues and will include this in the next release.

It's really nice to go to sleep worrying about trying to debug an issue, and wake up to find it solved!
Well, unfortunately, the change isn't correct . It is going to take a little more effort to fix properly. I'll take another crack at it tonight.

There are two issues, I think. (1) dealing with the end condition, and (2) incrementing the sample count, which is incremented too often as is.

The problem is with the stts atom only. The old code for the ctts atom is correct.
cahoon is offline   Reply With Quote
Old 01-23-2009, 05:33 PM   #114
cahoon
Registered User
 
Join Date: Nov 2007
Posts: 19
Quote:
Originally Posted by kearygriffin View Post
And just to give an explanation for why the reinterleaving is there, for some reason a lot of my MP4's were interleaved OK in the beginning of the file, but would drift as you got further into the movie. So after positioning to say 50 minutes into the movie, the first video sample might be right at the beginning of the file, but the first audio sample might be 45 megabytes after that. Tivo really didn't like this. (It was OK if you started from the beginning, I am assuming because it would have enough buffered to handle the 45 megabyte difference)
Interesting - I was wondering why the reinterleaving was performed. Thanks for the explanation.
cahoon is offline   Reply With Quote
Old 01-23-2009, 06:28 PM   #115
westside_guy
Annoyingly ephemeral
 
westside_guy's Avatar
 
Join Date: Mar 2005
Location: The soggy part of the Pacific NW
Posts: 454
Quote:
Originally Posted by kearygriffin View Post
One thing that may be useful to try is to process the MP4 through the pseudo-streaming code and then try it in tivostream. This should tell us whether or not the pseudo-streaming code is responsible for the synch issues. You can run a movie through the pseudo-streaming code with the following command:
streambaby --test mp4copy src.mp4 dst.mp4 startposition

Where src.mp4 is the original mp4, dst.mp4 will be the video after it has been processed through the pseudo-streaming code, and startposition is a time in milliseconds to start the copy from. (so seconds*1000. 3000000 would be 50 minutes into the video for example)

If you then try to stream dst.mp4 through tivostream I'd be interested in the results.
Okay, when I did this and played the resulting file through tivostream, I got both green blocks during the first 10 seconds of video AND saw audio/video synch problems as the show progressed. Neither one is usually an issue with tivostream.

Quote:
Originally Posted by cahoon View Post
Hmm, I'm wondering if adding mp4module.interleave=false to the config file will help.
Funny thing - this didn't solve the audio/video sync problem; but it did solve the "green blocky video during the first 10 seconds of the show" issue I've been having with streambaby.
westside_guy is offline   Reply With Quote
Old 01-23-2009, 09:10 PM   #116
kearygriffin
Registered User
 
Join Date: Jan 2008
Posts: 346
Quote:
Originally Posted by cahoon View Post
Well, unfortunately, the change isn't correct . It is going to take a little more effort to fix properly. I'll take another crack at it tonight.

There are two issues, I think. (1) dealing with the end condition, and (2) incrementing the sample count, which is incremented too often as is.

The problem is with the stts atom only. The old code for the ctts atom is correct.
Thanks cahoon-- I think I found a relatively straight forward way to solve this (instead of calculating the sample_duration in the stts loop, I store the sample_duration in the samples_ array itself and use the stored value in the loop. I added code in trak_build_index to store the duration in the same loop that was calculating the pts_). However it looks to me like the sample count was getting calculated correctly, it was just the end case that was problematic.

Before I release a new version, I was wondering what your thought process was on why the sample count might be getting calculated incorrectly.

EDIT: I uploaded my latest src code bundle with the changes above to the streambaby web site, streambaby-0.19-src.zip. It should be available on the download tab, I did not move it to the front page yet (and also didn't upload a non-src build of it). I need to get SVN going at some point...

Last edited by kearygriffin : 01-23-2009 at 09:16 PM.
kearygriffin is offline   Reply With Quote
Old 01-23-2009, 10:36 PM   #117
cahoon
Registered User
 
Join Date: Nov 2007
Posts: 19
Quote:
Originally Posted by kearygriffin View Post
Thanks cahoon-- I think I found a relatively straight forward way to solve this (instead of calculating the sample_duration in the stts loop, I store the sample_duration in the samples_ array itself and use the stored value in the loop. I added code in trak_build_index to store the duration in the same loop that was calculating the pts_). However it looks to me like the sample count was getting calculated correctly, it was just the end case that was problematic.
Great! I think that's the best way the fix this problem. Without adding that duration, it's a pain to fix the end case.

Quote:
Originally Posted by kearygriffin View Post
Before I release a new version, I was wondering what your thought process was on why the sample count might be getting calculated incorrectly.
It is really the 's' variable that gets incremented too often, so the new stts atom may contain fewer entries than it should. Sorry for the confusion.

The way the code was structured, every time an stts entry is written the 's' variable is incremented due to the outer loop. But, it's also incremented in the inner while loop (which is where the variable should be incremented). For example, when s=1 and control enters the inner while loop, the 'if' condition is always true the first time the while loop executes. That causes 's' to be incremented (s=2). On the next iteration of the while loop, let's say the break is executed. Then, the entry is written, and 's' is incremented again (s=3) for the outer for-loop. So, a sample is skipped potentially.

If there is only 1 entry in the stts, then it's not a problem.

EDIT: kearygriffin - your new code doesn't have the same problem because you use 's + 1' in the inner while loop as your if condition. In this case, the while loop may break immediately, so 's' won't be incremented.

Last edited by cahoon : 01-23-2009 at 10:51 PM.
cahoon is offline   Reply With Quote
Old 01-23-2009, 10:48 PM   #118
kearygriffin
Registered User
 
Join Date: Jan 2008
Posts: 346
Quote:
Originally Posted by cahoon View Post
It is really the 's' variable that gets incremented too often, so the new stts atom may contain fewer entries than it should. Sorry for the confusion.
...
So, a sample is skipped potentially.
...
I'm actually pretty sure that is OK. The inner loop is actually trying to reduce the number of entries in the table. All consecutive stts entries that have the same duration are "condensed" into a single entry in the table.

Really only one way to find out (well, not really, but..). I'm going push out V0.19 and see what happens.
kearygriffin is offline   Reply With Quote
Old 01-23-2009, 11:02 PM   #119
kearygriffin
Registered User
 
Join Date: Jan 2008
Posts: 346
Streambaby V0.19

Just uploaded new streambaby V0.19

===V0.19===
* Added MKV to default list of extensions to scan
* Catch NumberFormatExceptions and return default values while trying to parse ffmpeg output
* cahoon/KG: Fix off-by-one issue (causing ArrayIndexOutOfbounds) in MP4 psuedo-streaming
* Changed preview cache cleanup code to work faster/use less memory & deal with recursive symlinks
* Added additional debugging for loading of native ffmpeg libraries
* Fixed bug where saved bookmark position ended up negative (caused Play/Replay screen to not have correct text positioning)
* TiVo doesn't seem to report correct duration for MP4's (always seems to report ~8secs less).
- Added code to work-around by using my own calculated duration if I receive RSRC_EVENT_COMPLETE from tivo and its duration is shorter than expected
- Still some weirdness around end of MP4s-- Shuttle bar will stop moving around 8 seconds before end...
* Fixed centering of shuttlebar -- Also made it wider while I was at it.

I think that should solve most of the problems reported so far-- The only exceptions being:
-- Audio sync issues w/MP4 videos
-- Possibly issues with green/random blocks at the beginning of MP4 videos

My guess is I am going to have to get my hands on one of the MP4's that exhibit these issues. I haven't seen any of these problems with the MP4's that I have.

Last edited by kearygriffin : 01-23-2009 at 11:35 PM.
kearygriffin is offline   Reply With Quote
Old 01-23-2009, 11:05 PM   #120
cahoon
Registered User
 
Join Date: Nov 2007
Posts: 19
Quote:
Originally Posted by kearygriffin View Post
I'm actually pretty sure that is OK. The inner loop is actually trying to reduce the number of entries in the table. All consecutive stts entries that have the same duration are "condensed" into a single entry in the table.
I added an EDIT to my previous post while you posted this message. I just wanted to clarify.

I think your new code is correct, and increments the 's' variable correctly. In fact, it worked on a couple examples for me.

The inner loop is trying to condense the stts entries. The problem with the old code is that inner loop would always be executed at least once - the 'if' would be true on the first iteration, and then 's' and 'sample_count' would be incremented. In your new code, the 'if' in the inner loop correctly checks the next entry and can 'break', so that 's' and 'sample_count' would not be incremented. This is in the case where the sample_count for the entry is 1.
cahoon is offline   Reply With Quote
Reply
Forum Jump




Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Advertisements

TiVo Community
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
vBulletin Skins by: Relivo Media

(C) 2013 Magenium Solutions - All Rights Reserved. No information may be posted elsewhere without written permission.
TiVoŽ is a registered trademark of TiVo Inc. This site is not owned or operated by TiVo Inc.
All times are GMT -5. The time now is 02:53 AM.
OUR NETWORK: MyOpenRouter | TechLore | SansaCommunity | RoboCommunity | MediaSmart Home | Explore3DTV | Dijit Community | DVR Playground |