I am sorry for necroing this thread, but I found it while searching for a very similar problem and in case someone else finds this after me I want to provide an even better answer.
( cmd | sed 's|out|OUT|g' ) 3>&1 1>&2 2>&3 | sed 's|err|ERR|g'
is really all you need, the swapping at the end is superfluous, because nothing is done with it after the second sed and the descriptors get reset to their previous state automatically.
Now to the better solution:
cmd 1> >(sed 's|out|OUT|g') 2> >(sed 's|err|ERR|g')
It's that simple
As a little extra *g*, you can use this to play all files found under the current directory with mplayer without losing control (because /dev/stdin doesn't get redirected from /dev/null) and without using a pipe made by mkfifo:
(xargs -a /proc/self/fd/3 -0 mplayer -vo null -shuffle) 3< <(find -type f -print0)
my source: h++p://stupefydeveloper.blogspot.de/2008/10/bash-file-descriptors_20.html
I hope this necro was not too annoying and instead relevant and "timely" enough