Aller au contenu

Conversion .FLAC to .MP3 en script

Featured Replies

Posté(e)

Bonjour à vous,

 

Je voudrais lancer, en tâche plannifliée, un script pour convertir des *.flac en .mp3

 

J'ai ce script mais cela ne fait rien.

Où est mon erreur ?

 

Bonne soirée

 

 

#!/bin/bash

# Dossier source (et de destination)
dossier="/volume1/TESTS/FLAC"
ffmpeg_path="/var/packages/ffmpeg/target/bin/ffmpeg"  # Adaptez ce chemin

# Créer un fichier log
log_file="conversion.log"

find "$dossier" -name "*.flac" -print0 | while IFS= read -r -d '' fichier; do
    echo "$(date) : Traitement de $fichier" >> "$log_file"
    fichier_mp3="${fichier%.*}.mp3"

    "$ffmpeg_path" -i "$fichier" -ab 320k -y "$fichier_mp3" 2>&1 | tee -a "$log_file"
    if [ $? -ne 0 ]; then
        echo "$(date) : Erreur lors de la conversion de $fichier" >> "$log_file"
    else
        rm "$fichier"
    fi
done

 

Rejoindre la conversation

Vous pouvez publier maintenant et vous inscrire plus tard. Si vous avez un compte, connectez-vous maintenant pour publier avec votre compte.

Invité
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Répondre à ce sujet…

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.