supplierdeeply

Restart video recording when time limit is reached (FAT32 4gb) automatically

  • 20 Replies
  • 4383 Views
  • Publish
    Advertisements
    Hi, I've a powershoot S95 and I'm a bit frustrated by the video time limit, wich is caused by the FAT32 limitation of 4GB per file.

    I think CHDK could overcome this issue simply forcing the REC state continuously, just looking to its state and sending a shutter button press in case the camera has stopped . If the camera stops cause the 4GB limit is reached, the CHDK would put the camera in REC state, creating a new video file.

    The perfect solution would be a continuously shooting function, splitting videos to 4gb files, but I suppose it's not possible. I think this could be a simple workaround to that.

    Hope someone could implement it.

    Thanks.

    *

    Offline fe50

    • ******
    • 3033
    • IXUS50 & 860, SX10 Star WARs-Star RAWs
      • fe50
  • Publish
    I think CHDK could overcome this issue simply forcing the REC state continuously, just looking to its state and sending a shutter button press in case the camera has stopped . If the camera stops cause the 4GB limit is reached, the CHDK would put the camera in REC state, creating a new video file.
    This can be done with a simple script - use the search function, there are several posts about this (and also some scripts) in the forum...

  • Publish
    @title MultiMovie
    @param x one part time in sec
    @default x 590

    f=0

    print "record will start..."

    press "shoot_half"
    sleep 1500
    :new
    f=f+1
    press "shoot_full"
    release "shoot_full"
    if f=1 then release "shoot_half"

    print "file number: ";f

    s=get_time 0
    m=get_time 1
    h=get_time 2
    d=get_time 3
    b=s+m*60+h*3600+d*3600*24

    :loop
    s=get_time 0
    m=get_time 1
    h=get_time 2
    d=get_time 3
    t=s+m*60+h*3600+d*3600*24
    u=t-b
    print "file number: ";f
    print "time left:";x-u
    if u>x then goto "reload"
    sleep 900
    goto "loop"

    :reload
    print "reloading..."
    press "shoot_full"
    release "shoot_full"
    print "waiting for ready..."
    :waitloop
    q=get_movie_status
    if q=1 then goto "new"
    print "status:",q
    sleep 100
    goto "waitloop"

    this script basiclly records in a loop for however long its set for the time is in seconds, also this script "may" require some modding as it was made for a SX130

  • Publish
    I think CHDK could overcome this issue simply forcing the REC state continuously, just looking to its state and sending a shutter button press in case the camera has stopped . If the camera stops cause the 4GB limit is reached, the CHDK would put the camera in REC state, creating a new video file.
    This can be done with a simple script - use the search function, there are several posts about this (and also some scripts) in the forum...

    Thanks for the advice. I've tried searching for "continuous video" and similar strings but haven't had any luck.

    Perhaps this feature should be part of the main CHDK trunk, since I have found several posts asking about it.


    *

    Offline msl

    • *****
    • 1173
    • A720 IS, SX220 HS 1.01a
      • CHDK inside
  • Publish
    Perhaps this feature should be part of the main CHDK trunk, since I have found several posts asking about it.

    I think not so. Some script lines solve the problem. With a script you can use more personal settings, e.g. switch off the display.

    Perhaps we should include a 'restart video recording' script in the complete package of the autobuild.

    msl
    German CHDK pages:  CHDK forum | CHDK inside | CHDK Twitter News by msl | Download CHDK-DE (Autobuild)
    Note: SDM violates the GPL rules!

  • Publish
    Perhaps this feature should be part of the main CHDK trunk, since I have found several posts asking about it.

    I think not so. Some script lines solve the problem. With a script you can use more personal settings, e.g. switch off the display.

    Perhaps we should include a 'restart video recording' script in the complete package of the autobuild.
    I've been working on a wiki page for this.  Those are usually easier to search than the forum. Here's a link to the draft >  http://chdk.wikia.com/wiki/User:Waterwingz/Continuous_Video

  • Publish
    I've been working on a wiki page for this.  Those are usually easier to search than the forum. Here's a link to the draft >  http://chdk.wikia.com/wiki/User:Waterwingz/Continuous_Video

    And if I might suggest something - please refer users to this waterwingz's script rather than to mine that Vash has posted... Waterwingz did it much more cleanly and simple. My script, which uses get_time has been written at the begining of my adventures with CHDK and it's not very pretty;) I just haven't found the get_tick_count command then...
    if (2*b || !2*b) {
        cout<<question
    }

    Compile error: poor Yorick

    *

    Offline msl

    • *****
    • 1173
    • A720 IS, SX220 HS 1.01a
      • CHDK inside
  • Publish
    I've been working on a wiki page for this.  Those are usually easier to search than the forum. Here's a link to the draft >  http://chdk.wikia.com/wiki/User:Waterwingz/Continuous_Video

    Ok, chdk.wikia is also a place ...

    I think, this script is a little bit complicated. When we check the video status, it's easier. We don't need any time code. Here is a example for cameras with video button. For cameras without video button it is easy to expand with a function. With the dispay button you con switch off the display backlight.

    Code: [Select]
    --[[
    ********************************
    Licence: GPL
    (c) msl 2011/10/28
    ********************************
    @title Video extended
    @param a Auto restart [1]
    @default a 1
    ]]

    function restore()
        if get_movie_status() == 4 then click("video") end
        cls()
        set_console_layout(0,0,25,5)
        set_console_autoredraw(1)
    end

    if a<0 or a>1 then a=0 end

    BL=0
    END=0

    set_console_layout(9,1,39,6)

    if a==1 then
        cls()
        print("Automatic Video (Re)Start")
        sleep(3000)
    end

    repeat
        cls()
        if a ~= 1 then print("[Video] Start/Stop Video") end
        print("[DISP]  On/Off Backlight")
        print("[MENU]  End")
        console_redraw()
        wait_click(2000)
        if is_pressed("display") then
            set_backlight(BL)
            if BL == 1 then BL=0 else BL=1 end
        end
        if is_pressed("video") and b ~= 1 then
            click("video")
        end
        if is_pressed("menu") then END = 1 end
        status = get_movie_status()
        if status < 4 and a == 1 then
            click("video")
            cls()
            print("Start recording")
            sleep(5000)
            if BL == 1 then set_backlight(0) end
        end
    until  END == 1

    restore()

    msl
    German CHDK pages:  CHDK forum | CHDK inside | CHDK Twitter News by msl | Download CHDK-DE (Autobuild)
    Note: SDM violates the GPL rules!


  • Publish
    I think, this script is a little bit complicated. When we check the video status, it's easier. We don't need any time code.
    Or you could do both.

    One of the reasons the script I posted is still on a user page is that I intended to add a check for a button press during recording that would immediately restart the video (useful if you are near the current limit and have a good spot to initiate the recycle operation).

    I'd also planned to rewrite it in Lua and use the OSD drawing functions to get rid of the ugly script console window. 

    There is always something else you can add to a script :)

    *

    Offline funnel

    • ****
    • 349
  • Publish
    @msl

    When the dial is on movie mode the idle movie status is also 6 sometimes, if you haven't noticed already.

    idle == 1 && 6
    recording == 4

     

    Related Topics