Solved

video as a stream of bytes

Posted on 2009-05-10
1
210 Views
Last Modified: 2013-12-17
Hi

Can I store video as stream of bytes in a textfile which I can later use it to play video
0
Comment
Question by:KaranGupta
1 Comment
 
LVL 9

Accepted Solution

by:
tculler earned 500 total points
ID: 24351841
You can store data as however you want. File extensions don't actually change data; they just change the way programs interact with them. As long as you know all of the meta info and such, you can write your own video with your keyboard, if you wanted (though it would take an absurd amount of time...). It's all just a bunch of bits.

Remember, though, a "stream" is an active connection, or "tunnel", between two things. If your program isn't running, it can't have a stream with a text-file. However, you could create a FileStream within your application, get the video bytes from their source, and write those bytes to your FileStream, like in the following code snippet. However, remember that there are countless ways to do anything.

Hope this helps,
Nate
public static void WriteVideo(System.String myOutputPath, System.Byte[] myVideoBytes)
{
    using (System.IO.FileStream writer = System.IO.File.OpenWrite(myOutputPath))
    {
        writer.Write(myVideoBytes, 0, myVideoBytes.Length);
    }
}

Open in new window

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now