Last active
January 14, 2021 11:17
-
-
Save scorpion3013/6eedb410dc93bcc10baf427d9e3f6ce3 to your computer and use it in GitHub Desktop.
Used to merge my ReLive files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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