Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using the data of whole video file in byte[].how to play the video in wpf? i am not having any idea about which control i need to use for the video player,need to support pause and play any idea?

What I have tried:

suggestions please about which control i need to use and what methods need to use?
Posted
Comments
[no name] 13-Jul-21 18:19pm    
Search for playing a "byte stream". Or create a file on disk.
Richard Deeming 14-Jul-21 4:42am    
This looks like a good option:
VideoLAN / LibVLCSharp · GitLab[^]
Adérito Silva 31-Jul-21 15:12pm    
MediaPlayer is the control for playing video, which uses DirectShow and is limited to the video codecs you have installed on your system.

However, playing video from a byte array is not the usual way and is not performance friendly. You would use a Stream, for anything video related, as having a video file completely loaded into memory is a bad idea. Imagine you playing a 2 hours 4K AVI movie of about 1 Terabyte... how could it be loaded into a byte array in RAM? In this case, you would use a FileStream to load the video from a file and the player would only load small chunks of the video into a static buffer in memory, which would likely consume just a few Megabytes in RAM. Also, because how big is the buffer and how big are the loaded chunks depends on the video format, resolution, pixel format, etc., so the codec is the one responsible for handling that.

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