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

H.264
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> pyTivo
 View previous topic :: View next topic  
Author Message
PaulS



Joined: 04 Jan 2008
Posts: 140

PostPosted: Fri Jul 18, 2008 6:02 pm    Post subject: Reply with quote

Test D without the extraneous -f yields interesting results.

ffmpeg actually starts chugging through frames for a few seconds, then self-terminates.
Try to play back the file, and the TiVo pops up an info screen : "not able to record this program because there was no video signal on the channel".

DEBUG:root:CACHE HIT! F:\Videos\H264\skatedog.mp4
DEBUG:root:transcoding to tivo model 648 using ffmpeg command:
DEBUG:root:C:\pytivo\pyTivo-06-25-2008-wmcbrine-H264\plugins\video\ffmpeg_mp2.exe -i F:\Videos\H264\skatedog.mp4 -an -vcodec copy -comment pyTivo.py -f vob -
FFmpeg version SVN-r11870, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-liba52 --enable-avisynth --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --cpu=i686 --enable-memalign-hack --extra-ldflags=-static
libavutil version: 49.6.0
libavcodec version: 51.50.0
libavformat version: 52.7.0
libavdevice version: 52.0.0
built on Feb 5 2008 23:46:38, gcc: 4.2.3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\Videos\H264\skatedog.mp4':
Duration: 00:01:28.3, start: 0.000000, bitrate: 599 kb/s
Stream #0.0(und): Audio: mpeg4aac, 44100 Hz, stereo
Stream #0.1(und): Video: h264, yuv420p, 480x320 [PAR 0:1 DAR 0:1], 29.97 tb(r)
Output #0, vob, to 'pipe:':
Stream #0.0(und): Video: libx264, yuv420p, 480x320 [PAR 0:1 DAR 0:1], q=2-31, 29.97 tb(c)
Stream mapping:
Stream #0.1 -> #0.0
Press [q] to stop encoding
DEBUG:pyTivo.video.transcode:killing pid=3948me=11.5 bitrate= 678.0kbits/s
Back to top
View user's profile Send private message
PaulS



Joined: 04 Jan 2008
Posts: 140

PostPosted: Fri Jul 18, 2008 6:05 pm    Post subject: Reply with quote

rdian06 wrote:
What really would be nice is if I could get a network capture of the traffic between your Tivo and YouTube while you're viewing a YouTube video.

But it's a lot more difficult to strip your personal info out of a network capture and unless you are familiar with doing one, it might be a real pain to setup. Guess that's a last resort or I can wait until one of my S3s finally gets the update.

We'll see what I can do with testing down path A.


I'm not equipped here at home to do packet captures, which is somewhat ironic since I code routers/switches for a living. Smile

No hubs or mirror/SPAN capable switches here... Sorry!
Back to top
View user's profile Send private message
rdian06



Joined: 12 Apr 2008
Posts: 369

PostPosted: Fri Jul 18, 2008 6:08 pm    Post subject: Reply with quote

PaulS wrote:
Test D without the extraneous -f yields interesting results.

ffmpeg actually starts chugging through frames for a few seconds, then self-terminates.
Try to play back the file, and the TiVo pops up an info screen : "not able to record this program because there was no video signal on the channel".



Hrmm, pyTivo is killing ffmpeg. I wonder why...

BTW, what version of the pyTivo code did you start with? And have you made any code changes in this process? Or just conf file changes?

Just want to make sure I'm starting with the same code you are to exempt mp4 files from transcoding.
Back to top
View user's profile Send private message
PaulS



Joined: 04 Jan 2008
Posts: 140

PostPosted: Fri Jul 18, 2008 6:10 pm    Post subject: Reply with quote

Just pytivo.conf changes. No other code changes. Using 6/25/2008 snapshot of the wmcbrine branch.

I can easily grab his latest snapshot and try again...
Back to top
View user's profile Send private message
rdian06



Joined: 12 Apr 2008
Posts: 369

PostPosted: Fri Jul 18, 2008 6:15 pm    Post subject: Reply with quote

PaulS wrote:
Just pytivo.conf changes. No other code changes. Using 6/25/2008 snapshot of the wmcbrine branch.

I can easily grab his latest snapshot and try again...


Nah, not necessary. I just want to make sure I'm telling you the right lines to change Smile
Back to top
View user's profile Send private message
PaulS



Joined: 04 Jan 2008
Posts: 140

