Giter VIP home page Giter VIP logo

ffmediaelement's People

Contributors

aaronwatsonsubc avatar adamhewitt627 avatar ajdillhoff avatar cybersinh avatar dbruning avatar deltagc avatar deltasem avatar ememadegbola avatar esmodavid avatar fatalex76 avatar geoperez avatar gitter-badger avatar israelramosm avatar jnschulze avatar keboo avatar kennethwhite avatar kuliner avatar mariodivece avatar melvingr avatar mrbean2016 avatar n9 avatar saturne1606 avatar tpetrina avatar truong-thanh-quang avatar xj42 avatar zgabi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ffmediaelement's Issues

SpeedRatio 4 causes playback issues

Hi,

When I set the SpeedRatio to 4, the media will play at 4x speed, for a few seconds but then pause.

Sending a play command to the player will repeat this process. A SpeedRatio less than 4 does not cause this issue.

Any ideas?

Error on test play following instructions provided

Using the ffmpeg link provided and starting it up I get the following:

Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in \Repos\ffmediaelement\Unosquare.FFmpegMediaElement.Tests\bin\Debug\Unosquare.FFmpegMediaElement.Tests.vshost.exe'.

Additional information: The runtime has encountered a fatal error. The address of the error was at 0x7349260b, on thread 0x5820. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

Synchronization problem causes Index out of range exception.

It seems there is some problem with synchronization which causes index out of range exception.
Call stack:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Unosquare.FFmpegMediaElement.FFmpegMediaFrameCache.SearchFrame(Decimal renderTime) in c:\xxx\ffmediaelement\ffmediaelement-master\Unosquare.FFmpegMediaElement\FFmpegMediaFrameCache.cs:line 290
at Unosquare.FFmpegMediaElement.FFmpegMediaFrameCache.GetFrame(Decimal renderTime, Boolean checkBounds) in c:\xxx\ffmediaelement\ffmediaelement-master\Unosquare.FFmpegMediaElement\FFmpegMediaFrameCache.cs:line 342
at Unosquare.FFmpegMediaElement.FFmpegMedia.RenderVideoImage(Object sender, EventArgs e) in c:\xxx\ffmediaelement\ffmediaelement-master\Unosquare.FFmpegMediaElement\FFmpegMedia.cs:line 602
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()

Control: Setting Position pauses the video

I'm playing an HTTP video stream and whenever I seek to a specific part of the video via setting the Position property, it pauses the video. Invoking Play() from the same method/thread that set the position doesn't help in any way, but calling Play() after 1 second on a separate thread continues the video from the new position.

Ram usage

Im looking at this project and have been impressed so far. Im wanting to use this to be able to play multiple video stream at the same time however im struggling with the ram usage, a 375k MJPEG video turns into 55mb ram, 2x is 100mb. For a 2x MP4 h.264 27mb, 479mb RAM.

Is there something that im missing to reduce this effect?

Thanks

Freeze of video

Added line in

Unosquare.FFmpegMediaElement\FFmpeg.Autogen\FFmpeg.avutil.g.cs

public AVBufferRef* hw_frames_ctw;

causing not functionality of video rendering. Video is frozen on the first frame

Shrinking Audio Samples creates Sound Artifacts

thank you very much, this project helped me a lot!It's fantastic!
There are two issues below.
Issues 1、When I frequently switch the source, command does not work.cant play anymore. Issues 2、Long time off the net,After the network is restored,, command does not work,cant play anymore.
///


/// Executes this command asynchronously
/// by starting the associated promise and awaiting it.
///

///
public async Task ExecuteAsync()
{
var m = Manager.MediaElement;
if (m.Commands.ExecutingCommand != null)
await m.Commands.ExecutingCommand.Promise;//Issues 1 &Issues 2,Can not jump out,Dead here

        m.Commands.ExecutingCommand = this;
        Promise.Start();
        await Promise;
        m.Commands.ExecutingCommand = null;

    }

Support realtime stream switching

Currently, only a single component stream is supported. It is impossible to switch to a different chapter, program, or individual stream. Provide a method to change the components being rendered.

Rewinding frame by frame, some frames aren't loaded/rendered

First off : This project is awesome and is a life saver for me!

I'm currently working on using ffme for an application that needs fine-grained rewind/forward and frame-by-frame seeking. I have quickly implemented NextFrame and PrevFrame commands in the sample application and it works flawlessly when seeking forward, but when seeking backwards I get a lot of frames that simply don't render at all. So for example you go back frame by frame and only 1 frame out of 2 or 3 gets rendered, so it is not as smooth as seeking forward.

You can take a look at my fork to see how I implemented frame by frame seek : https://github.com/StevenGilligan/ffmediaelement

Did I implement it wrong? If not, is this something that can be fixed? I wouldn't mind fixing it myself if you can give me some direction, I just wouldn't know where to start looking to fix this.

I tested with a couple different .avi mpeg4 files and .mkv h264 files with the same result.

When stepping frame forward/backward a couple of times with arrow keys, an assertion is hit.

Debug - [h264 @ 146ebe80] Reinit context to 1280x544, pix_fmt: yuv420p
Debug - SEEK R: Elapsed: 44 | Target: 41.270 | Seek: 0 | P0: 27,607.266 | P1: 27,319.266
Debug - SEEK D: Elapsed: 45
Debug - SEEK L: Elapsed: 0 | Target: 41.229 | Seek: 989,489 | P0: 28,027.181 | P1: 28,027.181
Error - Assertion ret <= avpkt->size failed at src/libavcodec/utils.c:2486
Debug - [h264 @ 146ebe80] Reinit context to 1280x544, pix_fmt: yuv420p
Debug - SEEK R: Elapsed: 38 | Target: 41.229 | Seek: 0 | P0: 28,027.181 | P1: 27,287.266
Debug - SEEK D: Elapsed: 38
Debug - EVENT START: BufferingStarted
Debug - EVENT DONE : BufferingStarted

Rendering Issue

First, let me say this is an awesome project! My team is working with the Microsoft HoloLens and we have been having a very hard time finding a control that will render the video. This is working well overall and I was glad that it was so easy to add the frame capture because that was important to our project.

However, we are having an odd issue with the video rending a small stripe on the right hand side of the control. It appears like some sort of overflow or resolution issue. When I subscribe to the stream from the demo application there is no bug but even when I copy the control directly into our project it still shows up. Sometimes it's black and sometimes pieces of video that has played in the past.

image

If you have any questions or I can help resolve this, please let me know! I've tried many configurations and can't seem to get this straightened out so I decided to post as a last resort.

Thanks,
Kidron

Invalid data found when processing input

I'm getting the following error at this line in Decoding.cs:
receivedFrame = this.FillDecodedPictureHolderFrame(&readingPacket, emptyPacket);

{"Error decoding video packet. Code -1094995529 - Invalid data found when processing input"}

Trying to load an MP4 (MOV) and using the latest 32bit shared build ffmpeg build from zeranoe. I've also ensured the build is targeted for x86. I've also tried a number of various video formats.

Unable to play 4k video

Attempt to play HEV x265 4k file results in error. Tried both 64 and 32 bit builds, makes no difference. Box is Windows 10 Pro 64bit.

Source video file: http://4ksamples.com/elysium-2013-2160p-1-minute-sample-footage/
Exception detail:

An unhandled exception of type 'System.AccessViolationException' occurred in Unosquare.FFmpegMediaElement.dll

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Stacktrace:

at FFmpeg.AutoGen.ffmpeg.swr_convert(SwrContext* s, SByte** out, Int32 out_count, SByte** in, Int32 in_count)
at Unosquare.FFmpegMediaElement.FFmpegMedia.CreateMediaFrameFromDecodedWaveHolder() in Unosquare.FFmpegMediaElement\FFmpegMedia.Decoding.cs:line 315
at Unosquare.FFmpegMediaElement.FFmpegMedia.PullMediaFrame() in ffmediaelement\Unosquare.FFmpegMediaElement\FFmpegMedia.Decoding.cs:line 515
at Unosquare.FFmpegMediaElement.FFmpegMedia.InternalFillFramesCache(TimeSpan timeout) in ffmediaelement\Unosquare.FFmpegMediaElement\FFmpegMedia.cs:line 205
at Unosquare.FFmpegMediaElement.FFmpegMedia.InternalLoadFrames(Decimal renderTime) in ffmediaelement\Unosquare.FFmpegMediaElement\FFmpegMedia.cs:line 434
at Unosquare.FFmpegMediaElement.FFmpegMedia.ExtractMediaFramesContinuously() in ffmediaelement\Unosquare.FFmpegMediaElement\FFmpegMedia.cs:line 581
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

An unhandled exception of type 'System.AccessViolationException' occurred in Unosquare.FFmpegMediaElement.dll

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Issue with RTSP streaming

