Terminal Notes

Commands that were useful at some point, starting with media files.

admech@mars:~$ cat notes.txt MEDIA Playlist in track order: yt-dlp -x --audio-format mp3 --audio-quality 0 -o "%(playlist_index)s-%(title)s.%(ext)s" {URL} Splitting audio of a video with chapters into separate files: yt-dlp -t mp3 --split-chapters -o "chapter:%(section_number)s %(section_title)s.%(ext)s" {URL} Put in ~/.local/bin not forgetting to set the file as executable VIDEO Editing rotation metadata: exiftool -rotation=180 video.mp4 Join files with the same dimensions and codecs etc: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4 Repeat last frame for N seconds: ffmpeg -i in.mp4 -filter_complex "[0]trim=0:N[hold];[0][hold]concat[extended];[extended][0]overlay" out.mp4 Combine series of single frame images into video: fmpeg -framerate 30 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p out.mp4 Two videos side by side: ffmpeg -i left.mp4 -i right.mp4 -filter_complex hstack=inputs=2 output.mp4 AUDIO Crop MP3: ffmpeg -i input.mp3 -vn -acodec copy -ss 00:00:00.000 -t 00:01:30.000 output.mp3 IMAGES Remove EXIF data: for i in *.jpg; do echo "Processing $i"; exiftool -all= "$i"; done Video thumbnails: ffmpeg -i in.mp4 thumb%04d.png ffmpeg -i input.mp4 -vf "thumbnail,scale=640:360" -frames:v 1 thumb.png for f in *.webm; do ffmpeg -i "$f" -ss 00:00:03 -vframes 1 -s 1280x720 "${f%.webm}.jpg"; done CONTAINERS Mux video and audio without re-encoding: ffmpeg -i video.mp4 -i audio.m4a -vcodec copy -acodec copy output.mp4 Remux into another container format: ffmpeg -i input.mkv -vcodec copy -acodec copy output.mp4 FILES Remove non-standard characters: detox * admech@mars:~$ _

💬 Comments are off, but you can use the mail form to contact or see the about page for social media links.