PostPosted: Fri Jul 18, 2008 6:22 pm    Post subject: Reply with quote

Upgraded to wmcbrine's latest snapshot. No change. ffmpeg is still getting whacked.
Back to top
View user's profile Send private message
rectalogic



Joined: 17 Jul 2008
Posts: 8

PostPosted: Fri Jul 18, 2008 7:18 pm    Post subject: Reply with quote

PaulS wrote:
No hubs or mirror/SPAN capable switches here... Sorry!


You should be able to do a capture on the box that is running pyTivo - using Wireshark/Ethereal or tcpdump.
Back to top
View user's profile Send private message
rectalogic



Joined: 17 Jul 2008
Posts: 8

PostPosted: Fri Jul 18, 2008 7:36 pm    Post subject: Reply with quote

PaulS wrote:
Test D without the extraneous -f yields interesting results.

ffmpeg actually starts chugging through frames for a few seconds, then self-terminates.
Try to play back the file, and the TiVo pops up an info screen : "not able to record this program because there was no video signal on the channel".


Without the "-f mp4" ffmpeg is copying AAC audio and H.264 video into a VOB container (MPEG-2 PS). AAC/H.264 can be encapsulated in an MPEG-2 TS (like BlueRay and AVCHD do - e.g. like on the PS3 as mentioned) but ffmpeg only supports MPEG1 layer2 audio and MPEG2 video in a VOB/MPEG2-PS, but since it is copying the video codec (not transcoding) it's not checking that it's invalid so you end up with an unplayable/invalid vob file.

We really need a packet sniff of the Tivo playing an MP4 from Youtube and compare that to a sniff of Tivo attempting to play an MP4 downloaded from Youtube and renamed to *.tivo to prevent transcoding. There is probably some extra HTTP header or handshaking that needs to be sent. I don't think ffmpeg is relevant yet - we need to get MP4 playing on the Tivo then we can worry about how to encode that.
Back to top
View user's profile Send private message
rdian06



Joined: 12 Apr 2008
Posts: 369

PostPosted: Fri Jul 18, 2008 8:51 pm    Post subject: Reply with quote

rectalogic wrote:


Without the "-f mp4" ffmpeg is copying AAC audio and H.264 video into a VOB container (MPEG-2 PS). AAC/H.264 can be encapsulated in an MPEG-2 TS (like BlueRay and AVCHD do - e.g. like on the PS3 as mentioned) but ffmpeg only supports MPEG1 layer2 audio and MPEG2 video in a VOB/MPEG2-PS, but since it is copying the video codec (not transcoding) it's not checking that it's invalid so you end up with an unplayable/invalid vob file.

We really need a packet sniff of the Tivo playing an MP4 from Youtube and compare that to a sniff of Tivo attempting to play an MP4 downloaded from Youtube and renamed to *.tivo to prevent transcoding. There is probably some extra HTTP header or handshaking that needs to be sent. I don't think ffmpeg is relevant yet - we need to get MP4 playing on the Tivo then we can worry about how to encode that.


Right, that attempt with just copying the h264 video into a vob container was a longshot Smile Got the idea from some Google search results that pointed to the PS3's XMB being able to handle these wierd vobs with h264 video and ac3 audio. See here.

I looked at the code for Test A transfer and Test D transfer. The actual transmission part is identical, except that in D there is a try except block to deal with I think the Tivo closing the socket when it realizes the initial bytes of the file are not valid. In Test A there is no try except block so it just bombs out with a stacktrace.

I'm going to modify the transcode code to pass .mp4 files un-transcoded like .tivo files and then sniff my own traffic playing and downloading a YouTube video from Firefox to see what the headers look like. The current pyTivo code seems to declare everything as ContentType x-tivo-mpeg which like you said is probably part of the problem.
Back to top
View user's profile Send private message
rdian06



Joined: 12 Apr 2008
Posts: 369

PostPosted: Fri Jul 18, 2008 11:32 pm    Post subject: Reply with quote

Crap. So the good news is that designating mp4 files to be passed without transcoding was easy.

But after re-reading the code, I realize that the transfer routine doesn't send a ContentType header at all. It only sends the response code and then starts sending bytes from the file.

And when I download an mp4 file from YouTube, the ContentType header is set to text/html on the download.

So the Tivo doesn't like it when pyTivo hands it a valid mp4 binary file and will abort the transfer as PaulS saw when renaming skatedog.mp4 to skatedog.tivo.

