Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 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.

share|improve this answer
    
Thanks for response, that may do the thing, but just found out that since 0.9.4 Handbrake ditched avi/xvid support that prohibits its usage (i'm transcoding media files to play on portable devices, such as Cowon players that doesn't support mp4 container). Any ideas for alternatives that will encode mp4 -> avi without much pain? –  Alcz May 31 '11 at 17:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.