Post AYOd0t60jNBbSC3f60 by thisisthebreath@noagendasocial.com
 (DIR) More posts by thisisthebreath@noagendasocial.com
 (DIR) Post #AYObnDPGJugIRAymgq by thisisthebreath@noagendasocial.com
       2023-08-04T18:50:45Z
       
       0 likes, 0 repeats
       
       dudes named ben i need some help passing filenames with spaces in bashcommand is:for file in *.flac; do ffmpeg -i $file -q:a 0 ${file%flac}.mp3; doneit chokes on files with spaces
       
 (DIR) Post #AYOc3CVDRtHKGcO23U by joel@noagendasocial.com
       2023-08-04T18:53:38Z
       
       0 likes, 0 repeats
       
       @thisisthebreath sets of double quotes around each of your two $ parameters should do the job
       
 (DIR) Post #AYOcVgvru9vMkgRFmS by mhjohnson@noagendasocial.com
       2023-08-04T18:58:47Z
       
       0 likes, 0 repeats
       
       @thisisthebreath Yeah - a few methods described in this page using the find commandhttps://www.baeldung.com/linux/iterate-files-with-spaces-in-namesThis page suggests defining $IFS (as well as a few other methods)https://www.cyberciti.biz/tips/handling-filenames-with-spaces-in-bash.htmlPlenty of options available.
       
 (DIR) Post #AYOd0rcYDQ1isXGcXQ by joel@noagendasocial.com
       2023-08-04T18:55:41Z
       
       0 likes, 0 repeats
       
       @thisisthebreath Like this:for file in *.flac; do ffmpeg -i "$file" \-q:a 0 "${file%flac}.mp3"; doneI broke it into two lines for clarity.
       
 (DIR) Post #AYOd0sMHTObfAMf8oi by joel@noagendasocial.com
       2023-08-04T18:58:05Z
       
       0 likes, 0 repeats
       
       @thisisthebreath just noticed, leave out the extra . Before mp3 or you'll get two periods in the output file names.
       
 (DIR) Post #AYOd0t60jNBbSC3f60 by thisisthebreath@noagendasocial.com
       2023-08-04T19:04:25Z
       
       0 likes, 0 repeats
       
       @joel i mistyped it, was {file%.flac} inside the {}
       
 (DIR) Post #AYOiLZCyMqgVcoziL2 by thisisthebreath@noagendasocial.com
       2023-08-04T20:04:12Z
       
       0 likes, 0 repeats
       
       @joel ok im learning. my next project is to re-encode flac files into a subdirectory (as ffmpeg wont overwrite) which works withany way to make find work recursvely? theres this but i was hoping for  singe line commandhttps://superuser.com/questions/1532996/use-find-command-for-recursive-conversion-using-ffmpeg
       
 (DIR) Post #AYOyZMOoO1mVDf8BtI by joel@noagendasocial.com
       2023-08-04T23:05:58Z
       
       0 likes, 0 repeats
       
       @thisisthebreathchange "DESTDIR" to a full path to the base directory where your files will go:find -type f -name \*.flac -exec bash -c 'i="{}"; o="/DESTDIR/${i%flac}mp3"; [[ -d "${o%/*}" ]] || mkdir -p "${o%/*}"; ffmpeg -i "$i" -q:a 0 "${o}"' \;
       
 (DIR) Post #AYY4nbfwjaJqnexfkm by thisisthebreath@noagendasocial.com
       2023-08-09T08:28:10Z
       
       0 likes, 0 repeats
       
       @joel just saw this, i'm learning a lot, thanks!!!!
       
 (DIR) Post #AYYBCofQAVpc3b7UWG by thisisthebreath@noagendasocial.com
       2023-08-09T09:39:57Z
       
       0 likes, 0 repeats
       
       @joel 1/2 ok im stuck again! this script can derive mp3s to a new directory and the -vn strips album art (a lot of the source files have oversized .jpgs and ffmpeg makes them bigger .pngs in the mp3. in a perfect world i would have it map foldersm.jpg from the same directory to the metadatafind -type f -name \*.flac -exec bash -c 'i="{}"; o="/full/path/to/new/dir/${i%flac}mp3"; [[ -d "${o%/*}" ]] || mkdir -p "${o%/*}"; ffmpeg -i "$i" -q:a 0 -vn "${o}"' \;
       
 (DIR) Post #AYYCCmqb2BcUMptfLE by thisisthebreath@noagendasocial.com
       2023-08-09T09:51:09Z
       
       0 likes, 0 repeats
       
       @joel 2/2 pursuant to this request, ffmpeg has this command to resize jpgshttps://stackoverflow.com/questions/28806816/use-ffmpeg-to-resize-imagein a perfect world i would have it extract the (typically 1600x1600 ~1.5MB) embedded artwork, resize it to a 400x400 jpg (typ 150KB), then append that to the mp3s. absent the -vn switch in the command in the preceding posts, it copies all metadata straight across. ive tried inserting -i /absolute/path/to/foldersm.jpg after -i "$i" ut t doesnt like it - says it cant open it
       
 (DIR) Post #AYaUddMKbd3QFZbzWa by thisisthebreath@noagendasocial.com
       2023-08-10T12:27:07Z
       
       0 likes, 0 repeats
       
       @joel 1/2 ok im really close. i found a python script that can recursively strip album art and padding from flacs, and i know how to resize album art using
       
 (DIR) Post #AYaV5oppX5gfwxqiY4 by thisisthebreath@noagendasocial.com
       2023-08-10T12:32:13Z
       
       0 likes, 0 repeats
       
       @joel 1/2 ok im really close. i found a py script that can recursively strip album art and padding from flacs and dump the large album art in the folder and i know how to resize album art to a second smaller file using ffmpeg and should be able to figure that out recursively. but im stuck here. This command copies the flac audio stream and embeds the small art. should work recursively and duplicate the 'stripped' dirs to new 'tagged' dirs. but i cant find foldersm.jpg without an absolute path
       
 (DIR) Post #AYaVy5Aj0ZEOFvUu9o by thisisthebreath@noagendasocial.com
       2023-08-10T12:42:01Z
       
       0 likes, 0 repeats
       
       @joel 2/2 find -type f -name \*.flac -exec bash -c 'i="{}"; o="/full/path/to/folder/tagged/${i}"; [[ -d "${o%/*}" ]] || mkdir -p "${o%/*}"; ffmpeg -i "$i" -i /need/full/path/to/foldersm.jpg -map a -map 1:v -disposition:v attached_pic -metadata:s:v comment="Cover (Front)" -codec copy "${o}"' \;1. how do i parse path to folder.jpg? or copy the absolute path from the arguments?2. how do i append " - FLAC16" to the end of the new tagged directories? ${i - FLAC16}" and ${i} - FLAC16" both fail
       
 (DIR) Post #AYaWkPw96lKmYaj51M by thisisthebreath@noagendasocial.com
       2023-08-10T12:50:44Z
       
       0 likes, 0 repeats
       
       @joel in other word i want to append the particular foldersm.jpg in each folder to the files in said folder.