Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Linux Chromium でビデオのハードウェアエンコード・デコードしたい

Linux Chromium でビデオのハードウェアエンコード・デコードしたい

Kenichiro MATOHARA

April 24, 2021
Tweet

More Decks by Kenichiro MATOHARA

Other Decks in Technology

Transcript

  1. 今の Video Card 今の Video Card Intel HD 4000とNVIDIA OptimusなGF117M(うまく動いてない)

    $ lspci | grep -iE 'Graphic|3D' 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controlle 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/6 6 / 20
  2. Intel HD 4000 Intel HD 4000 $ lspci -vvvnnn -s

    00:02.0 00:02.0 VGA compatible controller [0300]: Intel Corporation 3rd Gen Core processor Graphics Con Subsystem: Lenovo 3rd Gen Core processor Graphics Controller [17aa:2200] Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- Fa Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR Latency: 0 Interrupt: pin A routed to IRQ 33 IOMMU group: 2 Region 0: Memory at f1000000 (64-bit, non-prefetchable) [size=4M] Region 2: Memory at e0000000 (64-bit, prefetchable) [size=256M] Region 4: I/O ports at 7000 [size=64] Expansion ROM at 000c0000 [virtual] [disabled] [size=128K] Capabilities: <access denied> Kernel driver in use: i915 Kernel modules: i915 7 / 20
  3. VAAPIでH.264いけそう VAAPIでH.264いけそう $ vainfo libva info: VA-API version 1.10.0 libva

    info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so libva info: va_openDriver() returns -1 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so libva info: Found init function __vaDriverInit_1_8 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.10 (libva 2.10.0) vainfo: Driver version: Intel i965 driver for Intel(R) Ivybridge Mobile - 2.4.1 vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Simple : VAEntrypointEncSlice VAProfileMPEG2Main : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointEncSlice VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileH264StereoHigh : VAEntrypointVLD VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileNone : VAEntrypointVideoProc VAProfileJPEGBaseline : VAEntrypointVLD 8 / 20
  4. ※発表時はav1なのに気づいていなかった $ youtube-dl https://youtu.be/Zk9J5xnTVMA -F : 248 webm 1920x1080 1080p

    2543k , webm_dash container, vp9@2543k, 24fps, video 399 mp4 1920x1080 1080p 2557k , mp4_dash container, av01.0.08M.08@2557k, 24fp 137 mp4 1920x1080 1080p 3594k , mp4_dash container, avc1.640028@3594k, 24fps, 400 mp4 2560x1440 1440p 7117k , mp4_dash container, av01.0.12M.08@7117k, 24fp 271 webm 2560x1440 1440p 7650k , webm_dash container, vp9@7650k, 24fps, video 401 mp4 3840x2160 2160p 11997k , mp4_dash container, av01.0.12M.08@11997k, 24 313 webm 3840x2160 2160p 16729k , webm_dash container, vp9@16729k, 24fps, vide : $ youtube-dl https://youtu.be/Zk9J5xnTVMA -f 400 # 1440p $ youtube-dl https://youtu.be/Zk9J5xnTVMA -f 401 # 2160p 14 / 20
  5. まとめ まとめ Google Chrome/Chromiumで設定でGPU触れるようになっていた Electronはアプリ毎に対応が必要そう は対応してるみたい Jitsi meet実行中に chrome://webrtc-internals で見るとcodecはVP8だっ

    た NVIDIA GF117M がちゃんと動くと?? Jitsi Meet Electron 今回は第3世代目なのでVP8非対応,Core i5世代目以降だとVP8 decodeが入っているので良さそう 16 / 20
  6. 奥付 奥付 発表 2021-04-24(Sat) 発表者 利用ソフトウェア ライセンス CC BY-NC-SA 4.0

    東海道らぐ 春のあひる焼きフェスティバル Kenichiro Matohara(matoken) Asciidoctor Reveal.js 20 / 20