sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
| # https://www.fosshub.com/MKVToolNix.html | |
| $ sudo apt install mkvtoolnix | |
| # Update the default audio track to the second one in all the files in the current directory | |
| $ for i in *; do if [[ $i == *.mkv ]]; then mkvpropedit "$i" --edit track:a1 --set flag-default=0 --edit track:a2 --set flag-default=1; fi; done | |
| # If you have a single subtitle, and you want it to be default, then do: | |
| $ for i in *; do if [[ $i == *.mkv ]]; then mkvpropedit "$i" --edit track:s1 --set flag-default=1; fi; done | |
| # Merge two files into one |
| # Requires pydub (with ffmpeg) and Pillow | |
| # | |
| # Usage: python waveform.py <audio_file> | |
| import sys | |
| from pydub import AudioSegment | |
| from PIL import Image, ImageDraw | |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!