Solved

video as a stream of bytes

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

791 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