473,326 Members | 2,095 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

video from static images

Hello,

I have a program that renders an animation. I would like the program
to be able to save this animation to a popular video file. Is there
a .NET API for doing this? I looked into DirectShow, but I could not
determine if it can be used to capture data from the screen.
Oct 21 '08 #1
4 2411
On Mon, 20 Oct 2008 22:34:22 -0700, <cr*****@gmail.comwrote:
Hello,

I have a program that renders an animation. I would like the program
to be able to save this animation to a popular video file. Is there
a .NET API for doing this? I looked into DirectShow, but I could not
determine if it can be used to capture data from the screen.
DirectShow is not supported in .NET. But there is an open-source project
providing a managed-code wrapper for it, called DirectShow.NET.

As far as whether it supports screen capture, it doesn't. But if your own
program is generating the animation, it should be simple enough to divert
the images being displayed to the screen to a source filter for a video
compression graph in DirectShow.

If it's not your own program generating the animation and you need to
capture from the screen, I'm pretty sure there are existing third-party
programs that do that. I seem to recall Fraps having this feature, for
example.

Pete
Oct 21 '08 #2
As far as whether it supports screen capture, it doesn't. But if your own
program is generating the animation, it should be simple enough to divert
the images being displayed to the screen to a source filter for a video
compression graph in DirectShow.
Thanks for your reply. My own program is generating the animation and
this is probably what I want to do. If you are familiar with this,
can you elaborate more on what needs to be done or at least give the
DShow interface names so I can start looking them up on MSDN?

Is a source filter basically an array of images?
[...]
>
Pete
Oct 21 '08 #3
On Mon, 20 Oct 2008 23:16:11 -0700, <cr*****@gmail.comwrote:
Thanks for your reply. My own program is generating the animation and
this is probably what I want to do. If you are familiar with this,
can you elaborate more on what needs to be done or at least give the
DShow interface names so I can start looking them up on MSDN?
Sorry...I haven't done this stuff recently enough to have the relevant
interface names off the top of my head. Basically, though...you'll want
to set up a graph with the appropriate encoder and file writer as the
renderer, and your own pull source filter as the input.

Looking at the built-in "File Source (Async)" filter, it looks like a good
start would be the IBaseFilter and IAsyncReader filter interfaces (the
latter being implemented by the output pin of your IBaseFilter).

If you want more details, I recommend the DirectShow specific forums, such
as microsoft.public.win32.programmer.directx.video. There's also
microsoft.public.multimedia.directx.dshow.programm ing...I don't recall
that newsgroup, but it looks like it's been around since '97. I don't
know what the difference between the two might be, other than that the
"video" newsgroup is likely to be more specific to video-related
questions, while the other is probably more general.
Is a source filter basically an array of images?
In DirectShow, the entire process is set up as a directed graph. Each
node in the graph is a "filter". Every filter exposes input pins, output
pins, or both. The pins are the logical connection between one filter and
another.

Different filters do different things. Source filters provide data,
transformation filters change the data, and renderers write data. Sources
can be files, video cameras, or programmatically generated, for example.
Transformations including codecs, color-space conversion, video effects,
etc. Renderers can be video cards, files, network i/o, etc.

Source filters have only output pins, renderers have only input pins.

So, when I write "source filter", I mean that you'll implement a filter
with an output pin that will present each image in sequence to the
DirectShow graph that you've set up to write the file. You'll use as the
renderer an appropriate codec writing into the "File Writer" filter. When
I describe the filter as a "pull" filter, that means that the downstream
input pin is responsible for requesting each video frame as needed. A
"push" filter is one where the source controls the flow. "Pull" is
generally more appropriate when you want the renderer to go as fast as it
can (such as when writing a file).

This is all already pretty off-topic. Hopefully the above is enough to
get you pointed in the right direction, and you can get more help in the
more directly related forums as needed. (They may even clear up whatever
mistakes I've made in the above...as I said, it's been awhile and I may be
a bit rusty).

Pete
Oct 21 '08 #4
On Oct 21, 2:16*am, cron...@gmail.com wrote:
Thanks for your reply. *My own program is generating the animation and
this is probably what I want to do. *If you are familiar with this,
can you elaborate more on what needs to be done or at least give the
DShow interface names so I can start looking them up on MSDN?
I would also look at the DirectShowLib stuff on SourceForge.
http://sourceforge.net/project/showf...roup_id=136334

We've been using that with C# for a couple of years now without
problems. Most of the code is in C# but we have a few custom filters
written in C++. As long as you have some familiarity with C++ and COM
you can easily create a source filter to take a series of bitmaps from
your application and pump them through the filter. I would look into
using the ASFWriter fitler to start with for creating .wmv files since
there are examples for that and it works pretty well. The examples
that come with direct show SDK already have a simple bitmap array
pumper and I believe a sample graph that dumps to .wmv format.
Oct 21 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: googlemike | last post by:
Is there a video module so that I can write a Linux Python script to record video coming over USB video cams? What about these side-thoughts: * What about recording multiple streams over...
0
by: Gerry Viator | last post by:
Hi all, Can someone recommend a good 3rd party image\video control or VS.NET control for imaging\video. I will need a recomendation on a good capture card as well for medical images\video?...
0
by: dicky2283 | last post by:
windows development community please help me im deepak roy , doing my final year undergrad in computer science.... im doing a project - Motion detection and Tracking in vc++( video for...
3
by: rangermccoy | last post by:
Hello there, What are the best php/c libraries for handling media including images, video, and music? I would like to manipulate media dfiles, including watermarking, thumbnailing,...
5
by: Pete Chen | last post by:
Hello all: I'd like to grab images from video (wmv format, a physical file stored in the host or even a streaming video, e.g. mms://abc.com/test.wma). Is there any solution that after I put...
3
by: rajibnsu | last post by:
While searching for capturing video with a webcam I god the following code.It gives two errors.Says:The type or namespace name 'WebcamEventArgs' does not exit in the namespace 'WebCam_Capture' (are...
1
by: alcool | last post by:
I, i would like publishing some images captured with a local video camera (with opencv api). Then I would like view this images with a client in a browser (like a applet or with the simple...
9
by: GloStix | last post by:
Okay, when I click the link it dissapears and makes a white space underneath it but the space is clickable. so when you click the space, the link actually works Used Firefox 3.0 RC2 for this. OS X...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.