Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Visual Basic Programming

Visual Basic Programming Discussion forum for Visual Basic, an event driven programming language and associated development environment from Microsoft for its COM programming model.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-28-2008, 11:19 AM
sakishrist's Avatar   
sakishrist sakishrist is offline
Learning Programmer
 
Join Date: Dec 2007
Location: Greece - Syros
Posts: 60
Credits: 0
Rep Power: 3
sakishrist is on a distinguished road
Send a message via MSN to sakishrist Send a message via Skype™ to sakishrist
Question Extract frame from video (VB.NET)

Hello everyone!
I want to extract some frames from a video file and save them in a variable so I can then use them in my project as still images. I have been looking for some way to do that but i did not find anything at all ... Is there any way of doing that? (I use VB.NET)
Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 04-01-2008, 09:01 AM
Xav's Avatar   
Xav Xav is online now
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 5,576
Last Blog:
Web slideshow in JavaS...
Credits: 215
Rep Power: 47
Xav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to behold
Send a message via MSN to Xav
Default Re: Extract frame from video (VB.NET)

I don't know about programming one, but you can do this with the normal Windows functions. Just open up the video file in Windows Movie Maker, move the marker to the place in the video you want, then click the little camera icon in the preview box. This will prompt you to save the image.
Otherwise, just load it up in Windows Media Player (WMP) and take a screenshot of it. In some cases the video will not be captured in the screenshot, in which case you need to switch Hardware Acceleration on/off (you can do this inside the Options menus).
If you use Winamp, you can slow the video dow to see the individual frames, for greater control. Once you have saved them as images, you can load them like this:

Code:
Dim bmp As Bitmap = Image.FromFile("C:/thepicture.jpg")
If you want to show them, you can load them into a picture box:

Code:
PictureBox1.Image = bmp
Or, you can draw them straight to the screen with Me.CreateGraphics().DrawImage().

Xav
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-01-2008, 01:04 PM
sakishrist's Avatar   
sakishrist sakishrist is offline
Learning Programmer
 
Join Date: Dec 2007
Location: Greece - Syros
Posts: 60
Credits: 0
Rep Power: 3
sakishrist is on a distinguished road
Send a message via MSN to sakishrist Send a message via Skype™ to sakishrist
Default Re: Extract frame from video (VB.NET)

Thank you but that's not what I meant. The frames must not be saved in the HDD but just loaded in the ram and all this has to be done withe my application. Anyway, thank you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-07-2008, 10:47 AM
Xav's Avatar   
Xav Xav is online now
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 5,576
Last Blog:
Web slideshow in JavaS...
Credits: 215
Rep Power: 47
Xav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to behold
Send a message via MSN to Xav
Default Re: Extract frame from video (VB.NET)

You could always use your program to control the other software. Anyway, by now you probably have worked it out already.
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-21-2008, 12:16 PM
sakishrist's Avatar   
sakishrist sakishrist is offline
Learning Programmer
 
Join Date: Dec 2007
Location: Greece - Syros
Posts: 60
Credits: 0
Rep Power: 3
sakishrist is on a distinguished road
Send a message via MSN to sakishrist Send a message via Skype™ to sakishrist
Default Re: Extract frame from video (VB.NET)

Yes i did but this wont really help me because i don't want to store the frames in the HDD but just put them in the memory for future use. And there should be some way of taking it from the memory of the "controlled" program but i think it would take me much time to find out some way of doing this. But ... if you have something in mind that would help me i would appreciate it if you tel me!
Thanks really!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 04-21-2008, 12:51 PM
Xav's Avatar   
Xav Xav is online now
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 5,576
Last Blog:
Web slideshow in JavaS...
Credits: 215
Rep Power: 47
Xav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to behold
Send a message via MSN to Xav
Default Re: Extract frame from video (VB.NET)

In memory for future use? The whole point of memory is that it stores things temporarily. Once the program is shut down, it loses its objects (and hence memory allocation slots).
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-21-2008, 12:57 PM
sakishrist's Avatar   
sakishrist sakishrist is offline
Learning Programmer
 
Join Date: Dec 2007
Location: Greece - Syros
Posts: 60
Credits: 0
Rep Power: 3
sakishrist is on a distinguished road
Send a message via MSN to sakishrist Send a message via Skype™ to sakishrist
Default Re: Extract frame from video (VB.NET)

What I mean by Future use: After extracting about 50 frames i want to get some pixel information and then delete them from the memory ... I don't mean to use them after some weeks. So what i want is just compare a few frames and see if there is any movement ... maybe I wasn't clear enough at the beginning ... Sorry.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-21-2008, 01:18 PM
Xav's Avatar   
Xav Xav is online now
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 5,576
Last Blog:
Web slideshow in JavaS...
Credits: 215
Rep Power: 47
Xav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to behold
Send a message via MSN to Xav
Default Re: Extract frame from video (VB.NET)

Oh - well, if you use System.Graphics and save the images as a bitmap, you could always extract the pixels using GetPixel() and SetPixel().
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-22-2008, 02:28 AM
sakishrist's Avatar   
sakishrist sakishrist is offline
Learning Programmer
 
Join Date: Dec 2007
Location: Greece - Syros
Posts: 60
Credits: 0
Rep Power: 3
sakishrist is on a distinguished road
Send a message via MSN to sakishrist Send a message via Skype™ to sakishrist
Default Re: Extract frame from video (VB.NET)

So that means that I have to display it on a control to get the pixels ... I could try it! Otherwise ill make my own decoder!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-22-2008, 12:54 PM
Xav's Avatar   
Xav Xav is online now
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 5,576
Last Blog:
Web slideshow in JavaS...
Credits: 215
Rep Power: 47
Xav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to behold
Send a message via MSN to Xav
Default Re: Extract frame from video (VB.NET)

Actually, you don't even need to do that! All you need is to store the current frame as some sort of image, like a Bitmap or Image file. Then, you use this code:
Quote:
Dim g As System.Graphics = Graphics.FromImage(myBitmap)
Replace 'myBitmap' with your image. Then, just use g.GetPixel() to get the pixel. I think you have to pass in two parameters when you call the method - the x and y co-ordinates of the pixel. Remember that pixels start in the top-left corner of the image, and progress to the right and downwards.

You might use a loop to put each frame in a slot of a Bitmap() array, then just access them from there.
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Animated Ripple effect (Simple) - Flash MX 2004 ahsan16 Photoshop Tutorials 10 05-22-2008 05:54 AM
Need a program created in VB.Net Thomas Request Services (Paid) 0 08-29-2007 06:02 PM
New <$200 Video card, got some options kool Computer Hardware 4 08-28-2007 05:08 PM
AOL opens video search engine to developers Lop General Programming 0 09-19-2006 01:26 PM


All times are GMT -5. The time now is 02:02 PM.

Contest Stats

Xav ........ 214.93
chili5 ........ 80.87
morefood2001 ........ 57.41
John ........ 52.33
gamiR ........ 40.76
MeTh0Dz|Reb0rn ........ 40.7
-MW- ........ 40
WingedPanther ........ 35.4
gaylo565 ........ 24
RyanTuosto ........ 23.34

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 68%

Ads