Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Test script for multipass encoding....
- #
- # Variables
- #
- [[ -z "$1" ]] && \
- echo "Must pass a video to encode!" && \
- exit 1
- video="$1"
- of="output.mkv"
- container=mkv
- c_vid="-c:v libx264"
- c_audio="-c:a ac3"
- silent="-v quiet " # Apply only when cmd works
- checkit() # Upon first try, the input filesize was reduced to 0.. couldnt 're-create' this situation
- { echo "-----------------"
- ls -l "$video"
- echo "-----------------"
- }
- #
- # Action
- #
- checkit
- # Pass 1
- ffmpeg $silent -i "$video" $c_vid -pass 1 -an -f rawvideo -y /dev/null || exit 1
- echo "PASS 1 - done"
- checkit
- # Pass 2
- ffmpeg -i "$video" $c_vid -pass 2 -an -f rawvideo -y /dev/null || \
- ( rm ffmpeg2pass* ; exit 1 )
- echo "PASS 2 - done" ; tui-header "pass 2 done" # tui-header is just for to easier find that line
- # Pass 3
- echo "TODO pass 3, fails befor this is started anyway..."
- echo "But obviously, it didnt exit!?!?"
- ffmpeg -i "$video" $c_vid -strict -2 -map 0:0 $c_audio -map 0:1 "$of"
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement