项目作者: databrary

项目描述 :
FFmpeg dependencies for the Datavyu Player and FFmpeg Compiling instructions
高级语言:
项目地址: git://github.com/databrary/ffmpeg-libs.git
创建时间: 2018-05-11T22:49:45Z
项目社区:https://github.com/databrary/ffmpeg-libs

开源协议:

下载


ffmpeg-libs

The following outlines the compilation of ffmpeg DLL’s and executables using the
Microsoft Visual Studio compiler.

  1. Download Microsoft Visual Studio (Community edition) from
    Microsft Website
    and install it.

  2. Download MSYS2 x68_64 from link and install it into C:\ folder

  3. Install build tools in msys64

    1. cd C:\msys64
    2. Execute msys2_shell.cmd

    Execute in the msys2 shell

    1. pacman -S make gcc diffutils

    Close the shell.
    To avoid a name conflict rename C:\msys64\usr\bin\link.exe into
    C:/msys64/usr/bin/link_old.exe. This ensures that your compile environment will
    use the linker from the Microsoft Visual Studio.

  4. Install YASM

    Download Win64.exe from link and rename
    the downloaded executable to yasm.exe. Create the folder C:\yasm and place the renamed file into
    this latter. Add this folder to your path.

  5. Setup the environment variables for the 64 bit build

    Run the following batch script in the
    windows command line tool:

    1. cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
    2. vcvarsall.bat x64

    The flag x64 sets the environment up for compilation of 64 bit versions.

  6. Switch to the MSYS shell

    In the windows command line from the prior step navigate to C:\msys64.
    Run the command: msys2_shell.cmd -msys -use-full-path
    This ensures that the environment variables PATH and LIB carry over into the
    msys shell. This opens a new msys shell in a separate window.

  7. In the msys shell CHECK the compiler and linker:

    1. $ which cl
    2. /c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/amd64/cl
    3. $ which link
    4. /c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/amd64/link

    This ensures that your MVS compiler and linker are used.

  8. Download FFmpeg source code

    Download the ZIP file of the latest FFmpeg source code
    from the Github Repository
    and unzip the file into the folder FFmpeg-release-x.x.x.

  9. Configure for compilation of 64 bit DLLs
    In the msys shell:

    1. cd /c/PATH/TO/FFMPEG_SOURCE/

    Run the following command to configure the build for FFmpeg:

    1. ./configure --toolchain=msvc
    2. --enable-swscale
    3. --enable-asm
    4. --enable-yasm
    5. --target-os=win64
    6. --arch=x86_64
    7. --enable-shared
    8. --disable-static
    9. --disable-ffserver
    10. --disable-avdevice
    11. --disable-doc
    12. --disable-ffplay
    13. --disable-ffprobe
    14. --disable-ffmpeg
    15. --enable-w32threads
  10. A successful configuration ends with the lines

    1. License: LGPL version 2.1 or later
    2. Creating config.mak, config.h, and doc/config.texi...
    3. config.asm is unchanged
    4. libavutil/avconfig.h is unchanged
    5. WARNING: pkg-config not found, library detection may fail.
    6. libavcodec/bsf_list.c is unchanged
    7. libavformat/protocol_list.c is unchanged

    You can ignore the pkg-config not found issue. It will not affect compilation.

  11. Compile the source code to produce DLLs

    1. make -j4

    The -j4 flag indicates to use 4 threads for compilation. This
    speeds up the compilation process. You may want to set the number
    of threads even higher depending on your hardware.

  12. The successful compilation ends with.

    1. LD libavdevice/avdevice-57.dll
    2. Creating library libavdevice/avdevice.lib and object libavdevice/avdevice.exp
    3. LD ffmpeg_g.exe
    4. LD ffprobe_g.exe
    5. CP ffprobe.exe
    6. STRIP ffprobe.exe
    7. skipping strip ffprobe.exe
    8. CP ffmpeg.exe
    9. STRIP ffmpeg.exe
    10. skipping strip ffmpeg.exe

Resources

Useful installation guides: