unosquare / ffmediaelement

FFME: The Advanced WPF MediaElement (based on FFmpeg)
https://unosquare.github.io/ffmediaelement/
Other
1.17k stars 238 forks source link

Cannot properly seek Mpeg-TS video files #575

Open Mitra-M opened 2 years ago

Mitra-M commented 2 years ago

Issue Categories

Steps to Reproduce

  1. Play a Mpeg-TS video file
  2. Seek to a position then seek to zero

hangs in this loop:

         `while (MediaCore.Container.IsReadAborted == false && MediaCore.HasDecodingEnded == false && 
              ct.IsCancellationRequested == false)
                {
                    // Check if we are already in range
                    hasSeekBlocks = TrySignalBlocksAvailable(targetSeekMode, mainBlocks, targetPosition, hasSeekBlocks);
                    if (hasSeekBlocks) break;

                    // Read the next packet
                    _ = MediaCore.Container.Read();
                    IList<MediaFrame> frames = MediaCore.Container.Decode();

                    foreach (var frame in frames)
                    {
                        MediaBlockBuffer blocks = MediaCore.Blocks[frame.MediaType];
                        blocks?.Add(frame, MediaCore.Container);
                    }
                }`
pankajsaini1987 commented 2 years ago

do you got solution. i also want to play multiple video files on a single seekbar, how cn i do this, can you help?

Mitra-M commented 2 years ago

@lkinfotechai, No, unfortunately I did not.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.