Ffmpeg Watch-Folder PDF
Ffmpeg Watch-Folder PDF
iwatch -d -f /etc/iwatch/iwatch_encoder.xml
<config>
<guard email="root@localhost" name="IWatch"/>
<watchlist>
<title>Neue Video-Daten erhalten. Encoding starten.</title>
<contactpoint email="[email protected]" name="Administrator"/>
<path type="recursive" alert="off" exec="find %f -iname '*.mp4' -execdir /data/upload/
</watchlist>
</config>
f=$(basename "$1")
if ! [ -f "/data/streamfiles/$f" ]; then
ffmpeg -i "$1" -vcodec libx264 -b:v 1000k -ab 96k -ar 48k -f mp4 -strict experimental "/
fi
if ! [ -f "/data/streamfiles/128_$f" ]; then
ffmpeg -i "$1" -vcodec libx264 -b:v 250k -ab 96k -ar 48k -f mp4 -strict experimental "/d
fi
if ! [ -f "/data/streamfiles/250_$f" ]; then
ffmpeg -i "$1" -vcodec libx264 -b:v 500k -ab 96k -ar 48k -f mp4 -strict experimental "/d
fi
f=$(basename "$1") - Take the first parameter and strip it of its path. This gets you the
bare filename (my_uploaded_file.mp4 instead of
/data/uploaded/subfolder/my_uploaded_file.mp4)
if ! [ -f "/data/streamfiles/$f" ]; then - If the file doesnt exist at the
target destination run the following command
ffmpeg -i "$1" -vcodec libx264 -b:v 1000k -ab 96k -ar 48k -f mp4
-strict experimental "/data/streamfiles/$f" - This is a bunch of ffmpeg
gibberish, also outside of the scope of this post. Ffmpeg seems overwhelming at first but is quite
well documented.