Skip to content

A program that can scan existing FFmpeg/LibAV source files and dynamically generate a Visual Studio project file.

License

Notifications You must be signed in to change notification settings

xialixin/FFVS-Project-Generator

 
 

Repository files navigation

FFVS-Project-Generator

Build status Github All Releases GitHub release GitHub issues license donate

About

The FFmpeg VS Project Generator is a standalone program that can be used to create a custom Visual Studio project within a FFmpeg source code distribution. This program allows for the created Visual Studio project to be customised using virtually any of the options supported by FFmpegs default configure script. This allows for selecting which dependency libraries and codec/format support should be built into the created project file. With the output project FFmpeg libraries and programs can be built and debugged directly within Visual Studio.

FFmpeg

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

Downloads

Pre-built executables are available from the releases page in a single archive containing both 32bit and 64bit versions.

Generating Custom Project Files

This project comes with the ffmpeg_generator program which can be used to build custom project files. This program accepts many of the configuration parameters that are supported by FFmpegs standard configure script (see FFmpegs documentation for more details). These options can be used to disable/enable specific options that define how FFmpeg is built. Using ffmpeg_generator a new project can be built using these options.

To generate a custom project using different configuration options simply build ffmpeg_generator and then run it by passing in the desired config options. In order for the generator to run it must have access to the ffmpeg source files that should be built into the new generated project. The generator will search for the source configure file in order to find what options are avilable for the current sources. This file must be accessible for the program to run, if the generator cannot find the configure files location then the input command option --rootdir= can be used to specify its location.

For example to build FFmpeg without any additional dependencies:

ffmpeg_generator.exe --enable-gpl --enable-version3 --disable-bzlib --disable-iconv --disable-zlib --disable-lzma --disable-sdl --toolchain=msvc

As well as enabling/disabling dependency libraries, specific config options can also be enabled/disabled. For instance a project that does not require yasm can be built by passing --disable-yasm. Specific FFmpeg programs can also be disabled such as --disable-ffprobe which will prevent a project file being generated for the FFmpeg program ffprobe.

The generator is designed to automatically resolve dependencies so if a configure option is disabled all options that depend on it will also be disabled accordingly.

For a complete list of available commands the --help option can be passed to the generator. This will give the complete list of accepted options based on the current sources.

By default the generator will build a project using the latest available toolchain detected on the host computer. This can be changed by hand in the generated projects properties Project Configuration->General->Platform Toolset if an older toolset is desired. The generator also supports use of the Intel compiler. The --toolchain= option can be used to change between standard Microsoft compiler (msvc) and the Intel compiler (icl).

Note: FFmpeg requires C99 support in order to compile. Only Visual Studio 2013 or newer supports required C99 functionality and so any older version is not supported. Visual Studio 2013 or newer is required. If using an older unsupported version of Visual Studio the Intel compiler can be used to add in the required C99 capability.

The project generator will also check the availability of dependencies. Any enabled options must have the appropriate headers installed in *OutputDir otherwise an error will be generated.

Sevaral automated batch files are supplied with the project that can be used to generate FFmpeg projects based on dependencies provided by ShiftMediaProject (smp_project_generate_gpl etc.). These batch files can be used to build projects based on various configurations and they can also optionally download all the appropriate dependency libraries that are supplied by ShiftMediaProject.

  • OutputDir is the Output Directory specified in the project properties.
    Note: There is a different OutputDir for 32/64bit configurations. Lib's and DLL's should be placed in the correct directory.
    Any header files will need to be placed in the Output directories include folder OutputDir\include.
    By default the 32bit lib OutputDir is OutputDir/lib/x86 and 64bit is OutputDir/lib/x64. DLLs follow a similar scheme except using OutputDir/bin/x86 and for 64bit OutputDir/bin/x64.
    The default value of OutputDir is ....\msvc relative to the FFmpeg source directory. An example of the expetced directory structure is:
    • msvc (OutputDir)
    • source >
      • FFmpeg
      • ..Any other libraries source code..

Using the Supplied Dependency Projects

Many of the possible FFmpeg dependencies (and their dependencies) are provided by the ShiftMediaProject repositories.

Many of the possible FFmpeg dependencies (and there dependencies) are available in the ShiftMediaProject repositories. However the following is a list of extra dependency options that require external downloads:

  1. opengl (requires glext)
    1. Download glext.h and wglext.h from opengl.org.
    2. Save the header files into OutputDir/include/gl/*.
  2. opencl (requires latest Intel/AMD OpenCL or NVIDIA CUDA SDK)
    1. Download either the "Intel OpenCL SDK", "AMD OpenCL SDK" or the "NVIDIA CUDA SDK" from their respective suppliers.
    2. Install the downloaded SDK wherever desired.
  3. decklink (requires Blackmagic DeckLink SDK)
    1. Download the "Blackmagic DeckLink SDK" from the Blackmagic website.
    2. Extract the downloaded SDK wherever desired.
    3. Create a batch file in the extracted "Win/include" folder containing the following (Note: you may have to change the first line depending on the installed Visual Studio version and location): call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat" midl /win32 /h DeckLinkAPI.h DeckLinkAPI.idl
    4. Copy the newly created "DeckLinkAPI.h" and "DeckLinkAPI_i.c" files to OutputDir/include/*.

Any dependencies supplied by ShiftMediaProject should be downloaded next to the FFmpeg folder as they will use the same OutputDir location. Projects to build each dependency can be found in the respective repository ./SMP directories.

Only dependencies built from supplied ShiftMediaProject repositories are tested and supported. Using compiled dependencies from other sources may result in version or other issues. Although these external sources generally work fine any problems associated with them are not covered by ShiftMediaProject and so they should be used with discretion.

Building with YASM

If the enable-yasm option is used to generate a project then in order to use the output project file using msvc you must first download and install YASM. YASM is required to compile all used assembly files.

  1. Visual Studio YASM integration can be downloaded from https://github.com/ShiftMediaProject/VSYASM/releases/latest
  2. Once downloaded simply follow the install instructions included in the download.

About

A program that can scan existing FFmpeg/LibAV source files and dynamically generate a Visual Studio project file.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 95.6%
  • Batchfile 2.7%
  • C 1.7%