Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
HEVC Video with Alpha Channel
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Tachibana Kaoru
July 24, 2019
Technology
1.3k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
HEVC Video with Alpha Channel
Tachibana Kaoru
July 24, 2019
More Decks by Tachibana Kaoru
See All by Tachibana Kaoru
GeoLocationAnchor and MKTileOverlay
toyship
0
400
Custom Group Activities
toyship
3
1.5k
Synchronized iPhones, Again!
toyship
2
1.6k
ARKit4.pdf
toyship
1
2.3k
Custom Gesture Recognizer on iOS
toyship
3
1.5k
RealityKit & Reality Composer
toyship
3
680
ARKit3
toyship
4
7.6k
UIViewPropertyAnimator and Easing
toyship
2
1.2k
Synchronized iPhones!
toyship
3
5k
Other Decks in Technology
See All in Technology
日本 Fintech 未来予測レポート 2027〜2028年(オリジナル版)
8maki
0
2.2k
ACE-Step-1.5で見る 音楽生成AIのしくみと“破綻だけ直す”Retake機能の開発【zennfes spring 2026 登壇資料】
personabb
1
490
AIはどのように 組織のアジリティを変えるのか?
junki
3
930
Kiroで書いた 設計書 が AI レビューの 採点基準 になる
ezaki
0
110
【セミナー資料】Claude Code をセキュアに使うための考え方と設定の勘どころ / Claude Code Webinar 20260616
masahirokawahara
2
360
SONiCで構築・運用する生成AI向けパブリッククラウドネットワーク ~実装編~
sonic
0
220
AmazonRoute 53ではじめてのドメイン取得!HTTPS化までの道のりを整理してみた
usanchuu
3
140
2026年6月23日 Syncable Tech + Start Python Club にて
hamukazu
0
120
作って終わりにしない タイミーのセマンティックレイヤー育成の現在地
chanyou0311
4
2.4k
Disciplined Vibes: Scaling AI-Assisted Engineering
sheharyar
0
150
AI駆動開発を通して感じた、 AI時代のデザイナーの役割変化
whisaiyo
3
2.2k
LayerXにおけるセキュリティ管理の現在地と次の一手
tosho
0
210
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
A Tale of Four Properties
chriscoyier
163
24k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
170
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
380
Writing Fast Ruby
sferik
630
63k
How to train your dragon (web standard)
notwaldorf
97
6.7k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
We Are The Robots
honzajavorek
0
250
Ethics towards AI in product and experience design
skipperchong
2
310
Fireside Chat
paigeccino
42
4k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Utilizing Notion as your number one productivity tool
mfonobong
4
320
Transcript
HEVC Video with Alpha Channel @TachibanaKaoru 2019/7/24 #potatotips
About Me @TachibanaKaoru Freelance iOS Engineer झຯɿϘϧμϦϯάɺBotWͰཾͷྡྷङ ࠷ۙͷςʔϚɿཱྀΛ͠ͳ͕ΒࣄΛ͢Δ όϦౡɺαϯτϦʔχౡɺόϯίΫɺόϧηϩφɺΞΠεϥϯυ
Alpha Channel alpha channel each pixel include transparency information popular
in images
Alpha Channel alpha channel each pixel include transparency information popular
in images
video codec support alpha channel Apple ProRes 4444 WebM VP8
media with alpha Image Video High bitrate PNG, TIFF Apple
ProRes 4444 Flexible bitrate HEIF, HEIFS HEVC with alpha
HEVC support os iOS 13~ tvOS13 ~ macOS Catalina ~
Playback AVPlayerͰͷ࠶ੜ
Demo Sample Code https://github.com/TachibanaKaoru/ HEVCAlphaSample
Encoding HEVC video with API Color Chroma key from Apple
ProRes 4444 to HEVC with alpha
Color Chroma key
let asset = AVAsset(url: sourceURL) guard let exportSession = AVAssetExportSession(asset:
asset, presetName: AVAssetExportPresetHEVCHighestQualityWithAlpha) else { print("Failed to create export session to HEVC with alpha.") handleExportCompletion(.failed) return } // Make CIFilter let filter = makeChromaKeyFilter(usingHueFrom: 0.3, to: 0.4, brightnessFrom: 0.05, to: 1.0 ) let chromaKeyComposition = AVVideoComposition(asset: asset, applyingCIFiltersWithHandler: { request in let source = request.sourceImage.clampedToExtent() filter.setValue(source, forKey: kCIInputImageKey) let output = filter.outputImage! // Provide the filter output to the composition request.finish(with: output, context: nil) }) // Export exportSession.outputURL = destinationURL exportSession.outputFileType = .mov exportSession.videoComposition = chromaKeyComposition exportSession.exportAsynchronously { handleExportCompletion(exportSession.status) }
let asset = AVAsset(url: sourceURL) guard let exportSession = AVAssetExportSession(asset:
asset, presetName: AVAssetExportPresetHEVCHighestQualityWithAlpha) else { print("Failed to create export session to HEVC with alpha.") handleExportCompletion(.failed) return } // Make CIFilter let filter = makeChromaKeyFilter(usingHueFrom: 0.3, to: 0.4, brightnessFrom: 0.05, to: 1.0 ) let chromaKeyComposition = AVVideoComposition(asset: asset, applyingCIFiltersWithHandler: { request in let source = request.sourceImage.clampedToExtent() filter.setValue(source, forKey: kCIInputImageKey) let output = filter.outputImage! // Provide the filter output to the composition request.finish(with: output, context: nil) }) // Export exportSession.outputURL = destinationURL exportSession.outputFileType = .mov exportSession.videoComposition = chromaKeyComposition exportSession.exportAsynchronously { handleExportCompletion(exportSession.status) }
let asset = AVAsset(url: sourceURL) guard let exportSession = AVAssetExportSession(asset:
asset, presetName: AVAssetExportPresetHEVCHighestQualityWithAlpha) else { print("Failed to create export session to HEVC with alpha.") handleExportCompletion(.failed) return } // Make CIFilter let filter = makeChromaKeyFilter(usingHueFrom: 0.3, to: 0.4, brightnessFrom: 0.05, to: 1.0 ) let chromaKeyComposition = AVVideoComposition(asset: asset, applyingCIFiltersWithHandler: { request in let source = request.sourceImage.clampedToExtent() filter.setValue(source, forKey: kCIInputImageKey) let output = filter.outputImage! // Provide the filter output to the composition request.finish(with: output, context: nil) }) // Export exportSession.outputURL = destinationURL exportSession.outputFileType = .mov exportSession.videoComposition = chromaKeyComposition exportSession.exportAsynchronously { handleExportCompletion(exportSession.status) }
from Apple ProRes 4444 to HEVC with alpha
let asset = AVAsset(url: sourceURL) AVAssetExportSession.determineCompatibility(ofExportPreset: AVAssetExportPresetHEVCHighestQualityWithAlpha, with: asset, outputFileType:
.mov) { compatible in if compatible { guard let exportSession = AVAssetExportSession(asset: asset, presetName: AVAssetExportPresetHEVCHighestQualityWithAlpha) else { handleExportCompletion(.failed) return } // Export exportSession.outputURL = destinationURL exportSession.outputFileType = .mov exportSession.exportAsynchronously { handleExportCompletion(exportSession.status) } } else { handleExportCompletion(.failed) } }
let asset = AVAsset(url: sourceURL) AVAssetExportSession.determineCompatibility(ofExportPreset: AVAssetExportPresetHEVCHighestQualityWithAlpha, with: asset, outputFileType:
.mov) { compatible in if compatible { guard let exportSession = AVAssetExportSession(asset: asset, presetName: AVAssetExportPresetHEVCHighestQualityWithAlpha) else { handleExportCompletion(.failed) return } // Export exportSession.outputURL = destinationURL exportSession.outputFileType = .mov exportSession.exportAsynchronously { handleExportCompletion(exportSession.status) } } else { handleExportCompletion(.failed) } }
let asset = AVAsset(url: sourceURL) AVAssetExportSession.determineCompatibility(ofExportPreset: AVAssetExportPresetHEVCHighestQualityWithAlpha, with: asset, outputFileType:
.mov) { compatible in if compatible { guard let exportSession = AVAssetExportSession(asset: asset, presetName: AVAssetExportPresetHEVCHighestQualityWithAlpha) else { handleExportCompletion(.failed) return } // Export exportSession.outputURL = destinationURL exportSession.outputFileType = .mov exportSession.exportAsynchronously { handleExportCompletion(exportSession.status) } } else { handleExportCompletion(.failed) } }
·ͱΊ HEVCiOS13͔Β͑ΔAlpha͖ͭಈըϑΥʔϚοτͰ͢ɻ ࠶ੜAVPlayerWKWebViewͰ؆୯ʹͰ͖·͢ɻ SpriteKitɺSceneKitɺMetalͰ࠶ੜՄೳɻARͰ͑·͢ɻ
Links HEVC Video with Alpha https://developer.apple.com/videos/play/wwdc2019/506/ Using HEVC Video with
Alpha https://developer.apple.com/documentation/avfoundation/ media_assets_playback_and_editing/using_hevc_video_with_alpha HEVC Video with Alpha https://developer.apple.com/av-foundation/HEVC-Video-with-Alpha-Interoperability- Profile.pdf