Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.02 KB | None | 0 0
  1. #!/bin/bash
  2. # Test script for multipass encoding....
  3. #
  4. #   Variables
  5. #
  6.     [[ -z "$1" ]] && \
  7.         echo "Must pass a video to encode!" && \
  8.         exit 1
  9.     video="$1"
  10.     of="output.mkv"
  11.     container=mkv
  12.     c_vid="-c:v libx264"
  13.     c_audio="-c:a ac3"
  14.     silent="-v quiet "  # Apply only when cmd works
  15.     checkit() # Upon first try, the input filesize was reduced to 0.. couldnt 're-create' this situation
  16.     {   echo "-----------------"
  17.         ls -l "$video"
  18.         echo "-----------------"
  19.     }
  20. #
  21. #   Action
  22. #
  23.     checkit
  24.    
  25.     # Pass 1
  26.     ffmpeg $silent -i "$video" $c_vid -pass 1 -an -f rawvideo -y /dev/null  || exit 1
  27.     echo "PASS 1 - done"
  28.    
  29.     checkit
  30.    
  31.     # Pass 2
  32.     ffmpeg -i "$video" $c_vid -pass 2 -an -f rawvideo -y /dev/null  || \
  33.         ( rm ffmpeg2pass* ; exit 1 )
  34.     echo "PASS 2 - done" ; tui-header "pass 2 done" # tui-header is just for to easier find that line
  35.    
  36.     # Pass 3
  37.     echo "TODO pass 3, fails befor this is started anyway..."
  38.     echo "But obviously, it didnt exit!?!?"
  39.     ffmpeg -i "$video" $c_vid -strict -2 -map 0:0 $c_audio -map 0:1  "$of"
  40. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement