Here’s a rolling post on Terminal utilities I find particularly useful and which you could as well. For the moment I won’t go too in depth on what everything is, this is more for quick reference. I’ve linked the original sites they were from if you want to see the source
Ffmpeg commands
Add italian subtitles to MKV file
-i file.mkv -sub_charenc CP1252 -i file.srt -map 0:v -map 0:a -c copy -map 1 -c:s:0 srt -metadata:s:s:0 language=ita output.mkv
https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/subtitle_options
Convert from one file type to other
ffmpeg -i input.mp4 output.mkv
https://opensource.com/article/17/6/ffmpeg-convert-media-file-formats
convert from webm to mp4 quickly
ffmpeg -i video.webm -preset veryfast video.mp4
https://blog.addpipe.com/converting-webm-to-mp4-with-ffmpeg/
Extract audio from video
Doesn’t work/needs to be fixed
ffmpeg -i input-video.avi -vn -acodec copy output-audio.aac
-vn is no video.
-acodec copy says use the same audio stream that’s already in there.
https://stackoverflow.com/questions/9913032/how-can-i-extract-audio-from-video-with-ffmpeg
Batch convert .mkv files to mp4 files
for f in *.mkv;do ffmpeg -i “$f” -c copy “${f%mkv}mp4”;done
Imagemagick
Batch scale images
Place all the images you want to scale in a directory and navigate to that location via command line. Then enter:
mogrify -resize 960×528 *.png
This command resizes all of the .png files in your directory to a size of 960 pixels by 528 pixels. Perhaps the height isn’t as important as the width. You can simply enter:
mogrify -resize 960 *.png
This will scale all of your images to a width of 960 pixels, the height will be scaled accordingly, preserving the aspect ratio. Perhaps you have a height and width you are aiming for, but want to preserve the aspect ratio. You can enter:
mogrify -resize 960×528! *.png
https://dototot.com/imagemagick-tutorial-batch-resize-images-command-line/
Cat commands
Merge CSV Excel files
cd into directory
then
cat *.csv >combined.csv”