Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hi,

iam converting video file to byte[] how can i convert byte[] back to native format(video).

Regards,

sajith
Posted
Updated 25-Mar-12 18:29pm
v2
Comments
JF2015 26-Mar-12 1:13am    
Hard to answer. How are you converting the video file to byte[]?
sajithnet 26-Mar-12 1:46am    
public byte[] ToByteArray(string path) {
byte[] buffer = File.ReadAllBytes(path);
return buffer;
}
jiojo 16-May-12 5:28am    
could you please post the whole class that convert video to byte?

1 solution

byte[] bytes = GetbyteArray();

// Convert the byte array to avi file



using (Stream s = new MemoryStream(bytes))

{


System.Media.SoundPlayer myPlayer = new System.Media.SoundPlayer(s);

myPlayer.Play();

}

System.Media.SoundPlayer myPlayer = new System.Media.SoundPlayer(myfile);

myPlayer.Stream = new MemoryStream();
myPlayer.Play();
 
Share this answer
 
Comments
sajithnet 26-Mar-12 1:47am    
thanks Meel,this is not for video,sound player will not play vedio

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900