I am developing a WPF application (in .NET 4) which
contains a lot of videos (40 videos, each video > 1 G) using the WPF
media element. Unfortunately, I cannot load more than 10 videos at a
time. When I try to display more videos, a black screen appears
where normally the video should be played.
Has anyone ever experienced such a problem and found a solution? It would help me a lot.
In the mean time, I found the solution: calling 'close' on a mediaelement frees the memory... .
Related
I m working on this project, the client gave me the task to design the UI and embed videos. The backend code of that application is complete according to the client and the backend code is really poorly written with zero optimization.
The application is working perfectly, the application starts the main form loads axWindowsMediaPlayer form with it self and axWindowsMediaPlayer loads videos through resources. The issue is that in the beginning of each video the media player blinks, like if the playlist have 3 videos it'll blink 3 times and if I run the axWindowsMediaPlayer form separately it doesn't blink at all.
I've no idea what to do here.
Standart windows media player control is way too dated. It's basically good for nothing at this point. I'd just open nuget package list and look for any video player control. In case there is none, you can always just add a chromium-based webview element and play your video in there.
I need a very simple video player in my C# app. It only has to loop a video from file and nothing more. Since I'm developing a WPF application, I've tried to use System.Windows.Controls.MediaElement. It has all the functions I need, but works quite poor: I've played some full HD videos on it, and it's always lagging and spiking.
To make sure, it's not my app problem, I've created 2 test applications. The first in a WinForms borderless 1920x1080 window with only AxWMPLib.AxWindowsMediaPlayer control. And the second in a borderless WPF window of the same size with System.Windows.Controls.MediaElement.
Then I run 2 videos on both of players. Here are their specs:
1: 1920x1080, 12000kb/s, 25 FPS, wmv
2: 1920x1080, 5730kb/s, 25 FPS, mp4
On AxWindowsMediaPlayer everything looks fine. But MediaElement seems to drop some frames and ignore vertical sync (it's possible to see parts of one frame on another during fast scene changes). So, it's completely unsuitable and shouldn't be like that, but I've found nothing about the problem in Microsoft official docs (they only suggest to use MediaElement instead of AxWindowsMediaPlayer in WPF apps). Is it possible to make it work more smoothly or using an additional WinForms Form with AxWindowsMediaPlayer is the only solution?
It was written over five years ago (look up James Dailey messages in the thread), there were possibly some improvements but overall I suppose the statements are still in good standing. I will pick up some relevant quotes:
As you know the WPF environment is constructed from the ground up to offer developers a very rich “graphics first” environment. The MediaElement in particular was designed to allow you to mix video with various other UI components seamlessly. This solution will give you the flicker free, “draw over video” solution that you are looking for. The best part is you can do all of this in C#. The bad part of this solution is that the MediaElement is not designed for displaying time sensitive media content. In other words, the MediaElement is notorious for dropping and delaying the display of video frames. There are ways to minimize this such as using SD rather than HD content, use a video accelerated codec, etc.
also:
Unfortunately you can’t really tell the WPF MediaElement to never drop frames. The term we use for this class of issues is “disparate clocks”. In this case WPF is updating the screen at a certain rate (clock 1). The MediaElement (based on WMP) is cranking out video frames at a slightly different rate (clock 2). Given the underlying technologies there is currently no way to synchronize the two clocks and force them to “tick” at the same rate. Since the display will only be updated according to the WPF clock, multiple frames of video may be sent from the MediaElement to WPF between clock ticks. Because of this the MediaElement may appear to drop frames. This is a very common problem in multimedia development and there is no simple solution.
Windows Media Player uses Media Foundation and DirectShow APIs which power media playback with high quality video experience.
I have a set of Images and i want to make a video with them.
I made a R&D over that and i found a lots of way like, FFmpeg. but there is nothing worked with windows phone 7.
My concept is just combine the set of images and prepare a video with any video format that you tube supports. and then i have to share this video on you tube.
I completed the share Functionality. but, i have a confusion in this generating video functionality.
Please suggest me any possible solution with windows phone 7. Waiting for your valuable feedback.
Thanks in advance.
Hello I am writing a WPF application which should plays a set of videos which should played fullscreen.
i tried to work with some VLC lib's but they did not worked for me.
then i moved to mediaelement - when i start playing a video i always get a black flicker
loading multiple videos was a huge performance loss - videos stuttered...
any recommendations how to resolve this issue ?
i plan do the following programm:
the kinect detects people which move along --> the programm plays a video
if people stop and watch the screen --> the programm plays a extended version
UPDATE: checked vlc.net and it will also have a BLACK frame at the beginnign -- ARGH !
UPDATE: seems like the first frame is always black!? hmmm (added timer and started the video 1 second after it was loaded - still have the black frame ...)
Solution for my application : i use vvvv.org and send my data trough a UDP connection - i handle the video stuff in this VVVV application - works great ... i am very disapointed by microsofts video support ... i hope this will get better in the future thx anyways :)
I have a working program that could load and play a video file. It has a canvas over the video on which an interrupt draws events loaded from a separate text or csv file. It was all working marvelously and I have been using it for weeks, but I wanted to add fft and video analysis functionality. I added Exocortex to the project and now loaded videos don't play and loaded events don't display on the canvas.
I can't think of why this would have any effect, and it's the only change that's been made. The rest of the program appears to work normally. Does Exocortex have anything about it that might interfere with MediaElements or Canvases?
EDIT: Further investigation suggests the problem is not with Exocortex, but with the mediaelement and a recent Windows 7 Update. The solution is still evading me.
A reformatting my computer with a new install of windows 7 has fixed the problem. In other words, I have absolutely no idea what was broken and what wasn't working. Windows Media player was experiencing the same problem.