Jump to content

Exact loop for second


Recommended Posts

Hi community

Sorry if the title isn't explicative, i'd like to make 24 screenshot for second using the screencapture udf( like a video, but with images ) but i have some doubt like:

Is possible to make an exact loop like this?

It will kill my CPU and destroy the world?

Many thanks for the help

I'M QUIT FROM THIS FORUM!

It was fun until it lasted, hope on my future way i can't find people that offend without any reason ( i was called lazy and parasitic, and everyone agreed...United we stand, divided we fall ) just for fun because don't have anything to do in the life, without knowing anything about the person who write, noone forced to post, noone forced to help.

From the top of the from their very great superiority they not go down to my level, that people can not spread the knowledge but you have to learn by yourself.

In what way? It's easy...just search on google

For that people, wish you the best way,

Oliver Astone

Link to comment
Share on other sites

  • Moderators

OliverA,

I doubt it will end the world - or even fry your CPU if you only run for 1 second. But I think you might run into problems with the disk writing cache. Give it a go and see. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Thanks

I don't wont to run it for 1 second, but i want to save 24 frames/screen for second, for underterminate minutes :D

About the disk writing cache, i think can be a problem and maybe the files can be saved at the end of the process, but i dunno

Edited by OliverA

I'M QUIT FROM THIS FORUM!

It was fun until it lasted, hope on my future way i can't find people that offend without any reason ( i was called lazy and parasitic, and everyone agreed...United we stand, divided we fall ) just for fun because don't have anything to do in the life, without knowing anything about the person who write, noone forced to post, noone forced to help.

From the top of the from their very great superiority they not go down to my level, that people can not spread the knowledge but you have to learn by yourself.

In what way? It's easy...just search on google

For that people, wish you the best way,

Oliver Astone

Link to comment
Share on other sites

I've never used the UDF, but for accurate timing you might be able to use the AdLib function. I would have thought writing the shots to separate image files would be possible within the small time window available. However I'm not familiar with the UDF so I don't know exactly what it does or how fast it is. I also don't know if this is a practical method: the amount of data would get large very quickly.

Edited by czardas
Link to comment
Share on other sites

Mmm maybe the UDF is not fast like i have think:

#include <ScreenCapture.au3>

Global $iCount

