Make buffer writing non blocking

Got an idea for something that SharpCap should do? Share it here.
Forum rules
'+1' posts are welcome in this area of the forums to indicate your support for a particular feature suggestion. Suggestions that get the most +1's will be seriously considered for inclusion in future versions of SharpCap.
Post Reply
cyo
Posts: 5
Joined: Fri Jun 07, 2024 8:25 pm

Make buffer writing non blocking

#1

Post by cyo »

Hi,

I have a sequence that I use to create time-lapse on planets. The idea is to capture 10 seconds every 30s. It works reasonably well but I noticed that the timing is actually not reliable. The "Capture X seconds" routine waits for the disk writing operation before moving to the "Delay" routine, so the interval before captures are not consistent. This is especially pronounced when I run a AS3 process in the background while capturing.

I have also tried using subroutines but the result is the same. Please let me know if there is a more proper way to do this. But for now I think It would be great if the write can be made asynchronous and merged in the delay phase.

Code: Select all

SEQUENCE
    DELAY 1
    LIVE MODE
    SET COLOUR SPACE TO MONO8
    SET OUTPUT FORMAT TO "SER file (*.ser)"
    LOOP UNTIL LOCALTIME "8:00:00 PM"
        SEQUENCE
            FRAMETYPE Light
            CAPTURE 10 SECONDS LIVE FRAMES
            DELAY 20
        END SEQUENCE
    END LOOP
END SEQUENCE
Best,
Siyu
User avatar
admin
Site Admin
Posts: 13710
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Make buffer writing non blocking

#2

Post by admin »

Hi,

the way to make the interval regular with the way things currently work is to use the 'Add a delay if these steps take less than <Minimum Duration>s' step - put your captures inside that step and set the minimum to 30s. The capture will run, including writing to disk and then the 'Add a delay' step will wait for the remaining part of the 30s total. It will still take longer than 30s if the capture + writing takes longer that 30s - in which case, set the minimum to a longer value to allow for the worst case of capture + writing out.

cheers,

Robin
Post Reply