Advertisement
Guest User

Untitled

a guest
Apr 17th, 2021
84
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cat[171823Z APR 21][palmer@trinity] palmer $ cat !$
  2. cat ~/bin/mp4-to-mkv.sh
  3. #!/usr/bin/env bash
  4.  
  5. set -e
  6.  
  7. if termux-battery-low; then
  8.     echo "Battery is too low to encode files"
  9.     exit 1
  10. fi
  11.  
  12. for x in *.mp4; do
  13.     NAME=$(basename "$x" .mp4);
  14.     MKV="$NAME.mkv";
  15.  
  16.     if [ -f "$MKV" ]; then
  17.         continue;
  18.     fi
  19.  
  20.     ffmpeg -i "$x" -map 0 -c copy -c:a ac3 "$MKV"
  21. done
Advertisement
RAW Paste Data Copied
Advertisement