Tokyo Video Tech #8 Shift https://www.meetup.com/ja-JP/Tokyo-Video-Tech/events/273026420/
$SPTT1MBUGPSN7JEFP1MBZFS4FQUFNCFSUI/"9" --$"MM3JHIUT3FTFSWFE
View Slide
4IVNQFJ63"#&/"9" --$$&0
$SPTTQMBUGPSN
J04 "OESPJE NBD04 8JOEPXT
UseCase• Play Video from File• Get Raw Video Buffer
Supported CodecsiOS macOSAndroid WindowsH.264 H.264 H.264 H.264H.265 H.265 H.265 H.265VP8 VP8VP9 VP9
8IBUEPZPVBDUVBMMZEP
6TF044UBOEBSE"1*
iOS / macOS1. AVPlayer(AVFoundation)2. VTDecompressionSession to MTKView
iOS / macOSVTDecompressionSessionCVMetalTextureMTKViewCVMetalTextureCacheMTLTexture
Android1. ExoPlayer (Google OSS)2. MediaCodec to SurfaceView
AndroidMediaExtractorMediaCodecSurfaceView
Windows1. MediaFoundation.MediaEngine2. MediaFoundation.MFCreateVideoRenderer
WindowsSet 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.
WMDPSNQW
mpv
mpv• Famous as a video player.• Backend is ffmpeg.• There is a libmpv that can be used as a library.
libmpv• embedded into other programs as video/audioplayback backend.• Compared to other libraries, it is very simple touse.
libmpv1. Embed Native Window(Windows / X11)2. Rendering API(OpenGL)
Basic Usagempv_handle *ctx = mpv_create();mpv_initialize(ctx);const char *cmd[] = {"loadfile", filename, NULL};mpv_command(ctx, cmd);
OpenGL
Native Window Renderer (Windows)_mpvHandle = _mpvCreate.Invoke();_mpvInitialize.Invoke(_mpvHandle);_mpvSetOption(_mpvHandle, GetUtf8Bytes("wid"),mpvFormatInt64, ref windowId);DoMpvCommand("loadfile", filename);
Tips• If you use libmpv, you can't handle the rawbuffer.• mpv iOS build is pretty hard to do.
TipsYou can use libvlc to get a buffer on callback.
&/%