Search code examples
android-ndkffmpegvideo-streaminglibyuv

rendering YUV ffmpeg frames in Android native ndk


Can we render YUV frames from ffmpeg streaming output(AV_PIX_FMT_YUV420P) directly in Android screen without converting to RGB format?


Solution

  • I've had some experience with Google WebRTC open source project recently.

    It provide a fully packaged video call example, also contains an Android demo.

    What the demo doing is displaying decoded video frames, which is I420(YUV420P) pixel format.

    Take a look at the source code: https://code.google.com/p/webrtc/source/browse/trunk/webrtc/modules/video_render/android/video_render_opengles20.cc