0

I need to write a frame from a video stream to an image file. The stream is coming from a GStreamer Player, so it needs to be directed to a Surface object (it won't accept an EGLSurface). However, I'm trying to use Grafika's OffscreenSurface as the output so that I can call saveFrame(File file) to save the latest frame to a file.

So the problem is OffscreenSurface uses an EGLSurface rather than a Surface, so I can't set it as the output location for the stream since Player#setSurface(Surface surface) requires a Surface.

Is there a way to get a Surface object when creating an EGLSurface, or possibly when creating an OffscreenSurface from Grafika?

MarkyDD
  • 272
  • 5
  • 16
  • 1
    Create a SurfaceTexture, use that to construct a Surface, pass that Surface to GStreamer. Video output becomes available as a GL texture. Something like http://bigflake.com/mediacodec/#ExtractMpegFramesTest . – fadden Aug 27 '16 at 19:58
  • The solution was to replace the `SurfaceView` with a `TextureView`, that way you get a `SurfaceTexture` as @fadden says – MarkyDD Jan 09 '17 at 20:41

0 Answers0