Always try ffmpeg on unknown filetypes

This commit is contained in:
Vincent Riquer 2016-09-01 18:44:02 +02:00
parent 5977629cab
commit b4afedb70f
6 changed files with 47 additions and 3 deletions

View File

@ -1,4 +1,5 @@
#!/bin/bash
declare soxtaskid
decodeFile() {
case "$mimetype" in
'video/'*)
@ -77,7 +78,23 @@ decodeFile() {
fi
;;
*)
if (( disablevideo ))
then
decodeSox
else
extractAudio
if (( ${destinationnormalize["$destination"]}))\
|| (
[ -n "${destinationfrequency["$destination"]}" ]\
&& (( ${rate:-0} != ${destinationfrequency["$destination"]}))\
) || (
[ -n "${destinationchannels["$destination"]}" ]\
&& (( ${channels:-0} != ${destinationchannels["$destination"]} ))
)
then
sox_needed=1
fi
fi
;;
esac
;;

View File

@ -75,4 +75,5 @@ encodeFile::mp3() {
EOInsert
)
progressSpin
soxtaskid=''
}

View File

@ -43,4 +43,5 @@ encodeFile::opus() {
EOInsert
)
progressSpin
soxtaskid=''
}

View File

@ -39,4 +39,5 @@ encodeFile::vorbis() {
EOInsert
)
progressSpin
soxtaskid=''
}

View File

@ -1,6 +1,6 @@
#!/bin/bash
extractAudio() {
tmpfile="${fileid}ffmpeg"
tmpfile="${fileid}ffmpeg.wav"
commandline=(${ionice}ffmpeg -v 0 -vn -y)
commandline+=(-i "$sourcepath/$filename" "$tempdir/$tmpfile.wav")
commandline+=(-i "$sourcepath/$filename" "$tempdir/$tmpfile")
}

View File

@ -93,6 +93,30 @@ master() {
then
sleep 0.1
continue
elif (( active == 0 && ready == 0 ))
then
dumpfile=tasks-$(date +%Y%m%d%H%M%S).csv
cat <<-EOF
$remaining TASKS LEFT, NONE READY!
Something went wrong, dumping tasks table to $dumpfile
EOF
cat >&3 <<-EOSQL
.mode csv
.headers on
.output $dumpfile
SELECT * from tasks;
.mode list
.headers off
.output stdout
EOSQL
closeDatabase
echo "Waiting for children to come back home..."
wait
echo $'\nGood luck!'
exit 1
elif (( ready == 0 ))
then
sleep 0.1