It is currently Tue Jul 16, 2019 5:57 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Video for Windows: VfW
PostPosted: Tue Dec 16, 2014 10:41 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1572
-----------------------------------------------------------------------------------

Download Video for Windows: VfW from My PureBasic Stuff

-----------------------------------------------------------------------------------

Tricks 'n' Tips
PureBasic Interface to OpenCV
PureBasic Interface to WinDivert
PureBasic Interface to WinRAR
PureBasic Interface to 7-Zip
PureBasic Interface to ImDisk
Windows Services & Other Stuff
Invading Space Aliens
Death Star vs Asteroids
GIF Toolkit
LSB File Embedding
Spider Web Drawing
Deform Image: MLS
Video Snipping Tool
Image Waves: LUT
HTML5 YouTube Player
HTML5 MP4 Player
Barcode Generator
Embed JS into PureBasic
Geolocation: Google Maps
Book & Viewer & Magnify
Video for Windows: VfW
Alternate Console
Network Share Management

-----------------------------------------------------------------------------------

Context menu:
- Save Image: save frame capture to a BMP image
- Record Video / Stop Recording: create and save an AVI video
- Resolution List >: change webcam resolution / window size
- Close Window

Current settings:
- video source dialog disabled
- video format disabled
- video display disabled
- video compression disabled
- when the webcam screen doesn't have focus, preview is frozen
- recording ends after 30 seconds if not stopped manually

Enabling Debug:
- displays status information from CapStatusCallback while recording
- displays error information from CapErrorCallback
- other callback Procedures available
-- CapControlCallback
-- CapYieldCallback
-- CapVideoStreamCallback
-- CapWaveStreamCallback

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Thu Jun 06, 2019 7:06 am, edited 52 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: VfW (Video for Windows)
PostPosted: Wed Dec 17, 2014 1:47 am 
Online
Enthusiast
Enthusiast
User avatar

Joined: Tue May 28, 2013 10:51 pm
Posts: 536
Location: Europe
Hi JHPJHP,

although all your OpenCV camera examples work with my camera on W7 x64, this one only shows black screen... :(

What info could I provide so you could see what's wrong?

_________________
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: VfW (Video for Windows)
PostPosted: Wed Dec 17, 2014 3:01 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1572
Hi bbanelli,

Thank you for the feedback and the offer to provide information to fix the current problem.

I've improved the handoff between OpenCV to VfW, please let me know if the update fixes the issue you reported.

NB*: I've also added the OpenCV license file to the package: references\license.txt.

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: VfW (Video for Windows)
PostPosted: Wed Dec 17, 2014 10:58 am 
Online
Enthusiast
Enthusiast
User avatar

Joined: Tue May 28, 2013 10:51 pm
Posts: 536
Location: Europe
JHPJHP wrote:
Hi bbanelli,

Thank you for the feedback and the offer to provide information to fix the current problem.

I've improved the handoff between OpenCV to VfW, please let me know if the update fixes the issue you reported.

NB*: I've also added the OpenCV license file to the package: references\license.txt.
Didn't help. When I try to capture image/video (on black screen), this is the Debuger output.

Code:
ERROR: Out of memory
ERROR:

Capture Start
Setting up for capture - Please wait

Hit ESCAPE or click to end capture
Captured 0 frames (0 dropped) 0.000 sec.
Captured 0 frames (0 dropped) 0.300 sec.
Captured 1 frames (0 dropped) 0.448 sec.
Captured 2 frames (0 dropped) 0.543 sec.
Captured 3 frames (0 dropped) 0.656 sec.
Captured 5 frames (1 dropped) 0.754 sec.
Captured 6 frames (1 dropped) 0.849 sec.
Captured 7 frames (1 dropped) 0.944 sec.
Captured 9 frames (2 dropped) 1.056 sec.
Captured 11 frames (3 dropped) 1.154 sec.
Captured 12 frames (3 dropped) 1.249 sec.
Captured 13 frames (3 dropped) 1.344 sec.
Captured 15 frames (4 dropped) 1.456 sec.
Captured 15 frames (4 dropped) 1.486 sec.
Captured 17 frames (5 dropped) 1.554 sec.
Captured 18 frames (5 dropped) 1.649 sec.
Captured 19 frames (5 dropped) 1.744 sec.
Captured 21 frames (6 dropped) 1.856 sec.
Captured 23 frames (7 dropped) 1.953 sec.
Captured 24 frames (7 dropped) 2.049 sec.
Captured 25 frames (7 dropped) 2.144 sec.
Captured 27 frames (8 dropped) 2.256 sec.
Captured 29 frames (9 dropped) 2.353 sec.
Captured 30 frames (9 dropped) 2.448 sec.
Captured 31 frames (9 dropped) 2.543 sec.
Captured 33 frames (10 dropped) 2.656 sec.
Captured 35 frames (11 dropped) 2.753 sec.
Captured 36 frames (11 dropped) 2.848 sec.
Captured 38 frames (12 dropped) 2.961 sec.
Captured 38 frames (12 dropped) 2.976 sec.
Captured 39 frames (12 dropped) 3.056 sec.
Captured 41 frames (13 dropped) 3.153 sec.
Captured 42 frames (13 dropped) 3.248 sec.
Captured 44 frames (14 dropped) 3.361 sec.
Captured 45 frames (14 dropped) 3.456 sec.
Captured 47 frames (15 dropped) 3.553 sec.
Captured 48 frames (15 dropped) 3.648 sec.
Captured 50 frames (16 dropped) 3.761 sec.
Captured 51 frames (16 dropped) 3.856 sec.
Captured 53 frames (17 dropped) 3.953 sec.
Captured 54 frames (17 dropped) 4.048 sec.
Captured 56 frames (18 dropped) 4.161 sec.
Captured 57 frames (18 dropped) 4.256 sec.
Captured 59 frames (19 dropped) 4.353 sec.

Captured 60 frames (19 dropped) 4.448 sec.
Finished capture, now writing frame 60
Finished capture, now writing frame 60
Captured 4.449 sec.  60 frames (19 dropped) (13.486 fps).  49061 audio bytes (11,025 sps)
ERROR: Dropped 19 of 60 frames (31.6%) during capture.
Capture End

ERROR:

ERROR: Out of memory
ERROR:


No pictures are captured, but there is a video though.

How come you didn't use cvQueryFrame and cvShowImage functions to display live video?

_________________
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: VfW (Video for Windows)
PostPosted: Wed Dec 17, 2014 5:45 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1572
Hi bbanelli,

Thanks again for the feedback.

Quote:
How come you didn't use cvQueryFrame and cvShowImage functions to display live video?

This is a "Video for Windows" implementation not OpenCV, but because VfW breaks down starting the webcam, I'm using OpenCV to initiate the link. It was a hack I thought would work acrossboard, but obviously I was wrong even though I tested it on 3 separate machines of varying webcam drivers and operating systems.

Can you try setting the first dialog (video source) to True.
- mainfiles\vfw_capture.pb: dlg1.b = #True

It's possible that it's defaulting to the wrong video source.

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Wed Dec 17, 2014 6:10 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: VfW (Video for Windows)
PostPosted: Wed Dec 17, 2014 5:52 pm 
Online
Enthusiast
Enthusiast
User avatar

Joined: Tue May 28, 2013 10:51 pm
Posts: 536
Location: Europe
JHPJHP wrote:
Hi bbanelli,

Thanks again for the feedback.

Quote:
How come you didn't use cvQueryFrame and cvShowImage functions to display live video?

This is a "Video for Windows" implementation not OpenCV, but because VfW breaks down initiating the webcam, I'm using OpenCV to initiate the link. It was a hack I thought would work acrossboard, but obviously I was wrong even though I tested it on 3 separate machines of varying webcam drivers and operating systems.

Can you try setting the first dialog (video source) to True.
- mainfiles\vfw_capture.pb
-- dlg1.b = #True

It's possible that it's defaulting to the wrong video source.
I only have one source, HD web camera. As said, works like a charm with OpenCV.

Changing dlg1.b = #True only gave me an option to choose device, but since there is only one, I couldn't have done much. Strangely, video recording works, with some frames dropped, though.

In any case, interesting code, as always! :)

With my best,

Bruno

_________________
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: VfW (Video for Windows)
PostPosted: Wed Dec 17, 2014 6:08 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1572
Hi bbanelli,

Much appreciated. I'll probably play-around a little more with it, but I think VfW may be getting to old for Microsoft to support.

I've just switched to Windows 8.1 full-time and I'm noticing some strange behaviour with some of my other scripts. I think I'll spend the next few days seeing what I can do with them.

Cheers!

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: VfW (Video for Windows)
PostPosted: Wed Dec 17, 2014 10:20 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Aug 19, 2013 3:28 pm
Posts: 256
Hi JHP! :) EXCELLENT plugin! Can you please add a video streaming server / client example to the pack? I am curious to see if this can be done.

Thanks again!

Sincerely,

~Mythros


Top
 Profile  
Reply with quote  
 Post subject: Re: VfW (Video for Windows)
PostPosted: Sun Feb 01, 2015 12:29 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1572
Hi Mythros,

Thank you for the acknowledgement.

I won't be adding anything more to VfW (Video for Windows) then the following update. I only created this thread because I thought it might assist someone still using the technology.

-----------------------------------------------------------------------

Added a couple new Procedures: SetResolution / ResolutionList.
- builds a resolution list supported by your webcam, adding it as a context submenu
- the last / highest resolution is defaulted

Modified the Procedure I wrote for OpenCV and applied it to the VfW example.
- no additional binaries were added

-----------------------------------------------------------------------

Added a splash-screen while the webcam resolution list is built.

-----------------------------------------------------------------------

Updated:
- fix an issue with the Include files, should now run in PureBasic 5.24 LTS (x86 / x64)

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: Video for Windows: VfW
PostPosted: Tue Apr 17, 2018 7:53 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1572
Updated:
- 32 & 64 bit OpenCV binaries
-- v2.4.13.3 to v2.4.13.6
- SetResolution Procedure updated (alternate options REM'd out)

Context Menu:
- Save Image: save frame capture to a BMP image
- Record Video / Stop Recording: create and save an AVI video
- Resolution List >: change webcam resolution / window size
- Close Window

NB*: This is a "Video for Windows" implementation not OpenCV, but because VfW breaks down starting the webcam, I'm using OpenCV to initiate the link.

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Baidu [Spider] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye