diff --git a/ffmpegauto/ffmpegauto b/ffmpegauto/ffmpegauto new file mode 100755 index 0000000..8a28457 --- /dev/null +++ b/ffmpegauto/ffmpegauto @@ -0,0 +1,45 @@ +#!/bin/bash + +help() +{ + echo "Usage: ffmpegauto [ -h | duration targetdirectory ]" +} + +capture() +{ + local duration="$1" + local targetDirectory="$2" + + duration="$1" + targetDirectory="$2" + + currentDate="$(date '+%Y-%m-%d-%Hh%M')" + + echo "============ $(date) ============" + + echo "Capture launching…" + ffmpeg -loglevel error -i https://icecast.libre-a-toi.org:8444/voixdulat_ogg -t "$duration" -c copy "$targetDirectory/output-$currentDate-bis.ogg" + #ffmpeg -i "$targetDirectory/output-$currentDate.ogg" "$targetDirectory/output-$currentDate.mp3" +} + + +# +case $# in + 1) + if [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then + help + else + capture "$1" "." + fi + ;; + + 2) capture "$1" "$2" + ;; + + *) echo "Invalid parameter count." + help + ;; +esac + + + diff --git a/ffmpegauto/readme b/ffmpegauto/readme new file mode 100644 index 0000000..c0242e3 --- /dev/null +++ b/ffmpegauto/readme @@ -0,0 +1,4 @@ +The script wgetauto generates a multi-channel file. Not ffmpegauto. + +Example of cron line: +25 15 * * 2 /home/cpm/Libreàvous/ffmpegauto 6300 /home/cpm/Libreàvous/ >> /home/cpm/Libreàvous/cron.log 2>&1 diff --git a/wgetauto/readme b/wgetauto/readme index fd08c7a..46584e1 100644 --- a/wgetauto/readme +++ b/wgetauto/readme @@ -1,5 +1,5 @@ Example of cron line: -25 15 * * 2 /home/cpm/Libreàvous/wgetauto 6300 /home/cpm/Libreàvous/ >> /home/cpm/Libreàvous/cronlog 2>&1 +25 15 * * 2 /home/cpm/Libreàvous/wgetauto 6300 /home/cpm/Libreàvous/ >> /home/cpm/Libreàvous/cron.log 2>&1 Another way using ffmpeg: ffmpeg -i https://icecast.libre-a-toi.org:8444/voixdulat_ogg -t 5420 -c copy foo.ogg