$30 off During Our Annual Pro Sale. View Details »

Androidで動画編集アプリの技術選択

 Androidで動画編集アプリの技術選択

potatetips #43で発表させていただいた資料です。

Masayuki Suda

August 28, 2017
Tweet

More Decks by Masayuki Suda

Other Decks in Programming

Transcript

  1. "OESPJEͰಈըฤूΞϓϦͷٕज़બ୒ QPUBUPUJQT

  2. ࣗݾ঺հ $$IBOOFMגࣜձࣾ "OESPJE&OHJOFFS݉1. ਢాɹխ೭ .BTBZVLJ4VEB EBBTVV ʮ4PEBʯಈըฤूΞϓϦ

  3. ຊ೔ͷྲྀΕ ᶃΞϓϦͷओཁػೳ ᶄͦΕͧΕͷػೳͷٕज़બ୒ ᶅ࡞੒ͨ͠ϥΠϒϥϦ

  4. J Τϯίʔυ ಈըฤूɾ࡞੒  JJ ಈըࡱӨ ɹ *JJ ಈըϓϨϏϡʔ ಈը࠶ੜ

    ᶃΞϓϦͷओཁػೳ
  5. ᶄͦΕͧΕͷػೳͷٕज़બ୒  J Τϯίʔυ ಈըฤूɾ࡞੒  ˙''NQFH ɾͰ͖Δ͜ͱ͕๛෋ʢϑΟϧλʔɺಈը݁߹ɺը૾੾Γग़͠ɺ8.ɾɾɾʣ ɾυΩϡϝϯτɺ(PPHMFઌੜ৘ใ͕๛෋ ɾϥΠηϯε͕ωοΫ

    ɾϋʔυ΢ΣΞσίʔμʔ͕ΦϯʹͳΒͳ͍ɻ ˙.FEJB$PEFDˍ0QFO(-&4Ͱࣗ࡞ ɾֶशίετɺ࣮૷ίετ͕ߴ͍ ɾΧελϚΠζੑ͕ߴ͍ ϑΟϧλʔɺจࣈೖΕɺഒ଎ɾɾ  ɾ''NQFHΑΓ΋֓Ͷ͘Β͍ૣ͘Ͱ͖Δ ɾ"1*Ҏ্͔Β4VSGBDFΛ௚઀౉ͤΔͷͰ࢖͍΍͍͢ ˠ.FEJB$PEFDˍ0QFO(-&4Ͱࣗ࡞͠·ͨ͠ɻ
  6. ᶄͦΕͧΕͷػೳͷٕज़બ୒  JJ ಈըࡱӨ ˙''NQFH ɾి஑ফඅ͕ܹ͍͠ ɾϥΠηϯε͕ωοΫ ˙0QFO$7 ɾإೝূͱ͔͍ͨ͠ͱ͖͸͍͍͔΋ EMJCͷ͕͍͍͔΋

     ɾͰ͖Δࣄ๛෋ʢϑΟϧλʔɺ෺ମೝࣝɺإೝࣝʣ ɾύϑΥʔϚϯε͕ɾɾɾ ˙.FEJB3FDPSEFS ɾ"OESPJE͕σϑΥϧτͰఏڙ͍ͯ͠Δˍ࣮૷Χϯλϯ ɾͰ͖Δࣄ͕ݶΒΕΔ ˙.FEJB$PEFDˍ0QFO(-&4Ͱࣗ࡞ ɾֶशίετɺ࣮૷ίετ͕ߴ͍ ɾΧελϚΠζੑ͕ߴ͍ʢϓϨϏϡʔͱ࿥ը͍ͯ͠ΔಈըΛ෼͚ΕΔʣ ˠ.FEJB$PEFDˍ0QFO(-&4Ͱࣗ࡞͠·ͨ͠ɻ
  7. ᶄͦΕͧΕͷػೳͷٕज़બ୒  JJJ ಈըϓϨϏϡʔ ˙.FEJB1MBZFS ɾ"OESPJE͕σϑΥϧτͰఏڙ͍ͯ͠Δˍ࣮૷Χϯλϯ ɾ୺຤΍όʔδϣϯݻ༗ͷόά͕ଟ͍ ɾγʔΫ͕Αͣ͘ΕΔ ˙.FEJB$PEFDˍ0QFO(-&4Ͱࣗ࡞ ɾ࣮૷ίετ͕ߴ͍

    ɾΧελϚΠζੑ͕ߴ͍ ˙&YP1MBZFS ɾ.FEJB&YUSBDUPSˍ.FEJB$PEFDͰ࣮૷͞ΕͯΔ ɾഒ଎࠶ੜ͕"OESPJEҎ߱Ͱ࢖͑Δ ɾόά͕΄΅ແ͍ɻ͋ͬͯ΋मਖ਼͞Ε͍ͯ͘ɻ ˠ&YP1MBZFSΛબ୒͠·ͨ͠ɻ
  8. ᶄͦΕͧΕͷػೳͷٕज़બ୒ɹ ࠔͬͨ఺ Τϯίʔυ͕஗͍ ɹJ04ʹൺ΂ͯഒ͸͔͔ͬͯ͠·͏ɻ  J1IPOFTWT(BMBYZ4FEHF  ˠಈըϓϨϏϡʔதʹϑΟϧλʔ౳Λ ͔͚ɺฤू݁ՌΛ൓өͤ͞Δඞཁ͋Γ

  9. ᶅ࡞੒ͨ͠ϥΠϒϥϦ &YP1MBZFS'JMUFS IUUQTHJUIVCDPN.BTBZVLJ4VEB&YP1MBZFS'JMUFS ˞ϓϧϦΫΤετେ׻ܴʂ0QFO(-4-΍4IBEFSಘҙͳํʂ

  10. ᶅ࡞੒ͨ͠ϥΠϒϥϦ &YP1MBZFSʹϑΟϧλʔΛ͔͚Δ &YP1MBZFS (M4VSGBDF7JFX 3FOEFSFS 4VGBDF5FYUVSFΛ౉͢ ಈըΛσίʔυͯ͠ 4VSGBDF5FYUVSFʹ൓ө σίʔυͯ͘͠Εͨ 4VSGBDF5FYUVSFʹ

    0QFO(-4-4IBEFSͰ ϑΟϧλʔΛ͔͚Δ
  11. ᶅ࡞੒ͨ͠ϥΠϒϥϦ &YP1MBZFS'JMUFSͷ࢖͍ํᶃ 4JNQMF&YP1MBZFSΛ࡞Δ BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter(); TrackSelection.Factory videoTrackSelectionFactory

    = new AdaptiveTrackSelection.Factory(bandwidthMeter); TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory); // Measures bandwidth during playback. Can be null if not required. DefaultBandwidthMeter defaultBandwidthMeter = new DefaultBandwidthMeter(); // Produces DataSource instances through which media data is loaded. DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(context, Util.getUserAgent(context, "yourApplicationName"), defaultBandwidthMeter); // Produces Extractor instances for parsing the media data. ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory(); // This is the MediaSource representing the media to be played. MediaSource videoSource = new ExtractorMediaSource(Uri.parse(MP4_URL), dataSourceFactory, extractorsFactory, null, null); // SimpleExoPlayer player = ExoPlayerFactory.newSimpleInstance(context, trackSelector); // Prepare the player with the source. player.prepare(videoSource); player.setPlayWhenReady(true);
  12. ePlayerView = new EPlayerView(context); // set SimpleExoPlayer ePlayerView.setSimpleExoPlayer(player); ePlayerView.setLayoutParams(new RelativeLayout.LayoutParams(

    ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); // add ePlayerView to WrapperView ((MovieWrapperView) findViewById(R.id.layout_movie_wrapper)).addView(ePlayerView); ePlayerView.onResume(); ᶅ࡞੒ͨ͠ϥΠϒϥϦ &YP1MBZFS'JMUFSͷ࢖͍ํᶄ &1MBZFS7JFXΛ࡞੒͠ɺ4JNQMF&YP1MBZFSΛηοτ
  13. ePlayerView.setGlFilter(new GlSepiaFilter()); ᶅ࡞੒ͨ͠ϥΠϒϥϦ &YP1MBZFS'JMUFSͷ࢖͍ํᶃ &1MBZFS7JFXʹ'JMUFSΛηοτ

  14. ·ͱΊ ɾ.FEJB$PEFDˍ0QFO(-&4͸ֶशίετɺ࣮૷ίετ͕ ɹߴ͍͕ɺಈըฤूʹؔ͢Δػೳ͸Ұ௨Γ཈͑ΒΕΔɻ ɾ࣮૷ͷࢀߟʹͳΔϥΠϒϥϦʔ͸͋Δ͕ɺόά͕ଟ͔ͬͨΓ ɹػೳ͕খ͔ͬͨ͞Γ͢ΔͷͰࣗ࡞͢Δͷ͕ݱঢ়ͷղܾࡦɻ

  15. .FEJB$PEFDͰࢀߟʹͳΔϦϯΫ "OESPJE.FEJB$PEFDTUV⒎ IUUQCJHqBLFDPNNFEJBDPEFD ंྠͷ࠶ൃݟΈ͍ͨͳʁ IUUQTFSFOFHJBOUDPNCMPH DBU "OESPJEͰ.FEJB$PEFDΛ࢖͍''NQFHͳ͠ͰಈըΛ ѹॖ͢Δํ๏ʢϥΠϒϥϦ͋Γʣ IUUQRJJUBDPNZVZB@QSFTUPJUFNTEFDCE "OESPJEͷ.FEJB$PEFDͱ.FEJB&YUSBDUPS͋ͨΓͰಈըͷ

    ϑϨʔϜεΩοϓͳͲΛͯ͠ΈΔ IUUQRJJUBDPNNFDIBNPHFSBJUFNTEGF
  16. ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ ˞$$IBOOFMͰ͸J04ɺαʔόʔαΠυ 1ZUIPO ΤϯδχΞΛಛʹืूதͰ͢ʂ ੈքͰ௨༻͢ΔαʔϏεΛҰॹʹ૑Γ·͠ΐ͏ʂ