[MPlayer-users] Parsing mplayer output

Yan Seiner yan at seiner.com
Tue Jan 19 17:25:51 CET 2010


I've got a semi-automatic script that helps me with mencoder.  It's based
on zenity, a sort of x-dialog clone.

I've been struggling with getting the output of mencoder to make sense to
zenity.

Basically, mencoder outputs a status line about 10 times / sec.  Those
lines are separated by a \r, so they overwrite on the screen.

Ideally I'd like to filter this two ways:

1.  1 status line posted every minute, to show it's still alive.
2.  A status line posted for every 'Skipping frame' or 'Duplicate frame'
message.

I've been struggling with this and I can't get it to work; something
always screws up.

No combination of

mencoder ... 2>&1 | tr '\r' '\n' | grep -v '^Pos'
or
mencoder ... 2>&1 | sed -e s/\r/\n\r/g | grep -v '^Pos'

seems to do the trick.




-- 
If you have eight hours to chop down a tree
spend six sharpening your axe.
--Abraham Lincoln



More information about the MPlayer-users mailing list