maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Multimedia (https://talk.maemo.org/forumdisplay.php?f=32)
-   -   [ANNOUNCE] Mirror (https://talk.maemo.org/showthread.php?t=33098)

eiffel 2009-10-20 17:08

Re: [ANNOUNCE] Mirror
 
Thanks for that screenshot, matteone. It shows that the resolution of the front-facing camera may be the limiting factor.

To improve the quality of the image, perhaps the application can be modified to use the main camera. Of course the difficulty with that approach is that you can't see the screen while you're pointing the main camera at your face. But if you have a small mirror with you, you can position it so that you can see the N900 screen.

Regards,
Roger

daperl 2009-10-20 17:13

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by matteone (Post 352807)
And the program runs without any problem. But ... ... in the scree I see a darker band than the rest on the right side.
I tried on 2 N900 ... and the results is the same.
Is this a problem of the internal camera or ... what is this ?

That looks close to 160 pixels. Try the following:

Code:

gst-launch-0.10 v4l2src device=/dev/video1 ! video/x-raw-yuv,width=640,height=480,framerate=30/1 ! ffmpegcolorspace ! videoflip method=4 ! autovideosink

qole 2009-10-20 17:21

Re: [ANNOUNCE] Mirror
 
Same problem as always, daperl:

...could not negotiate formate.... check your filtered caps, if any....

As soon as you try to tidy up the output of the camera, it gorks.

EDIT: Setting it to ... ! video/x-raw-yuv,width=640 ! ... works, but it looks exactly the same.

qole 2009-10-20 17:36

Re: [ANNOUNCE] Mirror
 
Ok this isn't stretched anymore, but it still has the dark band:

gst-launch-0.10 v4l2src device=/dev/video1 ! "video/x-raw-yuv,pixel-aspect-ratio=(fraction)1/1" ! ffmpegcolorspace ! videoflip method=4 ! xvimagesink force-aspect-ratio=true

attila77 2009-10-20 17:40

Re: [ANNOUNCE] Mirror
 
The dark band problem is deeper, either electronics or kernel driver level. It's there even I don't use gstreamer at all (=direct v4l2)

lcuk 2009-10-20 17:50

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by eiffel (Post 352853)
Thanks for that screenshot, matteone. It shows that the resolution of the front-facing camera may be the limiting factor.

To improve the quality of the image, perhaps the application can be modified to use the main camera. Of course the difficulty with that approach is that you can't see the screen while you're pointing the main camera at your face. But if you have a small mirror with you, you can position it so that you can see the N900 screen.

Regards,
Roger


just an observation.

you want to use a small mirror in your possession to hack together an app supposed to work as a mirror?

isn't that a little redundant ?

attila77 2009-10-20 17:53

Re: [ANNOUNCE] Mirror
 
In case some devs wants to track progress or make their own packages, I opened a garage project for this 'app' (talk about waste of resources :) ). The address is https://garage.maemo.org/projects/mirrorapp/

eiffel 2009-10-20 17:56

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by lcuk (Post 352906)
isn't that a little redundant ?

precisely! :D

(or, as they say on slashdot, "whoosh!")

attila77 2009-10-20 18:00

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by lcuk (Post 352906)
isn't that a little redundant ?

Ever tried to take a look at the back of your head with a single mirror ? Can get tricky ! :D The solution is simple though, use TWO N900s and display the main cam image on the OTHER unit. Now THAT is a PUSH project right there :D

qole 2009-10-20 18:04

Re: [ANNOUNCE] Mirror
 
Ok, so here's how to get rid of the dark band. Use "videocrop" to crop it away!

The new pipeline to produce a properly sized image with no dark band:

gst-launch-0.10 v4l2src device=/dev/video1 ! "video/x-raw-yuv,pixel-aspect-ratio=(fraction)1/1" ! ffmpegcolorspace ! videoflip method=4 ! videocrop right=122 ! xvimagesink force-aspect-ratio=true

anidel 2009-10-20 18:22

Re: [ANNOUNCE] Mirror
 
I just installed mirror 1.0-2 and it installed libspeex1 gstreamer0.10-plugins-good-extra, but when I run it I get:

Quote:

/usr/bin/mirror: line 2: gst-launch-0.10: not found
something is missing?

anidel

EDIT: forgot to say that I've installed it via apt-get install mirror

daperl 2009-10-20 18:35

Re: [ANNOUNCE] Mirror
 
How about swapping out v4l2src for v4l2camsrc.

eiffel 2009-10-20 18:41

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by attila77 (Post 352925)
Ever tried to take a look at the back of your head with a single mirror ? Can get tricky ! :D The solution is simple though, use TWO N900s and display the main cam image on the OTHER unit. Now THAT is a PUSH project right there :D

Or use one N900, but have it plugged in to an external monitor.

daperl 2009-10-20 18:55

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by attila77 (Post 352891)
The dark band problem is deeper, either electronics or kernel driver level. It's there even I don't use gstreamer at all (=direct v4l2)

Does /dev/video0 have this problem?

Also, please try v4l2camsrc. I just looked at the source, it's plenty different than v4l2src.

qole 2009-10-20 18:55

Re: [ANNOUNCE] Mirror
 
Ok, last pipeline. This one crops the top and the bottom so it fills the whole mirror window:

gst-launch-0.10 v4l2src device=/dev/video1 ! "video/x-raw-yuv,pixel-aspect-ratio=(fraction)1/1" ! ffmpegcolorspace ! videoflip method=4 ! videocrop top=60 bottom=160 right=122 ! xvimagesink force-aspect-ratio=true

EDIT: v4l2camsrc looks identical to v4l2src :(

dmj726 2009-10-20 19:12

Re: [ANNOUNCE] Mirror
 
Can we add a zoom feature so you can dial into that pimple? (Perhaps the swirly zoom from the browser ;) )

attila77 2009-10-20 19:18

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by anidel (Post 352946)
I just installed mirror 1.0-2 and it installed libspeex1 gstreamer0.10-plugins-good-extra, but when I run it I get:

something is missing?

anidel

EDIT: forgot to say that I've installed it via apt-get install mirror

yep, you're missing gstreamer-tools (fixed in 1.0-3)

attila77 2009-10-20 19:20

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by daperl (Post 352993)
Does /dev/video0 have this problem?

No, video0 works just fine (and has a lot better quality)

anidel 2009-10-20 21:31

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by attila77 (Post 353029)
yep, you're missing gstreamer-tools (fixed in 1.0-3)

Thanks, some other update installed it, as it was already installed when I ran (now) apt-get install gstreamer-tools...

Anyway, it's working fine.
It's quite fast, but yes, the aspect ratio is to be fixed.

No way to take snapshots? :)

qole 2009-10-20 22:17

Re: [ANNOUNCE] Mirror
 
The zoom feature wouldn't be too hard, just crop the picture more and the remaining area will be hardware scaled to fill the screen.

mikec 2009-10-20 22:23

Re: [ANNOUNCE] Mirror
 
Guys

I'm sorry to report a Portrait use-case at last !!!:D

Mike C

daperl 2009-10-20 22:53

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by qole (Post 353283)
The zoom feature wouldn't be too hard, just crop the picture more and the remaining area will be hardware scaled to fill the screen.

If you're gonna zoom and stuff, I think it's time to wrap camerabin in a gui. If I had an n900, I would probably start with the attached gtk/gst Python script from here.

attila77 2009-10-20 23:06

Re: [ANNOUNCE] Mirror
 
I already started wrapping it in a pinch of python after connys remarks as a prospective v2, but will certainly take a look.

aboaboit 2009-10-21 07:20

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by lcuk (Post 352906)
just an observation.
you want to use a small mirror in your possession to hack together an app supposed to work as a mirror?
isn't that a little redundant ?

Redundant is bad. Recursive is divine ;)

attila77 2009-10-21 13:07

Re: [ANNOUNCE] Mirror
 
Good news everyone !

Apparently the vertical band problem was a firmware issue that is already fixed in the upcoming firmware, and is confirmed to work OK with mirror.

https://bugs.maemo.org/show_bug.cgi?id=5663

anidel 2009-10-21 13:40

Re: [ANNOUNCE] Mirror
 
If only we could get an OTA!!!

so many bug fixes and no more firmware updates :(

anidel 2009-10-21 13:45

Re: [ANNOUNCE] Mirror
 
Btw, you may also want to have a look at this interesting piece of code:

http://wiki.maemo.org/Documentation/...mera_API_Usage

andrewfblack 2009-10-21 13:50

Re: [ANNOUNCE] Mirror
 
I guess this widget would be great also if you think you are being followed just hold the n900 a little to the left of you and so you can see behind you. Every spy needs this.

eiffel 2009-10-21 14:38

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by andrewfblack (Post 353897)
...if you think you are being followed just hold the n900 a little to the left of you and so you can see behind you...

As if to announce: "hey, suspicious person following me, here's a £500 device for you to grab".

daperl 2009-10-22 14:38

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by anidel (Post 353894)
Btw, you may also want to have a look at this interesting piece of code:

http://wiki.maemo.org/Documentation/...mera_API_Usage

I basically ported that to Python.

qole 2009-10-22 18:52

Re: [ANNOUNCE] Mirror
 
I was hoping to see some cropping in the latest version... I guess you can leave the dark band in there for now, since that will be fixed, but crop the top and bottom to match the screen's aspect ratio, so that the user's face isn't stretched.

attila77 2009-10-22 19:24

Re: [ANNOUNCE] Mirror
 
The next version will be a 2.0, which is a python script, so I can actually call it an app without blushing. It will contain all the mentioned goodies and hopefully please the testers so it has at least a remote chance of getting the 10 karma required for extras :)

daperl 2009-10-22 20:13

Re: [ANNOUNCE] Mirror
 
2 Attachment(s)
I've attached a compiled FREMANTLE_ARMEL version of the camerabin directory from gst-plugins-bad0.10-0.10.13-git209/tests/examples.

Inside the camera directory you should be able to type:

./gst-camera

It's a shell script that I think runs the gst-camera binary that's inside .libs.

Maybe one of you n900 guys could give it a try and let us know what you see.

EDIT:

Here's a screen shot from my hacked x86 version:

Attachment 4476

I think the bottom slider is for zooming.

qole 2009-10-22 21:32

Re: [ANNOUNCE] Mirror
 
gunzip cb.gz just produces a file called cb...?

EDIT: Ok, it's a TAR. When I "tar xvf cb" it expands into a directory called "camerabin".

qole 2009-10-22 21:53

Re: [ANNOUNCE] Mirror
 
daperl: The script is designed to be run inside scratchbox, and it just doesn't like being run on a real device. I replaced a bunch of scratchbox-specific stuff, but it still doesn't work, and I can't figure out what's going on. It seems to delete .libs/lt-gst-camera and then attempts to run it. What's up with that?

kryptoniankid17 2009-10-22 22:09

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by attila77 (Post 355816)
The next version will be a 2.0, which is a python script, so I can actually call it an app without blushing. It will contain all the mentioned goodies and hopefully please the testers so it has at least a remote chance of getting the 10 karma required for extras :)

how short are u on karma?

daperl 2009-10-22 22:16

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by qole (Post 355947)
daperl: The script is designed to be run inside scratchbox, and it just doesn't like being run on a real device. I replaced a bunch of scratchbox-specific stuff, but it still doesn't work, and I can't figure out what's going on. It seems to delete .libs/lt-gst-camera and then attempts to run it. What's up with that?

Maybe just go inside the .libs directory and run the gst-camera executable.

cd .libs
./gst-camera

qole 2009-10-22 22:45

Re: [ANNOUNCE] Mirror
 
./gst-camera: line 1: syntax error: "(" unexpected

daperl 2009-10-22 23:20

Re: [ANNOUNCE] Mirror
 
Quote:

Originally Posted by qole (Post 355979)
./gst-camera: line 1: syntax error: "(" unexpected

Woops, I attached the i386 stuff by mistake. I'll get back to you.

daperl 2009-10-22 23:28

Re: [ANNOUNCE] Mirror
 
1 Attachment(s)
Here, try this one.


All times are GMT. The time now is 00:23.

vBulletin® Version 3.8.8