Click here to Skip to main content
15,920,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I save a few selected screen images using CopyFromScreen in bmp or png files listed serially like img001.png, img002.png, etc. Can I make an mp4 or avi (no sound in it) from those saved screen pictures? I do not want to continuously record the screen - only some selected stages in calculations. I am not looking for a software program. I guess this can hopefully be done in a few lines of code. Thanks.

What I have tried:

I have checked a lot of pages which address related issues. There are software packages which do this but that does not interest me. I want to learn to do it in if possible - preferably in just a few lines of code (which does not have to be idiot-proof because my own program will create the *.png or *.bmp files.)
Updated 27-Jul-21 5:22am

1 solution

No, not in a few lines of code!
Creating a video from image frames isn't a job for a beginner - even using a framework like AForge which can (apparently) do it. This may help you get started: c# - Image sequence to video stream? - Stack Overflow[^] But you'd probably be better off with an existing app to do it like FFMPEG: Create a Video From Images With ffmpeg - deparkes[^]
Share this answer
VBeginner.NET 27-Jul-21 12:07pm    
That raises the obvious question: Why hasn't Microsoft thought of providing this facility so that the programmer can do this in one line? Even without compression plain avi file would be fine.
OriginalGriff 27-Jul-21 12:33pm    
Why on Earth would they? How often do you think developers need to do that? :laugh:
Dave Kreskowiak 27-Jul-21 12:39pm    
Probably because of the MASSIVE number of configuration and encoding options that encompasses the imaging and video worlds.
OriginalGriff 27-Jul-21 12:50pm    
And changing quickly, as well. H264 is rapidly becoming obsolete due to H265 - it's a better format, but legacy devices don't support it.
[no name] 27-Jul-21 13:59pm    
At 32+ FPS (frames per second), that's a lot of "still" images. Not a lot of demand. The closest thing to your requirement is a "slideshow", which you can do yourself by timing a series of image / picture box displays.
For that matter, once your slideshow is running, you can use screen capture to create a video (e.g. MS Expression Encoder - Screen Capture)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900