Re: xvidtune in non-interactive mode
On Wed, Nov 28, 2001 at 10:53:24AM -0600, Steve Langasek wrote:
> Eric,
>
> On Wed, Nov 28, 2001 at 04:58:28PM +0100, Eric Van Buggenhaut wrote:
> > I'm currently trying to build a package (tempest) which needs to be passed the arguments
> > returned by xvidtune.
>
> > Basically, the command needs:
>
> > - pixelclock
> > - hdisplay
> > - vdisplay
> > - htotal
>
> > which are all displayed when launching xvidtune. Is there any way of
> > extracting to data by running xvidtune in non-interactive mode ?
>
> xvidtune -help lists an option '-timeout [seconds]', which suggests to
> me a somewhat non-interactive mode. However, trying this option gives a
> syntax error (shame), and the output on console doesn't seem to include
> what you need anyways. Never having seen anything else that's similar
> to xvidtune, I suspect the best option is to grab the xvidtune source
> and hack it to do what you need.
>
I finally came out with a perl script that parses XFree86 log file and
at least on my machine, it gives accurate results.
open (IN,"/var/log/XFree86.0.log");
foreach (<IN>) {
next unless ( /Virtual size is (\d+x\d+)/ || /Modeline/);
next unless /Modeline .$1/;
($pixelclock,$hdisplay,$vdisplay,$htotal)=(split /\s+/)[4,5,9,8];
$pixelclock =~ s/\.\d+//;
last;
}
close (IN);
Any comment welcome.
--
Eric VAN BUGGENHAUT "Los niños son esponjas"
(Amaya Rodrigo Sastre)
\_|_/ Andago
\/ \/ Av. Santa Engracia, 54
a n d a g o |-- E-28010 Madrid - tfno:+34(91)2041100
/\___/\ http://www.andago.com
/ | \ "Innovando en Internet"
eric@andago.com
Reply to: