LINUX.ORG.RU

История изменений

Исправление Im_not_a_robot, (текущая версия) :

!#/bin/sh

SAVEIFS=$IFS
IFS=$(echo -en "\n\b")

for i in $(cat TheWall.list); do 
    ffmpeg -i Music/TheWall/Pink\ Floyd\ -\ 1979\ -\ The\ Wall\ \(24bit-96kHz\)/Disc\ 1/$i.flac -ab 320k -map_metadata 0 -id3v2_version 3 mp3/The_Wall/$i.mp3; 

ffmpeg -i "$FILEPATH" -strict experimental "$DIR/${BASE}.mp4"

done

IFS=$SAVEIFS

Ну короч у меня есть похожий скрипт для Наутилуса, может приспособишь его для себя:

$ cat Convert\ to\ MP4 
#!/bin/sh
# Convert any type of video file to mp4.

# changing delimeter of bash globbing to \n
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")

for FILEPATH in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
    # get file extension
    EXT=$(echo "$FILEPATH" | sed 's/^.*\.\([^.]*\)$/\1/')

    # get filename without extension
    BASE=$(basename --suffix=".$EXT" "$FILEPATH")

    DIR=$(dirname "$FILEPATH")

    ffmpeg -i "$FILEPATH" -strict experimental "$DIR/${BASE}.mp4"

    if [ $? -eq 0 ]; then
        notify-send "'$BASE.$EXT' convert to mp4" "<b>OK</b>"
    else
        notify-send "'$BASE.$EXT' convert to mp4" "<b>FAIL</b>"
    fi
done

# go back to normal bash delimiter (space)
IFS=$SAVEIFS

Исходная версия Im_not_a_robot, :

!#/bin/sh

SAVEIFS=$IFS
IFS=$(echo -en "\n\b")

for i in $(cat TheWall.list); do 
    ffmpeg -i Music/TheWall/Pink\ Floyd\ -\ 1979\ -\ The\ Wall\ \(24bit-96kHz\)/Disc\ 1/$i.flac -ab 320k -map_metadata 0 -id3v2_version 3 mp3/The_Wall/$i.mp3; 
done

IFS=$SAVEIFS