Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##!/bin/bash
- set -u
- #
- # <input VOB directory> <output filename>
- #
- #-----------------------------------------------------------------
- # get a list of all the VOBS, exluding the menu - VTS_xx_0.VOB
- vobs_list=$(find "${1}" -type f -name 'VTS_[0-9][0-9]_[1-9].VOB' | sort)
- # check if any VOB files found
- if [[ -z ${vobs_list} ]]
- then
- echo "${movie_path} : No VOB files found"
- return 1
- fi
- #-----------------------------------------------------------------
- # set the file separator to newline to for the list of vobs
- oIFS="${IFS}"
- IFS=$'\n'
- #--------------------------FFMPEG---------------------------------------
- # -map 0 // to capture all streams
- # -map -dn // ignore all data channels (used for dvd menus?), (prevents ffmpeg error)
- # -c:v libx264 // video encoding to h264
- # -crf 18 // video, almost loss-less
- # -c:a copy // copy audio stream as is
- # -c:s copy // copy subtitle stream as is
- # -preset fast // best output file size (compression ratio) in reasonable
- # -analyzeduration 50M -probesize 50M // to make sure subtitle is found correctly
- TIMEFORMAT='Elapsed time %R seconds'
- time {
- cat ${vobs_list} | \
- ffmpeg \
- -y \
- -analyzeduration 50M \
- -probesize 50M \
- -i - \
- -map 0 \
- -map -dn \
- -c:v libx264 \
- -c:a copy \
- -c:s copy \
- -preset fast \
- -crf 18 \
- "${2}"
- exit_status=$?
- }
- #-----------------------------------------------------------------
- # reset the file separator to original
- IFS="${oIFS}"
Add Comment
Please, Sign In to add comment