preface

Recently in the study of audio things, record the problems encountered recently, first talk about the compilation library FFmpeg library, encountered environment configuration problems.

Tools and environment configuration for compilation

  • Download ffMPEG-4.0.5 from ffmpeg.org/
  • The NDK version 17, address: developer.android.com/ndk/downloa…
  • Ffmpeg and NDK are ubantu versions (currently I’m using Ubantu version 20.04).

NDK path configuration

  • After decompressing, configure the NDK path in the Ubantu system. For the path configuration, open the command line (Ctrl+Alt+T), then obtain the root permission, and type the following command
    su rootCopy the code

  • After obtaining the root permission, run the following command

vim /etc/profile Copy the code

  • Open the environment variable script as shown below, add your own NDK path at the end of the file in the following format, then press Esc and run the: wq command to save. 1. Open the file as root, otherwise you will not be able to save the file you edited. 2. If you want to view the NDK path, run the PWD command to view the NDK path.

    exportThe path of the NDK_HOME = the NDKexport PATH=$PATH:$NDK_HOMECopy the code



  • When done, type the following command for the environment to take effect:

source /etc/profileCopy the code

  • Finally, run the following command to check whether the configuration is successful. If the following figure is displayed, the configuration is successful

ndk-build -vCopy the code



Summary: The first problem I encountered was that I did not edit the configuration environment as root, so I could not save the configuration after compiling. Mandatory command, but still can not save, today here, the first post, if there is a mistake, but also hope you don’t hesitate to give advice, the next time I will slowly put their learning audio and video problems encountered gradually issued, as well as part of the solution.