Compare commits
No commits in common. "c33104c552d41bb8eb674d25cc411a470fcf57e5" and "df1f8f488994dcedc656ee1eae2f2f87f258cff1" have entirely different histories.
c33104c552
...
df1f8f4889
|
@ -18,11 +18,7 @@ TRACK_COUNT=$(echo "$JSON_OUTPUT" | jq length)
|
||||||
[[ $TRACK_COUNT -lt 2 ]] && echo -e "\tFile has only 1 track, skipping." && exit 1
|
[[ $TRACK_COUNT -lt 2 ]] && echo -e "\tFile has only 1 track, skipping." && exit 1
|
||||||
# check if tracks other than the one to keep are present
|
# check if tracks other than the one to keep are present
|
||||||
UNDESIRED_TRACK_COUNT=$(echo "$JSON_OUTPUT" | jq '[.[] | select(.properties.language!="$LANGUAGE_TO_KEEP")] | length')
|
UNDESIRED_TRACK_COUNT=$(echo "$JSON_OUTPUT" | jq '[.[] | select(.properties.language!="$LANGUAGE_TO_KEEP")] | length')
|
||||||
[[ $UNDESIRED_TRACK_COUNT -lt 2 ]] && echo -e "\tFile has only '$LANGUAGE_TO_KEEP' tracks, skipping." && exit 1
|
[[ $TRACK_COUNT -lt 2 ]] && echo -e "\tFile has only '$LANGUAGE_TO_KEEP' tracks, skipping." && exit 1
|
||||||
FILENAME_EXT=${FILENAME##*.}
|
FILENAME_WITHOUT_EXT=${FILENAME%.*}
|
||||||
echo -e "\tRemoving all audio tracks except '$LANGUAGE_TO_KEEP' tracks..."
|
echo -e "\tRemoving all audio tracks except '$LANGUAGE_TO_KEEP' tracks..."
|
||||||
TMPFILE=$(mktemp)
|
pv "$FILENAME" | ffmpeg -i pipe:0 -map 0:v -map 0:a:m:language:${LANGUAGE_TO_KEEP} -map 0:s -c copy -v warning "${FILENAME_WITHOUT_EXT}.converted.mkv"
|
||||||
echo -e "\tOutputting to temporary file ${TMPFILE}.${FILENAME_EXT}..."
|
|
||||||
pv "$FILENAME" | ffmpeg -i pipe:0 -map 0:v -map 0:a:m:language:${LANGUAGE_TO_KEEP} -map 0:s -c copy -v error "${TMPFILE}.${FILENAME_EXT}"
|
|
||||||
echo -e "\tReplacing ${FILENAME} with ${TMPFILE}..."
|
|
||||||
mv "${TMPFILE}.${FILENAME_EXT}" "$FILENAME"
|
|
||||||
|
|
Loading…
Reference in New Issue