Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open, Seek + ReadFrame => decoding error (current packet not a key frame) #11

Open
GoogleCodeExporter opened this issue May 11, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

context: I'm tying to create a thumbnailer using ffmpeg-sharp

What steps will reproduce the problem?
1. open MediaFile
2. get VideoDecoderStream
3. create VideoScalingStream
4. Seek (100ms)
5. ReadFrame (out frame)

What is the expected output? What do you see instead?
expected: decoded frame bytes
instead: crash

What version of the product are you using? On what operating system?
latest

Please provide any additional information below.

as a workaround I added a loop, forcing a key frame to be returned (i'm only 
interested in single frame decoding -> creating thumbnails)

MediaFile.cs:120
internal void EnqueueNextPacket()
{
  AVPacket packet = new AVPacket();
  FFmpeg.av_init_packet(ref packet);

+  while (packet.flags != PacketFlags.Key)
+  {
    if (FFmpeg.av_read_frame(ref FormatContext, ref packet) < 0)
      throw new System.IO.EndOfStreamException();
+  }

Original issue reported on code.google.com by [email protected] on 29 Feb 2012 at 10:53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant