October 12th, 2012, 01:44 AM
Convert image frames to .avi c# without using library tools(directx...)
Im developing a c# application to save /record video playing picturebox using timer call.
following work has been done:
> getting video from an ip camera to picturebox using timer call
Need to do
>now i want to get video from this picturebox
> record the video frames at different intervals
i have tried a lot of things( saving image to stream and then byte array then saving as file stream)
but the saved video does not open , might be not saving in correct format.
i dont want to using directx or avifilemanager etc... using natural c# ways
Plz help. im tired of searching on it...
its very very urgent... i will be obliged for this favour
October 12th, 2012, 05:56 AM
Video files (indeed any image file (and practically any binary file)) is one of several types. Simply saving the bytes to file does not instruct any playing program what type it is. Google 'magic number' to learn about file headers.
BTW, just because you put a correctly formatted file header does not mean it automatically works, the data needs to be in the correct format to match the header.
I suggest you are very far away from being able to do what you want to do. Pick up a few intro books to image/video manipulation. It is not for nothing that there are so many libraries out there.
October 14th, 2012, 04:35 AM
You have to realise that AVI is not a video format. Rather it is a container format, the audio and video data contained itself can be encoded in many different formats.
Typically such data is encoded/decoded by codec software installed on your PC. There are a number of reasons why you would not write the encoding software yourself, such as complexity and intellectual-property rights licensing on some formats. It sounds as if you have not attempted any kind of encoding at all!?
If you do want to do the encoding yourself, then you will need to understand the formats and encoding techniques involved. Personally I think it is an ill-advised waste of time, but Wotsit's Movies and Animations section is perhaps a good place to start - even if it only convinces you that you do need to use an existing library.