monoceres Posted December 28, 2008 Share Posted December 28, 2008 (edited) Yep, 7 months later and I finally did it!It's a UDF for creating uncompressed avi:s from bitmap files (support for compressing the video, may or may not appear). The structure is very easy:Start the avi libraryCreate a avi fileAdd bitmaps to itClose the aviStop the avi libraryDownload:AVIWriter.au3Previous downloads: 55Example:; Example by ProgAndy #include <ScreenCapture.au3> #include "AVIWriter.au3" Hotkeyset("{ESC}","close") Break(0) FileDelete(@DesktopDir & "\test.avi") _StartAviLibrary() $avi = _CreateAvi(@DesktopDir & "\test.avi", 5,200,200) Do $m = MouseGetPos() $hBmp = _ScreenCapture_Capture("", $m[0] - 100, $m[1] - 100, $m[0] + 100, $m[1] + 100, True) _AddHBitmapToAvi($avi, $hBmp) _WinAPI_DeleteObject($hBmp) Sleep(200) Until False Func close() _CloseAvi($avi) _StopAviLibrary() exit EndFunc;==>closeEnjoy! Link to FireFox's AviScreencapture tool that relies on this udf. Edited December 31, 2008 by monoceres ravkr and mLipok 2 Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
FireFox Posted December 28, 2008 Share Posted December 28, 2008 (edited) @monoceresYep, 7 months later and I finally did it!For 4.11 Ko ? Its a joke ?Nice work I like it Edit : Colors in avi are not same as in bitmap : compressed ? I dont think with 23Mo for 40sec but its good way to do it in AutoIt This can be used for manythings : 5stars for me (keep it up) Edit : I think this was for udf ?Cheers, FireFox. Edited December 28, 2008 by FireFox Link to comment Share on other sites More sharing options...
monoceres Posted December 28, 2008 Author Share Posted December 28, 2008 (edited) @monoceresFor 4.11 Ko ? Its a joke ?Unfortunately not. I've picked up the project at multiple times but never been able to get past some difficulties with the bitmaps. I also didn't realize I could use the bitmap header as the format for the avi stream. I've always tried to create a compressed stream, something I still haven't been able to figure out.Nice work I like it Edit : Colors in avi are not same as in bitmap : compressed ? I dont think with 23Mo for 40sec but its good way to do it in AutoIt This can be used for manythings : 5stars for me (keep it up) Edit : I think this was for udf ?Cheers, FireFox.Thanks Would you mind uploading a sample bitmap and avi? Oh and what player are you using? The videos don't work in vlc for me but do in media player classic.Edit: Yeah, that was me asking for help with this udf. Edited December 28, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
FireFox Posted December 28, 2008 Share Posted December 28, 2008 Would you mind uploading a sample bitmap and avi? Oh and what player are you using? The videos don't work in vlc for me but do in media player classic.Hum... this work for me with vlc I will try with other avi players and I will upload for you sample bitmap and aviCheers, FireFox. Link to comment Share on other sites More sharing options...
FireFox Posted December 28, 2008 Share Posted December 28, 2008 (edited) @monoceres Vlc reverse some colors but with windows media player this works great ! <snipped deprecated urls> btw : I think that you can do like hypercam program... with parameters (selecting area etc...) Cheers, FireFox. Edited October 2, 2012 by FireFox Link to comment Share on other sites More sharing options...
FireFox Posted December 28, 2008 Share Posted December 28, 2008 (edited) @monoceres Sample example (with many errors to fix) Wrong idea... Cheers, FireFox. Edited December 28, 2008 by FireFox Link to comment Share on other sites More sharing options...
monoceres Posted December 28, 2008 Author Share Posted December 28, 2008 (edited) @monoceresVlc reverse some colors but with windows media player this works great !Uploaded bmp : http://d3monautoit.free.fr/capture.bmpUploaded avi : http://d3monautoit.free.fr/test.avibtw : I think that you can do like hypercam program... with parameters (selecting area etc...)Cheers, FireFox.Well yeah. Nothing odd about the files. So I guess it's vlc fault (or my sloppy avi writing).Anyways, as you noticed the file size grows very fast so one should probably use a cli video encoder like ffmpeg to create usuable video files.And yeah, a hypercam program could be done quite easily with this Edit:@FireFox: You've got the wrong idea. This works only with uncompressed bitmaps, due to how you set the stream in the avi and how each frame is served to the avi file. Edited December 28, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
FireFox Posted December 28, 2008 Share Posted December 28, 2008 Edit:@FireFox: You've got the wrong idea. This works only with uncompressed bitmaps, due to how you set the stream in the avi and how each frame is served to the avi file.Hmm.... yeah, use compression dll would be better as soon as video is finished; like other programs do Cheers, FireFox. Link to comment Share on other sites More sharing options...
Andreik Posted December 28, 2008 Share Posted December 28, 2008 (edited) I have a little problem with this: _StartAviLibrary() $FILE = _FileListToArray(@ScriptDir,"*.BMP",1) If IsArray($FILE) Then $FOLDER = @ScriptDir & "\" $AVI = _CreateAvi(@ScriptDir & "\AVI_File.avi",5,$PATH & $FILE[1]) For $INDEX = 2 To $FILE[0] _AddBitmapToAvi($AVI,$PATH & $FILE[$INDEX]) Next _CloseAvi($AVI) _StopAviLibrary() And I got this error: _WinAPI_CloseHandle: The operation completed successfully Edited December 28, 2008 by Andreik Link to comment Share on other sites More sharing options...
monoceres Posted December 28, 2008 Author Share Posted December 28, 2008 I have a little problem with this: _StartAviLibrary() $FILE = _FileListToArray(@ScriptDir,"*.BMP",1) If IsArray($FILE) Then $FOLDER = @ScriptDir & "\" $AVI = _CreateAvi(@ScriptDir & "\AVI_File.avi",5,$PATH & $FILE[1]) For $INDEX = 2 To $FILE[0] _AddBitmapToAvi($AVI,$PATH & $FILE[$INDEX]) Next _CloseAvi($AVI) _StopAviLibrary() And I got this error: _WinAPI_CloseHandle: The operation completed successfully I assume $PATH doesn't have a trailing "\" so when you're passing $PATH&$FILE[n] you need to have a "\" between them. Oh and note that $FILE[1] won't appear in the video. The bitmap you pass to _CreateAVI() is only used to determine the format of the stream. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Andreik Posted December 28, 2008 Share Posted December 28, 2008 I assume $PATH doesn't have a trailing "\" so when you're passing $PATH&$FILE[n] you need to have a "\" between them. Oh and note that $FILE[1] won't appear in the video. The bitmap you pass to _CreateAVI() is only used to determine the format of the stream. Thanks monoceres. I changed a little your example, hope you like. #include <ScreenCapture.au3> #include <AVIWriter.au3> #include <Process.au3> Hotkeyset("{ESC}","close") Break(0) $X = @DesktopWidth $Y = @DesktopHeight _StartAviLibrary() _ScreenCapture_Capture("capture.bmp",0,0,$X,$Y,True) $AVI = _CreateAvi("test.avi", 5,"capture.bmp") Do _ScreenCapture_Capture("capture.bmp",0,0,$X,$Y,True) _AddBitmapToAvi($AVI, @ScriptDir & "\capture.bmp") Sleep(200) Until False Func close() _CloseAvi($AVI) _StopAviLibrary() CompressAVI("test.avi") exit EndFunc ;==>close Func CompressAVI($PATH) _RunDOS('ffmpeg -i test.avi -b 512k -vcodec msmpeg4v2 Compressed_AVI.avi') EndFunc FFMPEG Link to comment Share on other sites More sharing options...
FireFox Posted December 28, 2008 Share Posted December 28, 2008 @Andreik Change little your example #include <ScreenCapture.au3> #include <AVIWriter.au3> #include <Process.au3> HotKeySet("{ESC}", "close") Break(0) $X = @DesktopWidth $Y = @DesktopHeight _StartAviLibrary() _ScreenCapture_Capture("capture.bmp", 0, 0, $X, $Y, True) $AVI = _CreateAvi("test.avi", 5, "capture.bmp") Do _ScreenCapture_Capture("capture.bmp", 0, 0, $X, $Y, True) _AddBitmapToAvi($AVI, @ScriptDir & "\capture.bmp") Sleep(200) Until False Func close() _CloseAvi($AVI) _StopAviLibrary() CompressAVI("test.avi") Exit EndFunc ;==>close Func CompressAVI($PATH) TrayTip("AVIWritter", "Compressing avi...", 3, 4) _RunDOS('ffmpeg -i test.avi -b 512k -vcodec msmpeg4v2 Compressed_AVI.avi') TrayTip("AVIWritter", "Finished !", 3, 4) EndFunc ;==>CompressAVI Cheers, FireFox. Link to comment Share on other sites More sharing options...
monoceres Posted December 28, 2008 Author Share Posted December 28, 2008 That's a nice start FireFox However you still cannot save the captured frames as anything else than .bmp. It just how the UDF work. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
FireFox Posted December 28, 2008 Share Posted December 28, 2008 That's a nice start FireFox However you still cannot save the captured frames as anything else than .bmp. It just how the UDF work.Thanks Huh? Cant do it better for add more picture extensions ?We'll have to find better compression...Cheers, FireFox. Link to comment Share on other sites More sharing options...
NerdFencer Posted December 29, 2008 Share Posted December 29, 2008 could you add the ability to extract frames from an AVI? _________[u]UDFs[/u]_________-Mouse UDF-Math UDF-Misc Constants-Uninstaller Shell Link to comment Share on other sites More sharing options...
Andreik Posted December 29, 2008 Share Posted December 29, 2008 @NerdFencer??? Why ???Look at source code, frames are only screenshots with _ScreenCapture_Capture and I think you can do it yourself or....Function for write all screenshots in a folder ?Cheers, FireFox.I think he want pictures from AVI not especially screenshots. Maybe he used this AVI functions to do something else, like a short clip based on 50 pictures and now he want to extract picture 21.I hope that I`m not wrong. Link to comment Share on other sites More sharing options...
cypher175 Posted December 29, 2008 Share Posted December 29, 2008 this seems promising.. hopefully.. how come it drops a capture.bmp for..?? is there there anyway to change the Frames captured Per Second..?? Link to comment Share on other sites More sharing options...
Andreik Posted December 29, 2008 Share Posted December 29, 2008 this seems promising.. hopefully..how come it drops a capture.bmp for..??is there there anyway to change the Frames captured Per Second..??$fps is frame per sec$avi = _CreateAvi("test.avi", $fps,"capture.bmp") Link to comment Share on other sites More sharing options...
monoceres Posted December 29, 2008 Author Share Posted December 29, 2008 (edited) I have seen examples on the net for extracting bitmaps, however it only works on uncompressed avi's which kinda limits the usefulness. I'll look into sound as well, as far as I understand it's just another stream (however I kinda suspect it will be uncompressed audio as well). Oh and FireFox, I think it would be better if you support your app in you own thread. I'll ask a mod if he can break out the posts concerning your app Edited December 29, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
FireFox Posted December 29, 2008 Share Posted December 29, 2008 @monoceres Sorry for have spamming your udf i thought it was nice idea to make an example but i went to far and made app with it You didnt have to call mod but now its done... anyway thanks And the most important is to keep it up ! Cheers, FireFox. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now