|
-
Mar 21st, 2011, 03:08 PM
#1
Thread Starter
Member
Images to AVI
Hello, im trying to make images to avi maker, now i watched this thread: http://www.vbforums.com/showthread.php?t=395812 And i downloaded that avilib and imported, so now im trying to use this code:
Code:
Dim fr As UInt32 'set up a uint32 for frame rate
fr = Convert.ToUInt32(60) 'set frame rate (from a constant in this case)
Dim AW As AviWriter = New AviWriter
Dim BM As Bitmap
BM = AW.Open("replay.avi", fr, pbField.Width, pbField.Height)
Dim canvas As Graphics = Graphics.FromImage(BM)
'// THEN WRITE TO THE AVI FILE
For i = 0 To 4 'loop through writing each frame one at a time
BM = Image.FromFile("C:\Stopmo\1.bmp")
BM = Image.FromFile("C:\Stopmo\2.bmp")
canvas.Clear(Color.White) 'clear the canvas
' THEN DRAW SHAPES ON TO THE CANVAS (using standard GDI+ code e.g. canvas.FillRectangle(...) etc.)
' I think you could also use BM = BM.FromFile(filename) to load bitmaps one at a time from the hard drive
AW.AddFrame() 'add the bitmap (BM) to the AVI file
Next
AW.Close()
On form load. So now when i run my program, then it just makes replay.avi file and there is just white background for 1 second, and why it doesn't adds my image: BM = Image.FromFile("C:\Stopmo\1.bmp") ?
-
Mar 22nd, 2011, 04:08 AM
#2
Re: Images to AVI
 Originally Posted by Daslee
Code:
BM = Image.FromFile("C:\Stopmo\1.bmp")
BM = Image.FromFile("C:\Stopmo\2.bmp")
AW.AddFrame() 'add the bitmap (BM) to the AVI file
In this case you overwrite 1.bmp.
-
Mar 22nd, 2011, 08:18 AM
#3
Thread Starter
Member
Re: Images to AVI
 Originally Posted by namrekka
In this case you overwrite 1.bmp.
So that will replaces 1.bmp with 2.bmp?
-
Mar 22nd, 2011, 09:03 AM
#4
Re: Images to AVI
Did you name the bitmap files:
1.bmp
2.bmp
3.bmp
.
.
.
n.bmp
-
Mar 22nd, 2011, 10:04 AM
#5
Thread Starter
Member
Re: Images to AVI
Yes and they are in C:\Stopmo folder
-
Mar 22nd, 2011, 10:08 AM
#6
Thread Starter
Member
Re: Images to AVI
Don't i need to make canvas.DrawImage(...) Because in video are black background and i think its from canvas.clear(color.white) so i think i should to do canvas.DrawImage(...) But i don't know how to code it..
-
Mar 22nd, 2011, 06:46 PM
#7
Thread Starter
Member
-
Mar 23rd, 2011, 04:31 AM
#8
Re: Images to AVI
 Originally Posted by Daslee
So no more answers? ;/
Hmmm...
I must admit I have no experience with this Avifil32, but have some remarks.
You can see a video stream as a certain amounts of frames in a certain time. In this case you defined 60 frames/second. That means if you want to have a bitmap shown for 1 second, 60 frames must be added with the same bitmap.
Its not clear for me how long a certain bitmap must be shown in this case. I'm also not sure if every bitmap must be in a frame now after explaining this.
Please define this first more clearly. Also I'm not a code provider but I can give you advise and point you in the right directions.
-
Mar 23rd, 2011, 04:42 AM
#9
-
Mar 23rd, 2011, 07:30 AM
#10
Thread Starter
Member
Re: Images to AVI
 Originally Posted by namrekka
Hmmm...
I must admit I have no experience with this Avifil32, but have some remarks.
You can see a video stream as a certain amounts of frames in a certain time. In this case you defined 60 frames/second. That means if you want to have a bitmap shown for 1 second, 60 frames must be added with the same bitmap.
Its not clear for me how long a certain bitmap must be shown in this case. I'm also not sure if every bitmap must be in a frame now after explaining this.
Please define this first more clearly. Also I'm not a code provider but I can give you advise and point you in the right directions.
So i need to make like 2 frames/second and add BM = image.fromfile(image) and again BM = image.fromfile(image) ?
-
Mar 23rd, 2011, 07:33 AM
#11
Thread Starter
Member
Re: Images to AVI
 Originally Posted by Radjesh Klauke
Pff.. F**k that ffmpeg last **** i don't know how to install, but if i get that ffmpeg.exe, then my program process.start(blabla...) doesn't work with that ffmpeg, it just runs and closes that ffmpeg, so...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|