Skip to content
Python

wip

Gunther Schulzf19ba7d9c1d8
diff --git a/extract_source_images.py b/extract_source_images.py
index 81c59ae..1003ccd 100755
--- a/extract_source_images.py
+++ b/extract_source_images.py
@@ -1,9 +1,10 @@
#!/usr/bin/env python3
"""
-Extract Source Images from MKV Video Files
+Extract Source Images from Video Files
-This utility extracts source images that were embedded as attachments in MKV video files
+This utility extracts source images that were embedded in video files
generated by Wan2GP with source image embedding enabled.
+Supports MKV (attachments) and MP4 (cover art) formats.
"""
import sys
@@ -15,7 +16,7 @@ from shared.utils.audio_video import extract_source_images
def main():
parser = argparse.ArgumentParser(
- description="Extract source images from MKV video files with embedded attachments",
+ description="Extract source images from video files with embedded images (MKV attachments or MP4 cover art)",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=__doc__
)
@@ -23,7 +24,7 @@ def main():
parser.add_argument(
'video_files',
nargs='+',
- help='MKV video file(s) to extract source images from'
+ help='Video file(s) to extract source images from (MKV or MP4)'
)
parser.add_argument(
@@ -58,8 +59,8 @@ def main():
print(f"Warning: File not found: {video_file}")
continue
- if not video_file.lower().endswith('.mkv'):
- print(f"Warning: Skipping non-MKV file: {video_file}")
+ if not (video_file.lower().endswith('.mkv') or video_file.lower().endswith('.mp4')):
+ print(f"Warning: Skipping unsupported file: {video_file} (only MKV and MP4 supported)")
continue
if args.verbose: