You are not logged in.

#1 2009-04-22 13:07:32

btgo
Member
Registered: 2008-01-15
Posts: 7

problem with grep and awk...

mplayer -nosound -vo null -frames 1 movie.avi

My last serveral line of output is:
VDec: vo config request - 720 x 540 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [null] 720x540 => 720x540 Planar YV12
V:   0.1   3/  3 ??% ??% ??,?% 0 0

mplayer -nosound -vo null -frames 1 movie.avi 2>1 | grep 'vo config' | awk '{print $0}'

My output is:
VDec: vo config request - 720 x 540 (preferred colorspace: Planar YV12)

mplayer -nosound -vo null -frames 1 movie.avi 2>1 | grep 'vo config' | awk '{print $1 $2 $3 $4 $5 $6 $7 $8 $9}'

My output is:
V:0.01/1??%??%??,?%00

Apparently awk weren't processing the line greped by grep,  Instead, awk was processing the line grep didn't pipe to awk, can anyone tell me why it is?  thanks

Last edited by btgo (2009-04-22 13:08:10)

Offline

#2 2009-04-22 13:12:21

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: problem with grep and awk...

2>1 ==> 2>&1

$ mplayer -nosound -vo null -frames 1 movie.avi 2>&1 | grep 'vo config' | awk '{print $1 $2 $3 $4 $5 $6 $7 $8 $9}'
VDec:voconfigrequest-720x480(preferred

Offline

#3 2009-04-22 14:24:29

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: problem with grep and awk...

And why use grep?

mplayer -nosound -vo null -frames 1 movie.avi 2>&1 | awk '/vo config/ {print $1 $2 $3 $4 $5 $6 $7 $8 $9}'

is more efficient wink


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

Board footer

Powered by FluxBB