Hey all, I have a question for learning purposes. I have a live band DVD that I have ripped into multiple VOB files per song/chapter on the DVD. I would like to cut these to ogg audio. So far I was going to do this:
Code:
for i in track*.vob; do mplayer -ao pcm:file=$i.wav -vo null $i && oggenc -q9 $i.wav && rm $i.wav
This uses mplayer to cut the raw audio to a wav file and then it encodes them as ogg and deletes them. However, what if I wanted to do it so that if mplayer exits successfully, then it cuts a child process to do the encoding and deleting on its own while it goes on to the next file? My question is really how to cut child processes in this environment properly. I was thinking about
:
Code:
for i in track*.vob; do mplayer -ao pcm:file=$i.wav -vo null $i && (oggenc -q9 $i.wav && rm $i.wav) &; done
But the problem here is that I want the entire oggenc/rm part to be its own child process (i.e. rm waits until oggenc successfully finishes), and the child process itself to also only launch if mplayer exits status 0 (successful). Anyone have some insight on how to do this?