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

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

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

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

Masayuki Suda

August 28, 2017
Tweet

More Decks by Masayuki Suda

Other Decks in Programming

Transcript

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

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

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

    ɾΧελϚΠζੑ͕ߴ͍ ˙&YP1MBZFS ɾ.FEJB&YUSBDUPSˍ.FEJB$PEFDͰ࣮૷͞ΕͯΔ ɾഒ଎࠶ੜ͕"OESPJEҎ߱Ͱ࢖͑Δ ɾόά͕΄΅ແ͍ɻ͋ͬͯ΋मਖ਼͞Ε͍ͯ͘ɻ ˠ&YP1MBZFSΛબ୒͠·ͨ͠ɻ
  4. ᶅ࡞੒ͨ͠ϥΠϒϥϦ &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);
  5. 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Ληοτ