Skip to content

Instantly share code, notes, and snippets.

@scorpion3013
Last active January 14, 2021 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scorpion3013/6eedb410dc93bcc10baf427d9e3f6ce3 to your computer and use it in GitHub Desktop.
Save scorpion3013/6eedb410dc93bcc10baf427d9e3f6ce3 to your computer and use it in GitHub Desktop.
Used to merge my ReLive files.
# Pretty handy when you use the HEVC encodex & have "Seperate Microphone Track" enabled
# Needs to have ffmpeg in path!
# Usage https://www.youtube.com/watch?v=9fXbamn2cdM
import sys
import os
args = list(sys.argv)[1:]
file = None
if len(args) == 0:
file = input("File: ")
elif len(args) == 1:
file = args[0]
file = "".join(file.split("\\")[-1:])
file = ".".join(file.split(".")[:-1])
os.system(f"""ffmpeg -i {file}.m4a -i {file}.mp4 -c:v copy -filter_complex amix=inputs=2:duration=first:dropout_transition=2 {file}-output.mp4""")
if input("Convert (Needed for discord embeding? y/n: ").lower() == "y":
os.system(f"""ffmpeg -i {file}-output.mp4 -c:v libx264 -crf 1 -c:a copy {file}-output-converted.mp4""")
# Made by scorpion3013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment