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:
parent
48ccee225d
commit
8090b572cf
1 changed files with 16 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue