Linux automated media files transcoding

automationlinuxmediaservicetranscoding

I'm looking for software that would help to implement above described scenario. By automation i mean minimization of actions needed for that process. For example, it would be nice to run some daemon that will constantly look to some folders and convert videos with specific settings as soon as they appear there. Both input and output folders could be shared over network and be very convenient. Handbrake-CLI + inotify + some other custom (cron?) scripts may be a solution, but maybe somewhere exist a solution with such out-of-the-box functionality?

Best Answer

Handbrake-CLI and inoticoming should be all you need. You'd run inoticoming something like:

inoticoming /my/drop/folder /my/script {} \;

The script would follow the general pattern of:

#!/bin/bash
OUTDIR="/my/output/folder"
INPUT_FILE="${1}"
OUTPUT_FILE="${OUTDIR}/`basename \"${INPUT_FILE}\"`.mkv"
HANDBRAKE_OPIONS="-q 20 --keep-display-aspect"

# Wait for file to be closed
do    
    lsof -n "${INPUT_FILE}" >/dev/null 2>/dev/null
    FILE_STATUS=${?}
    sleep 5
while [ ${FILE_STATUS} -eq 0 ];

# Process the file
HandBrakeCLI ${HANDBRAKE_OPTIONS} -i "${INPUT_FILE}" -o "${OUTPUT_FILE}"

Note that I haven't tested this, so it may require a little bit of tweaking.


If that particular model supports MKV then try that, otherwise I'm afraid I don't know. It would help people answer your question better if you tell us (edit the question) what the devices you're wanting to play the media on, and what other restrictions have have are.

Related Topic