How do I delay video from my webcam on my own feed? - video-capture

Id like to have the ability to delay the video from my webcam on. my own computer. Honestly I am using. it. as a "delayed mirror" for my golf swing. I have always recorded, then stopped, opened up the file and watched then did it again. Doing this 30 times in a session working on my swing is annoying. Id like to just take a webcam, be able to delay the video 5,8,10 seconds so I can watch and just keep moving. what is the easiest way around this. I have been told I could do this with a script but not sure where to start. Can anyone help me or send me in the right direction? Im on a Mac but also have a PC if needed.

Python + OpenCV.
First manage to show a current image from your webcam using tutorials.
Then instead of immediately showing the image you add it at the end of a buffer object, this could be a collections.deque from standard Python.
If you want to delay for say 5 seconds and you're capturing with 30 frames per second, then don't show anything until you add 5*30 images from your camera to the buffer. Now when you filled the buffer as soon as you get another image, you add it to the end of the buffer, but also remove 1 image from the beginning of the buffer and show it.

Related

Jitbit Macro Recorder - IF Image statement, why it is not waiting until the image appears?

I am using Jitbit MacroRecorder and it is a really helpful tool. The problem is this: By using the IF image found feature, I want the program to execute 2 sequential commands as soon as the image I selected on my screen appears. However, the program is putting too much load on the CPU by running thousands of times until the IF statement is true. What I want is for the program to WAIT until the image in the IF image found statement appears on the screen, that is, not to run thousands of times.
My simple code
The only way for the program to know when the image appears is to continuously "scan" the screen until it sees it. You may be able to use the image NOT found feature inside a loop with a delay. You would look for the image, and if not found, delay a second, and then look for it again. The tradeoff is you will have that delay in there which will keep your program from running the following commands immediately.

Transmit Audio Via Micro:bit Radio In MicroBlocks

I am using a BBC Micro:bit version 2 and have a program set up on an editor called Micro:blocks. The code is supposed to take input from the first micro:bit's microphone and play it out of the other one's speaker. But when I try it, all I get is an annoying buzzing noise coming out the other end.
I can play it correctly out of the first micro:bit only (not using radio) and it sounds fine. I can't figure out why the second micro:bit makes a buzzing noise.
With the program without radio, I messed around with how long before it played the noise, and none of the tests resulted in a buzzing noise, so I know it's probably not a timing or delay issue.
Anyways, here is my code.
Transmitting code:
when [button a] pressed
set radio group to (7)
set radio channel to (7)
set radio transmit power to (7)
digital pin write (on) to (28)
forever
analog pin write (microphone + 500) to (0)
radio transmit number (microphone + 500)
when [button b] pressed
stop other processes
radio transmit number (0)
analog pin write (0) to (0)
receiving code:
when program started
forever
if (new radio message)
analog pin write (0) to (radio last received number)
This is an interesting project!
Your program looks correct but the radio system may not be fast enough to send each sound sample as a separate message. As a result, you are just hearing a series of clicks, resulting in the buzzing noise.
You could check that the sound data is being sent and received by sending a second or two of sound and graphing the incoming samples on the receiving side. It will be slow, but you should see something that looks like a smooth audio waveform.
Assuming speed is the issue, you could try sending several samples in each packet by encoding them into a string. But even that may not be fast enough to create a smooth audio stream, especially since the encode/decode process will take time.
A different approach would be for the receiver to collect a second or two of sound samples in a list, then play them back in a burst. That would not provide continuous audio but might allow transmitting a sentence at a time.
Here is a record/playback project you might use as a starting point for experimentation.
Note that you can download this image and drop the .png file into the MicroBlocks IDE. MicroBlocks will read the project back from the image itself :)

Vb.Net Take snapshot of streaming webcam video (over internet)

I have a video streaming of a security webcam. I'd need to take screenshots at a as high as possible resolution at regular intervals.
Option 1 would be to fullscreen the video and take regular screenshots and save them but I'd have the computer busy and couldnt work on it anymore.
Option 2 would be to somehow capture the webstream, and extract a screenshot from the stream.
Are there any better otpions? How could i capture screenshots from the stream?
Thanks
Here is some code that can help you taking a screen shot and automatically saving it. OPTION 1.
Dim screenShot As New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb)
Dim g = Graphics.FromImage(screenShot)
g.CopyFromScreen(0, 0, 0, 0, screenShot.Size)
g.Dispose()
screenShot.Save("C:\test.bmp")
You could put this in a timer or something and just add like the date or an incremented number to the end of the file name.
For option 2 you might have to resort to some third party program to be able to do what you want. As far as I know, the only way to get a capture of your screen is to have it visible. Maybe I'll poke around at it. You've got me curious now.

Windows phone universal app is using camera only one time

In my app I have a button which open camera, take picture and do some processing on it and return back to previous page with the results.
Now Problem is this that it works one time and on second time it open other page but doesn't show camera. Then I have to completely close my application and again launch it to make it work.
I think this is happening because when I am taking picture first time, I open camera, capture it in a captureElement and when I open it second time the previous code is using camera or some thing. I thing there is some thing to close camera which i am missing.
You have to initialize camera every time you navigate to the page that contains it (OnNavigatedTo method). If you want to write a good code you have to deactive camera every time you leave the page (OnNavigatedFrom method). I hope this could be help you.

Record Silverlight 4 MediaElement content

At the moment I'm working on a project. Which contains streaming from an IP camera to the Silverlight 4 MediaElement. The stream that goes through the MediaElement, needs to be cut when a button is clicked.
So is it possible to record MediaElement's content on demand? When that's done, write the recorded part of MediaElement to disk.
If it is possible, what's the most efficient way to do this?
Thank you in advance,
AFAIK, extract part of the entirely video, you can just use a program which has record screen function to record silverlight video on demand. Then you just play the video and use it to start recording from desired beginning and finish recording at intended ending. Thus you will get demand content.