[MPlayer-users] Scripting and cropdetect

Carl Fûrstenberg azatoth at gmail.com
Thu Sep 2 18:07:41 CEST 2004


ok, I men -r :)

but I have a possible solution to '2':
"mplayer dvd://1 -vo null -nosound -vf cropdetect -ss 300 -frames 4
2>&1 | grep "crop area" | perl -e 'while (<STDIN>) {$_ =~ 
s/^.*?\((.*?)\)/$1/g; print $_}'"
On Thu, 02 Sep 2004 17:34:48 +0200, JiHO <jo.irisson at noos.fr> wrote:
> Hi all,
> 
> I previously mentionned on this list (a long time ago... thread:
> "Encoding problems / tips needed") that I wanted to scrip the DVD
> encoding process.
> At this stage I am trying to automate the crop detection procedure (I
> know this is controversial and has been discutted previously,
> nevertheless I want to automate this). My problem is with getting the
> result of -vf cropdetect. Indeed let us put the interesting lines in a file:
>    mplayer dvd://1 -vo null -nosound -vf cropdetect -ss 300 -frames 4
> 2>&1 | grep "crop area" > file
> 
> then if I do:
>    cat file
> I obtain:
> crop area: X: 9..716  Y: 75..501  (-vf crop=706:426:10:76)
> crop area: X: 9..716  Y: 75..501  (-vf crop=706:426:10:76)
> which seems interesting
> 
> but if I do:
>    less file
> I obtain:
> V:   0,0    1   0%  0%  0,0% 0 0 0%^MV:   0,1    2   0%  0%  0,0% 0 0
> 0%^MV:   0
> ,2    3   0%  0%  0,0% 0 0 0%^Mcrop area: X: 9..716  Y: 75..501  (-vf
> crop=706:4
> 26:10:76)
> V:   0,2    4   0%  0%  0,0% 0 0 0%^Mcrop area: X: 9..716  Y: 75..501
> (-vf crop
> =706:426:10:76)
> 
> question 1/ why this difference?
> 
> then if I try to extract the information with awk:
> cat file | awk '/crop area/ {print $8}'
> I get
> 0
> 0
> which corresponds to the 8th position in the output of "less file"...
> The result is the same if I use variables and not files to store
> mplayer's ouput.
> 
> question 2/ I'm lost!!! help!!! can some people who have this procedure
> automated help me please?
> 
> thanks for any help.
> --
> JiHO
> ---
>    Windows, c'est un peu comme le beaujolais nouveau :
> à chaque nouvelle cuvée on sait que ce sera dégueulasse,
>      mais on en prend quand même, par masochisme.
> ---
> http://www.irisson.fr.st
> 
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-users
>




More information about the MPlayer-users mailing list