maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   little bit of code help (https://talk.maemo.org/showthread.php?t=42225)

lcuk 2010-01-26 00:07

little bit of code help
 
hi,

i've got a problem, and i dont know how to solve it.
its only small but i need it for something.
in liqbase i've got a liqcamera module and like the original liqbase it just starts viewing but on the n900 its always showing me full 5mb scanline images which are sluggish to refresh.
i don't need such high resolution imagery and just want to use the same stream the camera preview window uses, its nice and fast.

a number of people have cured this, but i seem to have a bit of a block and cant work out how.

i've got the code to my current camera module here, and i would like someone to patch it to work with the same preview image the camera software uses.

its a simple gstreamer stack at the moment so don't imagine any real problems manipulating it, i just dont know how.

anyone able to help?
http://github.com/lcuk/libliqbase/bl...rc/liqcamera.c

danielwilms 2010-01-26 11:49

Re: little bit of code help
 
Hi,

not sure, but is libgdigicam the library you are looking for? Have a look at this header-file. It should do the trick.

Daniel

lardman 2010-01-26 12:58

Re: little bit of code help
 
Do you actually use the full res data? If not why not just change one of the caps to produce a smaller frame. Otherwise you need to look at iirc the camerabin gst element.

lcuk 2010-05-22 13:20

Re: little bit of code help
 
Well, I found out what was causing the problem \o/
(I've been doing other things since, this hasn't been on my mind the whole time ;))

I was reading up on some things last night and went tracking the differences.
First, a big thanks to everyone who made suggestions, but the problem appeared from day 1 - infact carried over from the code I used on the n810!

and it was much simpler.

take this example:

Code:

gst-launch v4l2camsrc ! video/x-raw-yuv,width=400,height=240 ! xvimagesink force-aspect-ratio=true
it works nicely and exactly as the live camera view should work :D

then, look at what I was specifying in liqbase:

Code:

gst-launch v4l2camsrc ! video/x-raw-yuv,width=400,height=240,framerate=[1/25,25/1] ! xvimagesink force-aspect-ratio=true

As you will see, there is a dramatic, noticable difference when I pre-specify a framerate!
which is the amazingly craptastic effect I was experiencing.

Now by simply removing the framerate setting I can show the video flawlessly at around 30fps just as before in original liqbase.
problem with camera is officially dealt with \o/
It did not involve anything generic, just cleaning the simple framerate :)



you may need to install gstreamer-tools for these examples to work.
( apt-get install gstreamer-tools )


All times are GMT. The time now is 16:46.

vBulletin® Version 3.8.8