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. Nov 3, 2011 #3261 of 5684
    lpwcomp

    lpwcomp Active Member

    8,081
    2
    May 6, 2002
    John's...
    No, some of them are still the old style SH[6 or 8 digits leading 0 filled, or 7 digits no leading 0] .

    Let me see if I can explain it in English even though I loathe Cobol.:D The following reflects code changes that I haven't yet posted

    A leading EP will be removed. If the seriesId is 10 characters long and begins with SH00, that will be removed. If it doesn't begin with either of those, it will be taken as is. Blast it, just realized this won't handle the case of them changing one that is SH followed by 7 digits by adding a loading 0. I'll just have to get to the numeric part and recreate it.

    If what remains is numeric, that is when the limits come in. If the value is <= the upper limit, leading zeros will be removed. If the value is also < 1000000(note 1), it will be leading zero filled to 6 digits. We now have a string that is 6,7, or 8 digits long. An SH will be added to the beginning of this string.

    I am assuming that if the ID in theTVDB is not of the form EPn, SHn(note 2) or n, it is correct or uncorrectable. Although maybe I need to revisit the code and not remove the EP or SH if the remainder is not numeric, but theoretically that shouldn't happen. I am also assuming that if the numeric portion has a value greater than the upper limit, it will have a leading 0 if there is supposed to be one.

    My reading of the discussion at theTVDB forum is that they are looking at 3 options: Leaving things as they are now, going back to the SH form or going to a strictly numeric form. I think my code will handle any of those or a mixture, even if they return to the SH form but leading zero fill it to 8 digits.

    note 1. I had error in the code that I have corrected.

    note 2. Logic error. Some IDs that begin SH0 may not be correct. Corrected code in next post.
     
  2. Nov 3, 2011 #3262 of 5684
    lpwcomp

    lpwcomp Active Member

    8,081
    2
    May 6, 2002
    John's...
    new code:

    Code:
                            
                            if ( tvTag == 'seriesId' ):
                                    texttmp = text
                                    if ( texttmp.startswith('EP') ):
                                            texttmp = texttmp.lstrip('EP') # strip off leading 'EP' if there is one
                                    if ( texttmp.startswith('SH') ) :
                                            texttmp = texttmp.lstrip('SH') # same for SH
                                    if ( str(texttmp).isdigit() ): # if remaining is numeric
                                            textint = int(texttmp)
                                            if ( textint <= 1026171 ): # not 8 digit format (unknown if this upper bound is correct)
                                                    texttmp = texttmp.lstrip('0') # strip leading zeros
                                                    if ( textint < 1000000 ): # must be at least 6 digits
                                                            texttmp = texttmp.zfill(6)
                                            
                                            text = "SH" + texttmp # add leading 'SH' to numeric ID
     
  3. Nov 3, 2011 #3263 of 5684
    lpwcomp

    lpwcomp Active Member

    8,081
    2
    May 6, 2002
    John's...
    To summarize, I made the following assumptions with the latest version:

    1. If the seriesId obtained from theTVDB is not numeric and it doesn't begin with EP or SH, it can't be fixed.

    2. If the portion after the EP or SH is not numeric, it can't be fixed.

    3. If the numeric portion is < 1000000, the correct format is SH followed by 6 digits.

    4. If the numeric portion is >= 1000000 and <= 1026171, the correct format is SH followed by 7 digits.

    5. If the numeric portion is > 1026171, the correct format is SH followed by the numeric string as it was obtained from theTVDB.

    6. Any seriesId that can't be fixed should be kept as is.
     
  4. Nov 3, 2011 #3264 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    Where does this number come from? I searched both this thread and the one on theTVDB.com forum and the only place I found "1026171" was the three recent posts by you in this thread. (?)

    I understand you said you're not sure about this limit, but what is the basis for saying there is such a limit?
     
  5. Nov 3, 2011 #3265 of 5684
    lpwcomp

    lpwcomp Active Member

    8,081
    2
    May 6, 2002
    John's...
    This.
     
  6. Nov 3, 2011 #3266 of 5684
    lpwcomp

    lpwcomp Active Member

    8,081
    2
    May 6, 2002
    John's...
    What would be nice is if we could get someone at theTVDB to execute SQL something like:

    Select max(zap2itid) from whatevertableitsin where zap2itid like 'SH1%';

    Especially if they could do it on a copy of the DB made prior to the mass update.
     
  7. Nov 3, 2011 #3267 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    What would really be nice is if someone at TiVo would spend a paragraph or two (or a code snippet) to explain this.... but that's pie in the sky. :(
     
  8. Nov 3, 2011 #3268 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    Yep, I had figured this out just before you posted, by reading through the entire thread on theTVDB.com forum and viewing the linked text file. For the benefit of others, the last item in this file, which is sorted by ascending ID number, is a show with SH1026171. Thus the file is a proof of existence of 7-digit SH numbers at least that high. And we also have specific examples of SH numbers greater than that with a leading zero and 8 digits, which you and I have verified with our tivo TTG transfers. What a pain this is. I hope they don't plan to change this very often.
     
  9. Nov 3, 2011 #3269 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    Huhh ??

    I was using Metagenerator 3 to look at ID's returned by theTVDB.com, trying to see if I could push the 7-digit SH number limit higher than SH102671. I found "Breaking Bad" returning "SH01009396", which is 8-digits and BELOW the limit.

    "Breaking Bad" is also on the list linked a few posts above by lpwcomp, but with the ID = "SH1009396", i.e., WITHOUT the leading zero.

    Is there actually any solid info regarding this issue?
     
  10. Nov 3, 2011 #3270 of 5684
    lpwcomp

    lpwcomp Active Member

    8,081
    2
    May 6, 2002
    John's...
    Does anyone have an episode of Breaking Bad that they actually recorded on their computer?


    The following paragraph is all IMHO:

    This is not TiVo's fault. I suspect they used what they got from TMS. TMS probably switched to 7 digits for a while and has now switched to 8. For existing series, TiVo is mapping the eight digit ids back to what they initially got so that episodes remain grouped together. Can you imagine the screams from the user community if they didn't do this?

    BTW, during the discussion on theTVDB forum, it came out that TMS is still providing the SH seriesId. That both the SH and EP are available.
     
  11. Nov 3, 2011 #3271 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    I would record it but I'm on TWC and all channels except locals are copy protected so no TTG (or MRV).

    Still wondering if the ID they get will depend on whether they already have recordings on their TiVo made before the zap2it changes.
     
  12. Nov 3, 2011 #3272 of 5684
    lpwcomp

    lpwcomp Active Member

    8,081
    2
    May 6, 2002
    John's...
    Not that I am aware of, thus the caveat in my initial code post.

    What is in theTVDB is really not relevant except that it means that it is probably not an accurate source for the upper limit. The important thing is - what does TiVo use?
     
  13. Nov 3, 2011 #3273 of 5684
    lpwcomp

    lpwcomp Active Member

    8,081
    2
    May 6, 2002
    John's...
    You should still be able to determine seriesId using the program that wcmbrine wrote.

    Extremely unlikely.
     
  14. Nov 3, 2011 #3274 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    LOL, I was one of the first users of that program -- then forgot completely about it. I got it going again but nothing on my TiVo now has an ID number in the magic gap, and using MG3 and my program guide I can't find anything to record tonight that falls in the gap. My tivo shows no episodes of Breaking Bad in the next 12 days.
     
  15. Nov 3, 2011 #3275 of 5684
    innocentfreak

    innocentfreak Active Member

    8,950
    3
    Aug 25, 2001
    Florida
    I would imagine that you could verify if Breaking Bad was changed by searching season pass alerts. I think when the series ID has changed this is what has required users to create a new season pass.

    I remember years ago this was fairly prevalent but it then went away. There was a time when several season passes just broke over night and the only fix was to recreate the season pass.
     
  16. Nov 3, 2011 #3276 of 5684
    lpwcomp

    lpwcomp Active Member

    8,081
    2
    May 6, 2002
    John's...
    I've been using it quite a bit over the last day or so. It's how I determined that pushed shows are getting those weird seriesIds. tivo.mind apparently uses some arcane formula involving metadata seriesId, seriesTitle and title. I guess you could say it has a - mind of its own.:)

    My other recent use of it was one reason I was so peeved at the recent mass update to theTVDB. I had updated 8-10 records by hand for new series using the seriesIds I got using the program, only to be undone in one fell swoop.:(

    I took another look at the list. It appears to me that, with a few notable exceptions, most of the 7 digit entries are one-offs. So whatever the final resolution, it doesn't present a huge problem.

    While I've got your attention, If you do decide to make a mod to MetaGenerator, while you're mucking about in it, how difficult would it be to change it to allow 4 digit episode numbers? Just askin'.:)
     
  17. Nov 3, 2011 #3277 of 5684
    lpwcomp

    lpwcomp Active Member

    8,081
    2
    May 6, 2002
    John's...
    I have some documentation showing grouping of pulled shows on a Premiere based on a made up seriesId. Since I don't have TV screen capture capability, I had to get it elsewhere. You'll just have to take my word for it that I didn't make it up. I put it in a "CODE" block to maintain formatting.

    Code:
    Harry Potter Movies (2)	Fri 11/15/02 07:00 	  	 0:04 	0.04 GB 	 1.63 
    
    Harry Potter Movies - Harry Potter and the Chamber of Secrets	Fri 11/15/02 07:00 		 0:01 	0.02 GB 	 1.93 
    Harry Potter Movies - Harry Potter and the Philosopher's Stone	Fri 11/16/01 07:00 		 0:02 	0.02 GB 	 1.33 
    
    HP01234567 Harry Potter Movies
    Not counting blank lines, the first line is from the main kmttg NPL list for the Premiere. The next two lines are the contents of the folder, again from kmttg. The final line is the relevant line of output from the seriesid program that wcmbrine wrote. Note that the seriesId is the one I created and not one of those strange ones created by tivo.mind
     
  18. Nov 7, 2011 #3278 of 5684
    lpwcomp

    lpwcomp Active Member

    8,081
    2
    May 6, 2002
    John's...
    Based on the results of tests dlfl and I performed, it appears that TiVo is using either 6 digits or 8 digits after the SH, and not using 7 at all. With that in mind, here is the third and hopefully final version of the code:

    Code:
                            
                            if ( tvTag == 'seriesId' ):
                                    texttmp = str(text).translate(None,' ') # remove all blanks
                                    if ( texttmp.startswith('EP') ):
                                            texttmp = texttmp.lstrip('EP') # strip off leading 'EP' if there is one
                                    if ( texttmp.startswith('SH') ) :
                                            texttmp = texttmp.lstrip('SH') # same for SH
                                    if ( texttmp.isdigit() ): # if remaining is numeric
                                            texttmp = texttmp.lstrip('0') # strip leading zeros
                                            if (int(texttmp) < 1000000 ): #  6 digit format
                                                    texttmp = texttmp.zfill(6)
                                            else:
                                                    texttmp = texttmp.zfill(8)
                                            
                                            text = "SH" + texttmp # add leading 'SH' to numeric ID
     
  19. Nov 9, 2011 #3279 of 5684
    bgc

    bgc Member

    165
    0
    Jan 12, 2008
    Why do .mp4 videos transferred with pyTivo seem to fast forward and rewind alot faster than the same files transferred with Tivo Desktop? The 2nd level ">>" fast forward seems to be faster then the normal 3rd level and the 3rd level for the pyTivo files is so fast you can't really use it.
     
  20. Nov 9, 2011 #3280 of 5684
    pmiranda

    pmiranda New Member

    669
    0
    Feb 12, 2003
    Austin, TX
    I've noticed that on some .mp4 videos I transfer to TiVo that the first fast-forward is still just 1X speed... I'm guessing it has to do with the number of "key" frames per second. TiVo can't interpolate on the fly so the only way to get all the playback capability you expect would be to adjust the ffmpeg settings for the transcode. I don't know exactly what they would be, but this seems like the right avenue.
     

Share This Page