3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

WindowsのAndroidStudioでFFmpegを使用する

Posted at

環境

  • Windows 7
  • AndroidStudio 3.0

概要

本来はFFmpegをAndroid用にビルドして自作アプリに組み込む必要があるが、
Windowsでは成功例がなかった。
そこで、すでに作成済みのものをお借りして組み込もうとした。
しかし、いろいろエラーが出たのでその解決方法を記載。

拝借先

↓をお借りしました。
https://github.com/WritingMinds/ffmpeg-android-java

作成手順

↑のリンクから「ffmpeg-android-java-master.zip」をダウンロードして解凍。

解凍した「ffmpeg-android-java-master」をAndroidStudioで開く。

↓のようなエラーが出るが、リンクをクリックしてはいけない。
WS000013.JPG

build.gradleとgradle-wrapper.propertiesを変更する必要がある。

それぞれ以下のように変更。
変更前:classpath 'com.android.tools.build:gradle:2.1.0-beta3'
変更後:classpath 'com.android.tools.build:gradle:2.2.0'

変更前:classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
変更後:classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'

↓画像
WS000019.JPG

変更前:distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip
変更後:distributionUrl=https://services.gradle.org/distributions/gradle-2.14.1-all.zip

↓画像
WS000020.JPG

変更後、以下の画面が出るが、Updateしてはいけない。これをすると、先ほどの設定が書き換わる。Don't~をクリック。
WS000017.JPG

この状態でビルドすると、以下のようなエラーが出る。
WS000018.JPG

エラーの部分を以下のように変更。
WS000021.JPG

これでビルドが通るはず。
↓のアプリが起動できれば成功。
Screenshot_2018-06-05-22-18-40.png

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?