Another possibility is that the Tivo is expecting the ContentType based on what's returned in the folder listing, which is currently always x-tivo-mpeg. If that's not it, then the Tivo must just really examine the beginning bytes of the file to determine the type and is rejecting our YouTube downloaded mp4 file. Suck.
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 444

PostPosted: Sat Jul 19, 2008 2:15 am    Post subject: Reply with quote

Sniffing the YouTube playback isn't going to help much -- well, not for this, anyway -- because that's HME, and this is HMO. Assuming this is eventually going to be supported in TiVo Desktop, the necessary details will probably become apparent then. While it would certainly be amusing to have it in pyTivo before it was in TiVo Desktop, we don't even know that it's possible at this point. (It could be enabled for HME, but not HMO.)

Re: ContentType, the TiVo asks for a specific type in its requests, so that's what it expects back. The requests should be based on what it's told are available, but you can verify this by looking at the GET lines. For testing purposes, I just suggested changing all references to "video/x-tivo-mpeg" to "video/mp4", or perhaps "video/x-tivo-mp4". But who knows if that's what it wants?

_________________
My pyTivo fork
Back to top
View user's profile Send private message
PaulS



Joined: 04 Jan 2008
Posts: 140

PostPosted: Sat Jul 19, 2008 4:41 am    Post subject: Reply with quote

rectalogic wrote:
PaulS wrote:
No hubs or mirror/SPAN capable switches here... Sorry!


You should be able to do a capture on the box that is running pyTivo - using Wireshark/Ethereal or tcpdump.


I believe he was looking for a capture of the traffic between my S3 and YouTube, not of the traffic between pyTivo and my S3. Since my network is switched, the traffic wouldn't traverse my pyTivo machine, and therefore is not directly subject to capture. I'll have to "borrow" a hub from work...
Back to top
View user's profile Send private message
PaulS



Joined: 04 Jan 2008
Posts: 140

PostPosted: Sat Jul 19, 2008 4:46 am    Post subject: Reply with quote

wmcbrine wrote:
Re: ContentType, the TiVo asks for a specific type in its requests, so that's what it expects back. The requests should be based on what it's told are available, but you can verify this by looking at the GET lines. For testing purposes, I just suggested changing all references to "video/x-tivo-mpeg" to "video/mp4", or perhaps "video/x-tivo-mp4". But who knows if that's what it wants?


If this is what you and I tested previously, that would be a no-go as well, right ?

We tried changing the MIME types in the pyTivo code to mp4, and the TiVo outright rejected those recordings as incompatible/copy-protected. Red circle with a line through it.
Back to top
View user's profile Send private message
rectalogic



Joined: 17 Jul 2008
Posts: 8

PostPosted: Sat Jul 19, 2008 7:02 am    Post subject: Reply with quote

wmcbrine wrote:
Sniffing the YouTube playback isn't going to help much -- well, not for this, anyway -- because that's HME, and this is HMO.


But whatever the protocol is we could emulate it in pyTivo. It might be different enough that it ends up being a separate codebase. A simple web server that uses HME to serve a list of mp4 videos and can stream them direct to the tivo, or transcode them if they are in the wrong format.

It could also http proxy other internet web sites that have mp4 and other video content (e.g. flv) and stream/transcode them to the tivo.

This to me is actually more interesting than pyTivo/HMO mp4 support.
Back to top
View user's profile Send private message
rdian06



Joined: 12 Apr 2008
Posts: 369

PostPosted: Sat Jul 19, 2008 10:11 am    Post subject: Reply with quote

wmcbrine wrote:

Re: ContentType, the TiVo asks for a specific type in its requests, so that's what it expects back. The requests should be based on what it's told are available, but you can verify this by looking at the GET lines. For testing purposes, I just suggested changing all references to "video/x-tivo-mpeg" to "video/mp4", or perhaps "video/x-tivo-mp4". But who knows if that's what it wants?


Thanks for the confirmation about the types Smile I'm really only a python newbie and trying to wrap my head around some of the language constructs.

Assuming h264 is only enabled for HME, I see over at the Tivo HME SDK page that HME apps aren't allowed to playback video. So I take it that Tivo is hiding part of the HME API from us that allows video playback? Maybe they only allow it with their own signed code?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> pyTivo All times are GMT - 8 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 3 of 6

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

Powered by phpBB © 2001, 2005 phpBB Group
phpBB SEO
[ Time: 0.6360s ][ Queries: 13 (0.4518s) ][ Debug on ]