Remove sound from video

ffmpeg -i input.mp4 -c:v copy -an output.mp4

Compress images

Compress all images in the current folder,

for file in *.jpg *.jpeg *.png; do ffmpeg -i "$file" -q:v 10 -y "${file%.*}_temp.${file##*.}" && mv "${file%.*}_temp.${file##*.}" "$file"; done

Compress and reduce video size

Merge videos

Merge all video files named a_1.mp4, a_2.mp4, etc. into a single file a.mp4 in order, with smooth transitions.

ffmpeg -f concat -safe 0 -i <(for i in {1..2}; do echo "file '$(pwd)/a_$i.mp4'"; done) -c:v libx264 -preset fast -crf 23 -c:a aac a.mp4

An alias in .zshrc or .bashrc to merge and also mute all video starting with letter a and the number of the last file is 5

alias merge_video='_merge_video() { 
  local prefix=$1
  local last=$2
  local concat_file=$(mktemp)
  
  for i in {1..$last}; do
    echo "file '\\''$(pwd)/${prefix}_${i}.mp4'\\''" >> $concat_file
  done
  
  ffmpeg -f concat -safe 0 -i $concat_file -an -c copy "${prefix}_merged.mp4"
  rm $concat_file
}; _merge_video'

Split a videos

Split a video into segments of 200 ms each,

ffmpeg -i input.mp4 -c copy -map 0 -segment_time 200 -f segment output_%03d.mp4

Converter

Convert .m3u8 (streaming video) to a .mp4