Solved

video as a stream of bytes

Posted on 2009-05-10
1
209 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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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