]> git.pld-linux.org Git - packages/subconv.git/commitdiff
- precise framerate
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sat, 20 Feb 2010 22:30:04 +0000 (22:30 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    subconv.py -> 1.6

subconv.py

index ef39a2a7ce2144cee490e3fa862b8fd6f49535cf..428e02b5d17de57f892df3d27704ec1845a19229 100644 (file)
@@ -37,7 +37,7 @@ def detect_fps(list):
     returns: FPS
     """
     sys.stderr.write("FPS guessing, here are approximate length of file for several FPS :\n")
-    most_current=[23.976,25.0,29.97]
+    most_current = [24/1.001, 25.0, 30/1.001 ]
 
     re_mdvd = re.compile("^[\{\[](\d+)[\}\]][\{\[](\d*)[\}\]]\s*(.*)")
     count = len(list) - 1
@@ -48,7 +48,7 @@ def detect_fps(list):
     last = int(m.group(2))
 
     for i in range(0,len(most_current)):
-        sys.stderr.write(str(i)+" "+str(most_current[i])+" Fps -> ")
+        sys.stderr.write("%s %.2f Fps -> " % (str(i), most_current[i]))
         tot_sec = int(last / most_current[i])
         min = tot_sec / 60
         sec = tot_sec % 60
@@ -109,11 +109,11 @@ def read_mdvd(list, fps):
         m = re1.match(x, 0)
         if m:
             time1 = int(m.group(1))
-            subt = [int(time1) / float(fps)]
+            subt = [ time1 / fps ]
             time2 = m.group(2)
             if time2 == '':
                 time2 = int(time1) + 20
-            subt.append(int(time2) / float(fps))
+            subt.append(int(time2) / fps)
             texts = m.group(3).strip().split("|")
             for i in range(len(texts)):
                 text = texts[i]
This page took 0.056393 seconds and 4 git commands to generate.