Jump to content

[How would you do it] Checking a video file for a pixel


sameguy
 Share

Recommended Posts

Hey guys,

i want my script to watch a certain stream online and check for a certain pixel. If said pixel occurs, i want to the 15 seconds leading up to it recorded.

What i am doing right now is: Record the whole thing, check for the pixel, note the time, cut it out later. So i am basically recording and throwing away. I am using camstudio now, but i also looked for a solution that lets me create chunks of video and then copy them, if my pixel was found. However i did not seem to find a recording program that lets me do this. So i am asking for advice how to do this here. Perhaps i get a really good idea from someone.

Tl;dr: How can i check my screen for a pixel and record the 15 seconds leading up to the discovery of said pixel.

Link to comment
Share on other sites

  • Moderators

sameguy,

Welcome to the AutoIt forum. :oops:

Checking the screen for a particular pixel is not too hard as long as you can successfully identify the location on screen - look at PixelGetColor. :rip:

As to rewinding time 15 secs and recording, the only thing I can think of is to have 2 streams running with one 15 secs behind the other. Then when the lead stream shows the pixel, you run a script on the second stream to record the 15 secs beforehand. Unless you can pause/rewind/restart the running stream in which case you need only automate the original.

Any help? :D

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

thank you melba for your kind reply and the warm welcome :D

actually that is quite good input, didnt think of that. was about to implement more convoluted solutions. But how would i delay a stream by 15 seconds? That would require me to buffer it in code - normally a thing that the browser does, and i am not quite sure if it would be possible in autoit at all. Is there any software that does this by design? Like read a socket and print it delayed onto another? i could stream from one port and have the second port delayed with the record or sth. Dunno if there is an out of the box solution for something special like that ...

Link to comment
Share on other sites

  • Moderators

sameguy,

I was imagining 2 separate browser GUIs - one for the "search" stream and another for the "record" stream - started at 15 sec intervals. But I am not very au fait with streaming so that might be a complete impossibility. Sorry if that is the case and I have raised your hopes in vain. :D

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

hm that would not work, unfortunately, since both browser windows would get the synchronized stream from the source. But what i could do is record the whole thing on disc and go over it in a second pass. Unfortunately neither time nor space efficient. but i am thinking about sniffing the traffic from one port and sending it to the next in a delayed fashion. but that would carry me away from autoit unfortunately

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...