Bläddra i källkod

Deal with SIDE_DATA from ffprobe

ZiB 10 månader sedan
förälder
incheckning
a188b5f981
1 ändrade filer med 7 tillägg och 0 borttagningar
  1. 7 0
      remux/remux/probe.py

+ 7 - 0
remux/remux/probe.py

@@ -27,6 +27,7 @@ class Probe:
       return None
 
     # Parse streams
+    prefix = None
     stream = None
     for line in data.splitlines():
       if line == "[STREAM]":
@@ -34,9 +35,15 @@ class Probe:
       elif line == "[/STREAM]":
         streams.append(stream)
         steam = None
+      if line == "[SIDE_DATA]":
+        prefix = 'SIDE_DATA'
+      elif line == "[/SIDE_DATA]":
+        prefix = None
       elif stream is not None:
         try:
           (key, val) = line.split('=', 1)
+          if prefix is not None:
+            key = f"{prefix}:{key}"
         except ValueError:
           self.logger.error(f"Skipping unexpected stream data ({path}): {line}")
           continue