Pro Yearly is on sale from $80 to $50! »

Cross Platform Video Player

Cross Platform Video Player

Cb4d62dd7c1d325863696c45e9b6484d?s=128

Shumpei Urabe

September 09, 2020
Tweet

Transcript

  1. $SPTT1MBUGPSN7JEFP1MBZFS 4FQUFNCFSUI /"9" --$"MM3JHIUT3FTFSWFE

  2. 4IVNQFJ63"#& /"9" --$$&0

  3. $SPTTQMBUGPSN

  4. J04 "OESPJE NBD04 8JOEPXT

  5. UseCase • Play Video from File • Get Raw Video

    Buffer
  6. Supported Codecs iOS macOS Android Windows H.264 H.264 H.264 H.264

    H.265 H.265 H.265 H.265 VP8 VP8 VP9 VP9
  7. None
  8. Supported Codecs iOS macOS Android Windows H.264 H.264 H.264 H.264

    H.265 H.265 H.265 H.265 VP8 VP8 VP9 VP9
  9. None
  10. Supported Codecs iOS macOS Android Windows H.264 H.264 H.264 H.264

    H.265 H.265 H.265 H.265 VP8 VP8 VP9 VP9
  11. 8IBUEPZPVBDUVBMMZEP

  12. 6TF044UBOEBSE"1*

  13. iOS / macOS 1. AVPlayer(AVFoundation) 2. VTDecompressionSession to MTKView

  14. iOS / macOS 1. AVPlayer(AVFoundation) 2. VTDecompressionSession to MTKView

  15. iOS / macOS VTDecompressionSession CVMetalTexture MTKView CVMetalTextureCache MTLTexture

  16. Android 1. ExoPlayer (Google OSS) 2. MediaCodec to SurfaceView

  17. Android 1. ExoPlayer (Google OSS) 2. MediaCodec to SurfaceView

  18. Android MediaExtractor MediaCodec SurfaceView

  19. Windows 1. MediaFoundation.MediaEngine 2. MediaFoundation.MFCreateVideoRenderer

  20. Windows 1. MediaFoundation.MediaEngine 2. MediaFoundation.MFCreateVideoRenderer

  21. Windows Set up Video sink (Enhanced Video Renderer) Set up

    Video source. Create a media type and set on the source and sink. Set up event handler for sink events. Srart the sample loop.
  22. None
  23. WMDPSNQW

  24. mpv

  25. mpv • Famous as a video player. • Backend is

    ffmpeg. • There is a libmpv that can be used as a library.
  26. libmpv • embedded into other programs as video/audio playback backend.

    • Compared to other libraries, it is very simple to use.
  27. libmpv 1. Embed Native Window (Windows / X11) 2. Rendering

    API (OpenGL)
  28. Basic Usage mpv_handle *ctx = mpv_create(); mpv_initialize(ctx); const char *cmd[]

    = {"loadfile", filename, NULL}; mpv_command(ctx, cmd);
  29. OpenGL

  30. Native Window Renderer (Windows) _mpvHandle = _mpvCreate.Invoke(); _mpvInitialize.Invoke(_mpvHandle); _mpvSetOption(_mpvHandle, GetUtf8Bytes("wid"),

    mpvFormatInt64, ref windowId); DoMpvCommand("loadfile", filename);
  31. Tips • If you use libmpv, you can't handle the

    raw buffer. • mpv iOS build is pretty hard to do.
  32. Tips You can use libvlc to get a buffer on

    callback.
  33. &/%