venerdì 15 luglio 2011

Recording streams with VLC and cron

Here a quick and dirty shell script that can be crontabbed to download your favorite streams from the web via VLC


#!/bin/bash
# arguments "Name_of_file" "stream_uri" "duration_in_minutes"

FILE="/tmp/$1_$(date +%F_%H:%M).avi"
vlc -I dummy --sout file/avi:$FILE $2 &
PID=$!
echo "kill -STOP $PID" | at now + $3 minutes


The stream will be saved in /tmp/ with the name provided and a timestamp.

Nessun commento:

Posta un commento