FIrst of all, I would like to thank you for this .NET implementation of this FFmpeg player, it is such a great project!

I have only one issue, regarding real time streaming using RTSP protocol.

I would like to stream with the least delay as possible, but every RTSP stream I tried freeze very quickly.

The URI tested is : rtsp://mpv.cdn3.bigCDN.com:554/bigCDN/definst/mp4:bigbuckbunnyiphone_400.mp4
ffmediaelement plays the first frames and freezes quickly. I don't know why there is such a freeze playing the stream.

Thank you in advance!

Non monotonic frame seeking jumps around

Seeking abckards on for eaxample, an audio file (i.e. non monotonic frames) causes the position indicator to jump around and the dreaded seek condition of x does not contain y, clock set to z. This is due to the lack of code handling non-monotinic backwards seeking.

RTSP: Streaming and Player Improvements.

So I have some code I have merged into the library and I wanted to share it in hopes of being able to have smoother playback.

Let's start with the chunk from FFmpeg.Media (Keep in mind this is all lazy man coding)

private void ExtractMediaFramesContinuously() {
  decimal renderTime = StartTime;
  decimal lastTime = 0;
  bool internalMute = false;
  decimal oVolume = this.Volume;
  bool retrying = false;
  while (IsCancellationPending == false) {
   var wasPlaying = this.IsPlaying;
   if (lastTime - (Decimal) 5 > 0) {
    var frame = AudioFramesCache.GetFrame(lastTime - (Decimal) 0.05, CheckFrameBounds);
    var frame0 = AudioFramesCache.GetFrame(renderTime, CheckFrameBounds);
    if (frame0 == frame) {
     Debug.WriteLine("REPEATING AUDIO FRAMES!!");
     internalMute = true;
     if (this.Volume != 0) {
      oVolume = this.Volume;
     }
     this.Mute();
    } else if (internalMute == true) {
     Debug.WriteLine("NONREPEATING AUDIO FRAMES!!");
     internalMute = false;
     this.Volume = 1;
    }
   }
   //        // Lock up changes
   MediaFramesExtractedDone.Reset();
   //
   //        // Extract state
   lastTime = renderTime;
   renderTime = RealtimeClock.PositionSeconds;
   //
   //  Load frames
   //  Debug.WriteLine(lastTime);


   // Debug.WriteLine(renderTime);                                          


   InternalLoadFrames(renderTime);
   //
   //        // Unlock
   MediaFramesExtractedDone.Set();
   //

   if (wasPlaying && this.IsPlaying == false) {
    Debug.WriteLine("ATTEMPTING TO PLAY AGAIN");
    this.Play();
    retrying = true;
   }
   if (lastTime == renderTime && lastTime > 10 && retrying == false) {
    Debug.WriteLine("REPEATING FRAMES!!");
    this.Play();
   }
   //            // HasMediaEnded will most likely contain an "old value" for the current cycle. That's why we call the method to re-evaluate.
   //            if (InternalGetHasMediaEnded() == false)
   //            {
   //              ErrorOccurredCallback(this, new MediaPlaybackException(MediaPlaybackErrorSources.ExtractMediaFramesContinuously, MediaPlaybackErrorCode.FrameExtractionLoopForcedPause,
   //                   string.Format("WARNING: Something did not go smoothly. Wall clock paused @ {0:0.000} Call the Play method to resume playback.",
   //                        renderTime)));
   //                //Attempt To Start Playing Again
   //                this.Play();
   //            }
   //        }
   //
   //        // give waiter methods a chance to execute before a new lock is set.
   retrying = false;
   Thread.Sleep(1);

  }

The main changes here is fixing the audio stutter that happens when the player tries to repeat a frame in the queue. It tries to set the volume to 0 then return back to what ever the user had before setting it to 0. It works alright, has some delay before kicking in.

The other changes is the player will try to "replay" itself if it becomes desynced rather than throwing an error. This is a personal change to try and keep the video player from crashing all the time with the streams I use. As for some reason after about 2-3 mins it becomes desynced quite often.

This next part is very important and should be added ASAP for m3u8 links.

FFmpegMedia.Decoding.cs line 104
ffmpeg.av_dict_set_int(&optionsDict, "multiple_requests", 1, 0);
Without this the player WILL NOT have continues playback on m3u8 files.
This should be a toggle option within the interface for the player because I can understand some users not needing it but for my personal application without this line I can never have continuous playback from a streamed m3u8 file.

The below lines are icing and should help a little.
ffmpeg.av_dict_set_int(&optionsDict, "reconnect", 1, 0); ffmpeg.av_dict_set_int(&optionsDict, "reconnect_at_eof", 1, 0); ffmpeg.av_dict_set_int(&optionsDict, "reconnect_streamed", 1, 0); ffmpeg.av_dict_set_int(&optionsDict, "reconnect_delay_max", 200, 0);

My main issue here is trying to buffer some video into ffmpeg before playing so it is overall smoother and more reliable. I have yet to figure out how to do so. If you could provide any assistance that would be amazing. We (My team and I) Have decided to use this project because it loads and offloads video streams SOOOO much faster than VLC for .Net and load times are very important to us. We just need an increase in stream reliability and stability.
(Unfortunately they left me to do all this)

Also if you should add anything from my personal changes, I would add in the audio repeater identifier and muter and the multiple connections option.

Running MediaElement in second window

When running MediaElement in second window it throws "The calling thread cannot access this object because a different thread owns it.". Exception is first thrown when raising FFmpegMedia.PropertyChanged event.
Second window is running on different thread than Main thread.
I debugged it, and event is raised on thread that second window is running on, and MediaElement should be created on the same thread (but it doesn't seem like it).

A Trail Of Discovery: Adding Referrer support and User-agent into the library.

How well is rtmp supported?
(Answer: RTMP Is supported but only specific video encoding. MP4 being the best i think)

Additionally, how would i go about handling HD m3u8 files. Avoiding this error:
(Resolved, See Edit 2)

MediaFailed Event Fired System.Exception: Could not load sream frames in a timely manner. Timed out in 00:00:02
   at Unosquare.FFmpegMediaElement.FFmpegMedia..ctor(String filePath, MediaErrorOccurredCallback errorCallback) in C:\Users\Luke\Downloads\ffmediaelement-master\Unosquare.FFmpegMediaElement\FFmpegMedia.cs:line 146
   at Unosquare.FFmpegMediaElement.MediaElement.OpenMedia(Uri sourceUri) in C:\Users\Luke\Downloads\ffmediaelement-master\Unosquare.FFmpegMediaElement\MediaElement.MediaProperties.cs:line 241

EDIT 1: I changed the constant to 15 seconds to give it extra time after poking around but it didn't seem to do anything for loading.

EDIT 2: Fixed the issue with the m3u8. The file contained multiple links and this was confusing the player. Need to manual strip out the first/best working link from the m3u8 file.

EDIT 3: Now seem to be having issues with select files pointing to a list of TS links M3u8 files that require user-agent. It's throwing file could not be opened. Link was working a-okay in VLC's Player. FFMPEG is throwing this value as an error.
-858797304

Edit 4:
-858797304 to hex = -0x333034F8
-0x333034F8 to ascii = ?304 (Flipped) is 403.

Seems like the video player doesn't have a "set" http client like VLC. Going to see if i can resolve by making ffmpeg use a User-Agent header in its request to the url. This should hopefully resolve the issue with 403 in this case.

EDIT 5:
Fixed issue with m3u8 file not playing due to lacking user-agent by adding
ffmpeg.av_dict_set(&optionsDict, "user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36", 0);

to FFmpeg.MediaDecoding.cs at line 89

Whew, finally got that done after 3 hours of research..

EDIT 6:
Trying to figure out how to assign referrer header to request.. Doesn't work like previous method.

EDIT 7:
Figure out how to set referer used
ffmpeg.av_dict_set(&optionsDict, "headers", "Referer:"+referer, 0);

EDIT 8:
I added in support for using MediaElement.Referer = "" and MediaElement.UserAgent = "" into the library.
This is sloppy so if anyone comes along feel free to redo this
FFMpegMedia.Decoding.cs at lines 84 to 109

private void InitializeMedia(string filePath, string referer, string useragent)
        {
            // Create the input format context by opening the file
            InputFormatContext = ffmpeg.avformat_alloc_context();
            AVDictionary* optionsDict = null;
            ffmpeg.av_dict_set_int(&optionsDict, "usetoc", 1, 0);
            if (referer != null) {
                ffmpeg.av_dict_set(&optionsDict, "headers", "Referer:"+referer, 0);
            }

            if (useragent != null)
            {
                ffmpeg.av_dict_set(&optionsDict, "user-agent", useragent, 0);
            }
            else
            {
                ffmpeg.av_dict_set(&optionsDict, "user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36", 0);
            }


            fixed (AVFormatContext** inputFormatContextRef = &InputFormatContext)
            {
                int result = ffmpeg.avformat_open_input(inputFormatContextRef, filePath, null, &optionsDict);
                if (result != 0)
                   throw new Exception(string.Format("Could not open file '{0}' with error '{1}'", filePath, result));
            }

FFMpeg.Media line 92
this.InitializeMedia(filePath, referer, userAgent);

MediaElement.MediaProperties line 241
this.Media = new FFmpegMedia(inputPath, OnMediaError, useragent, referer);

MediaElement.DependencyProperties

32-33
private static string intReferer = ""; private static string intUserAgent = "";
77
element.OpenMedia(uri, intReferer, intUserAgent);
97-105
public string Referer { get { return intReferer; } set { intReferer = value; } } public string UserAgent { get { return intUserAgent; } set { intUserAgent = value; } }

MediaElement.Controls

13,27,41
this.OpenMedia(Source, Referer, UserAgent);

HLS: Feature Request: Smart m3u8 selection

Okay, so i was going to implement this into my own project but if we can figure out how to do it in the library it might make my life easier.

Repro steps are simple:
load an m3u8 file with more than one video element inside of it.

The player will get stuck trying to figure out what link to use.

If we can implement a simple get m3u8 and check for more than one link and play the first link in m3u8 that should work fine.

Just wanted to bring this up in a different issue thread so it can get its own attention.

MPEG2: Incorrect stream component start times

A couple of files are showing incorrect start times (negative pts) after removing the start time offset. They should show 0 but they show a negative value. Maybe stream component metadata start time is incorrect. Might need to decode the first frame and figure out the real start time and then rewind the stream. In realtime streams the start time of the stream component is set way before the first frame is produced. For example, the UDP sample stream takes about 4 seconds to load an start time offset is set to 4+ seconds. I am not sure I trust stream->start_time anymore...
image

Cannot build without Zeranoe ffmpeg

hi there!

I am in need of WPF MediaElement/MediaPlayer replacement since playback freezing problems, and got upon your player. I downloaded the sources, but I cannot build it since https://ffmpeg.zeranoe.com/ is forbidden now. can you post a link to the ffmpeg32 folder content that you have (3.1.4 version AFAIK), so I can try your player out? I trined some other version, but it didn`t work - Test project just does nothing after opening a video.
thank you!

PS sorry if I posted this here, while there is some more suitable place for such quesions, just couldn`t find.

Subtitle Rendering needs improvement

Subtitle rendering needs more work because it is not scaling and not displayed at the very bottome where it needs to. Also, the SubtitleRendering event should provide positioning information

Support loading subtitle-only URLs

Currently, there is no way to specify or automatically load a subtitle file. Implement a SubtitleInputContext in the container supporting Play, Stop, Pause and seek operations.

Its not playing at regular speed.

I open up a new video after building. First when I load a file larger than 10 minutes, its not currently playing or working.

Second, when I do find a video it plays, it plays at 1/10 speed. I don't see the speed, but the video and frames don't update fast enough to where It even seems like it plays at regular speed.

Have you seen this before?

Scaler: Wrong aspect ratio for videos with PAR != 1

Tested latest version (from 21.06.2017), and found out, that aspect ratio flag in movie file header isn't respected, It seems that currently the code calculates aspect ratio from video resolution. But all TV SD recordings have display aspect ratio (DAR) 16:9 though resolution is 720x576, so all such movies are shown compressed from both sides (long faces, tall people only, etc :) )
Some more information:
https://stackoverflow.com/questions/4422387/get-aspect-ratio-of-video-from-ffmpeg
I am looking forward to use this new version of the component, as it looks much better now, than 5 months back when i tested it last time !

Patch #51 cause cover art image not rendering

Your patch #51 introduces a new && wall.Ticks <= EndTime.Ticks while rendering blocks in MediaElement.Workers.RunBlockRenderingWorker class, which ignores those block who does not belong to the current timespan:

if (!block.contains(wallClock)) {continue;}
MediaBlock.Contains(wallClock) {
    ...
    return wallClock.Ticks >= StartTime.Ticks && wallClock.Ticks <= EndTime.Ticks;
}

However the wallClock is initially larger than the timespan of the video frame, so it is never being rendered. Please find the first several blocks:

Audio: wall: 00:00:00.0220000 start: 00:00:00 end: 00:00:00.0120000
Video: wall: 00:00:00.0220000 start: 00:00:00 end: 00:00:00.0000111
Audio: wall: 00:00:00.0260000 start: 00:00:00.0120000 end: 00:00:00.0333333
Audio: wall: 00:00:00.0380000 start: 00:00:00.0333333 end: 00:00:00.0546666
Audio: wall: 00:00:00.0600000 start: 00:00:00.0546667 end: 00:00:00.0760000
Audio: wall: 00:00:00.0850000 start: 00:00:00.0760000 end: 00:00:00.0973333
Audio: wall: 00:00:00.1070000 start: 00:00:00.0973333 end: 00:00:00.1186666
Audio: wall: 00:00:00.1310000 start: 00:00:00.1186667 end: 00:00:00.1400000
Audio: wall: 00:00:00.1520000 start: 00:00:00.1400000 end: 00:00:00.1613333
Audio: wall: 00:00:00.1730000 start: 00:00:00.1613333 end: 00:00:00.1826666
Audio: wall: 00:00:00.1950000 start: 00:00:00.1826667 end: 00:00:00.2040000
Audio: wall: 00:00:00.2160000 start: 00:00:00.2040000 end: 00:00:00.2253333
Audio: wall: 00:00:00.2410000 start: 00:00:00.2253333 end: 00:00:00.2466666
Audio: wall: 00:00:00.2630000 start: 00:00:00.2466667 end: 00:00:00.2680000
Audio: wall: 00:00:00.2880000 start: 00:00:00.2680000 end: 00:00:00.2893333
Audio: wall: 00:00:00.2910000 start: 00:00:00.2893333 end: 00:00:00.3106666
Audio: wall: 00:00:00.3210000 start: 00:00:00.3106667 end: 00:00:00.3320000
Audio: wall: 00:00:00.3410000 start: 00:00:00.3320000 end: 00:00:00.3533333
Audio: wall: 00:00:00.3670000 start: 00:00:00.3533333 end: 00:00:00.3746666
...

You can find a sample file from #27. After removing && wall.Ticks <= EndTime.Ticks the cover arts are rendered without problem.

compile errors

Hello, I was trying to run the test project using the instructions but visual studio shows 20+ error in ConstCharPtrMarshaler.cs and FFmpegMedia.Decoding.cs when I hit run.
am using VS 2013 on windows 8.1, is there something I'm missing?

Play audio file?

Hello, thanks for making such a great control for WPF.

I have used this control in my own project however I find that when I try to load a audio file (like a.mp3 and b.ogg), the control always gives Duration=0 and HasAudio=0, and nothing happens when I try to play it.
Could you tell me if it actually support such audio format, or there is anything I go wrong?

Reducing latency for live network streams

InputFormatContext->iformat->flags |= ffmpeg.AVFMT_FLAG_NOBUFFER | ffmpeg.AVFMT_FLAG_NOFILLIN;

Reduces latency in the FFmpeg layer, but how is it possible to reduce latency in the player? In my case, I need it to be very low, something like 250-350 ms.

License: Create a Nuget package

It would be great if you could put a nuget package up on nuget.org. Even if it requires the user to download the ffmpeg libs separately.

Interop: Using WPF MediaElement in an audio only oriented program

Hi Mario,
Thank you for having enabled more flexible ffmpeg binaries deployment model!
But is it possible to have a finer level of granularity regarding the DLLs to be loaded? For my audio-only oriented project, I would like to not having to deploy/load/initialize the avdevice-57.dll, avfilter-6.dll, postproc-54.dll and swscale-4.dll that I don't use.
Thanks.

Looping Media

Trying to get the media element to loop, currently ive been trying in the media_ended event to set the

position=0;
play();

Because the position is a dependancyobject its returning when play is called the media isnt ready yet so it never starts.

Ive attempted to do something like this however when ive got muliple players running its they all get quite out of sync.

position=0;
await Task.Run(() => {
    while (mediaME.HasMediaEnded) {
          Task.Delay(1);
    }
});
await Task.Delay(1);
play();

Is there a better way to loop the video?

Thanks

Fragmented MP4 does not play smoothly

Thanks so much for your work on this library. I'd like to use it in a project, but I am having a bit of trouble with playback of fragmented MP4s (instead of having the MOOV atom at the end or beginning, this format contains MOOF "headers" every second to enable playing the video without the file being 100% written to disk). The file does play, but it looks like it stutters at each segment- once per second in this case. FFPlay renders it without issue, so I'm not sure what's happening here.

Example file: Download
Thank you,
Josh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.