mirror of
https://github.com/tanrax/bash-folders.git
synced 2024-11-14 14:35:42 +01:00
Update video
This commit is contained in:
parent
164fa3c3cf
commit
02a0ee63eb
@ -1,9 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
#sudo apt install inotify-tools ffmpeg
|
||||
# @reboot /ruta/a/tu/script.sh >/dev/null 2>&1 &
|
||||
# Requirements: sudo apt install inotify-tools ffmpeg
|
||||
# Enable, cron: @reboot /path/script.sh >/dev/null 2>&1 &
|
||||
# Carpeta de destino
|
||||
WATCH_FOLDER="/ruta/a/la/carpeta"
|
||||
WATCH_FOLDER=$argv[1]
|
||||
|
||||
# Extensiones a monitorear
|
||||
EXTENSIONS=("mkv" "mp4" "avi" "mov")
|
||||
@ -18,9 +18,10 @@ while read filename; do
|
||||
if [[ " ${EXTENSIONS[@]} " =~ " ${extension} " ]]; then
|
||||
# Verifica si el nombre del archivo comienza con "optimized"
|
||||
if [[ "$filename" != optimized* ]]; then
|
||||
notify-send "Archivo detectado: $filename. Iniciando conversión..."
|
||||
# Convierte el archivo a formato MP4
|
||||
ffmpeg -i "$WATCH_FOLDER/$filename" -codec:v libx264 -preset slow -crf 18 -codec:a copy "$WATCH_FOLDER/${filename%.*}.mp4"
|
||||
echo "Archivo convertido: ${filename%.*}.mp4"
|
||||
ffmpeg -i "$WATCH_FOLDER/$filename" -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest "$WATCH_FOLDER/optimized_${filename%.*}.mp4"
|
||||
notify-send "Archivo convertido: optimized_${filename%.*}.mp4"
|
||||
else
|
||||
echo "Archivo ignorado: $filename"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user