Skip to content

Instantly share code, notes, and snippets.

@lzpel
Created August 27, 2022 05:29
Show Gist options
  • Save lzpel/9c6fd92f472b908063bf9dd2b0b11e25 to your computer and use it in GitHub Desktop.
Save lzpel/9c6fd92f472b908063bf9dd2b0b11e25 to your computer and use it in GitHub Desktop.
import glob
import os
const_filename_out = "out.mp4"
const_filename_list = "mylist.txt"
def print_mylist():
with open(const_filename_list, "wt") as flist:
for f in [flist, None]:
for i in sum((glob.glob("./*.{}".format(j)) for j in ["avi", "mp4"]), start=[]):
if not (const_filename_out in i):
print("file", "'{}'".format(os.path.abspath(i)), file=f)
print("# ./ffmpeg -y -f concat -safe 0 -i {l} -af volume=20dB {o}".format(l=const_filename_list, o=const_filename_out))
if __name__ == '__main__':
print_mylist()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment