cv431410
User

Senior Boarder
Posts: 10
graphgraph
 
Click here to see the profile of this user
Question About JukeBox Asmple 2 - 2008/01/31 18:12 Truely enjoyed the three JukeBox samples, Thank you.

Question, as a video plays, I try to get an image out of the playing video. There are numerous discussions on how to get image out of a panel, it all comes to somthing like this:

Bitmap bmp = new Bitmap(panel1.Width, panel1.Height);
Rectangle rect = new Rectangle(0, 0, panel1.Width, panel1.Height);
panel1.DrawToBitmap(bmp, rect);
bmp.Save("test.jpg");

The problem is I get an error saying panel1 does not have a function DrawToBitmap, Can you tell me how to solve this problem?
  | | No public write access. Please register.
Daniel
Admin

Admin
Posts: 44
graph
 
Click here to see the profile of this user
Re:Question About JukeBox Asmple 2 - 2008/02/01 14:51 The easiest way to extract frames is using IMediaDet interface. I wrote an article here. The code is not great but it should get you going.

The IMediaDet interface is just a user-friendly version of ISampleGrabber interface. You can find a sample use of it in my final frontier sample
  | | No public write access. Please register.
cv431410
User

Senior Boarder
Posts: 10
graphgraph
 
Click here to see the profile of this user
Re:Question About JukeBox Asmple 2 - 2008/02/01 15:40 You sure have a lot of good posts. I enjoyed your code project example a long time ago. Sure glad to join your forum. Thank you for your answer.

Let me give you the project background so you know where I come from. I am trying to get images out of FLV files.

(1) For $400, you can get a DirectShowLib dll from this web site:
http://www.mainmediasoft.com/products/flvflashvideosource/. This DirectshowLib.dll, combined with the Informikon's JukeBox Sample 2, will play FLV files.

(2) IMediaDet (from DexterLib) will not play FLV files.

(3) DirectShowLib does not have IMediaDet interface.

So here are two questions,

(1) What interface in DirectShowLib is equivalent to IMediadet in DexterLib?

(2) Back to the original question, how to get an image from JukeBox Sample 2?

Thank you in advance.
  | | No public write access. Please register.
Daniel
Admin

Admin
Posts: 44
graph
 
Click here to see the profile of this user
Re:Question About JukeBox Asmple 2 - 2008/02/01 21:58 I've just used my app from Codeproject to grab image from (the few) flv files I have.

So you can certainly use it to grab images from some flvs and it is using IMediaDet. IMediaDet will not grab pictures from files with streams whose "format block" is of type videoinfoheader2 (basically, with interlace fields).

I wouldn't spend $400 to grab image from flvs. I am not familiar with the dll they provide. The DirectshowLib.dll that I'm familiar can be found on sourceforge in the project Directshow.Net

From the source code of ImageExtractor.cs SaveButton event handler, you have (where md is the MediaDet object):

md.WriteBitmapBits( trackBar1.Value, 320, 240, fBitmapName + ".bmp" );
pictureBox1.Image = new Bitmap( fBitmapName + ".bmp" );
//save the picture as jpeg
Image img = Image.FromFile( fBitmapName + ".bmp" );
img.Save( fBitmapName + ".jpg", ImageFormat.Jpeg );
img.Dispose();

I think I posted some code to make this work with GetBitmapBits, which is more efficient.
  | | No public write access. Please register.
Daniel
Admin

Admin
Posts: 44
graph
 
Click here to see the profile of this user
Re:Question About JukeBox Asmple 2 - 2008/02/01 22:16 I forgot to add that you might have to install Gabest's flv DS filters which can be found here
  | | No public write access. Please register.
cv431410
User

Senior Boarder
Posts: 10
graphgraph
 
Click here to see the profile of this user
Re:Question About JukeBox Asmple 2 - 2008/02/04 16:49 Daniel wrote:
I forgot to add that you might have to install Gabest's flv DS filters which can be found here

I found "guliverkli's FLV Splitter" from this page:
http://sourceforge.net/project/downloading.php?group_id=82303&use_mirror=internap&filename=asf2mkv_20040112.zip&12496602

Is this what you mean by "Gabest's flv DS filters"?
  | | No public write access. Please register.
cv431410
User

Senior Boarder
Posts: 10
graphgraph
 
Click here to see the profile of this user
Re:Question About JukeBox Asmple 2 - 2008/02/04 17:25 I installed Gabest Flash Video Splitter (Win95/98/ME) v1.0.0.2
from here:

http://www.afterdawn.com/software/video_software/codecs_and_filters/ flv_splitter_win98.cfm

I download a flv video from Youtube and it could not open flv file I have (Youtube files).

The DirectShowLib (I mentioned earlier) can play flv files download from youtube; but will not work with DexterLib, only work with DirectShowLib.

Nothing works, just a typical day. Someday this will all go away. Microsoft already has an interface:

//Bitmap bmp = new Bitmap(panel1.Width, panel1.Height);
//Rectangle rect = new Rectangle(0, 0, panel1.Width, panel1.Height);
//panel1.DrawToBitmap(bmp, rect);
//bmp.Save("test.jpg");

It simply does not work for the moment, but it will work someday.
  | | No public write access. Please register.
Joomla Template by Joomlashack
Joomla Templates by JoomlaShack Joomla Templates by Compass Design