$timer = TimerInit()
Do
$iCount += 1
_ScreenCapture_Capture(@ScriptDir & "\Test\" & $iCount & ".jpg")
Until TimerDiff($timer) >= 1000

It saves 13 images on my PC, but it saves everytime in real-temp a screenshot

Maybe using _ScreenCapture_SaveImage at the end of the process it will be more faster, but i don't know if change or not

Edited by OliverA

I'M QUIT FROM THIS FORUM!

It was fun until it lasted, hope on my future way i can't find people that offend without any reason ( i was called lazy and parasitic, and everyone agreed...United we stand, divided we fall ) just for fun because don't have anything to do in the life, without knowing anything about the person who write, noone forced to post, noone forced to help.

From the top of the from their very great superiority they not go down to my level, that people can not spread the knowledge but you have to learn by yourself.

In what way? It's easy...just search on google

For that people, wish you the best way,

Oliver Astone

Link to comment
Share on other sites

Try different formats. I'm not sure if the UDF is best for the purpose. You could possibly run two processes simultaneously to get more shots, but they would have to be carefully synchronised and that could be tricky. I bet there are free tools available that do this kind of thing.

Edited by czardas
Link to comment
Share on other sites

My "goal" was a sort of screen recoding with autoit, and my best idea was to convert screenshot to a video file.

I know how to convert jpeg's to video in autoit, but the result isn't "smooth" because the number of the screen is too low.

Maybe was a bad idea :D

I'M QUIT FROM THIS FORUM!

It was fun until it lasted, hope on my future way i can't find people that offend without any reason ( i was called lazy and parasitic, and everyone agreed...United we stand, divided we fall ) just for fun because don't have anything to do in the life, without knowing anything about the person who write, noone forced to post, noone forced to help.

From the top of the from their very great superiority they not go down to my level, that people can not spread the knowledge but you have to learn by yourself.

In what way? It's easy...just search on google

For that people, wish you the best way,

Oliver Astone

Link to comment
Share on other sites

If it's faster to save bitmaps then you can convert them to jpg and then to video. I imagine there's some conversion taking place with the UDF functions, and the time taken by that process will most likely vary with different formats. This is the reason I suggested you try some different approaches. You might also find something in example scripts that does something similar.

Edited by czardas
Link to comment
Share on other sites

The fastes is jpeg, bitmap and png saves only 10 files, i think it depends on the output file size?

Other approach is using the clipboard and PRINT key but was slower then the UDF. I don't have find another example

I'M QUIT FROM THIS FORUM!

It was fun until it lasted, hope on my future way i can't find people that offend without any reason ( i was called lazy and parasitic, and everyone agreed...United we stand, divided we fall ) just for fun because don't have anything to do in the life, without knowing anything about the person who write, noone forced to post, noone forced to help.

From the top of the from their very great superiority they not go down to my level, that people can not spread the knowledge but you have to learn by yourself.

In what way? It's easy...just search on google

For that people, wish you the best way,

Oliver Astone

Link to comment
Share on other sites

Okay, here's an idea: Have a master script run a second script to capture each screenshot and then exit. You may need to introduce accurate timed delays before each shot. Then it should be possible with enough RAM available. It's just a thought, but be careful you don't kill your CPU and destroy the world. Run small tests on just a few shots. Monitor the cpu and memory as you go. This might be a possible workaround, but understand that this is not a normal proceedure - so run lots of small tests before the big one - 24 fps. This might not work.

Edited by czardas
Link to comment
Share on other sites

Starting a script has a bit of a delay...you would almost need to use a TCPIP, to one of several running scripts to be more instant...or write to a file, and logically have another running process know when to take the shot...too bad something like this wouldn't work:

$iCounter = 0
$iFramePerSec = 24
$iPause = 1000/$iFramePerSec
While $iCounter < 250
$iStart = TimerInit()
Run(@AutoItExe & " /AutoIt3ExecuteLine #include <ScreenCapture.au3>" & @CRLF & "_ScreenCapture_Capture('C:\testpic" & $iCounter & ".bmp')")
$iPauseLess = TimerDiff($iStart)
Sleep($iPause-$iPauseLess)
$iCounter += 1
WEnd

$start = TimerInit()
Run(@AutoItExe & " /AutoIt3ExecuteLine msgbox(1,'NEW','test')")
WinWait('NEW')
MsgBox(1,1,TimerDiff($start)/1000)

running a single line takes .307 sec

$iCounter = 1
$iFramePerSec = 24
$iPause = 1000/$iFramePerSec
$time = TimerInit()
While $iCounter < 24
$iStart = TimerInit()
_ScreenCapture_Capture(@DesktopDir & "\image\" & $iCounter & '.bmp', 0,0,100,100)
$iPauseLess = TimerDiff($iStart)
$iStart2 = TimerInit()
Sleep(Int($iPause-$iPauseLess))
ConsoleWrite(TimerDiff($iStart2) & "     " & $iPause-$iPauseLess & @CRLF)
$iCounter += 1
WEnd
ConsoleWrite( TimerDiff($time)/1000 & @CRLF)

This one works, within a pretty good tolerance (small screenshots though)...the loop takes .95933 seconds...very small margin(some waits are too short)

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

What you've written looks good.

I would set the delay according to the computer's clock, wait until it goes a certain number of seconds on the clock, and then begin sequenced delays in several scripts. You could perhaps do it with four scripts, each taking 6 shots per second and each out of phase by a precise number of miliseconds.

Edited by czardas
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...