Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xargs: unterminated quote

Tags:

ffmpeg

xargs

mp3

I'm trying to convert some .flac files to .mp3, that can I import into iTunes. I tried with find, xargs and ffmpeg, but xargs give me a unterminated quote error (because I have quotes in filename).

That`s my command line:

MacKassner:Geto Boys kassner$ find . -type f | egrep "\.flac$" | xargs -I {} ffmpeg -i {} -ab 192k -acodec libmp3lame -ac 2 {}.mp3

It`s stop and raise an error in filename "Talkin' Loud Ain't Saying Nothin'.flac".

Some tricks to make this one work?

-- Solved with find only -- find . -type f -name "*.flac" -exec ffmpeg -i {} -ab 192k -acodec libmp3lame -ac 2 {}.mp3 \;

like image 779
Rafael Kassner Avatar asked Oct 21 '25 13:10

Rafael Kassner


1 Answers

Use GNU Parallel. It is specifically built for this purpose:

MacKassner:Geto Boys kassner$ find . -type f | egrep "\.flac$" | parallel ffmpeg -i {} -ab 192k -acodec libmp3lame -ac 2 {}.mp3

You may also want to use {.}.mp3 to get rid of the .flac:

MacKassner:Geto Boys kassner$ find . -type f | egrep "\.flac$" | parallel ffmpeg -i {} -ab 192k -acodec libmp3lame -ac 2 {.}.mp3

Watch the intro video to learn more: http://www.youtube.com/watch?v=OpaiGYxkSuQ

like image 69
Ole Tange Avatar answered Oct 23 '25 08:10

Ole Tange