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

Video decode on iOS

Video decode on iOS

iOS上でビデオコンテナのデコード手法をAssetReaderとVTDecompressSessionの比較を通して学びます。

noppefoxwolf

June 21, 2018
Tweet

More Decks by noppefoxwolf

Other Decks in Programming

Transcript

  1. "7"TTFU3FBEFS let reader = try! AVAssetReader(asset: asset) let output =

    AVAssetReaderTrackOutput(track: asset.videoTrack) reader.add(output) reader.startReading() output.copyNextSampleBuffer() output.copyNextSampleBuffer() output.copyNextSampleBuffer() ... ͱͯ΋؆୯ DPQZ/FYU4BNQMF#V⒎FSΛݺͿͨͼʹऔΕΔϑϨʔϜ ͷλΠϜελϯϓ͕ਐΉ ! !OPQQFGPYXPMG  
  2. 75%FDPNQSFTTJPO4FTTJPOͷྲྀΕ  IBWDΛ෼ׂ  ө૾ؚ͕·ΕΔνϟϯΫΛऔΓग़͢  75%FDPNQSFTTJPO4FTTJPOΛੜ੒  νϟϯΫΛ4FTTJPOʹ౉͢ 

    σίʔυࡁΈͷ*NBHF#V⒎FS͕ίʔϧόοΫʹฦ͞ αϯϓϧͰ͸ྫͱͯ͠ΩʔϑϨʔϜΛऔΓग़͍ͯ͠Δ ! !OPQQFGPYXPMG  
  3. σίʔυࡁΈͷ*NBHF#V⒎FS͕ίʔϧόοΫʹฦ͞Ε Δ callback.decompressionOutputCallback = { (_, _, _, _, imageBuffer,

    _, _) in // imageBuffer } 4FTTJPOʹొ࿥ͨ͠DBMMCBDL΁σίʔυ͞Εͨ JNBHF#V⒎FS͕ฦͬͯ͘Δ ! !OPQQFGPYXPMG  
  4. 1SPT$POT &BTZ 4USFBNJOH 1FSGPSNBODF $VTUPNJ[F "7"TTFU3FB EFS P Y P

    ˚ 75%FDPNQSF TTJPO4FTTJPO Y P P P ϦϞʔτͷΞηοτͷQJYFM#V⒎FS͸औΕͳ͍ ! !OPQQFGPYXPMG