Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
# Batch Convert Script by StevenTrux
# The Purpose of this Script is to batch convert any video file to mp4 or mkv format for chromecast compatibility
# this script only convert necessary tracks if the video is already
# in H.264 format it won't convert it saving your time!
# Put all video files need to be converted in a folder!
# the name of files must not have " " Space!
# Rename the File if contain space
type mogrify >/dev/null 2>&1 || { echo >&2 "» This script requires mogrify. Please install ImageMagick first!"; exit 1; }
IOS_IMAGE_PATH="$1"
OUTPUT_PATH="$2"
mkdir -p $OUTPUT_PATH/res/drawable-hdpi $OUTPUT_PATH/res/drawable-mdpi $OUTPUT_PATH/res/drawable-xhdpi
echo " » Copy all resources to MDPI, this is"
echo " the same density as a non-retina iOS device"
find "${IOS_IMAGE_PATH}"/* -type f -exec cp {} ${OUTPUT_PATH}/res/drawable-mdpi/ \;