[mythtv-users] mythtranscode fails to find recording

Raymond Wagner raymond at wagnerrp.com
Wed Jul 3 19:56:57 UTC 2013


On 7/3/2013 1:35 PM, Rod Roark wrote:
> I don't know Python so this took me a while.  Here's a fix that seems to
> work for me:
>
> https://github.com/sunsetsystems/mythtv/commit/012a64847ee4e771ee7ac035b235cddee8ed4087
>
> Not sure it's ideal, because it creates new dependencies on dateutil and
> pytz.  Improvements welcomed.

The MythTV Python bindings have timezone aware datetime handling built 
in, so there should be no need for external dependencies. Could you try 
this instead?

-------------- next part --------------
diff --git a/mythplugins/mytharchive/mythburn/scripts/mythburn.py b/mythplugins/mytharchive/mythburn/scripts/mythburn.py
index f0c96ea..335c1a5 100755
--- a/mythplugins/mytharchive/mythburn/scripts/mythburn.py
+++ b/mythplugins/mytharchive/mythburn/scripts/mythburn.py
@@ -88,13 +88,13 @@ import ImageFont
 import ImageColor
 import unicodedata
 import time
-import datetime
 import tempfile
 from fcntl import ioctl
 import CDROM
 from shutil import copy

 import MythTV
+from MythTV import datetime
 from MythTV.altdict import OrdDict

 # media types (should match the enum in mytharchivewizard.h)
@@ -1696,6 +1696,7 @@ def runMythtranscode(chanid, starttime, destination, usecutlist, localfile):
     """Use mythtranscode to cut commercials and/or clean up an mpeg2 file"""

     rec = DB.searchRecorded(chanid=chanid, starttime=starttime).next()
+    starttime = rec.starttime.utcisoformat()
     cutlist = rec.markup.getcutlist()

     cutlist_s = ""
@@ -2134,11 +2135,12 @@ def encodeNuvToMPEG2(chanid, starttime, mediafile, destvideofile, folder, profil
            qdiff = value

     if chanid != -1:
+        utcstarttime = datetime.duck(starttime).utcisoformat()
         if (usecutlist == True):
             PID=os.spawnlp(os.P_NOWAIT, "mythtranscode", "mythtranscode",
                         '--profile', '27',
                         '--chanid', chanid,
-                        '--starttime', starttime,
+                        '--starttime', utcstarttime,
                         '--honorcutlist',
                         '--fifodir', folder)
             write("mythtranscode started (using cut list) PID = %s" % PID)
@@ -2146,7 +2148,7 @@ def encodeNuvToMPEG2(chanid, starttime, mediafile, destvideofile, folder, profil
             PID=os.spawnlp(os.P_NOWAIT, "mythtranscode", "mythtranscode",
                         '--profile', '27',
                         '--chanid', chanid,
-                        '--starttime', starttime,
+                        '--starttime', utcstarttime,
                         '--fifodir', folder)

             write("mythtranscode started PID = %s" % PID



More information about the mythtv-users mailing list