1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

pyTivo - Transcoding server

Discussion in 'TiVo Home Media Features & TiVoToGo' started by armooo, Nov 25, 2006.

  1. Mar 15, 2007 #141 of 5684
    A@ron

    A@ron New Member

    113
    0
    Jul 18, 2003
    Still no love... changed the conf file to get rid of the trailing slash to the video directory and corrected the <> issue...
    Code:
    [Server]
    port=9032
    #Full path to ffmpeg including filename\
    #For windows: ffmpeg=c:\Program Files\pyTivo\plugins\video\ffmpeg_mp2.exe
    #For linux:   ffmpeg=/usr/bin/ffmpeg
    ffmpeg=/pyTivo/ffmpeg
    
    [TiVoNet]
    type=video
    ##Full path to your files (No trailing slash needed)
    #For windows: path=c:\videos
    #For linux:   path=/media
    path=/Volumes/HD2/TiVoNet
    ffmpeg is not showing it's running at all in the process viewer and no videos show using the port 9032 connection

    IDLE does give me some sort of strange error which may or may not be related:
    Code:
    Warning (from warnings module):
      File "/pyTivo/Cheetah/Compiler.py", line 1508
        "\nYou don't have the C version of NameMapper installed! "
    UserWarning: 
    You don't have the C version of NameMapper installed! I'm disabling Cheetah's useStackFrames option as it is painfully slow with the Python version of NameMapper. You should get a copy of Cheetah with the compiled C version of NameMapper.
    I'll be more than happy to write up a mac section of a tutorial once I get this working BTW.
     
  2. Mar 15, 2007 #142 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    Great!
     
  3. Mar 15, 2007 #143 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    I guess this is a Linux system -- so you don't need drive letters (e.g., "C:") at the front of your paths (??).

    The warning can be ignored (covered in previous posts)

    You won't see ffmpeg running until it actually starts transcoding a video and sending it to your TiVo -- well actually it runs for a few milliseconds for each file it scans for the Now Playing List, but you may not catch that. Can you see TiVoNet on your Now Playing List ?

    You should see python on your process list -- at least that's the way it works on windows. Or maybe IDLE -- I don't run from IDLE.
     
  4. Mar 15, 2007 #144 of 5684
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
  5. Mar 15, 2007 #145 of 5684
    A@ron

    A@ron New Member

    113
    0
    Jul 18, 2003
    It's a Mac running 10.4.9 which is built upon FreeBSD. So it's UNIX not Linux but same kinda thing.

    I get an xml like response now with that link
    Code:
    &#8722;
    	<TiVoContainer>
    <ItemStart>0</ItemStart>
    <ItemCount>0</ItemCount>
    &#8722;
    	<Details>
    <Title>TiVoNet</Title>
    <ContentType>x-container/tivo-videos</ContentType>
    <SourceFormat>x-container/folder</SourceFormat>
    <TotalItems>0</TotalItems>
    </Details>
    </TiVoContainer>
    no files showing though... could it be having an issue since my files are on a different volume than the boot volume?
     
  6. Mar 15, 2007 #146 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    What if you set up an alias on the pyTivo volume and put that in the .conf path? Sorry if that doesn't make sense. Long time since I touched Unix and I wasn't that great even then.
     
  7. Mar 15, 2007 #147 of 5684
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    I would try creating a subfolder in /Volumes/HD2/TiVoNet if do don't have one.

    If the subfolder shows up you have a problem with your ffmpeg.

    If not the have a problem with the path.
     
  8. Mar 15, 2007 #148 of 5684
    A@ron

    A@ron New Member

    113
    0
    Jul 18, 2003
    it shows the folder. Nothing is wrong with my ffmpeg... it's the one I used with Tivo.Net and works fine there. These files a .mp4 (all of them) let me throw an AVI in the mix.

    ::Edit::
    not even the AVI shows. The path to my ffmpeg is correct since I've got one in the pyTivo folder.
     
  9. Mar 15, 2007 #149 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    To see what info ffmpeg is returning about your files do this:

    In transcode.py, in the video_info() function, find the line
    output = ffmpeg.stderr.read()

    Insert after that line:
    print output
    Be sure the indent exactly matches the previous line. Do not use tabs for the indent -- use spaces (unless you see that tabs have been used for all the other indents in the file).

    Run pyTivo and go to the NPL to the pyTivo folder(s). You should see 6-10 lines of ffmpeg text output for every file scanned. This output is the same you would get if you ran ffmpeg -i filename from a command line.

    pyTivo parses this text to determine type(codec) width height fps and duration in milliseconds. If it fails to find any of these, the file is not recognized as a video file. If ffmpeg running on your platform has some variation of format that causes the parsing to fail, that would explain things -- and it probably can easily be fixed!
     
  10. Mar 15, 2007 #150 of 5684
    KRKeegan

    KRKeegan Im lost and confused

    215
    0
    Jul 20, 2004
    Los Angeles, CA
    Hmm, I am wondering if ffmpeg is even starting at all. I have suspicions that subprocess may function slightly different on a Mac??

    Armooo
    Thanks for the wiki. I will be more than happy to toss in a few hours of work into that tonight. I think documentation is what we are currently lacking.
     
  11. Mar 15, 2007 #151 of 5684
    A@ron

    A@ron New Member

    113
    0
    Jul 18, 2003
    well something isn't kosher... I get some fairly strange errors now with 173
     
  12. Mar 15, 2007 #152 of 5684
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    That error is saying that your ffmpeg path is incorrect.
     
  13. Mar 15, 2007 #153 of 5684
    A@ron

    A@ron New Member

    113
    0
    Jul 18, 2003
    woops forgot to copy it in when I upgraded to 173. I've fixed that and it's no longer got those errors. I added those two lines of code to the transcode.py file within that one function and it never prints anything to the terminal. I don't think it's calling ffmpeg properly at all as a previous poster suggested... most likely just a mac thing. ffmpeg never runs as I could see it in the activity viewer and no videos are in the folder (but on a positive note the server shows up on the NPL with no videos). These files are valid video files most I ripped with handbrake as mp4 files and I know ffmpeg can handle them ok since they work with Tivo.Net.

    updated to python 2.5 since it updated the way subprocess worked and it does now call ffmpeg upon starting the script... no videos still though.

    moved that print output around and I can tell that ffmpeg works and it does go through the files but they do not show in the container file...
    what could be going on?
     
  14. Mar 15, 2007 #154 of 5684
    sabu

    sabu New Member

    17
    0
    Jan 29, 2002
    Harrisburg, PA
    Okay tried build 7215 from that link - same problem with the video being offset on the TiVo. Anything else I can try?

    FFmpeg version SVN-r7215, Copyright (c) 2000-2006 Fabrice Bellard, et al.
    configuration: --extra-cflags=-I/static/include --extra-ldflags=-L/static/lib
    --enable-memalign-hack --enable-mp3lame --enable-xvid --enable-a52 --enable-lib
    ogg --enable-vorbis --enable-faac --enable-faad --enable-x264 --enable-pp --enab
    le-amr_wb --enable-amr_nb --enable-avisynth --enable-dts --enable-libgsm --enabl
    e-gpl
    libavutil version: 49.1.0
    libavcodec version: 51.25.0
    libavformat version: 51.6.0
    built on Dec 3 2006 00:27:56, gcc: 3.4.6
    Input #0, avi, from 'c:\TiVo/Torchwood S01E01 Everything Changes.avi':
    Duration: 00:50:45.0, start: 0.000000, bitrate: 962 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 640x368, 25.00 fps(r)
    Stream #0.1: Audio: mp3, 48000 Hz, stereo, 128 kb/s
    Output #0, vob, to 'pipe:':
    Stream #0.0: Video: mpeg2video, yuv420p, 720x480, q=2-31, 4096 kb/s, 29.97 fps
    (c)
    Stream #0.1: Audio: mp2, 44100 Hz, stereo, 192 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Stream #0.1 -> #0.1
     
  15. Mar 15, 2007 #155 of 5684
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    Your ffmpeg output is different that what I have seen from other versions. The current code is expecting the fps to come after "Video:" so it can't find the fps and says it is not a supported type.
     
  16. Mar 15, 2007 #156 of 5684
    A@ron

    A@ron New Member

    113
    0
    Jul 18, 2003
    more recent builds do put the FPS after Video: sort of...
    That build is from 2006 ;)

    will that work? or does it have to directly follow Video:?
     
  17. Mar 15, 2007 #157 of 5684
    ocntscha

    ocntscha New Member

    149
    0
    Oct 22, 2003
    That ffmpeg output looks like mine and pyTivo works for me, so I'd expect that yes, switch in that ffmpeg and you'll be good to go.
     
  18. Mar 16, 2007 #158 of 5684
    KRKeegan

    KRKeegan Im lost and confused

    215
    0
    Jul 20, 2004
    Los Angeles, CA
    hmm, this is very strange, because that is within the range i provide to fit into 16:9 without any mesing with padding or anything like that.

    I think maybe we should try and convert it and view it on a computer first and verify that this is truly a ffmpeg issue. Run this command from the folder where ffmpeg resides:

    ffmpeg -i ''c:\TiVo\Torchwood S01E01 Everything Changes.avi' -vcodec mpeg2video -r 29.97 -b 4096K -aspect 16:9 -s 720x480 -comment pyTivo.py -ac 2 -ab 192 -ar 44100 -f vob -t 60 'c:\TiVo\test.mpg'

    That will transcode 60 seconds into a file named test.mpg. Try and play this file on a pc and tell me what happens. Additionally you should be able to play this file, test.mpg, from the TiVo too. But first I want to see what it looks like on the pc.

    Thanks
    Kevin
     
  19. Mar 16, 2007 #159 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    It doesn't have to directly follow "Video", just come later in the line.

    I suspect the problem is worse than that though if you didn't get anything from the print statement in video_info as follows:

    Code:
        output = ffmpeg.stderr.read()
        print output
    This should print whatever ffmpeg prints regardless of how formatted. If you got nothing it must mean one of these things:
    1. ffmpeg was never called.
    2. ffmpeg was called but its printout wasn't piped into stderr
    3. ffmpeg was called and timed out (4 secs per call)
     
  20. Mar 16, 2007 #160 of 5684
    panacea

    panacea New Member

    2
    0
    Jan 31, 2007
    I downloaded and installed pytivo yesterday (latest version, Windows installer). I think it's fabulous(!), but I did have one issue.

    My TV is 4:3, and my preferences on the Tivo are set to 4:3. I transferred an AVI file with the following specs:
    Bit rate: 1151kbps
    Format: mpeg4
    Size: 512x288
    Frame rate: 25.00fps

    When viewing the file on the Tivo, the image is distorted. Switching the Tivo to 16:9 mode in preferences fixes the image, except that it's a little horizontally squished because the whole 16:9 image is displayed in the 4:3 space.

    This is not a huge deal, but is there any way to tell pytivo to letterbox anything in 16:9? I'm using the version of ffmpeg distributed with the installer.

    Thanks all for a great program!
     

Share This Page