Play video from memory stream or byte array

Posted by Ray.chayan under C# on 11/26/2011 | Points: 10 | Views : 28355 | Status : [Member] | Replies : 7
Hi guys,

my problem is "simple" ... I need to play a video file from a byte array or a memory stream, not directly from a file on disk

Please reply me how can I do this?




Responses

Posted by: Vuyiswamb on: 11/26/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
The Solution for your Question differs per technology. In Silverlight it will be different the way it can be done in ASp.net and same as WPF and Win apps.

What Technology are you using ?



Thank you for posting at Dotnetfunda
[Administrator]

Ray.chayan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ray.chayan on: 11/26/2011 [Member] Starter | Points: 25

Up
0
Down
I am using C#.net and creating an window application. The videos remain in the same system in a encrypted format. I have to decrypt it and play without saving anywhere in the hard disk. I have successfully decrypted it and creat amemory stream .Now I have to play that video from stream.

Ray.chayan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 11/26/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
The following posts will help

http://social.msdn.microsoft.com/Forums/en-AU/vssmartdevicesvbcs/thread/77156b4d-d232-410c-b3b9-81489cccf287

http://social.msdn.microsoft.com/Forums/en/windowsmobiledev/thread/8b5d4086-f468-419a-805b-c553105d183a

or this


  byte[] bytes = GetbyteArray();

// Convert the byte array to wav file

using (Stream s = new MemoryStream(bytes))
{
// http://msdn.microsoft.com/en-us/library/ms143770%28v=VS.100%29.aspx
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();



Hope this helps



Thank you for posting at Dotnetfunda
[Administrator]

Ray.chayan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Aniperiye on: 3/8/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Ray.chayan ,
did u get the solution for this issue? if u solved please email me...aniperiye@hotmail.com is my email address.

Ray.chayan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Navi1478 on: 4/11/2013 [Member] Starter | Points: 25

Up
0
Down
Hello All
I want to Show live Video in my asp.net Website..how can i do ..please Help me ...

Ray.chayan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mike_G on: 7/16/2014 [Member] Starter | Points: 25

Up
0
Down
Old topic but anyway. There is a solution using 3rd party component BoxedApp SDK. Here explained how to play a video from stream: http://boxedapp.com/encrypted_video_streaming.html Of course this is a case of encrypted video stream, so in your case you could just create a virtual file based on MemoryStream.

Ray.chayan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yosefi1988 on: 8/5/2014 [Member] Starter | Points: 25

Up
0
Down
Hello to EveryBody
I'm a .Net Programmer from Iran.I need for your help
i'm try to develop a program like this post:

I need to play a video file from a byte array or a memory stream, not directly from a file on disk

but I dont know what do...
please help to me

excusme for my bad English :)


Ray.chayan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response