View Single Post
Posts: 482 | Thanked: 550 times | Joined on Oct 2010
#9
Originally Posted by nicholes View Post
can this help somehow?
Thanks! Here's a python script which should handle it by itself. To run:
Code:
chmod 755 record.py; ./record.py
record.py:
Code:
import gst
import time
import os

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"))

while True:
    bin.set_state(gst.STATE_PLAYING)
    bin.set_property("filename", "current.mp4")
    bin.set_property("mode",1)
    #starts recording
    bin.emit("user-start")

    time.sleep(60)

    # stops recording
    bin.emit("user-stop")
    bin.set_state(gst.STATE_PAUSED)
    bin.set_state(gst.STATE_NULL)
    try:
        os.remove("twominutesold.mp4")
    except OSError:
        print "No two-minutes-old file exists yet."
    try:
        os.rename("oneminuteold.mp4", "twominutesold.mp4")
    except OSError:
        print "No one-minute-old file exists yet."
    os.rename("current.mp4", "oneminuteold.mp4")

Last edited by skykooler; 2012-02-24 at 16:52.
 

The Following 3 Users Say Thank You to skykooler For This Useful Post: