AviFile Library creates avi bigger than 2 GB- not useable - c#

I am using the AviFile Library to make a avi video from Bitmaps, comming from Kinect. The file size gets really high, and over 2 GB I cannot open these files anymore. I will have to compress these files. Does anyone know a tool how I can compress it or a better lib than AviFile?
Kind regards
Alexander Ziegler

Ok, I have done a work around! The biggest problem was to handle the huge amount of images comming from the kinect. With compressing it was not possible to write them to file (--> out of memory). So I write them just into a file (during recording) as bytes. After recording I read them out, compress them and save them to avi (the files getting much smaller about 100 MB). Thanks for every comment

Related

Using SharpZipLib and getting progress status?

How would i show the progress of compressing in SharpZipLib?
I'm developing a small application that Zip many file to a single zip file.
it may got a while to be done, there might be a progress bar that shows the progress of compressing, so is there a way to know how much has been compressed in SharpZipLib?
Yes you can see how much is compressed, by size of output stream, but that is not enought to show a progress bar, you should also know how big a output stream would be at the end, and of course you can't know that in advance.
You can measure progres when zipping individual files, and do that proportionaly by size of files, one file moves progress percentage by (size_of_file / total_size_of_all_files) * 100
For example let's say that you have 3 files :
file1.bin 1000 kb
file2.bin 500 kb
file3.bin 200 kb
after first file compressed move progres on 59%, after second file move it by 29% to 88% and after third to 100%.
If you use DotNetZip, there is a SaveProgress event that tells you how many bytes it has compressed.
There are code examples in the DotNetZip SDK showing how to use it.

Convert Isolated Storage /RAW Format into WMV on Client side

Currently we're trying to create a project which has access via web cam to capture
the Video and Audio and store it on Cache.
We have been able to successfully capture the Video into the "Isolated Storage" or "Raw" File format. The next step is to create a silverlight friendly format like WMV version 8 or 9 which can be used for Replay.
Asof now we have been able to successfully get a project from Link
to capture the video and encode it into AVI format for replay mode. Unfortunately we've not been able to get a client version code snippet or API that allows encoding into WMV format directly.
Any pointers in the direction would be most appreciated.
TIA
For the moment there is no easy solution for encoding video/audio raw format from SL, and I think SL5 does not have that capabilities as well.
The only solution I found when I had that question too, was from StreamCoders's SilverSuite product, but it was too pricey for my needs. You might have a look there:
http://www.streamcoders.com/products/silversuite.html
Another solution would be to upload the raw data to a server and perform the encoding there, problem is the size of the raw data file are so big that it make it even not suitable.
I tried to zip the raw file, for a 45 second video/audio I had ~ 320 MB file size and ~ 210 after zipping. That was still way too high for my need.
So far I've not see much hope encoding raw file from the client side apart from the StreamCoders products.
Good luck
We have been developing the same application as a Pure Silverlight Browser solution and moved towards an out of browser solution where -
We capture the RAW Isolated Storage Format and convert it into AVI using AVIDLL available from the following urls -
Silverlight 4 More on Capturing Videos from Webcams
Silverlight 4 Yet More on Capturing Videos from Webcams
And later convert the AVI video (RAW->AVI) which is still large into a WMV file using FFMpeg.exe
Statistics on SIZE:
RAW atleast 700MB for a 1 min recording
AVI atleast 600MB after conversion from RAW
WMV atleast 500KB after conversion from AVI
Statistics on TIMELINE:
RAW to AVI conversion takes about 1min for the 700MB conversion
AVI to WMV conversion takes another 1min for the 600MB conversion
Comparing this with the RAW file upload to the server and converting it would be quite a time consuming process considering that the RAW file size is large.
Any optimizations which could help change the time taken to convert or perform a direct conversion to WMV could make the solution better.
Cheers !

ABCPdf uses a lot of memory and generates huge files. Solution?

I have a system for creating a pdf book from users own images. The images are in high resolution and the pdf end up with around 70pages with pictures on most of them.
When generating the pdf the in a local application on the server the process uses around 3Gb of ram which makes it crash more often then it succeeds. The files are also really huge, around 1,2 Gb. Running it through a print to pdf would make it a a hundred times smaller.
Is there a way to make ABCPdf use less memory and creating smaller files?
I have had a very similar experience with iTextSharp, where I was basically running out of memory anytime I create a large PDF with images in it.
I found that there is a function that I should call to release images after I am done with the image, since it holds it in memory in case you want to use it again or until you finally close the PDF.
Either reuse the image if they are repeating header/footer logos, or release images on the go.
Most likely that is the issue you are facing, but I have no experience in ABCPdf.
I've not used ABCPdf directly but I'd suspect that the images are the source of your issues, resize them before they are included in the PDF objects. I suspect that's what a print-to-PDF process will be doing.
One other note, for very large PDF's you may want to set "linearize" to false.
<pdfDoc.SaveOptions.Linearize = false;>
This optimizes the PDF for web streaming, so if you are streaming the PDF, then you might want to leave it as true, but I've found it drastically increases the memory used by ABCPDF during the save.

C# manipulating video

i want to take a folder of pictures, and turn it into a slideshow video with music in the background.
i have no idea how to do this, or where to get help, cos this isnt the kind of thing you can search in google.
idk if there are api's for it, or if it can even be done in C#.
maybe ill have to move the project to C++ or something, but first i need to know where the hell to start.
thanks.
This is definitely the kind of thing you can search in Google. Try "creating avi files in C#" and pick one of the answers. I recommend this one from personal experience.
Creating an AVI file is actually pretty easy - you basically just set a frame rate and dump in a bunch of bitmap files, then add a WAV or MP3 file (or files) for the audio, and that's it.
The AVI file can then be played as is, or compressed into an MPEG or whatever (although you won't get much size compression with a slideshow-type video file, you also don't need it as much).

How to split AVI files

I am trying to split a large AVI 2.0 (OpenDML format) file in smaller parts (under 1GB in my case) in order to be able to open the parts with VFW (avifil32.dll).
What is the best way to achieve this splitting (preferably in C#)?
One of the options is to copy it frame by frame. I found some examples on the net, which do the same. But most of these use VFW which can't read files above 2GB in general and AVI 2.0 files above 1GB because of the max RIFF part size of 1GB.
I would need DirectShow instead of VFW. I am pretty sure that I would also mess up the audio sync if I try to manually copy frames.
I am looking for something similar to what VirtualDub does with "direct stream copy" that doesn't affect the current compression, just splits the file and creates proper AVI indexes.
Avi files can be encoded in many different ways, depending on the codec used. Avi is a wrapper file, not an encoding method. This means there isn't really an easy generic way to split avi files using C#.
To do it in code from scratch would be a major undertaking. That said, you can cheat by using mencoder and calling it from c# - not ideal, but far easier and more reliable than trying to re-invent the wheel. Alternatively, there are a number of ffmpeg c# wrappers that will give you access the ffmpeg tools (but I haven't found one that isn't buggy as hell)
What are you trying to do, exactly? Why do you need avifil32.dll and how are you using it? If you are just trying to play a very large avi file, there are alternatives. Try aforge.net, for example.
mencoder can split files for you. Another option is ffmpeg

Categories