Upgrade to Pro — share decks privately, control downloads, hide ads and more …

LINE Creative Lab : Create Catchy Ads with HTML...

LINE DEVDAY 2021
November 11, 2021
180

LINE Creative Lab : Create Catchy Ads with HTML5 Canvas

LINE DEVDAY 2021

November 11, 2021
Tweet

Transcript

  1. Agenda - Introduction of LINE Creative Lab - Project design

    - Image editor - Video editor - Our next steps
  2. How LINE Creative Lab was born Before June30 2020 Import

    creative Designer Ads Hire Advertiser
  3. How LINE Creative Lab was born From June30 2020 Export

    creatives Advertiser Create/Edit template
  4. LINE Creative Lab’s main features - Image editor - Video

    editor - Optimize for ads - For LINE users
  5. Content overview What do we have in image editor section?

    - Image editor architecture - Layers - Technical challenges
  6. Image editor architecture Designer Designed template Image editor User template

    (Image) Create User Edit Use Save Image advertisement Render
  7. Technical challenges Fonts loading > Large size problem Fonts with

    large size 15 text layers X 16 MB = 240 MB
  8. Technical challenges Fonts loading > Font subsets solution Split original

    font to subsets Register each subset by using font-face
  9. Technical challenges Fonts loading > Font subsets solution Split original

    font to subsets 15 text layers X 50 KB = 750 KB
  10. Technical challenges Shape > Path2D solution Path APIs Path2D Shape

    Use Path2D – Browser compatibility Draw Canvas
  11. Content overview What do we have in video editor section?

    - Video editor architecture - Layers - Video rendering - Technical challenges
  12. Video editor architecture Designer Designed template Video editor User template

    (Video) Create User Edit Use Save Send to Browser Video advertisement Render Encoding server Video editor architecture Designer Designed template Video editor User template (Video) Create User Edit Use Save Send to Browser Video advertisement Render Encoding server
  13. Video rendering Draw and Encode methods - Canvas: 2d context

    - Canvas: WebGL context Drawing - MediaRecorder API - FFMPEG - Hardware encoder Encoding
  14. Video rendering Drawing > WebGL overview Application GPU Upload x

    N Download x N Application GPU Upload large data 1st slow case 2nd slow case
  15. Video rendering Drawing > Apply WebGL in CLAB - Text

    changes are expensive because we have to convert text to image - So text changes should be reduced Our situation Two properties of WebGL - Upload all resource to GPU memory before drawing - All resources must be images
  16. Technical challenges Encoding speed > MediaRecorder API 30s MediaStream 30s

    Video Play Wait 30s Switch tab = Postpone Close tab = Cancel MediaRecorder
  17. Technical challenges Encoding speed > Server-side rendering Node.js Browser JS

    drawing codebase node-canvas headless-gl Canvas WebGL
  18. Technical challenges Encoding speed > FFMPEG encoding flow Video frames

    GPU memory SSD or RAM SW encoder HW encoder H264 video Or FFMPEG Encode Read Copy video frames from GPU memory to SSD/RAM is a bottleneck and make the encoding process slower Copy Save Node.js server Draw 6 GB 6 GB
  19. Technical challenges Encoding speed > HW encoder & low-level SDK

    Memory area for drawing Memory area for encoding GPU memory HW encoder Video frames H264 video Node.js server Draw Encode Copy uncompressed data by low-level SDK
  20. Technical challenges MediaRecorder 30s Node.js + SDK + HW 2s

    Node.js + FFMPEG 7s Encoding speed > How long does it take to create a 30 seconds video?
  21. Technical challenges Encoding speed > Conclusion MediaRecorder 30s Node.js +

    SDK + HW 2s Node.js + FFMPEG 7s We selected this solution for our users
  22. Technical challenges Support new effects - Video effects = GLSL

    code - gl-transition = open source - New effects = increase dev time
  23. Our next steps In the future, we will - Apply

    more GLSL effects - Support video layer - Solve difference of text issue - Scale encoding server