LAV Perl bindings for SDL

Hi everybody,

i just uploaded version 0.2.0, called:

http://www.s.netic.de/tmohr/lavperl-0.2.0.tar.bz2

This one can export the buffer of a LAVRGBA as a perl string
which can then be used as an input to SDL::Surface to create
a Surface.

There’s a test script that lets you single step through an
AVI generated with the Linux Audio Video Tools with the SDLK_Left
(Backward) and SDLK_Right (Forward) keys.

SDL::Surface gives a warning, when a Surface is generated without
the parameter -name. I changed SDL/Surface.pm in my installation
like this, so it is checked if the parameter is defined:

  • if ( $options{-name} ne “” && exists $SDL::{IMGLoad} ) {
  • if ( defined($options{-name}) && $options{-name} ne “” &&
    exists $SDL::{IMGLoad} ) {

Best regards,
Torsten.> Hi!!!

Wow!! Nice!!!

i have some questions:

  1. how i can write sinfle frame in jpeg(or other) format.
  2. or how i can get array of array frame data i RGB massiv of massives
    (for example 122,222,222 for one pixel with num of 123)?

-rw-r–r-- 1 root root 2992294 ??? 16 23:42 out.avi
-rwxr-xr-x 1 root root 8303312 ??? 16 22:21 …/res.avi
[root at mobile100 lavperl]#

its work fine? source file size is 8303312 and output file size is 2992294?

thanks!

Torsten Mohr ???:

Hi everybody,

i wrote a C++ wrapper lib and based on that some perl bindings
that let me execute this little script attached at the bottom.

It can be downloaded at:

http://www.s.netic.de/tmohr/lavperl-0.1.0.tar.bz2

Best regards,
Torsten.

#! /usr/bin/perl -w

use LAV;

some objects to hold some inbetween values

$jpeg_in = LAVJPEG->new();
$ycbcr_in = LAVYCbCr->new();
$rgba = LAVRGBA->new();
$ycbcr_out = LAVYCbCr->new();
$jpeg_out = LAVJPEG->new();

$s = LAVSettings->new();
$i = LAVInFile->new(’…/res.avi’);
$i->fillSettings($s);
$s->setAudio(0, 0, 0);
$s->show();
$n = $s->getNumFrames();

$o = LAVOutFile->new(‘out.avi’, $s);

for($j = 0; $j < $n; $j++) {
print “frame $j\n”;
$i->readJPEG($jpeg_in, $j);
$ycbcr_in->fillFromJPEG($jpeg_in, $s);
$rgba->fillFromYCbCr($ycbcr_in, $s);
$ycbcr_out->fillFromRGBA($rgba, $s);
$jpeg_out->fillFromYCbCr($ycbcr_out, $s);
$o->writeJPEG($jpeg_out);
}

delete it, to make sure it will be closed

$o = undef;


This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl


Mjpeg-users mailing list
Mjpeg-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl


Mjpeg-users mailing list
Mjpeg-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users