I have a couple Dolphin service menus for file conversions using ffmpeg. For the life of me I cannot figure out how to not retain the original file extension.
For example: converting "MySong.m4a" to mp3 results in "MySong.m4a.mp3". Obviously I want "MySong.mp3"
The functional part looks like this currently: ffmpeg -i %u -y %u.mp3
I've tried this, but the conversion fails: ffmpeg -i %u -y $(basename %u | sed 's/\(.*\)\..*/\1/').mp3
I've also tried using a variable like this: fn=$(basename %u | sed 's/\(.*\)\..*/\1/'); ffmpeg -i %u -y "$fn" | sed 's/\(.*\)\..*/\1/').mp3 but that just spits out an error message:
For example: converting "MySong.m4a" to mp3 results in "MySong.m4a.mp3". Obviously I want "MySong.mp3"
The functional part looks like this currently: ffmpeg -i %u -y %u.mp3
I've tried this, but the conversion fails: ffmpeg -i %u -y $(basename %u | sed 's/\(.*\)\..*/\1/').mp3
I've also tried using a variable like this: fn=$(basename %u | sed 's/\(.*\)\..*/\1/'); ffmpeg -i %u -y "$fn" | sed 's/\(.*\)\..*/\1/').mp3 but that just spits out an error message:
Code:
Syntax error in command dbusRef=$(kdialog --title="Conversion ffmpeg" --progressbar " Converting $(basename %f) " 0); fn=$(basename %u | sed 's/\.*\\.*/\/'); ffmpeg -i %u -y "$fn" | sed 's/\.*\\.*/\/').mp3; qdbus $dbusRef close; kdialog --title "Conversion complete" --passivepopup "$(basename %f) converted to MP3."; coming from
Comment