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. Oct 26, 2007 #801 of 5893
    ScottE

    ScottE New Member

    22
    0
    Oct 15, 2001
    San Diego,...
    Yeah, I saw that, but since it went through TivoDesktop, I'm not confident that it wasn't transcoded to something else. :) (I've never used the Windows software, so don't know if it has a "force pass-through" type function or not for video that's already MPEG2)
     
  2. Oct 26, 2007 #802 of 5893
    mitch2k2

    mitch2k2 New Member

    110
    0
    Aug 2, 2006
    Well, I seem to have found the error on my end, mostly. Since I didn't put the pytivo folder in the Program Files folder (windows installation, obviously), I needed to, but had not, changed the line in the pytivo.conf that points to ffmpeg2.

    But now that I can navigate into the folders and find what's there, I still see each of them listed as empty (0) in the initial menu. wonder why that is.
     
  3. Oct 26, 2007 #803 of 5893
    mr2828

    mr2828 New Member

    43
    0
    Jun 18, 2007
    Have you tried using ffmpeg directly, with the same arguments pyTivo uses, to convert a file, and then playback the mpeg-2 output on your PC to see if it also has the macroblocking errors in it?

    I think the first step in debugging this bitrate problem is to first verify that the output seems to be good, and that it really is the S3 playback causing the problem.
     
  4. Oct 26, 2007 #804 of 5893
    ScottE

    ScottE New Member

    22
    0
    Oct 15, 2001
    San Diego,...
    Well, it seems like it's a Tivo decoding issue, at least on the surface. Running:

    ffmpeg -threads 2 -i Heroes.avi -vcodec mpeg2video -r 29.97 -b 10Mi -comment 'Test' -acodec ac3 -ab 448k -ar 48000 -f vob -b_strategy 1 -bf 2 -coder vlc -mbd rd -qmin 1 -aspect 16:9 -s 1440x720 Heroes.mpg

    (which is what pyTivo transcode.py does in my particular config) results in a file that plays back fine using VLC. When transferred to the Tivo, it shows significant macroblock errors.

    The "right" thing to do is to analyze the mpeg bitstream directly, but I'm too lazy. :) If I get ambitious, I might replace the ffmpeg calls with calls to mencoder (which generally does a better job, despite using libavutil like ffmpeg!). But I'm not feeling ambitious yet.

    Update:

    Well, I tried using mencoder with with the settings:

    mencoder -of mpeg -mpegopts format=dvd:vaspect=16/9:vframerate=30 -srate 48000 -ofps 30000/1001 -ovc lavc -oac lavc -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:keyint=18:vrc_maxrate=9800:vbitrate=10000:aspect=16/9:acodec=ac3:abitrate=192 Heroes.avi -o Heroes.mpg -endpos 120 -vf scale=1440

    ..and then letting pyTivo stream that directly (which is !$*%'ing FAST by the way), to no avail. I get odd jerkiness when played on Tivo, but it looks fine locally with VLC.

    Mencoder has a lot more options to play with though, so perhaps we can find some workaround using it.
     
  5. Oct 26, 2007 #805 of 5893
    ScottE

    ScottE New Member

    22
    0
    Oct 15, 2001
    San Diego,...
    Sorry, I'm not really that familiar with what pkgsrc is building there. You can try asking on current-users@netbsd.org to see if anyone has any ideas.

    Offhand, it looks like you can workaround the issue by removing "-Wall -Werror" from the CFLAGS (in one of the many Makefiles, most likely). That'll let it proceed past the warning.
     
  6. Oct 26, 2007 #806 of 5893
    neutral

    neutral New Member

    17
    0
    Jul 21, 2005
    I did get it past that point, and ffmpeg was compiled. But now when I attempt to execute it I get another error.

    I saw this at the end of the make install when building it.

    => Registering installation for ffmpeg-0.4.9pre1nb3
    pkg_admin: ffmpeg-0.4.9pre1nb3: File `/usr/pkg/bin/ffserver' is in +CONTENTS but not on filesystem!
    pkg_admin: ffmpeg-0.4.9pre1nb3: File `/usr/pkg/lib/libavcodec.la' is in +CONTENTS but not on filesystem!
    pkg_admin: ffmpeg-0.4.9pre1nb3: File `/usr/pkg/lib/libavformat.la' is in +CONTENTS but not on filesystem!
    pkg_admin: ffmpeg-0.4.9pre1nb3: File `/usr/pkg/man/man1/ffserver.1' is in +CONTENTS but not on filesystem!



    And now when I execut ffmpeg, I get this error.

    Shared object "libavformat.so.0" not found


    I'm going to look into it, but I figured I'd post it incase it's something you've seen already. :)
     
  7. Oct 26, 2007 #807 of 5893
    pac_ny

    pac_ny New Member

    1
    0
    Feb 24, 2007
    New York
    Hi

    Great software

    Quick question - does anyone have any idea how to direct the PATH statement in the pyTivo.conf file to an external USB drive, which appears in finder as 'MyBook'

    can access files stored on local hard disk just fine, by specifying path as / users / name / desktop or similar, but am stumped on connecting to another drive

    unfortunately creating an alias doesn't work either

    thanks
     
  8. Oct 26, 2007 #808 of 5893
    mr2828

    mr2828 New Member

    43
    0
    Jun 18, 2007
    I hope you keep playing around Scott - there may be a solution.

    In the meantime I find the 5 mb/s 720p to be remarkably watchable 99% of the time. I'm going to experiment tonight with some other ffmpeg options directly. Maybe I can get it to use 24 fps as in my source file to help the quality further.

    I have run into one other problem though with audio out of sync on the converted files. Sometimes it seems to be out of sync by around a quarter of a second by the time I get near the end of a 40 minute show. It gradually gets worse through the show. Have you seen anything like that, or maybe just my source file is bad?
     
  9. Oct 26, 2007 #809 of 5893
    mr2828

    mr2828 New Member

    43
    0
    Jun 18, 2007
    If there are any options in ffmpeg or other programs to use a very constant bitrate, or to prevent large fluctuations in varying video bitrates that might be worth exploring.
     
  10. Oct 27, 2007 #810 of 5893
    mr2828

    mr2828 New Member

    43
    0
    Jun 18, 2007
    Well I've found that the Tivo Desktop 2.5 (non-Plus) software will transfer over these HD mpeg files without messing with them. I made some 24 fps ones to start with and they went over very fast without reconversion.
     
  11. Oct 28, 2007 #811 of 5893
    neutral

    neutral New Member

    17
    0
    Jul 21, 2005
    After the issues I was having with NetBSD and ffmpeg, I decided to build an OpenSUSE box and use that for my pytivo server.

    All went well, ffmpeg works great when ran manually. The tivo sees my video share, but when I view the NPL for that share, it's empty. I have videos in that location, I'm confused as to why it shows up empty.

    If I run ffmpeg manually, everything seems to work just fine.



    ffmpeg -threads 2 -i file.avi -vcodec mpeg2video -r 29.97 -b 10Mi -comment 'Test' -acodec ac3 -ab 448k -ar 48000 -f vob -b_strategy 1 -bf 2 -coder vlc -mbd rd -qmin 1 -aspect 16:9 -s 1440x720 file.mpg seems to work as expected.





    So I checked the debug.txt, and this is what it returns.

    libavformat version: 51.17.0
    built on Oct 27 2007 18:16:02, gcc: 4.2.1 (SUSE Linux)
    Input #0, avi, from '/home/neutral/movies/fd.p.x-chwdf.avi':
    Duration: 01:46:39.6, start: 0.000000, bitrate: 917 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 576x304 [PAR 1:1 DAR 36:19], 25.00 fps(r)
    Stream #0.1: Audio: mp3, 48000 Hz, stereo, 32 kb/s
    Must supply at least one output file

    video_info: failed at width/height
    supported_format: /home/neutral/movies/fd.p.x-chwdf.avi is not supported
     
  12. Oct 28, 2007 #812 of 5893
    ScottE

    ScottE New Member

    22
    0
    Oct 15, 2001
    San Diego,...

    The problem is that pyTivo invokes ffmpeg to try and get the dimensions, but it parses them wrong. Old versions of ffmpeg reported like:

    Stream #0.0: Video: mpeg4, yuv420p, 576x304, 25.00 fps(r)

    New versions use:

    Stream #0.0: Video: mpeg4, yuv420p, 576x304 [PAR 1:1 DAR 36:19], 25.00 fps(r)

    pyTivo is looking for "WxH,", and so the right square bracket throws it off. You need to edit transcode.py and look for where it's setting rezre before setting width and height (sorry, don't remember the original line number). Change that line to be:

    rezre = re.compile(r'.*Video: .+, (\d+)x(\d+) .*')

    Basically, just take out the search for the comma after the resolution, and all will be well.

    (Overall, pyTivo needs some better error checking...it fails in all kinds of cases, but...why rewrite something that's working 80%?) :)
     
  13. Oct 28, 2007 #813 of 5893
    neutral

    neutral New Member

    17
    0
    Jul 21, 2005
    Worked perfectly, thank you!
     
  14. Oct 28, 2007 #814 of 5893
    ScottE

    ScottE New Member

    22
    0
    Oct 15, 2001
    San Diego,...
    From a tools-sharing standpoint, you might want to check out MPEG-2 Validator (http://www.geocities.com/gabrielgoc/). I'm trying to see if I can find a correlation between glitches and patterns in the bitstream.

    In some quick tests, I see short GOPs around where I see glitches, and occasionally large bitrate spikes (since it's a bit bucket, the encoder sometimes uses LOTS of bits if it has them to spare).

    If you (or other folks on this thread) want to take a look at glitchy vs working streams, maybe we can figure out the issue and work around it with mplayer/ffmpeg/transcoder/whatever.
     
  15. Oct 28, 2007 #815 of 5893
    mr2828

    mr2828 New Member

    43
    0
    Jun 18, 2007
    I'm seeing reports of working 720p files if videredo or womble are used. If you have access to one of those, maybe try that, and if it works then compare the differences.
     
  16. Oct 28, 2007 #816 of 5893
    doconeill

    doconeill Unix Guru

    265
    6
    Dec 13, 2002
    West of Boston
    Forgive me, but this thread is huge and I couldn't find what I am looking for.

    I'm converting from several hacked DirecTiVos and running tivoserver on my Linux server to a couple TiVoHDs and pyTivo.

    I'm used to pre-converting my video files using a modified ffmpeg that creates TY+ files, including the XML data, and a modified video2ty.py script. This allowed me to adjust ffmpeg parameters as needed, and also have the videos have information just like they would if they were normally recorded. It also allowed me to transfer at slightly better than real time over my Wireless-G bridged network.

    Will pyTivo accept these TY+ files at all? I think because ffmpeg can create them, but not decode them, pyTivo ignores them.

    Otherwise, what is the preferred format that will allow pyTivo to stream the files without doing on-the-fly conversion? Or is it possible?
     
  17. Oct 28, 2007 #817 of 5893
    WelshSage

    WelshSage New Member

    5
    0
    Oct 17, 2007
    Point pyTivo.conf to /Volumes/MyBook/More folders go here

    Also, make sure that there are not any spaces in your drive name or any folders that you want pyTivo to read, otherwise it will not see them.
     
  18. Oct 28, 2007 #818 of 5893
    MT-Hand

    MT-Hand New Member

    26
    0
    Mar 5, 2005
    There is also a Preference Pane called "Path Snagger" that is very handy for this. It gives you a contextual menu item to copy the full Unix path to the clip board.

    It's donation-ware and available at:
    http://www.bergenstreetsoftware.com
     
  19. Oct 29, 2007 #819 of 5893
    Q2112

    Q2112 New Member

    24
    0
    Sep 12, 2006
    I can get pytivo.py to run just fine...but I can't get pytivoservice.py to run. I know it's installed because I see it in my services window.

    It says " the service did not respond in a timely fashion". That's a very polite error message but I wish it would go away and start the service.

    I have even tried going to C:\Python25\Lib\site-packages\win32 and running pythonservice.exe and it says it failed because it can't find python25.dll. I have tried running the repair on the installation and rebooting but still can't get the service to start.

    I am using pytivo 182

    #######################

    I fixed the above problem by uninstalling and reinstalling and this time installing for "ALL USERs" and not just me. But now I have a different error that I will submit a new post for.
     
  20. Oct 29, 2007 #820 of 5893
    mr2828

    mr2828 New Member

    43
    0
    Jun 18, 2007
    I think I'm going to give up on pyTivo and any other software that relies on ffmpeg for my HD -> S3 file needs. Besides pyTivo I've tried a newer version of ffmpeg standalone, and also tried videora xbox 360 converter that also uses ffmpeg. All fail similarly at the higher bitrates.

    I'll probably take the rest of this discussion to another thread since it will be non-pyTivo related at this point.
     

Share This Page