Created
April 26, 2013 22:25
-
-
Save theapi/5470861 to your computer and use it in GitHub Desktop.
Watch the samba share for new videos with the .264 extension then mux them into a .mkv file playable by video players.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# apt-get install inotify-tools | |
# apt-get install mkvtoolnix | |
WATCHED_DIR="/mnt/sda1/cctv/videos" | |
echo "Watching directory: $WATCHED_DIR for new files" | |
inotifywait -m -q -e create -r "$WATCHED_DIR" --format "%w%f" | | |
while read file | |
do | |
case $file in | |
*264) | |
videoin="$file" | |
videoout="$file".mkv | |
mkvmerge -o $videoout --forced-track 0:no -d 0 -A -S -T --no-global-tags --no-chapters $videoin --track-order 0:0 | |
rm $file | |
;; | |
*) # do nothing | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment