add metadata copy to combine media script

This commit is contained in:
Lucas Vivo committed 2026-10-07 06:38:36 +02:00
1 parent 881bdcd925
commit ce656b6970
1 file changed
+14 -2
+14 -2
View File
@@ -84,7 +84,10 @@ def create_m4b(root_path: Path, book_dir: Path) -> None:
"-map","0:a", "-map","0:a",
# cover image from first media # cover image from first media
"-map","2:v?", "-map","2:v?",
"-map_metadata","1", # copy artist/album/composer/etc from first media file
"-map_metadata", "2",
# copy chapters from ffmetadata
"-map_chapters", "1",
"-c:a","copy", "-c:a","copy",
"-c:a", "aac", "-c:a", "aac",
@@ -101,8 +104,11 @@ def create_m4b(root_path: Path, book_dir: Path) -> None:
"-map", "0:a", "-map", "0:a",
# cover image from first media # cover image from first media
"-map", "2:v?", "-map", "2:v?",
"-map_metadata", "1",
# copy artist/album/composer/etc from first media file
"-map_metadata", "2",
# copy chapters from ffmetadata
"-map_chapters", "1",
"-c:a", "copy", "-c:a", "copy",
# copy cover image without re-encoding # copy cover image without re-encoding
"-c:v", "copy", "-disposition:v:0", "attached_pic", "-c:v", "copy", "-disposition:v:0", "attached_pic",
@@ -178,6 +184,12 @@ def main() -> None:
for book_dir in book_dir_set: for book_dir in book_dir_set:
log_message(f"Found Media: {book_dir}") log_message(f"Found Media: {book_dir}")
print("Proceed? y/n")
name = input()
if name != "y":
log_message(f"Aborted")
exit(0)
# Root folder containing many books # Root folder containing many books
for book_dir in book_dir_set: for book_dir in book_dir_set:
try: try: