maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Solved] Finally shortcut added. Use N900's camera as a spy cam (video recording while screen is locked) (https://talk.maemo.org/showthread.php?t=71326)

handaxe 2011-03-22 14:18

Re: How to make N900's camera a spycam(video recording while screen is locked)?
 
Quote:

Originally Posted by lancewex (Post 973103)
I hope this becomes a reality. I believe the N800 had a program that could motion detect and record. I currently use an old iBook with webcam for home security (motion detects--records video or jpeg--emails file to my phone). When AT&T renders my 2 N900s useless for 3G, I hope there is a program to make them useful as home monitoring devices instead.

You wish is answered....http://talk.maemo.org/showpost.php?p=802228&postcount=2

nicolai 2011-03-22 14:35

Re: How to make N900's camera a spycam(video recording while screen is locked)?
 
Quick and dirty way to use the camera api from python:

import gst
bin = gst.element_factory_make("camerabin")
bin.set_property("videoenc", gst.element_factory_make("dspmp4venc"))
bin.set_property("videomux", gst.element_factory_make("hantromp4mux"))
bin.set_property("audioenc", gst.element_factory_make("nokiaaacenc"))
bin.set_state(gst.STATE_PLAYING)
bin.set_property("filename", "test.mp4")
bin.set_property("mode",1)
#starts recording
bin.emit("user-start")

# wait some time

# stops recording
bin.emit("user-stop")
bin.set_state(gst.STATE_PAUSED)
bin.set_state(gst.STATE_NULL)

9000 2011-03-22 15:23

Re: How to make N900's camera a spycam(video recording while screen is locked)?
 
Here you are:

Code:

gst-launch v4l2camsrc device=/dev/video0 ! 'video/x-raw-yuv,width=800,height=480,framerate=30/1'  ! videorate ! ffmpegcolorspace ! jpegenc ! queue ! mux. avimux name=mux  ! filesink location=output.avi
You should still need to start it and break it manually as it's just a shell command.

Slide open the camera, close the camera app, start the script, put it aside; collect it later if it's not stolen, play the output.avi with mplayer, etc.

No sound, though, as I'm still not quite familiar with N900's way of dealing with sound. Please advise if anyone knows.

May be you could try nicolai's method first.

hathoda 2011-03-22 16:03

Re: How to make N900's camera a spycam(video recording while screen is locked)?
 
1 Attachment(s)
Quote:

Originally Posted by 9000 (Post 973184)
Here you are:

Code:

gst-launch v4l2camsrc device=/dev/video0 ! 'video/x-raw-yuv,width=800,height=480,framerate=30/1'  ! videorate ! ffmpegcolorspace ! jpegenc ! queue ! mux. avimux name=mux  ! filesink location=output.avi
You should still need to start it and break it manually as it's just a shell command.

Slide open the camera, close the camera app, start the script, put it aside; collect it later if it's not stolen, play the output.avi with mplayer, etc.

No sound, though, as I'm still not quite familiar with N900's way of dealing with sound. Please advise if anyone knows.

May be you could try nicolai's method first.

a noob qustion( i did not understand you) i put same code as you posted in xterminal and give me this
"i opened the lence cover and closed camera app and put your code in xterminal"
where is video?(i could not find it in media player) how to know that it has started captruing? where the video is stored?

9000 2011-03-22 16:31

Re: How to make N900's camera a spycam(video recording while screen is locked)?
 
Quote:

Originally Posted by hathoda (Post 973212)
a noob qustion( i did not understand you) i put same code as you posted in xterminal and give me this
"i opened the lence cover and closed camera app and put your code in xterminal"
where is video?(i could not find it in media player) how to know that it has started captruing? where the video is stored?

From the screenshot the location is /home/user/output.avi

You know it'd grow in size so it'd use up your /home/user very soon.

Therefore, you should have cd to /home/user/MyDocs first or enter the absolute path in the command such that the video could be stored in a relative large space.

The video is start recording once you start the command, and will stop when you break it with CTRL-C. You don't see the playback because OP asked for _stealth mode_.

If you wanna see the playback while video-taking, you could use the following:

Code:

gst-launch v4l2camsrc device=/dev/video0 ! 'video/x-raw-yuv,width=800,height=480,framerate=30/1' ! tee name=t_vid ! queue ! xvimagesink  sync=false t_vid. ! queue ! videorate ! ffmpegcolorspace ! jpegenc ! queue ! mux. avimux name=mux  ! filesink location=/home/user/MyDocs/output.avi
I use the absolute path above so that the video can be stored under MyDocs.

Again, no sound! It can be done very easily, as long as I know the sound device of N900. ^^

EDIT: missed the word 'large'

nicholes 2011-03-22 17:07

Re: How to make N900's camera a spycam(video recording while screen is locked)?
 
the video is not so smooth as camera app does!
however i would like to Thanks all you guys helping me (specially 9000 and nicolai) for your hard work and give your precious time for my little problem! i am now glade tooo much to be helped by all of you genius guys(specially 9000 and nicolai)
Our N900 and this community,please keep this alive.
THANKS AGAIN!

9000 2011-03-22 17:41

Re: How to make N900's camera a spycam(video recording while screen is locked)?
 
NP. The original video recorder might take advantage of the hardware acceleration somehow. I just pull this command straight from gst-launch man page so it's hardly perfect. ^^

I final figure out how to process sound with gst-launch in N900, but the quality is ever lower as it took even more processing power. Just for you and others reference only:

Code:

gst-launch v4l2camsrc device=/dev/video0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! queue ! videorate ! ffmpegcolorspace ! jpegenc ! queue ! mux. pulsesrc ! audioconvert ! audioresample ! nokiaaacenc ! queue ! mux. avimux name=mux ! filesink location=/home/user/MyDocs/output.avi
(Remember, do not stop the recording so quick, as the video streaming to file is taking tooo much time)

rmarcus 2011-03-22 18:17

Re: How to make N900's camera a spycam(video recording while screen is locked)?
 
Someone mentioned livefocus, I installed it, but I can't find it anywhere?
Where should it be? Widget list?How can I make it work?
:confused:

nicholes 2011-03-23 01:51

Re: How to make N900's camera a spycam(video recording while screen is locked)?
 
Quote:

Originally Posted by rmarcus (Post 973312)
Someone mentioned livefocus, I installed it, but I can't find it anywhere?
Where should it be? Widget list?How can I make it work?
:confused:

after installing live focus,open your camera cover(it will also start camera aaplication in full creen mode)now tap anywhere and you will see your status bar(where you battry status and time etc. is shown) tap there(near your battry icon) there would be a new botton(it is for live focus somthing looks like a red ball) click on it and you will see live focus optios! in the right bottom corner there are two arrow to scroll down options for live focus.in otherr words you cannot see live focus unless ur camera lence cover is open.hope this helps

hathoda 2011-03-23 06:49

Re: [Solved]How to make N900's camera a spycam(video recording while screen is locked)?
 
i hv checked nicolai mothode it has sound and good quality!!thanks!


All times are GMT. The time now is 11:31.

vBulletin® Version 3.8.8