I know WPF MediaElement has lots of bugs, but my project is quite simple:
I have two big video files, 500 mb each - same visuals, with different rendered texts - for 2 different languages.
WPF buttons on top of those videos:
'language' - switch visibility of each video, depending on language;
'product' - scroll forth/back to the required time in both videos simultaneously.
So - all this project does - it plays two video files 24 hours and scrolls both files to reqiured time marks on button click, and shows/hides each video depending on 'language' button click. It does not reload those video files, neither load new ones.
Currently I have this project done with WPFMediaKit. But the problem is - for some reason it has somewhat own time handling. Say I tell it to stop at 23rd second and rewind to 11th - it stops at 24-25 and then rewinds to 11th. I guess its related to its DX renderer.
So my question is - can WPF MediaElement play 2 video files and scroll/rewind both, simultaneously, without freezing/breaking whatever, for 24 hours? TIA
Related
How do I know how long an animation lasts and how do I stop the gif at the end?
I created a GIF from export tool (Maple) but I don't know how long the animation is, or how to make GIF run in real time. I made a gif for showing how something falls down from an altitude. I need to show some figures like t(time) , h(height), v(speed) while it falls down.
Commands that generate animations in Maple often have an option that controls the default number frames. For example, the plots:-animate uses 25 frames. Moreover, animations that are shown in the Maple GUI can be controlled by the animation toolbar, which sets animations to run at 10 frames per second (fps) by default. When you use the right-click menu to export your animation to a GIF file, the exporter will take the current setting for fps into consideration and produce an animation that is 25 frames / 10 frames per second = 2.5 seconds long. Changing this value in the animation toolbar will result in shorter or longer animations accordingly.
From a couple of quick tests, exporting the animation programmatically does not respect the choice of fps, so in this case you may need to play with the number of frames in order to compensate for the default 10 fps setting.
With respect to stopping the gif, as far as I know, there is no way to control this using Maple. I believe that the only solution is to use a GIF editing program to manually turn off the 'loop' option.
I have an interactive pdf document that is displayed fullscreen. there's a navigation bar that users can press to jump to different pages.
What I need is some sort of looping screensaver (a collection of photos) that can be enabled by the user pressing a button.
I considered dropping in a video of a slideshow that I made in after effects, until I realised it's not that easy to loop the playback of that video!
How can I loop a video that I have placed onto a page in a pdf? I've read somewhere about swf's looping but I've tried that and there's no loop option when I place the file in acrobat?
Can someone give me some advice as I thought it would be pretty straightforward to loop a video and now it's looking far from easy.
Thanks
If it is just a slide show, meaning changing images at regular intervals, a few things could be done with Acrobat/Reader's on-board means.
In Full Screen, Acrobat allows to cycle through pages every whatever second. A button on those "screensaver" pages would get back to a "real" page. The question is whether that would interfere with the rest of the document.
Another approach would be having a Button field, icon only, read-only, no action, where you would show an image (preferably PDF) as an icon, and have a control loop running (using interval, timeout) loading different icons. This could be implemented with quite little JavaScript.
I'm working on a project right now where we are in need of seamless video transition between multiple videos in a WPF application.
A second monitor is being used as a media player, events are being sent to the screen to fire off videos, the video position is then being used to fire events back according to the video hitting specific intervals. The project is using a PRISM so the events are being fired by it's Event Aggregator.
The issue is finding a way of playing Videos in WPF that will accommodate for buffering between videos. I don't have code examples for methods tried but I have attempted to do this using.
The native WPF Media Element. This was very buggy and most certainly not user friendly. Bad play back and huge gaps between media files.
WPFMediaKit This is probably the best solution so far, video play back is fine with two issues. The media screen stops playing videos at it seems random times and the control goes black. And the transition between videos is about half a second of black.
Hosting AxWindowsMediaPlayer in a WindowsFormsHost. Play back is great but there is a huge gap between videos, even when running a playlist (This does not happen in Windows Media player so there could be something we are missing.) also as the control is hosted in a WindowsFormsHost I'm not sure if it is possible to keep(Bind) the videos position, and the position event does not appear to be caught.
GMF Play - Seems to have the same issues as WPFMediaKit except the seen is collapsed rather than the screen going black during transitions.
Edit
Media Player Example
Media Element Setup
private void CreateMediaKitElement()
{
WpfMediaKit.BeginInit();
WpfMediaKit.Stretch = Stretch.Fill;
WpfMediaKit.LoadedBehavior = WPFMediaKit.DirectShow.MediaPlayers.MediaState.Manual;
WpfMediaKit.MediaEnded += WpfMediaKit_MediaEnded;
WpfMediaKit.Volume = 0;
WpfMediaKit.EndInit();
}
private void PlayVideo(string uri, IEnumerable<Interval> intervals)
{
// Stop the current Audio track if a new video is being shown.
AudioElement.Stop();
WpfMediaKit.Stop();
// WpfMediaKit = null;
//Try recreating Element
WpfMediaKit = new MediaUriElement();
CreateMediaKitElement();
WpfMediaKit.Source = new Uri(uri, UriKind.Relative);
WpfMediaKit.Play();
}
So my question, does anyone know of or have an example of a method to play videos in WPF with a seamless transition between videos?
Thanks in advance,
Oli
I'll start of by describing the problem, and then follow up with details about the process I'm going though.
Problem:
I'm having an issue where I'm playing a MediaElement on one storyboard and then setting the same MediaElement to hidden in another. After having the MediaElement set to hidden, I'm unable to replay the video portion of that storyboard again (non-MediaElement animations still happen.) Videos are WMVs encoded in VC-1 at 10,000 Kbps at a resolution of 1560x1004 and provided alongside the project as relative assets.
Details:
I'm working on a Kiosk application which makes use of a large number of videos combined with some graphical effects for real-time animation. Presently I'm creating storyboards using Blend, layering the videos for playback in the desired sequence. Below details two sample storyboard from the page:
Open performs the following:
Set's meOpen's visibility to 100%, Visible
Set's meIn's visibility to Hidden at 1 second (masking the start of meOpen)
Starts playing meOpen at 0:00.900.
Before playing the Close storyboard the Open storyboard is played, and the system waits for user input to continue. Once Close is triggered, the following happens:
meOpen - A MediaElement that has it's visibility set to 'Hidden' at 1 second
meClose - A MediaElement that is the desired video to play. I have it starting slightly before meOpen is hidden to mask the first frame 'black frame' while the element is loading the video
The rest of the items is just fading visibility of overlay elements.
The storyboard works for running through the video; however, if I try and play the Open storyboard a second time, meOpen does not play.
Thanks
I'm using VB.net 2010 and WPF 4. I need to have a smooth transition between two videos played on the mediaelement. I absolutely cannot use anything that requires me to use a winhost in the WPF window, as that will make my project impossible (since the video is full screen, and the controls are over the video)
Basically, I need for the video to play through, and then smoothly go to another video specified in code behind. I cannot splice the two videos together - they must be separate.
How do I have the videos transition smoothly, with no "blink"?
I'm guessing without testing here. You're probably going to need some CPU cores and a good video card.
If you have the memory, use two MediaElements.
Queue up both videos, one on each element.
Set the opacity of the second one to completely transparent. They're UIElements so this should work...
Use timers of some kind keyed from the start of playback on the first one so that you get an event a couple of seconds before playback ends.
With that event delegate, start the video in the second MediaElement, animate the first one's opacity to zero while simultaneously animating the second one to fully opaque.
If you need to do it again, set up the timer again and make sure your delegate animates things the other way.