]> git.poda.fr Git - converter.git/commitdiff
Remove ffmpeg vfr option
authorJulien <None>
Wed, 7 Oct 2026 15:09:04 +0000 (17:09 +0200)
committerJulien <None>
Wed, 7 Oct 2026 15:09:04 +0000 (17:09 +0200)
converter.py

index 6d5ae5928eba2ceccd3047ffbb8ad80ad5ff3008..a80503239a4c640b4965689323a8c48a6245182f 100755 (executable)
@@ -79,13 +79,10 @@ class ConvertProfile:
     def init(self, profileName: str) -> bool:
         # "-n" to prevent overwriting any existing file.
         # "-ar 44100" for 44.1 kHz audio output.
-        # "-fps_mode vfr" to drop frames which cannot be
-        #                 properly contained in the output file.
         # "-codec:v copy" to copy the integrated image from source
         #                 instead of converting it to png (default encoder).
-        commonFlags: list[str] = ["-hide_banner", "-loglevel", "error",
-                                  "-n", "-ar", "44100", "-fps_mode", "vfr",
-                                  "-codec:v", "copy"]
+        commonFlags: list[str] = ["-loglevel", "error", "-n",
+                                  "-ar", "44100", "-codec:v", "copy"]
 
         # "-sample_fmt s16" for 16 bits audio output.
         # "-write_id3v2 1" to write metadata in aiff files.
@@ -95,8 +92,7 @@ class ConvertProfile:
             self.convertExtensions = [".aiff", ".flac", ".wav"]
             self.copyExtensions = [".mp3"]
             self.converterArgs = (commonFlags
-                                  + ["-f", "aiff", "-sample_fmt", "s16",
-                                     "-write_id3v2", "1"])
+                                  + ["-f", "aiff", "-sample_fmt", "s16", "-write_id3v2", "1"])
             return True
         # "-sample_fmt s16" for 16 bits audio output.
         elif profileName == "flac":
@@ -271,7 +267,8 @@ class Converter:
             return
 
         # Playlists generated from playlist files.
-        libPlaylists: dict[str, LibraryPlaylist] = self._createLibraryPlaylists(convertParams.playlistDir)
+        libPlaylists: dict[str, LibraryPlaylist] = self._createLibraryPlaylists(
+            convertParams.playlistDir)
 
         if len(libPlaylists) == 0:
             self._log("Error: No playlist found.")
@@ -486,7 +483,8 @@ class Converter:
                 return
 
         if task.taskType == "copy":
-            self._log(str(task.taskId) + "/" + str(totalTasks) + ": Copying '" + task.inputFilePath
+            self._log(str(task.taskId) + "/" + str(totalTasks)
+                      + ": Copying '" + task.inputFilePath
                       + "' into '" + task.outputFilePath + "'.")
             self.copyFile(task.inputFilePath, outputFilePathWip)
             os.rename(outputFilePathWip, task.outputFilePath)
@@ -498,9 +496,11 @@ class Converter:
             command: list[str] = ([converterPath] + [self._CONVERTER_IN]
                                   + [task.inputFilePath] + task.converterArgs
                                   + [outputFilePathWip])
-            self._log(str(task.taskId) + "/" + str(totalTasks) + ": Converting '" + task.inputFilePath + "' to '"
-                      + task.outputFilePath + "'.")
-            result: subprocess.CompletedProcess = subprocess.run(command, capture_output=True, text=True)
+            self._log(str(task.taskId) + "/" + str(totalTasks)
+                      + ": Converting '" + task.inputFilePath
+                      + "' to '" + task.outputFilePath + "'.")
+            result: subprocess.CompletedProcess = subprocess.run(
+                command, capture_output=True, text=True)
 
             if result.returncode == 0:
                 os.rename(outputFilePathWip, task.outputFilePath)
@@ -547,7 +547,8 @@ class Converter:
 
     # Create a library playlist from a playlist file.
     def _createLibraryPlaylistFromFile(self, filePath: str) -> LibraryPlaylist:
-        playlist: LibraryPlaylist = LibraryPlaylist(self.trimFileExtension(os.path.basename(filePath)))
+        playlist: LibraryPlaylist = LibraryPlaylist(
+            self.trimFileExtension(os.path.basename(filePath)))
 
         if (self.getFileExtension(filePath).lower() == ".m3u"
             or self.getFileExtension(filePath).lower() == ".m3u8"):