From 53f6da98359646deb0e328b0f06927bd2de06b69 Mon Sep 17 00:00:00 2001 From: Fabrice Quenneville Date: Thu, 17 Oct 2024 16:24:36 -0400 Subject: [PATCH] feat: Preserve metadata during conversion Added '-map_metadata', '0' to the ffmpeg command to ensure all metadata from the input file is preserved in the output file. This change enhances the output quality by retaining important information such as title, year, and other metadata associated with the media files. --- mediacurator/library/video.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mediacurator/library/video.py b/mediacurator/library/video.py index 27937bb..379c109 100644 --- a/mediacurator/library/video.py +++ b/mediacurator/library/video.py @@ -176,7 +176,7 @@ class Video(): # Setting ffmpeg args = [ 'ffmpeg', '-i', self.path + self.filename_origin, '-map', '0:v', - '-map', '0:a?', '-map', '0:s?' + '-map', '0:a?', '-map', '0:s?', '-map_metadata', '0' ] # Conversion options @@ -193,6 +193,7 @@ class Video(): # Add mapping for video, audio, and subtitle streams args += ['-c:a', 'copy', '-c:s', 'copy'] + # Conversion output args += [self.path + self.filename_tmp]