1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/streama_ynh.git synced 2024-09-03 20:26:30 +02:00

Update convert.sh

This commit is contained in:
liberodark 2020-05-30 20:00:21 +02:00 committed by GitHub
parent 48ccee225d
commit 8090b572cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,7 @@
# Thanks :
# License: GNU GPLv3
version="0.2.2"
version="0.2.3"
echo "Welcome on Convert Movies Script $version"
@ -20,11 +20,12 @@ flock -n 9 || exit
usage ()
{
echo "usage: -ffmpeg or -avidemux or -mencoder"
echo "usage: -ffmpeg / -avidemux / -mencoder / -avconv"
echo "options:"
echo "-ffmpeg: Convert with ffmpeg"
echo "-avidemux: Convert with avidemux"
echo "-mencoder: Convert with mencoder
echo "-mencoder: Convert with mencoder"
echo "-avconv: Convert with avconv"
echo "-h: Show help"
}
@ -58,6 +59,15 @@ done < <(find /home/yunohost.app/streama/upload/ -name '*.mkv' -print0 -o -nam
chown -R streama:users /home/yunohost.app/streama/upload/
}
avconv_convert(){
while IFS= read -r -d '' file
do
avconv -i "$file" -codec copy "${file%.*}.mp4"
rm -f "$file"
done < <(find /home/yunohost.app/streama/upload/ -name '*.mkv' -print0 -o -name '*.avi' -print0)
chown -R streama:users /home/yunohost.app/streama/upload/
}
parse_args ()
{
while [ $# -ne 0 ]
@ -74,6 +84,9 @@ parse_args ()
-mencoder)
shift
mencoder_convert >&2
-avconv)
shift
avconv_convert >&2
-h|--help)
usage
exit 0