Page 1 of 1

Batch transcode problem

Posted: 05 Dec 2016 13:17
by rmvb
Hi guys
I'm trying to adapt the wiki tutorial here for my need (batch convert flac to ogg) but I get either white space stripped out file names ... or new line in file names where white space were in input file name.
I tried basename with -a too, and/or -z (this last removes spaces)
The goal is to get
01 - Neal And Jack And Me.ogg
instead of
01?-?Neal?And?Jack?And?Me.ogg #or
01 - Neal And Jack And Me.flac.ogg #or
01-NealAndJackAndMe.ogg

Code: Select all

#!/bin/bash vcodec="VIDEO_CODEC" #acodec="AUDIO_CODEC" acodec="vorb" bitrate="VIDEO_BITRATE" #arate="AUDIO_BITRATE" arate="320" #ext="OUTPUT_EXT" ext="ogg" #mux="MUXER" mux="ogg" vlc="/usr/bin/vlc" #fmt="INPUT_EXT" fmt="flac" for i in *$fmt; do f="`basename -s .${fmt} ${i}`" echo -e $f #$vlc -I dummy -vvv "$i" --sout "#transcode{vcodec=$vcodec,vb=$bitrate,acodec=$acodec,ab=$arate,channels=6}:standard{mux=$mux,dst=\"$f.$ext\",access=file}" vlc://quit $vlc -I dummy -vvv "$i" --sout "#transcode{vcodec=none,acodec=$acodec,ab=$arate,channels=2,samplerate=48000}:standard{mux=$mux,dst=\"$f.$ext\",access=file{no-overwrite}}" vlc://quit #$vlc -I dummy -vvv "$i" --sout "#transcode{vcodec=none,acodec=$acodec,ab=$arate,channels=2,samplerate=48000}:standard{mux=$mux,dst=\"$f.$ext\",access=file}" vlc://quit done
Many thanks for help

Re: Batch transcode problem

Posted: 05 Dec 2016 19:14
by rmvb
f=${i%%.${fmt}}