Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have the following script to convert a big bunch of .MOD and .XM files into Wave format:

#!/bin/bash

for f in ./XM.* ./MOD.*
    do
    xmp $f -d wav -o - | ffmpeg -i - -acodec libmp3lame -ab 320k "$f.mp3"
done

But it doesn't work as expected. The program just hang up. It creates the .wav file but nothing more.(Doesn't write in it) Even the -vvv switch doesn't give any information. The strange thing is: if I prepend "strace", it's working fine.

Any ideas/workarounds?

share|improve this question
What if you lose the pipe and just write to a temp file and have ffmpeg encode that? – ckhan Nov 23 '12 at 8:15
The problem is, that xmp doesn't respond if it's called in a shell script at all. – Noir Nov 23 '12 at 8:56
Run the script with -x to display the actual commands on stderr (e.g. bash -x convert.sh or place set -x somewhere in the script before the call to xmp). Or just print the commands instead of executing them (you'll have to escape the | of course). Then try to run the printed commands directly and get back to us with the results. – peterph Nov 24 '12 at 21:21

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.