Mercurial > codedump
diff copy-aac-fixup.py @ 136:da4f7200665f default tip
buncha shit
| author | Paper <paper@tflc.us> |
|---|---|
| date | Sat, 07 Mar 2026 18:04:10 -0500 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/copy-aac-fixup.py Sat Mar 07 18:04:10 2026 -0500 @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +import glob +import subprocess +import termios + +oldtty = termios.tcgetattr(0) + +# list of Popen classes to wait on +# this allows us to run metaflac independently on +# a huge list of files concurrently +processes = list() + +i = 1 + +# glob the files in order +files = glob.glob("*.aac") +files.sort() +for g in files: + processes.append(subprocess.Popen(["ffmpeg", "-i", g, "-c", "copy", "-metadata", "track=%d" % i, g + ".m4a"])) + i += 1 + +for p in processes: + p.wait() + +# ffmpeg fucks the terminal, restore it back +termios.tcsetattr(0, termios.TCSANOW, oldtty)
