View Single Post
Posts: 84 | Thanked: 76 times | Joined on Aug 2011
#4
After a lot of struggles and searches I managed to get it to work. It's because the window is closed automatically after executing the command. I did some search and found the way to keep it open. So here it is for anyone need it.

#!/usr/bin/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)
bin.emit("user-start")
raw_input("Press enter to stop")
bin.emit("user-stop")
bin.set_state(gst.STATE_PAUSED)
bin.set_state(gst.STATE_NULL)

My next question is: Can we somehow hide the recording window, so it'll be more like a spycam?

Last edited by LightRain; 2011-10-16 at 12:50.