Skip to content

Instantly share code, notes, and snippets.

@leandrocrs
Created November 23, 2021 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leandrocrs/749759d069098c8a3b280f04f1d9940c to your computer and use it in GitHub Desktop.
Save leandrocrs/749759d069098c8a3b280f04f1d9940c to your computer and use it in GitHub Desktop.
script to convert/encode a bunch of videos to mp4
#!/bin/sh
ls * | parallel -j 4 -u -k ffmpeg-bar -y -i {} -threads 0 -c:v libx264 -crf 23 -c:a aac -map_metadata 0 "../output/{.}.mp4"
# for fullfile in ./*; do
# # do some stuff here with "$f"
# # remember to quote it or spaces may misbehave
# filename=$(basename -- "$fullfile")
# extension="${filename##*.}"
# filename="${filename%.*}"
# echo "ffmpeg -i '$fullfile' -hide_banner -loglevel error -framerate 30 -c:v libx264 -crf 23 -c:a aac -map_metadata 0 ./output/$filename.mp4 "
# ffmpeg-bar -i "$fullfile" -threads 0 -framerate 30 -c:v libx264 -crf 23 -c:a aac -map_metadata 0 -async 1 "./output/$filename.mp4"
# done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment