Image processing real-time webcam feed and having flicker stimulus on screen too

Hi

I am try to set an experiment where I have a real-time webcam (30fps) on screen and I would like to apply an image process (e.g., filter the blue channel or converting the image to grayscale) to this video and at the same time I want to present stimulus on screen that has to flicker at specific frequencies (e.g., an object flickering at 8 Hz).

I am using the piece of code (below) to capture the video and put it on screen. However, if I set 'waitforImage' to zero, the flip is not longer ~1/60 (i.e., monitor refresh rate) so it doesn't ensure my stimulus flickers at a desire frequency. On the other hand, if I set 'waitforImage' to 4 it displays the video just fine and presents the stimulus at the right frequencies but the pointer out from 'GetCaptureImage' doesn't return any image (it returns 0) thus I can't do any image processing on-line procedure to the video and display it in real time. How can I do image processing on the video, flick stimulus on the video (when necessary) and all that while ensuring the 'flip' goes at 1/60Hz?

Screen('HookFunction'..., maybe? Is there another fast command to capture and display video than using the little known PsychCV and it's ARRenderImage arguments? I have tried using Screen('DrawTexture'.... but it's really slow and clearing the image (so it frees memory) every flip (loop iteration) just makes even slower affecting the frequency of all stimuli. Using the code below was the only way so far I've been able to displays the video, generate the stimuli at the right frequency at any time but I can't do any image processing to the video image.


Screen('GetCapturedImage', win, grabber, 0, [], 4, imgbuffer);
Screen('BeginOpenGL', win);
glClear(GL.DEPTH_BUFFER_BIT); % Clear z-buffer
PsychCV('ARRenderImage'); % Render current video image as backdrop
Screen('EndOpenGL', win);
Screen('DrawTexture', win, TextureCornerSq{1}, [], CornerPos);

if count >= 100 && count <= 400
if mod(count, 8) == 1
Screen('DrawTexture', win, TextureCornerSq{2}, [], CornerPos);
Screen('DrawTexture', win, TextureWhiteSq, [], position);
else
Screen('DrawTexture', win, TextureCornerSq{1}, [], CornerPos);
Screen('DrawTexture', win, TextureBlackSq, [], position);
end
end

Thanks in advance,
Alex
You could change colorMask anytime, and the change is very fast. Also, although I haven't tested it, the mask value can be a fraction like 0.2, which will act like a filter on whole image. Is this enough for your purpose?

-Xiangrui

--- In psychtoolbox@yahoogroups.com, "neurokillswitch" <firpihir@...> wrote:
>
> Hi Xiangrui
>
> Thank you. I am looking for something more like a filter. You see, the user will be able to click at some "icons" and pick any channel in real time and whenever the user wants he can go back to original colors just by turning off the button. So it needs to be written in a way where one sets a flag on and the filter starts working. I was taking a look at convolution2D shader but this shader applies the same kernel (a mxn matrix) to each channel. It'd be ideal if the kernel is more like (mxnx3) matrix. That way one could set R and B channels to 0 and green channel comes as an output. Does that make any sense? =)
>
> Best,
> Alex
>
> --- In psychtoolbox@yahoogroups.com, "xrli2002" <xrli2002@> wrote:
> >
> > It seems to me the simplest solution is to set colorMast as [0 1 0] in
> > Screen BlendFunction
> >
> > -Xiangrui
> >
> > --- In psychtoolbox@yahoogroups.com, "neurokillswitch" <firpihir@> wrote:
> > >
> > > Mario
> > >
> > > Some image processing I'd like to do is to remove the red and blue channels from the image and just present the green channel (remember the icons I mentioned before? One of those icons would allow the user to select the command and see the image green). What would be the most efficient way to do this using Screen?
> > >
> > > Thanks,
> > > Alex
> > >
> > > --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> > > >
> > > >
> > > >
> > > > --- In psychtoolbox@yahoogroups.com, "neurokillswitch" <firpihir@> wrote:
> > > > >
> > > > > Mario
> > > > >
> > > > > First of all, thanks!
> > > > >
> > > > > I think I am figuring it out thanks to you. I think a firewire camera will help but it seems it not the big issue right now (I am planning to get one, though. I was checking few of them and I liked the AVT Gumpy F-036C (62 FPS). If you have any opinion about it, let me know).
> > > > >
> > > >
> > > > No opinion. I used the cheap Unibrain Fire-i in the 100$ price segment and some Basler cameras in the > 1000$ category and was happy with them. In general IIDC compliant Firewire cameras are well standardized, i wouldn't expect any unpleasant surprises with any model. But it really only matters if you need a lot of control over acquisition parameters or very precise timing or timestamping, or synchronized acquisition across multiple cameras. For many simple things, a USB webcam will do.
> > > >
> > > > > Now, what I realized is that in the ImagingVideoCaptureDemo.m The Screen('flip'...) it's inside the if (tex > 0) condition. In my particular problem, I have the video image that needs to be updated. Also I have a number of "icons" (squares I created using MakeTexture which actually operations that the user selects) of different colors superimposed on the video image. Those icons are going to flick or blink at a frequency between 8 and 13 Hz. If Screen('flip', ...) is inside the if (tex > 0) condition, the icons are going to flick just when tex > 0 is met thus the icons are going to flick at totally different frequencies (more like a messy slow motion). On the other hand, if I put the Screen('flip'...) outside the if tex > 0 condition, the icons flip at the right frequency but the video image is updated at a faster speed that the video cam resolution (30 fps vs. 60 Hz refresh rate) so the video looks like blinking.
> > > > >
> > > > > In other words, how can you have different "textures" (i.e., video image and my icons) all going at different frequencies in the same window?
> > > > >
> > > >
> > > > One simple way is to set the Screen('Flip', ..., dontclear) flag to 1, so the window doesn't get cleared after a flip. Then your video image persists even if it isn't redrawn every flip. You only redraw your little icons. A properly placed PsychImaging('AddTask', 'General', 'UseVirtualFramebuffer'); makes sure that this is efficient.
> > > >
> > > > Another way, if you look at the original code of that demo, would be to place the Screen('DrawTexture', win, ftex); call outside the if (tex>0) statement like this:
> > > >
> > > > if ftex > 0
> > > > Screen('DrawTexture', win, ftex);
> > > > end
> > > >
> > > > and get rid of the Screen('Close', ftex) completely, instead feed ftex into Screen('TransformTexture') for recycling:
> > > >
> > > > ftex = Screen('TransformTexture', tex, bluroperator, blurmaptex, ftex);
> > > >
> > > > The inner segement of the loop would look this way:
> > > >
> > > > while whatever
> > > > [tex pts nrdropped]=Screen('GetCapturedImage', win, grabber, 0, tex);
> > > >
> > > > if tex > 0
> > > > % Apply image processing to tex, store result in ftex, recycle old ftex:
> > > > ftex = Screen('TransformTexture', tex, bluroperator, blurmaptex, ftex);
> > > > end;
> > > >
> > > > if ftex > 0
> > > > % Draw new processed ftex texture from framegrabber.
> > > > Screen('DrawTexture', win, ftex); %, [], Screen('Rect', win));
> > > > end;
> > > >
> > > > % Draw flickering icons...
> > > >
> > > > % Show it.
> > > > Screen('Flip', win);
> > > > end
> > > >
> > > > ftex is always drawn, each frame, but only updated with an image-processed tex from the camera if there is a new tex available from the camera.
> > > >
> > > > Of course you will need to use some other image processing operator for your purpose.
> > > >
> > > > Or maybe you don't need any if it is a simple enough manipulation. The trick in that case is just to check if tex is valid (non-zero). If it is, you Screen('Close', ftex); the old ftex, assign ftex = tex and set tex = 0; A bit of shuffling with texture handles, making sure you don't delete or recycle textures you still need.
> > > >
> > > > -mario
> > > >
> > > >
> > > >
> > > > >
> > > > >
> > > > > --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > > Nothing wrong there. It can capture and draw at 30 fps, i assume because the camera can't go faster and that's what is set as fps in the demo. As expected, making and drawing a texture takes way less than 16 msecs -- apparently less than 3 msecs if you use the caching of video textures, if you do it as in ImagingVideoCaptureDemo.
> > > > > >
> > > > > > I notice that your ptb is rather outdated, updating would be a good start, so you look at the same code as me and get the latest performance improvements and fixes.
> > > > > >
> > > > > > Try ImagingVideoCaptureDemo as a starting point again, with the following modifications:
> > > > > >
> > > > > > [tex pts nrdropped]=Screen('GetCapturedImage', win, grabber, 1, tex);
> > > > > >
> > > > > > turned into:
> > > > > >
> > > > > > [tex pts nrdropped]=Screen('GetCapturedImage', win, grabber, 0, tex);
> > > > > >
> > > > > > so you still use caching of the 'tex'ture but don't wait for new frames from the camera, but poll for them. The if (tex>0) will make sure that all texture processing/drawing is skipped if no new frame is available, so you can still flip at 60 fps instead of the 30 fps at which the camera delivers video.
> > > > > >
> > > > > > Replace this:
> > > > > >
> > > > > > ftex = Screen('TransformTexture', tex, bluroperator, blurmaptex);
> > > > > >
> > > > > > % Draw new texture from framegrabber.
> > > > > > Screen('DrawTexture', win, ftex); %, [], Screen('Rect', win));
> > > > > > Screen('Close', ftex);
> > > > > >
> > > > > > With this:
> > > > > >
> > > > > > Screen('DrawTexture', win, tex);
> > > > > >
> > > > > > So you skip the image processing. The image processing in this demo is actually somewhat compute intense. I doubt it would bring down fps to 15 fps, but the controllable image convolution is certainly more expensive than some simple color correction.
> > > > > >
> > > > > >
> > > > > > All the PsychImaging('AddTask',...) lines should go, although you'd expect minimal performance impact.
> > > > > >
> > > > > > And also check the impact of the GetMouse() queries and processing of mouse button presses. Maybe the performance problem is not where you think it is? I don't really see why that would happen, but Screen('Drawtexture') is not a likely candidate for the low performance, according to your benchmark results.
> > > > > >
> > > > > > Another hunch: Some webcams throttle their capture framerate depending on lighting conditions. Apple's iSight, e.g., don't care about what framerate you request, they simply adapt it according to lighting - 30 fps on a bright day or with bright indoor lighting, 15 fps or even only 7.5 fps on a rainy day or with weaker lighting. Maybe your webcam does the same, e.g., reducing fps to 15 fps on low light conditions?
> > > > > >
> > > > > > The best cheap consumer level USB webcam i know of is the Sony PlayStation Eye camera. They sell for 20 Euros and have excellent performance and control over various parameters. Under Linux they can do 60 fps at full 640x480 resolution (Windows / OSX do 30 fps with the drivers i found, maybe there are better ones now), and iirc can go up to 120 fps at reduced 320x240 resolution.
> > > > > >
> > > > > > Some clever people from the Faisal lab at Imperial College London managed to built a pretty decent eye tracker for about 50$ with a pair of those cameras - comparable with a 25000$ eye tracker for many relevant tasks. Pretty cool:
> > > > > > <http://phys.org/news/2012-07-low-cost-device-eyes-video.html>
> > > > > > <http://www.faisallab.com/>
> > > > > >
> > > > > > The advantage of pro-level Firewire cameras is usually lower latency, higher framerates/resolution/dynamic range, more control over image acquisition parameters, reliable timestamps of when an image was captured and often the ability to synchronize multiple cameras. With consumer cams you lose some or all of that, but our standard video capture engine for such cams is definitely capable of doing 120 fps if the camera provides that.
> > > > > >
> > > > > > -mario
> > > > > >
> > > > > > --- In psychtoolbox@yahoogroups.com, "firpihir" <firpihir@> wrote:
> > > > > > >
> > > > > > > Mario
> > > > > > >
> > > > > > > > It shouldn't be that slow, 60 fps should be feasible at least without demanding image processing, for a simple get->draw->flip loop and proper polling. Is your ptb up to date? What framerate does VideoCaptureDemo give you? Difference between fullscreen mode and windowed mode? What performance do you see with MakeTextureTimingTest2 if you set the image resolution to what your camera provides?
> > > > > > > >
> > > > > > > > If you set Screen('preference','verbosity', 10), what are the timings it reports for capture operations?
> > > > > > >
> > > > > > > I ran VideoCaptureDemo for 63.1513 and Framerate is 30fps (avgfps = 29.8806). I ran the fullscreen mode (VideoCaptureDemo(1, 1, [0 0 640 480])) vs. windowed mode (VideoCaptureDemo(1, 0, [0 0 640 480])) and there seems to be no difference. I went a step further and modified the function to save the timestamps (pts) and created a diff(TimeStamps)) plot. ........... (Well, heck, I don't know how to post images on here). The results out of MakeTextureTimingTest2 are as follow (for 640x480) (cont' below results):
> > > > > > >
> > > > > > >
> > > > > > > PTB-INFO: This is Psychtoolbox-3 for GNU/Linux X11, under Matlab (Version 3.0.9 - Build date: Oct 21 2011).
> > > > > > > PTB-INFO: Type 'PsychtoolboxVersion' for more detailed version information.
> > > > > > > PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with
> > > > > > > PTB-INFO: some restrictions. See file 'License.txt' in the Psychtoolbox root folder for the exact licensing conditions.
> > > > > > >
> > > > > > > PTB-INFO: nVidia Corporation - G71GL [Quadro FX 3500] GPU found. Trying to establish low-level access...
> > > > > > > PTB-INFO: Could not probe properties of GPU for screenId 0 [Permission denied]
> > > > > > > PTB-INFO: Beamposition timestamping and other special features disabled.
> > > > > > > PTB-INFO: Failed to enable realtime-scheduling [Operation not permitted]!
> > > > > > > PTB-INFO: You need to run Matlab or Octave with root-privileges for this to work.
> > > > > > >
> > > > > > >
> > > > > > > PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: Quadro FX 3500/PCI/SSE2 :: 2.1.2 NVIDIA 280.13
> > > > > > > PTB-INFO: VBL startline = 1050 , VBL Endline = -1
> > > > > > > PTB-INFO: Beamposition queries unsupported or defective on this system. Using basic timestamping as fallback: Timestamps returned by Screen('Flip') will be less robust and accurate.
> > > > > > > PTB-INFO: Measured monitor refresh interval from VBLsync = 16.729183 ms [59.775782 Hz]. (50 valid samples taken, stddev=0.014362 ms.)
> > > > > > > PTB-INFO: Reported monitor refresh interval from operating system = 16.679455 ms [59.953999 Hz].
> > > > > > > PTB-INFO: Small deviations between reported values are normal and no reason to worry.
> > > > > > >
> > > > > > > Average Make -> Upload -> Destroy time for a 640 x 480 pixels, 4 channels texture over 100 samples is: 5.504508 msecs.
> > > > > > >
> > > > > > > Average glTexSubImage2D() -> Upload time for a 640 x 480 pixels, 4 channels texture over 100 samples is: 2.156398 msecs.
> > > > > > >
> > > > > > >
> > > > > > > ===>> (CONTINUATION....) and finally I went to VideoCaptureDemo, added the line Screen('preference','verbosity', 10), ran it, and below are the results (below my name). Not sure how many iterations you wanted so posted several of them.
> > > > > > >
> > > > > > > Hope that gives you a better insight. If you need plots, let me know how I can send them.
> > > > > > >
> > > > > > > Alex
> > > > > > >
> > > > > > >
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 49.000000 46.000000 54.000000 48.000000 52.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 53.000000 46.000000 57.000000 52.000000 51.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 57.000000 57.000000 57.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 53.000000 46.000000 57.000000 55.000000 54.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 52.000000 48.000000 49.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 48.000000 49.000000 49.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 54.000000 49.000000 48.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 48.000000 52.000000 52.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 55.000000 50.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 48.000000 55.000000 54.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 53.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 49.000000 49.000000 49.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 55.000000 53.000000 52.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 49.000000 52.000000 52.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 51.000000 51.000000 48.000000 56.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 49.000000 55.000000 54.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 49.000000 46.000000 57.000000 57.000000 54.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 50.000000 49.000000 50.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 57.000000 57.000000 54.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 50.000000 52.000000 52.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 48.000000 53.000000 52.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 50.000000 55.000000 57.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 55.000000 54.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 51.000000 49.000000 50.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 49.000000 54.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 51.000000 52.000000 52.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 56.000000 53.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 51.000000 55.000000 57.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 55.000000 48.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 52.000000 49.000000 50.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 54.000000 51.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 52.000000 52.000000 52.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 52.000000 49.000000 55.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 52.000000 55.000000 57.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 56.000000 57.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 53.000000 49.000000 50.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 51.000000 52.000000 54.000000 50.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 53.000000 52.000000 52.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 53.000000 51.000000 55.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 53.000000 55.000000 57.000000 55.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 56.000000 48.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 54.000000 49.000000 50.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 52.000000 50.000000 56.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 54.000000 52.000000 55.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 56.000000 56.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 54.000000 56.000000 48.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 50.000000 55.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 55.000000 49.000000 50.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 55.000000 53.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 55.000000 52.000000 55.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 57.000000 49.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 55.000000 56.000000 48.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 52.000000 57.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 56.000000 49.000000 50.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 57.000000 56.000000 55.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 56.000000 52.000000 55.000000 55.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 55.000000 52.000000 50.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 56.000000 56.000000 48.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 52.000000 48.000000 53.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 57.000000 49.000000 53.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 55.000000 51.000000 51.000000 55.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 57.000000 52.000000 55.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 53.000000 57.000000 55.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 57.000000 56.000000 48.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 57.000000 55.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 48.000000 49.000000 53.000000 55.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 57.000000 55.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 48.000000 52.000000 55.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 56.000000 54.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 48.000000 56.000000 48.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 50.000000 55.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 49.000000 49.000000 53.000000 55.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 53.000000 55.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 49.000000 52.000000 56.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 55.000000 55.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 49.000000 56.000000 51.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 56.000000 57.000000 49.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 50.000000 49.000000 54.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 51.000000 54.000000 56.000000 57.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 50.000000 52.000000 56.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 49.000000 46.000000 56.000000 55.000000 55.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 50.000000 56.000000 51.000000 55.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 56.000000 50.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 51.000000 49.000000 53.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 49.000000 52.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 51.000000 52.000000 56.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 57.000000 49.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 51.000000 56.000000 51.000000 55.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 54.000000 48.000000 49.000000 57.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 52.000000 49.000000 53.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 56.000000 53.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 52.000000 52.000000 56.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 57.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 52.000000 56.000000 51.000000 54.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 52.000000 55.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 53.000000 49.000000 53.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 56.000000 56.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 53.000000 53.000000 49.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 56.000000 56.000000 57.000000 57.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 53.000000 56.000000 51.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 49.000000 46.000000 57.000000 54.000000 49.000000 52.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 54.000000 49.000000 54.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 56.000000 48.000000 52.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 54.000000 53.000000 49.000000 54.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 54.000000 48.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 54.000000 56.000000 51.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 57.000000 53.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 55.000000 49.000000 54.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 53.000000 50.000000 52.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 55.000000 53.000000 49.000000 54.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 54.000000 48.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 55.000000 56.000000 51.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 53.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 56.000000 49.000000 57.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 57.000000 53.000000 55.000000 56.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 56.000000 53.000000 49.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 56.000000 57.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 56.000000 56.000000 51.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 54.000000 49.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 57.000000 49.000000 57.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 56.000000 49.000000 56.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 57.000000 53.000000 49.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 55.000000 49.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 57.000000 56.000000 52.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 56.000000 50.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 56.000000 46.000000 48.000000 49.000000 57.000000 54.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 53.000000 54.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 56.000000 46.000000 48.000000 53.000000 49.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 52.000000 56.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> > > > > > > >
> > > > > > > > --- In psychtoolbox@yahoogroups.com, "firpihir" <firpihir@> wrote:
> > > > > > > > >
> > > > > > > > > Hello Mario
> > > > > > > > >
> > > > > > > > > I took a look at that ImagingVideoCapture.m you mentioned and the problem with using:
> > > > > > > > >
> > > > > > > > > Screen('DrawTexture, win, tex, [], [0 0 1280 1024]);
> > > > > > > > > Screen('Close', tex);
> > > > > > > > >
> > > > > > > > > It's slow. When one takes the TimeStamps from Screen like this TimeStamps(count) = Screen('Flip', win) and plot the following
> > > > > > > > >
> > > > > > > > > plot(diff(TimeStamps))
> > > > > > > > >
> > > > > > > > > my plot average around 0.0669s with some fluctuations but the fluctuations are not really important as long as they don't happen very often.
> > > > > > > > >
> > > > > > > > > I need the while loop fast enough so when I plot the aforementioned plot command the average is around 0.0167 (which is exactly the 1/60, that's the refresh rate of the display). I was using WindowsXP 32bit before (for my first post) and now I am using Linux Fedora 14 (I read somewhere a post from you that your "best combo" is using Linux and firewire machine camera) but it is not fast enough. Granted. I am using a inexpressive Logictech USB webcam (not a firewire machine camera) and the graphic card is a Quadro FX 3500 256MB.
> > > > > > > > >
> > > > > > > >
> > > > > > > > It shouldn't be that slow, 60 fps should be feasible at least without demanding image processing, for a simple get->draw->flip loop and proper polling. Is your ptb up to date? What framerate does VideoCaptureDemo give you? Difference between fullscreen mode and windowed mode? What performance do you see with MakeTextureTimingTest2 if you set the image resolution to what your camera provides?
> > > > > > > >
> > > > > > > > If you set Screen('preference','verbosity', 10), what are the timings it reports for capture operations?
> > > > > > > >
> > > > > > > > -mario
> > > > > > > >
> > > > > > > >
> > > > > > > > > Until I can ensure that polling for the image, image process it, and display it can be done below 0.0167 s, I can't ensure my flickering squares are going flick at the exact frequency I want them (e.g., frequency in the alpha band, 8-13 Hz). In short, I need the video, image processing, and some "alpha-band range stimulus squares" running at 0.0167.
> > > > > > > > >
> > > > > > > > > (By the way, in my previous post when I was talking "cleaning the image" I meant to close it using Screen('Close'...) so it frees memory. My bad, though. I was not clear enough.)
> > > > > > > > >
> > > > > > > > > Other specs just in case: My Matlab is R2010a. Linux machine is Intel Quad-core.
> > > > > > > > >
> > > > > > > > > Any ideas? If one of your recommendation is to get a firewire machine camera, please, let me know which one you recommend or any suggestion.
> > > > > > > > >
> > > > > > > > > Thanks in advance!
> > > > > > > > > Alex
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --- In psychtoolbox@yahoogroups.com, "firpihir" <firpihir@> wrote:
> > > > > > > > > > >
> > > > > > > > > > > Hi
> > > > > > > > > > >
> > > > > > > > > > > I am try to set an experiment where I have a real-time webcam (30fps) on screen and I would like to apply an image process (e.g., filter the blue channel or converting the image to grayscale) to this video and at the same time I want to present stimulus on screen that has to flicker at specific frequencies (e.g., an object flickering at 8 Hz).
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Have a look at ImagingVideoCaptureDemo.m That shows how to capture an image, apply some image processing to it on the GPU (a blur in this case) and display it.
> > > > > > > > > >
> > > > > > > > > > > I am using the piece of code (below) to capture the video and put it on screen. However, if I set 'waitforImage' to zero, the flip is not longer ~1/60 (i.e., monitor refresh rate) so it doesn't ensure my stimulus flickers at a desire frequency. On the other hand, if I set 'waitforImage' to 4 it displays the video just fine and presents the stimulus at the right frequencies but the pointer out from 'GetCaptureImage' doesn't return any image (it returns 0) thus I can't do any image processing on-line procedure to the video and
> > > > > > > > > >
> > > > > > > > > > You have to poll for new images. A wait would throttle you to the 30 fps of your camera. A setting of zero will poll for new images, 60 times per second when your loop repeats after each Screen('Flip'). Either there is one, then a non-zero handle will be returned, or there's none, then zero will be returned. You simply have to make sure that you only try to image process and draw the image if the returned texture handle is > 0, and otherwise skip that step. You can see that in ImagingVideocaptureDemo as well, although there it is only useful if the waitForImage flag is set to zero.
> > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Screen('HookFunction'..., maybe? Is there another fast command to capture and display video than using the little known PsychCV and it's ARRenderImage arguments? I have tried using Screen('DrawTexture'.... but it's really slow and clearing the image (so it frees memory) every flip (loop iteration) just makes even slower affecting the frequency of all stimuli. Using the code below
> > > > > > > > > >
> > > > > > > > > > Not sure what you mean with clearing the image? 'Getcapturedimage' -> process -> drawtexture -> flip should be fast if properly used. The demo also shows how to recycle the original texture from getcapturedimage to save a bit of time. And flip has options to avoid redrawing the framebuffer.
> > > > > > > > > >
> > > > > > > > > > PsychCV ARxxx stuff is not recommended. It is only useful for special augmented reality applications, and only supported in current PTB releases when used with 32-Bit GNU/Octave on OSX, not with Matlab. Even there it is basically a leftover. I've never seen anybody using it for anything, so i decided it wasn't worth the continued maintenance effort.
> > > > > > > > > >
> > > > > > > > > > -mario
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > was the only way so far I've been able to displays the video, generate the stimuli at the right frequency at any time but I can't do any image processing to the video image.
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Screen('GetCapturedImage', win, grabber, 0, [], 4, imgbuffer);
> > > > > > > > > > > Screen('BeginOpenGL', win);
> > > > > > > > > > > glClear(GL.DEPTH_BUFFER_BIT); % Clear z-buffer
> > > > > > > > > > > PsychCV('ARRenderImage'); % Render current video image as backdrop
> > > > > > > > > > > Screen('EndOpenGL', win);
> > > > > > > > > > > Screen('DrawTexture', win, TextureCornerSq{1}, [], CornerPos);
> > > > > > > > > > >
> > > > > > > > > > > if count >= 100 && count <= 400
> > > > > > > > > > > if mod(count, 8) == 1
> > > > > > > > > > > Screen('DrawTexture', win, TextureCornerSq{2}, [], CornerPos);
> > > > > > > > > > > Screen('DrawTexture', win, TextureWhiteSq, [], position);
> > > > > > > > > > > else
> > > > > > > > > > > Screen('DrawTexture', win, TextureCornerSq{1}, [], CornerPos);
> > > > > > > > > > > Screen('DrawTexture', win, TextureBlackSq, [], position);
> > > > > > > > > > > end
> > > > > > > > > > > end
> > > > > > > > > > >
> > > > > > > > > > > Thanks in advance,
> > > > > > > > > > > Alex
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
The modulateColor parameter to Screen('DrawTexture') is another option to change intensity per color-channel, e.g.,

modulateColor = [RedFactor, GreenFactor, BlueFactor, AlphaFactor], so

[0 255 128 255] would set red channel to 0/255 = 0 -> Red color zero, green channel unmodified 255/255 = 1, blue channel down to 128/255 == 0.5 or 50% intensity, ...

This multiplies color channels with those values during drawing.
The colormask Xiangrui proposed is a binary on or off thing. It blocks any modification of the framebuffers color channels if they are disabled.
Peter's ideas with alpha-blending would allow more complex manipulations.

All of these are rather cheap and fast -- no need for shaders or anything else more compute intense. For your purpose, you probably wouldn't be able to measure an impact to performance.

-mario


--- In psychtoolbox@yahoogroups.com, "neurokillswitch" <firpihir@...> wrote:
>
> Hi Xiangrui
>
> Thank you. I am looking for something more like a filter. You see, the user will be able to click at some "icons" and pick any channel in real time and whenever the user wants he can go back to original colors just by turning off the button. So it needs to be written in a way where one sets a flag on and the filter starts working. I was taking a look at convolution2D shader but this shader applies the same kernel (a mxn matrix) to each channel. It'd be ideal if the kernel is more like (mxnx3) matrix. That way one could set R and B channels to 0 and green channel comes as an output. Does that make any sense? =)
>
> Best,
> Alex
>
> --- In psychtoolbox@yahoogroups.com, "xrli2002" <xrli2002@> wrote:
> >
> > It seems to me the simplest solution is to set colorMast as [0 1 0] in
> > Screen BlendFunction
> >
> > -Xiangrui
> >
> > --- In psychtoolbox@yahoogroups.com, "neurokillswitch" <firpihir@> wrote:
> > >
> > > Mario
> > >
> > > Some image processing I'd like to do is to remove the red and blue channels from the image and just present the green channel (remember the icons I mentioned before? One of those icons would allow the user to select the command and see the image green). What would be the most efficient way to do this using Screen?
> > >
> > > Thanks,
> > > Alex
> > >
> > > --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> > > >
> > > >
> > > >
> > > > --- In psychtoolbox@yahoogroups.com, "neurokillswitch" <firpihir@> wrote:
> > > > >
> > > > > Mario
> > > > >
> > > > > First of all, thanks!
> > > > >
> > > > > I think I am figuring it out thanks to you. I think a firewire camera will help but it seems it not the big issue right now (I am planning to get one, though. I was checking few of them and I liked the AVT Gumpy F-036C (62 FPS). If you have any opinion about it, let me know).
> > > > >
> > > >
> > > > No opinion. I used the cheap Unibrain Fire-i in the 100$ price segment and some Basler cameras in the > 1000$ category and was happy with them. In general IIDC compliant Firewire cameras are well standardized, i wouldn't expect any unpleasant surprises with any model. But it really only matters if you need a lot of control over acquisition parameters or very precise timing or timestamping, or synchronized acquisition across multiple cameras. For many simple things, a USB webcam will do.
> > > >
> > > > > Now, what I realized is that in the ImagingVideoCaptureDemo.m The Screen('flip'...) it's inside the if (tex > 0) condition. In my particular problem, I have the video image that needs to be updated. Also I have a number of "icons" (squares I created using MakeTexture which actually operations that the user selects) of different colors superimposed on the video image. Those icons are going to flick or blink at a frequency between 8 and 13 Hz. If Screen('flip', ...) is inside the if (tex > 0) condition, the icons are going to flick just when tex > 0 is met thus the icons are going to flick at totally different frequencies (more like a messy slow motion). On the other hand, if I put the Screen('flip'...) outside the if tex > 0 condition, the icons flip at the right frequency but the video image is updated at a faster speed that the video cam resolution (30 fps vs. 60 Hz refresh rate) so the video looks like blinking.
> > > > >
> > > > > In other words, how can you have different "textures" (i.e., video image and my icons) all going at different frequencies in the same window?
> > > > >
> > > >
> > > > One simple way is to set the Screen('Flip', ..., dontclear) flag to 1, so the window doesn't get cleared after a flip. Then your video image persists even if it isn't redrawn every flip. You only redraw your little icons. A properly placed PsychImaging('AddTask', 'General', 'UseVirtualFramebuffer'); makes sure that this is efficient.
> > > >
> > > > Another way, if you look at the original code of that demo, would be to place the Screen('DrawTexture', win, ftex); call outside the if (tex>0) statement like this:
> > > >
> > > > if ftex > 0
> > > > Screen('DrawTexture', win, ftex);
> > > > end
> > > >
> > > > and get rid of the Screen('Close', ftex) completely, instead feed ftex into Screen('TransformTexture') for recycling:
> > > >
> > > > ftex = Screen('TransformTexture', tex, bluroperator, blurmaptex, ftex);
> > > >
> > > > The inner segement of the loop would look this way:
> > > >
> > > > while whatever
> > > > [tex pts nrdropped]=Screen('GetCapturedImage', win, grabber, 0, tex);
> > > >
> > > > if tex > 0
> > > > % Apply image processing to tex, store result in ftex, recycle old ftex:
> > > > ftex = Screen('TransformTexture', tex, bluroperator, blurmaptex, ftex);
> > > > end;
> > > >
> > > > if ftex > 0
> > > > % Draw new processed ftex texture from framegrabber.
> > > > Screen('DrawTexture', win, ftex); %, [], Screen('Rect', win));
> > > > end;
> > > >
> > > > % Draw flickering icons...
> > > >
> > > > % Show it.
> > > > Screen('Flip', win);
> > > > end
> > > >
> > > > ftex is always drawn, each frame, but only updated with an image-processed tex from the camera if there is a new tex available from the camera.
> > > >
> > > > Of course you will need to use some other image processing operator for your purpose.
> > > >
> > > > Or maybe you don't need any if it is a simple enough manipulation. The trick in that case is just to check if tex is valid (non-zero). If it is, you Screen('Close', ftex); the old ftex, assign ftex = tex and set tex = 0; A bit of shuffling with texture handles, making sure you don't delete or recycle textures you still need.
> > > >
> > > > -mario
> > > >
> > > >
> > > >
> > > > >
> > > > >
> > > > > --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > > Nothing wrong there. It can capture and draw at 30 fps, i assume because the camera can't go faster and that's what is set as fps in the demo. As expected, making and drawing a texture takes way less than 16 msecs -- apparently less than 3 msecs if you use the caching of video textures, if you do it as in ImagingVideoCaptureDemo.
> > > > > >
> > > > > > I notice that your ptb is rather outdated, updating would be a good start, so you look at the same code as me and get the latest performance improvements and fixes.
> > > > > >
> > > > > > Try ImagingVideoCaptureDemo as a starting point again, with the following modifications:
> > > > > >
> > > > > > [tex pts nrdropped]=Screen('GetCapturedImage', win, grabber, 1, tex);
> > > > > >
> > > > > > turned into:
> > > > > >
> > > > > > [tex pts nrdropped]=Screen('GetCapturedImage', win, grabber, 0, tex);
> > > > > >
> > > > > > so you still use caching of the 'tex'ture but don't wait for new frames from the camera, but poll for them. The if (tex>0) will make sure that all texture processing/drawing is skipped if no new frame is available, so you can still flip at 60 fps instead of the 30 fps at which the camera delivers video.
> > > > > >
> > > > > > Replace this:
> > > > > >
> > > > > > ftex = Screen('TransformTexture', tex, bluroperator, blurmaptex);
> > > > > >
> > > > > > % Draw new texture from framegrabber.
> > > > > > Screen('DrawTexture', win, ftex); %, [], Screen('Rect', win));
> > > > > > Screen('Close', ftex);
> > > > > >
> > > > > > With this:
> > > > > >
> > > > > > Screen('DrawTexture', win, tex);
> > > > > >
> > > > > > So you skip the image processing. The image processing in this demo is actually somewhat compute intense. I doubt it would bring down fps to 15 fps, but the controllable image convolution is certainly more expensive than some simple color correction.
> > > > > >
> > > > > >
> > > > > > All the PsychImaging('AddTask',...) lines should go, although you'd expect minimal performance impact.
> > > > > >
> > > > > > And also check the impact of the GetMouse() queries and processing of mouse button presses. Maybe the performance problem is not where you think it is? I don't really see why that would happen, but Screen('Drawtexture') is not a likely candidate for the low performance, according to your benchmark results.
> > > > > >
> > > > > > Another hunch: Some webcams throttle their capture framerate depending on lighting conditions. Apple's iSight, e.g., don't care about what framerate you request, they simply adapt it according to lighting - 30 fps on a bright day or with bright indoor lighting, 15 fps or even only 7.5 fps on a rainy day or with weaker lighting. Maybe your webcam does the same, e.g., reducing fps to 15 fps on low light conditions?
> > > > > >
> > > > > > The best cheap consumer level USB webcam i know of is the Sony PlayStation Eye camera. They sell for 20 Euros and have excellent performance and control over various parameters. Under Linux they can do 60 fps at full 640x480 resolution (Windows / OSX do 30 fps with the drivers i found, maybe there are better ones now), and iirc can go up to 120 fps at reduced 320x240 resolution.
> > > > > >
> > > > > > Some clever people from the Faisal lab at Imperial College London managed to built a pretty decent eye tracker for about 50$ with a pair of those cameras - comparable with a 25000$ eye tracker for many relevant tasks. Pretty cool:
> > > > > > <http://phys.org/news/2012-07-low-cost-device-eyes-video.html>
> > > > > > <http://www.faisallab.com/>
> > > > > >
> > > > > > The advantage of pro-level Firewire cameras is usually lower latency, higher framerates/resolution/dynamic range, more control over image acquisition parameters, reliable timestamps of when an image was captured and often the ability to synchronize multiple cameras. With consumer cams you lose some or all of that, but our standard video capture engine for such cams is definitely capable of doing 120 fps if the camera provides that.
> > > > > >
> > > > > > -mario
> > > > > >
> > > > > > --- In psychtoolbox@yahoogroups.com, "firpihir" <firpihir@> wrote:
> > > > > > >
> > > > > > > Mario
> > > > > > >
> > > > > > > > It shouldn't be that slow, 60 fps should be feasible at least without demanding image processing, for a simple get->draw->flip loop and proper polling. Is your ptb up to date? What framerate does VideoCaptureDemo give you? Difference between fullscreen mode and windowed mode? What performance do you see with MakeTextureTimingTest2 if you set the image resolution to what your camera provides?
> > > > > > > >
> > > > > > > > If you set Screen('preference','verbosity', 10), what are the timings it reports for capture operations?
> > > > > > >
> > > > > > > I ran VideoCaptureDemo for 63.1513 and Framerate is 30fps (avgfps = 29.8806). I ran the fullscreen mode (VideoCaptureDemo(1, 1, [0 0 640 480])) vs. windowed mode (VideoCaptureDemo(1, 0, [0 0 640 480])) and there seems to be no difference. I went a step further and modified the function to save the timestamps (pts) and created a diff(TimeStamps)) plot. ........... (Well, heck, I don't know how to post images on here). The results out of MakeTextureTimingTest2 are as follow (for 640x480) (cont' below results):
> > > > > > >
> > > > > > >
> > > > > > > PTB-INFO: This is Psychtoolbox-3 for GNU/Linux X11, under Matlab (Version 3.0.9 - Build date: Oct 21 2011).
> > > > > > > PTB-INFO: Type 'PsychtoolboxVersion' for more detailed version information.
> > > > > > > PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with
> > > > > > > PTB-INFO: some restrictions. See file 'License.txt' in the Psychtoolbox root folder for the exact licensing conditions.
> > > > > > >
> > > > > > > PTB-INFO: nVidia Corporation - G71GL [Quadro FX 3500] GPU found. Trying to establish low-level access...
> > > > > > > PTB-INFO: Could not probe properties of GPU for screenId 0 [Permission denied]
> > > > > > > PTB-INFO: Beamposition timestamping and other special features disabled.
> > > > > > > PTB-INFO: Failed to enable realtime-scheduling [Operation not permitted]!
> > > > > > > PTB-INFO: You need to run Matlab or Octave with root-privileges for this to work.
> > > > > > >
> > > > > > >
> > > > > > > PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: Quadro FX 3500/PCI/SSE2 :: 2.1.2 NVIDIA 280.13
> > > > > > > PTB-INFO: VBL startline = 1050 , VBL Endline = -1
> > > > > > > PTB-INFO: Beamposition queries unsupported or defective on this system. Using basic timestamping as fallback: Timestamps returned by Screen('Flip') will be less robust and accurate.
> > > > > > > PTB-INFO: Measured monitor refresh interval from VBLsync = 16.729183 ms [59.775782 Hz]. (50 valid samples taken, stddev=0.014362 ms.)
> > > > > > > PTB-INFO: Reported monitor refresh interval from operating system = 16.679455 ms [59.953999 Hz].
> > > > > > > PTB-INFO: Small deviations between reported values are normal and no reason to worry.
> > > > > > >
> > > > > > > Average Make -> Upload -> Destroy time for a 640 x 480 pixels, 4 channels texture over 100 samples is: 5.504508 msecs.
> > > > > > >
> > > > > > > Average glTexSubImage2D() -> Upload time for a 640 x 480 pixels, 4 channels texture over 100 samples is: 2.156398 msecs.
> > > > > > >
> > > > > > >
> > > > > > > ===>> (CONTINUATION....) and finally I went to VideoCaptureDemo, added the line Screen('preference','verbosity', 10), ran it, and below are the results (below my name). Not sure how many iterations you wanted so posted several of them.
> > > > > > >
> > > > > > > Hope that gives you a better insight. If you need plots, let me know how I can send them.
> > > > > > >
> > > > > > > Alex
> > > > > > >
> > > > > > >
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 49.000000 46.000000 54.000000 48.000000 52.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 53.000000 46.000000 57.000000 52.000000 51.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 57.000000 57.000000 57.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 53.000000 46.000000 57.000000 55.000000 54.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 52.000000 48.000000 49.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 48.000000 49.000000 49.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 54.000000 49.000000 48.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 48.000000 52.000000 52.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 55.000000 50.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 48.000000 55.000000 54.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 53.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 49.000000 49.000000 49.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 55.000000 53.000000 52.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 49.000000 52.000000 52.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 51.000000 51.000000 48.000000 56.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 49.000000 55.000000 54.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 49.000000 46.000000 57.000000 57.000000 54.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 50.000000 49.000000 50.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 57.000000 57.000000 54.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 50.000000 52.000000 52.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 48.000000 53.000000 52.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 50.000000 55.000000 57.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 55.000000 54.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 51.000000 49.000000 50.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 49.000000 54.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 51.000000 52.000000 52.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 56.000000 53.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 51.000000 55.000000 57.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 55.000000 48.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 52.000000 49.000000 50.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 54.000000 51.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 52.000000 52.000000 52.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 52.000000 49.000000 55.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 52.000000 55.000000 57.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 56.000000 57.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 53.000000 49.000000 50.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 51.000000 52.000000 54.000000 50.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 53.000000 52.000000 52.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 53.000000 51.000000 55.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 53.000000 55.000000 57.000000 55.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 56.000000 48.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 54.000000 49.000000 50.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 52.000000 50.000000 56.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 54.000000 52.000000 55.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 56.000000 56.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 54.000000 56.000000 48.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 50.000000 55.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 55.000000 49.000000 50.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 55.000000 53.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 55.000000 52.000000 55.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 57.000000 49.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 55.000000 56.000000 48.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 52.000000 57.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 56.000000 49.000000 50.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 57.000000 56.000000 55.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 56.000000 52.000000 55.000000 55.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 55.000000 52.000000 50.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 56.000000 56.000000 48.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 52.000000 48.000000 53.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 57.000000 49.000000 53.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 55.000000 51.000000 51.000000 55.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 57.000000 52.000000 55.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 53.000000 57.000000 55.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 57.000000 56.000000 48.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 57.000000 55.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 48.000000 49.000000 53.000000 55.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 57.000000 55.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 48.000000 52.000000 55.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 56.000000 54.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 48.000000 56.000000 48.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 50.000000 55.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 49.000000 49.000000 53.000000 55.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 53.000000 55.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 49.000000 52.000000 56.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 55.000000 55.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 49.000000 56.000000 51.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 56.000000 57.000000 49.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 50.000000 49.000000 54.000000 50.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 51.000000 54.000000 56.000000 57.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 50.000000 52.000000 56.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 49.000000 46.000000 56.000000 55.000000 55.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 50.000000 56.000000 51.000000 55.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 56.000000 50.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 51.000000 49.000000 53.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 49.000000 52.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 51.000000 52.000000 56.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 57.000000 49.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 51.000000 56.000000 51.000000 55.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 54.000000 48.000000 49.000000 57.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 52.000000 49.000000 53.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 56.000000 53.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 52.000000 52.000000 56.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 57.000000 54.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 52.000000 56.000000 51.000000 54.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 52.000000 55.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 53.000000 49.000000 53.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 56.000000 56.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 53.000000 53.000000 49.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 56.000000 56.000000 57.000000 57.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 53.000000 56.000000 51.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 49.000000 46.000000 57.000000 54.000000 49.000000 52.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 54.000000 49.000000 54.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 56.000000 48.000000 52.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 54.000000 53.000000 49.000000 54.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 54.000000 48.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 54.000000 56.000000 51.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 57.000000 53.000000 53.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 55.000000 49.000000 54.000000 49.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 53.000000 50.000000 52.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 55.000000 53.000000 49.000000 54.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 54.000000 48.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 55.000000 56.000000 51.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 53.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 56.000000 49.000000 57.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 57.000000 53.000000 55.000000 56.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 56.000000 53.000000 49.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 56.000000 57.000000 48.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 56.000000 56.000000 51.000000 57.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 54.000000 49.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 57.000000 49.000000 57.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 56.000000 49.000000 56.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 57.000000 53.000000 49.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 55.000000 49.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 57.000000 56.000000 52.000000 48.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 56.000000 50.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 56.000000 46.000000 48.000000 49.000000 57.000000 54.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 53.000000 54.000000 49.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > > PTB-DEBUG: Allocated unicode string: 56.000000 46.000000 48.000000 53.000000 49.000000 56.000000
> > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 52.000000 56.000000 51.000000
> > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > PTB-DEBUG: ...done.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> > > > > > > >
> > > > > > > > --- In psychtoolbox@yahoogroups.com, "firpihir" <firpihir@> wrote:
> > > > > > > > >
> > > > > > > > > Hello Mario
> > > > > > > > >
> > > > > > > > > I took a look at that ImagingVideoCapture.m you mentioned and the problem with using:
> > > > > > > > >
> > > > > > > > > Screen('DrawTexture, win, tex, [], [0 0 1280 1024]);
> > > > > > > > > Screen('Close', tex);
> > > > > > > > >
> > > > > > > > > It's slow. When one takes the TimeStamps from Screen like this TimeStamps(count) = Screen('Flip', win) and plot the following
> > > > > > > > >
> > > > > > > > > plot(diff(TimeStamps))
> > > > > > > > >
> > > > > > > > > my plot average around 0.0669s with some fluctuations but the fluctuations are not really important as long as they don't happen very often.
> > > > > > > > >
> > > > > > > > > I need the while loop fast enough so when I plot the aforementioned plot command the average is around 0.0167 (which is exactly the 1/60, that's the refresh rate of the display). I was using WindowsXP 32bit before (for my first post) and now I am using Linux Fedora 14 (I read somewhere a post from you that your "best combo" is using Linux and firewire machine camera) but it is not fast enough. Granted. I am using a inexpressive Logictech USB webcam (not a firewire machine camera) and the graphic card is a Quadro FX 3500 256MB.
> > > > > > > > >
> > > > > > > >
> > > > > > > > It shouldn't be that slow, 60 fps should be feasible at least without demanding image processing, for a simple get->draw->flip loop and proper polling. Is your ptb up to date? What framerate does VideoCaptureDemo give you? Difference between fullscreen mode and windowed mode? What performance do you see with MakeTextureTimingTest2 if you set the image resolution to what your camera provides?
> > > > > > > >
> > > > > > > > If you set Screen('preference','verbosity', 10), what are the timings it reports for capture operations?
> > > > > > > >
> > > > > > > > -mario
> > > > > > > >
> > > > > > > >
> > > > > > > > > Until I can ensure that polling for the image, image process it, and display it can be done below 0.0167 s, I can't ensure my flickering squares are going flick at the exact frequency I want them (e.g., frequency in the alpha band, 8-13 Hz). In short, I need the video, image processing, and some "alpha-band range stimulus squares" running at 0.0167.
> > > > > > > > >
> > > > > > > > > (By the way, in my previous post when I was talking "cleaning the image" I meant to close it using Screen('Close'...) so it frees memory. My bad, though. I was not clear enough.)
> > > > > > > > >
> > > > > > > > > Other specs just in case: My Matlab is R2010a. Linux machine is Intel Quad-core.
> > > > > > > > >
> > > > > > > > > Any ideas? If one of your recommendation is to get a firewire machine camera, please, let me know which one you recommend or any suggestion.
> > > > > > > > >
> > > > > > > > > Thanks in advance!
> > > > > > > > > Alex
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --- In psychtoolbox@yahoogroups.com, "firpihir" <firpihir@> wrote:
> > > > > > > > > > >
> > > > > > > > > > > Hi
> > > > > > > > > > >
> > > > > > > > > > > I am try to set an experiment where I have a real-time webcam (30fps) on screen and I would like to apply an image process (e.g., filter the blue channel or converting the image to grayscale) to this video and at the same time I want to present stimulus on screen that has to flicker at specific frequencies (e.g., an object flickering at 8 Hz).
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Have a look at ImagingVideoCaptureDemo.m That shows how to capture an image, apply some image processing to it on the GPU (a blur in this case) and display it.
> > > > > > > > > >
> > > > > > > > > > > I am using the piece of code (below) to capture the video and put it on screen. However, if I set 'waitforImage' to zero, the flip is not longer ~1/60 (i.e., monitor refresh rate) so it doesn't ensure my stimulus flickers at a desire frequency. On the other hand, if I set 'waitforImage' to 4 it displays the video just fine and presents the stimulus at the right frequencies but the pointer out from 'GetCaptureImage' doesn't return any image (it returns 0) thus I can't do any image processing on-line procedure to the video and
> > > > > > > > > >
> > > > > > > > > > You have to poll for new images. A wait would throttle you to the 30 fps of your camera. A setting of zero will poll for new images, 60 times per second when your loop repeats after each Screen('Flip'). Either there is one, then a non-zero handle will be returned, or there's none, then zero will be returned. You simply have to make sure that you only try to image process and draw the image if the returned texture handle is > 0, and otherwise skip that step. You can see that in ImagingVideocaptureDemo as well, although there it is only useful if the waitForImage flag is set to zero.
> > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Screen('HookFunction'..., maybe? Is there another fast command to capture and display video than using the little known PsychCV and it's ARRenderImage arguments? I have tried using Screen('DrawTexture'.... but it's really slow and clearing the image (so it frees memory) every flip (loop iteration) just makes even slower affecting the frequency of all stimuli. Using the code below
> > > > > > > > > >
> > > > > > > > > > Not sure what you mean with clearing the image? 'Getcapturedimage' -> process -> drawtexture -> flip should be fast if properly used. The demo also shows how to recycle the original texture from getcapturedimage to save a bit of time. And flip has options to avoid redrawing the framebuffer.
> > > > > > > > > >
> > > > > > > > > > PsychCV ARxxx stuff is not recommended. It is only useful for special augmented reality applications, and only supported in current PTB releases when used with 32-Bit GNU/Octave on OSX, not with Matlab. Even there it is basically a leftover. I've never seen anybody using it for anything, so i decided it wasn't worth the continued maintenance effort.
> > > > > > > > > >
> > > > > > > > > > -mario
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > was the only way so far I've been able to displays the video, generate the stimuli at the right frequency at any time but I can't do any image processing to the video image.
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Screen('GetCapturedImage', win, grabber, 0, [], 4, imgbuffer);
> > > > > > > > > > > Screen('BeginOpenGL', win);
> > > > > > > > > > > glClear(GL.DEPTH_BUFFER_BIT); % Clear z-buffer
> > > > > > > > > > > PsychCV('ARRenderImage'); % Render current video image as backdrop
> > > > > > > > > > > Screen('EndOpenGL', win);
> > > > > > > > > > > Screen('DrawTexture', win, TextureCornerSq{1}, [], CornerPos);
> > > > > > > > > > >
> > > > > > > > > > > if count >= 100 && count <= 400
> > > > > > > > > > > if mod(count, 8) == 1
> > > > > > > > > > > Screen('DrawTexture', win, TextureCornerSq{2}, [], CornerPos);
> > > > > > > > > > > Screen('DrawTexture', win, TextureWhiteSq, [], position);
> > > > > > > > > > > else
> > > > > > > > > > > Screen('DrawTexture', win, TextureCornerSq{1}, [], CornerPos);
> > > > > > > > > > > Screen('DrawTexture', win, TextureBlackSq, [], position);
> > > > > > > > > > > end
> > > > > > > > > > > end
> > > > > > > > > > >
> > > > > > > > > > > Thanks in advance,
> > > > > > > > > > > Alex
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
--- In psychtoolbox@yahoogroups.com, "neurokillswitch" <firpihir@...> wrote:
>
> Hello folks
>
> Thanks for your ideas/responses. Getting there to the final product but not yet...... Having an issue with:
>
> Screen('BlendFunction', win, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
>
> In Linux, the aforementioned function works fine, showing the transparent icons and the video image at the same time however, in windowsXP (32b , not in the same machine I have Linux)...... It's not showing the image video but just the icons and a black background. It's as if the video feed coming from Screen('GetCapturedImage',....) has the alpha layer set to zero. I know that's not the case. I commented
>

That's probably spot on. It's unlikely alpha-blending itself is broken on your WinXP machine, the function is too crucial for pretty much any 3D app or game for such a bug to go unnoticed. More likely is a bug in the device driver for your camera, which fills the alpha-channel with zero instead of 255 as it should.

Screen('Openvideocapture', ...) has an optional parameter 'pixeldepth'. Try if setting it to 3 fixes the problem. By default it is 4 = RGBA images requested, with the alpha channel set to 255 if the camera has no way of adding some meaningful alpha layer information. A setting of 3 asks for RGB, so the alpha value is always implicitely 255. This should fix it if it isn't a graphics driver bug, in which case you would update your graphics driver. The reason we request RGBA data is because this data format is usually much more efficient to process by the graphics hardware, saving some milliseconds of time.

I assume you use the GStreamer videocapture? This will use the installed DirectShow videocapture filter for your camera on WinXP iirc, so checking if there is some driver update for your webcam would be an option.

Otoh, why bother with WinXP if you have your setup already working on a real operating system?

I assume your performance is now good enough for your task?
-mario



> Screen('BlendFunction', win, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
>
> and ran it the code and does show the image and icons but the icons don't have the transparency effect which I so much need for my experiments.
>
> Ideas?!
>
> Thanks a million in advance,
> Alex
>
>
>
>
>
>
> --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> >
> >
> >
> > The modulateColor parameter to Screen('DrawTexture') is another option to change intensity per color-channel, e.g.,
> >
> > modulateColor = [RedFactor, GreenFactor, BlueFactor, AlphaFactor], so
> >
> > [0 255 128 255] would set red channel to 0/255 = 0 -> Red color zero, green channel unmodified 255/255 = 1, blue channel down to 128/255 == 0.5 or 50% intensity, ...
> >
> > This multiplies color channels with those values during drawing.
> > The colormask Xiangrui proposed is a binary on or off thing. It blocks any modification of the framebuffers color channels if they are disabled.
> > Peter's ideas with alpha-blending would allow more complex manipulations.
> >
> > All of these are rather cheap and fast -- no need for shaders or anything else more compute intense. For your purpose, you probably wouldn't be able to measure an impact to performance.
> >
> > -mario
> >
> >
> > --- In psychtoolbox@yahoogroups.com, "neurokillswitch" <firpihir@> wrote:
> > >
> > > Hi Xiangrui
> > >
> > > Thank you. I am looking for something more like a filter. You see, the user will be able to click at some "icons" and pick any channel in real time and whenever the user wants he can go back to original colors just by turning off the button. So it needs to be written in a way where one sets a flag on and the filter starts working. I was taking a look at convolution2D shader but this shader applies the same kernel (a mxn matrix) to each channel. It'd be ideal if the kernel is more like (mxnx3) matrix. That way one could set R and B channels to 0 and green channel comes as an output. Does that make any sense? =)
> > >
> > > Best,
> > > Alex
> > >
> > > --- In psychtoolbox@yahoogroups.com, "xrli2002" <xrli2002@> wrote:
> > > >
> > > > It seems to me the simplest solution is to set colorMast as [0 1 0] in
> > > > Screen BlendFunction
> > > >
> > > > -Xiangrui
> > > >
> > > > --- In psychtoolbox@yahoogroups.com, "neurokillswitch" <firpihir@> wrote:
> > > > >
> > > > > Mario
> > > > >
> > > > > Some image processing I'd like to do is to remove the red and blue channels from the image and just present the green channel (remember the icons I mentioned before? One of those icons would allow the user to select the command and see the image green). What would be the most efficient way to do this using Screen?
> > > > >
> > > > > Thanks,
> > > > > Alex
> > > > >
> > > > > --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > > --- In psychtoolbox@yahoogroups.com, "neurokillswitch" <firpihir@> wrote:
> > > > > > >
> > > > > > > Mario
> > > > > > >
> > > > > > > First of all, thanks!
> > > > > > >
> > > > > > > I think I am figuring it out thanks to you. I think a firewire camera will help but it seems it not the big issue right now (I am planning to get one, though. I was checking few of them and I liked the AVT Gumpy F-036C (62 FPS). If you have any opinion about it, let me know).
> > > > > > >
> > > > > >
> > > > > > No opinion. I used the cheap Unibrain Fire-i in the 100$ price segment and some Basler cameras in the > 1000$ category and was happy with them. In general IIDC compliant Firewire cameras are well standardized, i wouldn't expect any unpleasant surprises with any model. But it really only matters if you need a lot of control over acquisition parameters or very precise timing or timestamping, or synchronized acquisition across multiple cameras. For many simple things, a USB webcam will do.
> > > > > >
> > > > > > > Now, what I realized is that in the ImagingVideoCaptureDemo.m The Screen('flip'...) it's inside the if (tex > 0) condition. In my particular problem, I have the video image that needs to be updated. Also I have a number of "icons" (squares I created using MakeTexture which actually operations that the user selects) of different colors superimposed on the video image. Those icons are going to flick or blink at a frequency between 8 and 13 Hz. If Screen('flip', ...) is inside the if (tex > 0) condition, the icons are going to flick just when tex > 0 is met thus the icons are going to flick at totally different frequencies (more like a messy slow motion). On the other hand, if I put the Screen('flip'...) outside the if tex > 0 condition, the icons flip at the right frequency but the video image is updated at a faster speed that the video cam resolution (30 fps vs. 60 Hz refresh rate) so the video looks like blinking.
> > > > > > >
> > > > > > > In other words, how can you have different "textures" (i.e., video image and my icons) all going at different frequencies in the same window?
> > > > > > >
> > > > > >
> > > > > > One simple way is to set the Screen('Flip', ..., dontclear) flag to 1, so the window doesn't get cleared after a flip. Then your video image persists even if it isn't redrawn every flip. You only redraw your little icons. A properly placed PsychImaging('AddTask', 'General', 'UseVirtualFramebuffer'); makes sure that this is efficient.
> > > > > >
> > > > > > Another way, if you look at the original code of that demo, would be to place the Screen('DrawTexture', win, ftex); call outside the if (tex>0) statement like this:
> > > > > >
> > > > > > if ftex > 0
> > > > > > Screen('DrawTexture', win, ftex);
> > > > > > end
> > > > > >
> > > > > > and get rid of the Screen('Close', ftex) completely, instead feed ftex into Screen('TransformTexture') for recycling:
> > > > > >
> > > > > > ftex = Screen('TransformTexture', tex, bluroperator, blurmaptex, ftex);
> > > > > >
> > > > > > The inner segement of the loop would look this way:
> > > > > >
> > > > > > while whatever
> > > > > > [tex pts nrdropped]=Screen('GetCapturedImage', win, grabber, 0, tex);
> > > > > >
> > > > > > if tex > 0
> > > > > > % Apply image processing to tex, store result in ftex, recycle old ftex:
> > > > > > ftex = Screen('TransformTexture', tex, bluroperator, blurmaptex, ftex);
> > > > > > end;
> > > > > >
> > > > > > if ftex > 0
> > > > > > % Draw new processed ftex texture from framegrabber.
> > > > > > Screen('DrawTexture', win, ftex); %, [], Screen('Rect', win));
> > > > > > end;
> > > > > >
> > > > > > % Draw flickering icons...
> > > > > >
> > > > > > % Show it.
> > > > > > Screen('Flip', win);
> > > > > > end
> > > > > >
> > > > > > ftex is always drawn, each frame, but only updated with an image-processed tex from the camera if there is a new tex available from the camera.
> > > > > >
> > > > > > Of course you will need to use some other image processing operator for your purpose.
> > > > > >
> > > > > > Or maybe you don't need any if it is a simple enough manipulation. The trick in that case is just to check if tex is valid (non-zero). If it is, you Screen('Close', ftex); the old ftex, assign ftex = tex and set tex = 0; A bit of shuffling with texture handles, making sure you don't delete or recycle textures you still need.
> > > > > >
> > > > > > -mario
> > > > > >
> > > > > >
> > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Nothing wrong there. It can capture and draw at 30 fps, i assume because the camera can't go faster and that's what is set as fps in the demo. As expected, making and drawing a texture takes way less than 16 msecs -- apparently less than 3 msecs if you use the caching of video textures, if you do it as in ImagingVideoCaptureDemo.
> > > > > > > >
> > > > > > > > I notice that your ptb is rather outdated, updating would be a good start, so you look at the same code as me and get the latest performance improvements and fixes.
> > > > > > > >
> > > > > > > > Try ImagingVideoCaptureDemo as a starting point again, with the following modifications:
> > > > > > > >
> > > > > > > > [tex pts nrdropped]=Screen('GetCapturedImage', win, grabber, 1, tex);
> > > > > > > >
> > > > > > > > turned into:
> > > > > > > >
> > > > > > > > [tex pts nrdropped]=Screen('GetCapturedImage', win, grabber, 0, tex);
> > > > > > > >
> > > > > > > > so you still use caching of the 'tex'ture but don't wait for new frames from the camera, but poll for them. The if (tex>0) will make sure that all texture processing/drawing is skipped if no new frame is available, so you can still flip at 60 fps instead of the 30 fps at which the camera delivers video.
> > > > > > > >
> > > > > > > > Replace this:
> > > > > > > >
> > > > > > > > ftex = Screen('TransformTexture', tex, bluroperator, blurmaptex);
> > > > > > > >
> > > > > > > > % Draw new texture from framegrabber.
> > > > > > > > Screen('DrawTexture', win, ftex); %, [], Screen('Rect', win));
> > > > > > > > Screen('Close', ftex);
> > > > > > > >
> > > > > > > > With this:
> > > > > > > >
> > > > > > > > Screen('DrawTexture', win, tex);
> > > > > > > >
> > > > > > > > So you skip the image processing. The image processing in this demo is actually somewhat compute intense. I doubt it would bring down fps to 15 fps, but the controllable image convolution is certainly more expensive than some simple color correction.
> > > > > > > >
> > > > > > > >
> > > > > > > > All the PsychImaging('AddTask',...) lines should go, although you'd expect minimal performance impact.
> > > > > > > >
> > > > > > > > And also check the impact of the GetMouse() queries and processing of mouse button presses. Maybe the performance problem is not where you think it is? I don't really see why that would happen, but Screen('Drawtexture') is not a likely candidate for the low performance, according to your benchmark results.
> > > > > > > >
> > > > > > > > Another hunch: Some webcams throttle their capture framerate depending on lighting conditions. Apple's iSight, e.g., don't care about what framerate you request, they simply adapt it according to lighting - 30 fps on a bright day or with bright indoor lighting, 15 fps or even only 7.5 fps on a rainy day or with weaker lighting. Maybe your webcam does the same, e.g., reducing fps to 15 fps on low light conditions?
> > > > > > > >
> > > > > > > > The best cheap consumer level USB webcam i know of is the Sony PlayStation Eye camera. They sell for 20 Euros and have excellent performance and control over various parameters. Under Linux they can do 60 fps at full 640x480 resolution (Windows / OSX do 30 fps with the drivers i found, maybe there are better ones now), and iirc can go up to 120 fps at reduced 320x240 resolution.
> > > > > > > >
> > > > > > > > Some clever people from the Faisal lab at Imperial College London managed to built a pretty decent eye tracker for about 50$ with a pair of those cameras - comparable with a 25000$ eye tracker for many relevant tasks. Pretty cool:
> > > > > > > > <http://phys.org/news/2012-07-low-cost-device-eyes-video.html>
> > > > > > > > <http://www.faisallab.com/>
> > > > > > > >
> > > > > > > > The advantage of pro-level Firewire cameras is usually lower latency, higher framerates/resolution/dynamic range, more control over image acquisition parameters, reliable timestamps of when an image was captured and often the ability to synchronize multiple cameras. With consumer cams you lose some or all of that, but our standard video capture engine for such cams is definitely capable of doing 120 fps if the camera provides that.
> > > > > > > >
> > > > > > > > -mario
> > > > > > > >
> > > > > > > > --- In psychtoolbox@yahoogroups.com, "firpihir" <firpihir@> wrote:
> > > > > > > > >
> > > > > > > > > Mario
> > > > > > > > >
> > > > > > > > > > It shouldn't be that slow, 60 fps should be feasible at least without demanding image processing, for a simple get->draw->flip loop and proper polling. Is your ptb up to date? What framerate does VideoCaptureDemo give you? Difference between fullscreen mode and windowed mode? What performance do you see with MakeTextureTimingTest2 if you set the image resolution to what your camera provides?
> > > > > > > > > >
> > > > > > > > > > If you set Screen('preference','verbosity', 10), what are the timings it reports for capture operations?
> > > > > > > > >
> > > > > > > > > I ran VideoCaptureDemo for 63.1513 and Framerate is 30fps (avgfps = 29.8806). I ran the fullscreen mode (VideoCaptureDemo(1, 1, [0 0 640 480])) vs. windowed mode (VideoCaptureDemo(1, 0, [0 0 640 480])) and there seems to be no difference. I went a step further and modified the function to save the timestamps (pts) and created a diff(TimeStamps)) plot. ........... (Well, heck, I don't know how to post images on here). The results out of MakeTextureTimingTest2 are as follow (for 640x480) (cont' below results):
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > PTB-INFO: This is Psychtoolbox-3 for GNU/Linux X11, under Matlab (Version 3.0.9 - Build date: Oct 21 2011).
> > > > > > > > > PTB-INFO: Type 'PsychtoolboxVersion' for more detailed version information.
> > > > > > > > > PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with
> > > > > > > > > PTB-INFO: some restrictions. See file 'License.txt' in the Psychtoolbox root folder for the exact licensing conditions.
> > > > > > > > >
> > > > > > > > > PTB-INFO: nVidia Corporation - G71GL [Quadro FX 3500] GPU found. Trying to establish low-level access...
> > > > > > > > > PTB-INFO: Could not probe properties of GPU for screenId 0 [Permission denied]
> > > > > > > > > PTB-INFO: Beamposition timestamping and other special features disabled.
> > > > > > > > > PTB-INFO: Failed to enable realtime-scheduling [Operation not permitted]!
> > > > > > > > > PTB-INFO: You need to run Matlab or Octave with root-privileges for this to work.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: Quadro FX 3500/PCI/SSE2 :: 2.1.2 NVIDIA 280.13
> > > > > > > > > PTB-INFO: VBL startline = 1050 , VBL Endline = -1
> > > > > > > > > PTB-INFO: Beamposition queries unsupported or defective on this system. Using basic timestamping as fallback: Timestamps returned by Screen('Flip') will be less robust and accurate.
> > > > > > > > > PTB-INFO: Measured monitor refresh interval from VBLsync = 16.729183 ms [59.775782 Hz]. (50 valid samples taken, stddev=0.014362 ms.)
> > > > > > > > > PTB-INFO: Reported monitor refresh interval from operating system = 16.679455 ms [59.953999 Hz].
> > > > > > > > > PTB-INFO: Small deviations between reported values are normal and no reason to worry.
> > > > > > > > >
> > > > > > > > > Average Make -> Upload -> Destroy time for a 640 x 480 pixels, 4 channels texture over 100 samples is: 5.504508 msecs.
> > > > > > > > >
> > > > > > > > > Average glTexSubImage2D() -> Upload time for a 640 x 480 pixels, 4 channels texture over 100 samples is: 2.156398 msecs.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ===>> (CONTINUATION....) and finally I went to VideoCaptureDemo, added the line Screen('preference','verbosity', 10), ran it, and below are the results (below my name). Not sure how many iterations you wanted so posted several of them.
> > > > > > > > >
> > > > > > > > > Hope that gives you a better insight. If you need plots, let me know how I can send them.
> > > > > > > > >
> > > > > > > > > Alex
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 49.000000 46.000000 54.000000 48.000000 52.000000 53.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 53.000000 46.000000 57.000000 52.000000 51.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 57.000000 57.000000 57.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 53.000000 46.000000 57.000000 55.000000 54.000000 50.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 52.000000 48.000000 49.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 48.000000 49.000000 49.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 54.000000 49.000000 48.000000 48.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 48.000000 52.000000 52.000000 48.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 55.000000 50.000000 48.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 48.000000 55.000000 54.000000 50.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 53.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 49.000000 49.000000 49.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 55.000000 53.000000 52.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 49.000000 52.000000 52.000000 49.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 51.000000 51.000000 48.000000 56.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 49.000000 55.000000 54.000000 49.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 49.000000 46.000000 57.000000 57.000000 54.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 50.000000 49.000000 50.000000 49.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 57.000000 57.000000 54.000000 48.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 50.000000 52.000000 52.000000 50.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 48.000000 53.000000 52.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 50.000000 55.000000 57.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 55.000000 54.000000 49.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 51.000000 49.000000 50.000000 48.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 49.000000 54.000000 53.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 51.000000 52.000000 52.000000 50.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 56.000000 53.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 51.000000 55.000000 57.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 55.000000 48.000000 49.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 52.000000 49.000000 50.000000 48.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 54.000000 51.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 52.000000 52.000000 52.000000 50.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 52.000000 49.000000 55.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 52.000000 55.000000 57.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 56.000000 57.000000 48.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 53.000000 49.000000 50.000000 49.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 51.000000 52.000000 54.000000 50.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 53.000000 52.000000 52.000000 50.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 53.000000 51.000000 55.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 53.000000 55.000000 57.000000 55.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 56.000000 48.000000 54.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 54.000000 49.000000 50.000000 50.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 52.000000 50.000000 56.000000 48.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 54.000000 52.000000 55.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 56.000000 56.000000 48.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 54.000000 56.000000 48.000000 48.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 50.000000 55.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 55.000000 49.000000 50.000000 50.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 55.000000 53.000000 53.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 55.000000 52.000000 55.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 57.000000 49.000000 54.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 55.000000 56.000000 48.000000 48.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 52.000000 57.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 56.000000 49.000000 50.000000 50.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 57.000000 56.000000 55.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 56.000000 52.000000 55.000000 55.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 55.000000 52.000000 50.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 56.000000 56.000000 48.000000 49.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 52.000000 48.000000 53.000000 54.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 57.000000 49.000000 53.000000 57.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 55.000000 51.000000 51.000000 55.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 57.000000 52.000000 55.000000 57.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 53.000000 57.000000 55.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 54.000000 46.000000 57.000000 56.000000 48.000000 49.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 57.000000 55.000000 53.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 48.000000 49.000000 53.000000 55.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 57.000000 55.000000 54.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 48.000000 52.000000 55.000000 57.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 56.000000 54.000000 53.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 48.000000 56.000000 48.000000 49.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 50.000000 55.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 49.000000 49.000000 53.000000 55.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 53.000000 55.000000 53.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 49.000000 52.000000 56.000000 48.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 55.000000 55.000000 49.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 49.000000 56.000000 51.000000 57.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 56.000000 57.000000 49.000000 53.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 50.000000 49.000000 54.000000 50.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 51.000000 54.000000 56.000000 57.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 50.000000 52.000000 56.000000 49.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 49.000000 46.000000 56.000000 55.000000 55.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 50.000000 56.000000 51.000000 55.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 56.000000 50.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 51.000000 49.000000 53.000000 57.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 49.000000 52.000000 54.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 51.000000 52.000000 56.000000 49.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 57.000000 49.000000 48.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 51.000000 56.000000 51.000000 55.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 54.000000 48.000000 49.000000 57.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 52.000000 49.000000 53.000000 57.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 56.000000 53.000000 54.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 52.000000 52.000000 56.000000 49.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 57.000000 54.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 52.000000 56.000000 51.000000 54.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 52.000000 55.000000 53.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 53.000000 49.000000 53.000000 57.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 56.000000 56.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 53.000000 53.000000 49.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 56.000000 56.000000 57.000000 57.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 53.000000 56.000000 51.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 49.000000 46.000000 57.000000 54.000000 49.000000 52.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 54.000000 49.000000 54.000000 49.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 56.000000 48.000000 52.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 54.000000 53.000000 49.000000 54.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 54.000000 48.000000 49.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 54.000000 56.000000 51.000000 57.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 57.000000 53.000000 53.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 55.000000 49.000000 54.000000 49.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 49.000000 53.000000 50.000000 52.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 55.000000 53.000000 49.000000 54.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 54.000000 48.000000 49.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 55.000000 56.000000 51.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 53.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 56.000000 49.000000 57.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 57.000000 53.000000 55.000000 56.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 56.000000 53.000000 49.000000 57.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 56.000000 57.000000 48.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 56.000000 56.000000 51.000000 57.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 54.000000 49.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 57.000000 49.000000 57.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 56.000000 49.000000 56.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 57.000000 53.000000 49.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 48.000000 55.000000 49.000000 49.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 55.000000 46.000000 57.000000 56.000000 52.000000 48.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 48.000000 56.000000 50.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 56.000000 46.000000 48.000000 49.000000 57.000000 54.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 53.000000 46.000000 53.000000 53.000000 54.000000 49.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 56.000000 46.000000 48.000000 53.000000 49.000000 56.000000
> > > > > > > > > PTB-DEBUG: Allocated unicode string: 51.000000 50.000000 46.000000 50.000000 52.000000 56.000000 51.000000
> > > > > > > > > PTB-DEBUG: New Buffer received. 1
> > > > > > > > > PTB-DEBUG: Pulling from videosink, 1 buffers avail...
> > > > > > > > > PTB-DEBUG: Post-Pulling from videosink, 0 buffers avail...
> > > > > > > > > Bufferprobe: newfps = 30.000000 altfps = 30.000000
> > > > > > > > > PTB-DEBUG: ...done.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> > > > > > > > > >
> > > > > > > > > > --- In psychtoolbox@yahoogroups.com, "firpihir" <firpihir@> wrote:
> > > > > > > > > > >
> > > > > > > > > > > Hello Mario
> > > > > > > > > > >
> > > > > > > > > > > I took a look at that ImagingVideoCapture.m you mentioned and the problem with using:
> > > > > > > > > > >
> > > > > > > > > > > Screen('DrawTexture, win, tex, [], [0 0 1280 1024]);
> > > > > > > > > > > Screen('Close', tex);
> > > > > > > > > > >
> > > > > > > > > > > It's slow. When one takes the TimeStamps from Screen like this TimeStamps(count) = Screen('Flip', win) and plot the following
> > > > > > > > > > >
> > > > > > > > > > > plot(diff(TimeStamps))
> > > > > > > > > > >
> > > > > > > > > > > my plot average around 0.0669s with some fluctuations but the fluctuations are not really important as long as they don't happen very often.
> > > > > > > > > > >
> > > > > > > > > > > I need the while loop fast enough so when I plot the aforementioned plot command the average is around 0.0167 (which is exactly the 1/60, that's the refresh rate of the display). I was using WindowsXP 32bit before (for my first post) and now I am using Linux Fedora 14 (I read somewhere a post from you that your "best combo" is using Linux and firewire machine camera) but it is not fast enough. Granted. I am using a inexpressive Logictech USB webcam (not a firewire machine camera) and the graphic card is a Quadro FX 3500 256MB.
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > It shouldn't be that slow, 60 fps should be feasible at least without demanding image processing, for a simple get->draw->flip loop and proper polling. Is your ptb up to date? What framerate does VideoCaptureDemo give you? Difference between fullscreen mode and windowed mode? What performance do you see with MakeTextureTimingTest2 if you set the image resolution to what your camera provides?
> > > > > > > > > >
> > > > > > > > > > If you set Screen('preference','verbosity', 10), what are the timings it reports for capture operations?
> > > > > > > > > >
> > > > > > > > > > -mario
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > Until I can ensure that polling for the image, image process it, and display it can be done below 0.0167 s, I can't ensure my flickering squares are going flick at the exact frequency I want them (e.g., frequency in the alpha band, 8-13 Hz). In short, I need the video, image processing, and some "alpha-band range stimulus squares" running at 0.0167.
> > > > > > > > > > >
> > > > > > > > > > > (By the way, in my previous post when I was talking "cleaning the image" I meant to close it using Screen('Close'...) so it frees memory. My bad, though. I was not clear enough.)
> > > > > > > > > > >
> > > > > > > > > > > Other specs just in case: My Matlab is R2010a. Linux machine is Intel Quad-core.
> > > > > > > > > > >
> > > > > > > > > > > Any ideas? If one of your recommendation is to get a firewire machine camera, please, let me know which one you recommend or any suggestion.
> > > > > > > > > > >
> > > > > > > > > > > Thanks in advance!
> > > > > > > > > > > Alex
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --- In psychtoolbox@yahoogroups.com, "firpihir" <firpihir@> wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > Hi
> > > > > > > > > > > > >
> > > > > > > > > > > > > I am try to set an experiment where I have a real-time webcam (30fps) on screen and I would like to apply an image process (e.g., filter the blue channel or converting the image to grayscale) to this video and at the same time I want to present stimulus on screen that has to flicker at specific frequencies (e.g., an object flickering at 8 Hz).
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > Have a look at ImagingVideoCaptureDemo.m That shows how to capture an image, apply some image processing to it on the GPU (a blur in this case) and display it.
> > > > > > > > > > > >
> > > > > > > > > > > > > I am using the piece of code (below) to capture the video and put it on screen. However, if I set 'waitforImage' to zero, the flip is not longer ~1/60 (i.e., monitor refresh rate) so it doesn't ensure my stimulus flickers at a desire frequency. On the other hand, if I set 'waitforImage' to 4 it displays the video just fine and presents the stimulus at the right frequencies but the pointer out from 'GetCaptureImage' doesn't return any image (it returns 0) thus I can't do any image processing on-line procedure to the video and
> > > > > > > > > > > >
> > > > > > > > > > > > You have to poll for new images. A wait would throttle you to the 30 fps of your camera. A setting of zero will poll for new images, 60 times per second when your loop repeats after each Screen('Flip'). Either there is one, then a non-zero handle will be returned, or there's none, then zero will be returned. You simply have to make sure that you only try to image process and draw the image if the returned texture handle is > 0, and otherwise skip that step. You can see that in ImagingVideocaptureDemo as well, although there it is only useful if the waitForImage flag is set to zero.
> > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > Screen('HookFunction'..., maybe? Is there another fast command to capture and display video than using the little known PsychCV and it's ARRenderImage arguments? I have tried using Screen('DrawTexture'.... but it's really slow and clearing the image (so it frees memory) every flip (loop iteration) just makes even slower affecting the frequency of all stimuli. Using the code below
> > > > > > > > > > > >
> > > > > > > > > > > > Not sure what you mean with clearing the image? 'Getcapturedimage' -> process -> drawtexture -> flip should be fast if properly used. The demo also shows how to recycle the original texture from getcapturedimage to save a bit of time. And flip has options to avoid redrawing the framebuffer.
> > > > > > > > > > > >
> > > > > > > > > > > > PsychCV ARxxx stuff is not recommended. It is only useful for special augmented reality applications, and only supported in current PTB releases when used with 32-Bit GNU/Octave on OSX, not with Matlab. Even there it is basically a leftover. I've never seen anybody using it for anything, so i decided it wasn't worth the continued maintenance effort.
> > > > > > > > > > > >
> > > > > > > > > > > > -mario
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > was the only way so far I've been able to displays the video, generate the stimuli at the right frequency at any time but I can't do any image processing to the video image.
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > Screen('GetCapturedImage', win, grabber, 0, [], 4, imgbuffer);
> > > > > > > > > > > > > Screen('BeginOpenGL', win);
> > > > > > > > > > > > > glClear(GL.DEPTH_BUFFER_BIT); % Clear z-buffer
> > > > > > > > > > > > > PsychCV('ARRenderImage'); % Render current video image as backdrop
> > > > > > > > > > > > > Screen('EndOpenGL', win);
> > > > > > > > > > > > > Screen('DrawTexture', win, TextureCornerSq{1}, [], CornerPos);
> > > > > > > > > > > > >
> > > > > > > > > > > > > if count >= 100 && count <= 400
> > > > > > > > > > > > > if mod(count, 8) == 1
> > > > > > > > > > > > > Screen('DrawTexture', win, TextureCornerSq{2}, [], CornerPos);
> > > > > > > > > > > > > Screen('DrawTexture', win, TextureWhiteSq, [], position);
> > > > > > > > > > > > > else
> > > > > > > > > > > > > Screen('DrawTexture', win, TextureCornerSq{1}, [], CornerPos);
> > > > > > > > > > > > > Screen('DrawTexture', win, TextureBlackSq, [], position);
> > > > > > > > > > > > > end
> > > > > > > > > > > > > end
> > > > > > > > > > > > >
> > > > > > > > > > > > > Thanks in advance,
> > > > > > > > > > > > > Alex
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>