Code Monkey home page Code Monkey logo

androidffmpeg's Introduction

FFmpeg README

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides a mean to alter decoded Audio and Video through chain of filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • ffserver is a multimedia streaming server for live broadcasts.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

The online documentation is available in the main website and in the wiki.

Examples

Coding examples are available in the doc/examples directory.

License

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Patches should be submitted to the ffmpeg-devel mailing list using git format-patch or git send-email. Github pull requests should be avoided because they are not part of our review process and will be ignored.

androidffmpeg's People

Contributors

weimengerlai avatar

Watchers

James Cloos avatar  avatar

androidffmpeg's Issues

ffmpeg 编译步骤

AndroidFfmpeg

这是在mac电脑上面编译的ffmpeg,首先我们的环境需要是NDK android-ndk-r10,而ffmpeg版本必须是ffmpeg-3.3.7,我用4.0没有编译成功

1: 首先如果大家想自己编译ffmpeg,可以按照我接下来的步骤走在mac电脑,因为mac电脑安装完xcode,我们经常用来搞开发,所以我选择用mac电脑来编译,目前网上大部分的
编译采用的都是linux电脑,如果大家想用mac电脑编译so文件,可以按照我的步骤往下走

首先: 第一步: 我们需要去官网下载我们的NDK,但是版本不能是最新版本,必须是android-ndk-r10这个版本,下载地址是:
mac os 64位: http://dl.google.com/android/ndk/android-ndk-r10d-darwin-x86_64.bin
mac os 32位: http://dl.google.com/android/ndk/android-ndk-r10d-darwin-x86.bin

   第二步: 我们需要去下载历史版本的ffmpeg,下载链接如下: https://ffmpeg.org/download.html
   在这个地址我们需要选择: ffmpeg-3.3.7,这个版本,记住选择完了以后在下面有历史版本,我们要往下看
   
   第三不: 需要为我们的电脑配置NDK 环境: 首先使用 open .bash_profile 打开我们的环境配置文件,在里面输入如下内容:
           export NDK_HOME=/Users/gaoxuejun/Library/Android/sdk/android-ndk-r10(注意这里地址换成你的地址)
           export PATH=${PATH}:${NDK_HOME}
           
           使用如下命令: 输入在终端: ndk-build,
           
           出现如下的代码说明没有问题: 
           Android NDK: Could not find application project directory !    
           Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.    
           /Users/apple/Library/Android/sdk/android-ndk-r10/build/core/build-local.mk:148: *** Android NDK: Aborting    .  Stop.
           gaoxuejun:~ apple$ 
           
   第四步: 我们把我们下载的ffmpeg 文件放到任意一个文件夹下面: 
   第五步: 我们修改ffmpeg文件里面configure配置里面的内容: 
          讲下面这四句话替换掉: 
          SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'  
          LIB_INSTALL_EXTRA_CMD='$$(RANLIB)"$(LIBDIR)/$(LIBNAME)"'  
          SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'  
          SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR)$(SLIBNAME)'
          替换成如下语句: 
          SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'  
          LIB_INSTALL_EXTRA_CMD='$$(RANLIB)"$(LIBDIR)/$(LIBNAME)"'  
          SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'  
          SLIB_INSTALL_LINKS='$(SLIBNAME)'
          
          这是因为我们需要生产lib.so格式的包
          同时我们需要修改: 
          prefix_default="/Users/apple/Desktop/android_studio/src"(自己新建文件夹设置为自己的路径)
          如果不进行这一步,很可能会出错
          
    第六步: 编写shell脚本,比如名字为 ffmpeg_android.sh,内容如下: 
    #!/bin/bash
      # 因为我是在根目录,所以要先进入ffmpeg-3.3.1目录
      make clean
      # NDK的路径,根据自己的安装位置进行设置
      export NDK=/Users/apple/Library/Android/sdk/android-ndk-r10
      export SYSROOT=$NDK/platforms/android-15/arch-arm/
      export TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64
      export CPU=arm
      export PREFIX=$(pwd)/android/$CPU
      export ADDI_CFLAGS="-marm"
      function build_one
      {
      ./configure \
      --prefix=$PREFIX \
      --target-os=linux \
      --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
      --arch=arm \
      --sysroot=$SYSROOT \
      --extra-cflags="-Os -fpic $ADDI_CFLAGS" \
      --extra-ldflags="$ADDI_LDFLAGS" \
      --cc=$TOOLCHAIN/bin/arm-linux-androideabi-gcc \
      --nm=$TOOLCHAIN/bin/arm-linux-androideabi-nm \
      --enable-shared \
      --enable-runtime-cpudetect \
      --enable-gpl \
      --enable-small \
      --enable-cross-compile \
      --disable-debug \
      --disable-static \
      --disable-doc \
      --disable-asm \
      --disable-ffmpeg \
      --disable-ffplay \
      --disable-ffprobe \
      --disable-ffserver \
      --enable-postproc \
      --enable-avdevice \
      --disable-symver \
      --disable-stripping \
      $ADDITIONAL_CONFIGURE_FLAG
      sed -i '' 's/HAVE_LRINT 0/HAVE_LRINT 1/g' config.h
      sed -i '' 's/HAVE_LRINTF 0/HAVE_LRINTF 1/g' config.h
      sed -i '' 's/HAVE_ROUND 0/HAVE_ROUND 1/g' config.h
      sed -i '' 's/HAVE_ROUNDF 0/HAVE_ROUNDF 1/g' config.h
      sed -i '' 's/HAVE_TRUNC 0/HAVE_TRUNC 1/g' config.h
      sed -i '' 's/HAVE_TRUNCF 0/HAVE_TRUNCF 1/g' config.h
      sed -i '' 's/HAVE_CBRT 0/HAVE_CBRT 1/g' config.h
      sed -i '' 's/HAVE_RINT 0/HAVE_RINT 1/g' config.h
      make clean
      # 这里是定义用几个CPU编译,我用4个,一般在5分钟之内编译完成
      make -j4
      make install
      }
      build_one
      
第七步: 执行 sh ffmpeg_android.sh 就可以编译成功,注意: export NDK 修改成你自己的路径
如果有问题可以联系我: 电话 18301585363   qq: 1484315991

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.