Consider the following, if you dare: > ffmpeg -f concat -safe 0 -i <(find . -iname '*.flac' -and -type f -print0 | parallel --null printf '"file %q"' '{=1 my $pwd=qx(pwd); $pwd =~ s/^\s+|\s+$//g; $_=($pwd . "/" . q()) =}{1}' \&\& echo) -b:a 128k -c:a aac -y o.aac 1. > find . -iname '*.flac' -and -type f -print0 Finds all files in the current directory and its subdirectories with a case-insensitive file extension .flac. It prints the results separated by a null character (ASCII 0). 2. > parallel --null printf '"file %q"' '{=1 my $pwd=qx(pwd); $pwd =~ s/^\s+|\s+$//g; $_=($pwd . "/" . q()) =}{1}' \&\& echo GNU parallel reads the null-separated input from the find command and processes them in parallel. For each input file, it does the following: 3. a. > `{=1 my $pwd=qx(pwd); $pwd =~ s/^\s+|\s+$//g; $_=($pwd . "/" . q()) =}` Gets the current working directory and removes any leading or trailing whitespace. It then concatenates the current directory path with the input file name. b. > `printf '"file %q"' This part formats the output, escaping any special characters in the filename, and prefixing it with "file ". c. > \&\& echo Just adds \n to all lines. 4. > ffmpeg -f concat -safe 0 -i <(...) -b:a 128k -c:a aac -y o.aac Finally, ffmpeg reads the list of escaped file paths (generated @ №2) using process substitution <(...). The concat demuxer is used to concatenate the input files, -safe0 is specified to allow unsafe file paths, and the output is encoded with an AAC codec at 128 kbps bitrate, overwriting the output file o.aac if it exists. Or, ffmpeg *should* do that. It can't: > [concat @ 0x559da1fd1cc0] Impossible to open '/home/fred/Workspace/gcloud-synthesize-voice/./[af-ZA] Ek hoop dit is nie die geval nie.$\nHoop in die een hand en kak in die ander..flac' > /proc/self/fd/11: No such file or directory I should not have to rename my files, ffmpeg is what's broken here. The raw output being: > fred@デブ狸~/Workspace/gcloud-synthesize-voice% find . -iname '*.flac' -and -type f -print0 | parallel --null printf '"file %q"' '{=1 my $pwd=qx(pwd); $pwd =~ s/^\s+|\s+$//g; $_=($pwd . "/" . q()) =}{1}' \&\& echo > file /home/fred/Workspace/gcloud-synthesize-voice/./\[af-ZA\]\ Ek\ hoop\ dit\ is\ nie\ die\ geval\ nie.$'\n'Hoop\ in\ die\ een\ hand\ en\ kak\ in\ die\ ander..flac > file /home/fred/Workspace/gcloud-synthesize-voice/./\[ar-XA\]\ آمل\ أن\ لا\ يكون\ الأمر\ كذلك.$'\n'املئ\ يدك\ الواحدة\ بالأمل\ والأخرى\ بالسوء..flac > file /home/fred/Workspace/gcloud-synthesize-voice/./\[bg-BG\]\ Надявам\ се,\ че\ това\ не\ е\ така.$'\n'Надявай\ се\ в\ едната\ ръка\ и\ срах\ в\ другата..flac > file /home/fred/Workspace/gcloud-synthesize-voice/./\[bn-IN\]\ আমি\ আশা\ করি\ এটা\ সত্যি\ না।$'\n'একটা\ হাতে\ আশা\ আর\ অপরে\ বিষম\ চিন্তা।.flac > file /home/fred/Workspace/gcloud-synthesize-voice/./\[ca-ES\]\ Espero\ que\ no\ sigui\ el\ cas.$'\n'Esperança\ a\ una\ mà\ i\ merda\ a\ l\'altra..flac > file /home/fred/Workspace/gcloud-synthesize-voice/./\[cmn-CN\]\ 我希望不是这样。$'\n'一手抓希望,一手抓屎。.flac > file /home/fred/Workspace/gcloud-synthesize-voice/./\[cmn-TW\]\ 我希望不是這樣。$'\n'一手抓希望,一手抓屎。.flac > file /home/fred/Workspace/gcloud-synthesize-voice/./\[cs-CZ\]\ Doufám,\ že\ to\ není\ pravda.$'\n'Nadej\ se\ v\ jedné\ ruce\ a\ hovno\ v\ druhé..flac And so on. This is surely a bug, right? (Unfortunately GNU Parallel's weird NUL handling does not help clarify the question, but xargs mangles things worse.) -- ------------------------------------------------------------------------ Best, Fred Brennan [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] GnuPG: |98F2 8F76 7470 129F BE3B 054C E215 4DD1 A1C7 7B8B| Twitter: @fr_brennan Personal website