1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2009
    Rep Power

    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
  2. #2
  3. I'm Baaaaaaack!
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jul 2003
    Rep Power
    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.

    My blog, The Fount of Useless Information http://sol-biotech.com/wordpress/
    Free code: http://sol-biotech.com/code/.
    Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
    Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.
    LinkedIn Profile: http://www.linkedin.com/in/keithoxenrider

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw
  4. #3
  5. Contributing User

    Join Date
    Aug 2003
    Rep Power
    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.

IMN logo majestic logo threadwatch logo seochat tools logo