Added ffmpegauto script (#5250).
This commit is contained in:
parent
d7995fae9d
commit
a6553eb3cb
45
ffmpegauto/ffmpegauto
Executable file
45
ffmpegauto/ffmpegauto
Executable file
@ -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
|
||||
|
||||
|
||||
|
4
ffmpegauto/readme
Normal file
4
ffmpegauto/readme
Normal file
@ -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
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user