# FFmpeg in the Bosch Video Management System

Bosch Video Management System uses different compilations of FFmpeg for different purposes. This file helps you to identify these compilations in case you want to replace them.

Name | Purpose | Files | FFmpeg version | FFmpeg feature configuration options
--- | --- | --- | --- | ---
VSDK | Decode video streams for on-screen rendering | avcodec-vsdk-57.dll avutil-vsdk-55.dll | 3.2.4 + custom patches | --disable-all --enable-avcodec --enable-avutil --enable-decoder=h264 --enable-decoder=hevc --build-suffix=-vsdk
BVMS and TOP | Write video files and transcode H.263 video streams when exporting .mov and .mp4 files | avcodec-bvms-58.dll avfilter-bvms-7.dll avformat-bvms-58.dll avutil-bvms-56.dll swresample-bvms-3.dll | 4.3.1 | --disable-all --enable-avutil --enable-avcodec --enable-avfilter --enable-avformat --enable-protocol=file --enable-protocol=udp --enable-dct --enable-swresample --enable-demuxer=mpegts --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=mp4 --enable-muxer=mov --enable-muxer=mp4 --enable-muxer=mpegts --enable-decoder=h263 --enable-decoder=g726 --enable-decoder=g726le --enable-decoder=mp2 --enable-decoder=pcm_alaw --enable-decoder=pcm_s16be --enable-decoder=pcm_mulaw --enable-encoder=mpeg4 --enable-encoder=aac --enable-encoder=g726 --enable-encoder=g726le --enable-encoder=mp2 --enable-encoder=pcm_alaw --enable-encoder=pcm_s16be --enable-encoder=pcm_mulaw --build-suffix=-bvms

## How to build FFmpeg

These links contain general information on how to build FFmpeg on Windows using the Microsoft Visual C++ compiler. Reading them is helpful but not required:

- https://ffmpeg.org/platform.html#Microsoft-Visual-C_002b_002b-or-Intel-C_002b_002b-Compiler-for-Windows
- https://trac.ffmpeg.org/wiki/CompilationGuide/MSVC

#### Prerequisites

These are the prerequisites for building FFmpeg for the 64-bit BVMS Operator Client on a 64-bit Windows operating system using the Microsoft Visual C++ compiler toolchain contained in Visual Studio 2013 or higher:

- Microsoft Windows 64-bit.
- Microsoft Visual Studio 2013 or higher with the Visual C++ compiler.
- Download Minimal SYStem and extract it in the msys folder next to this file. Rename or delete the msys/bin/link.exe file so that the Visual C++ linker is used instead.
- Download the Yasm assembler, rename it to yasm.exe and put it into the msys\bin folder.
- An internet connection is required for building the VSDK files.

The VSDK files can also be built as 32-bit and using other compiler toolchains. The scripts in the vsdk folder support additional options that are not used in this document. The prerequisites for such builds are described in the vsdk/ReadMe.txt file. An additional download which is missing in that description is be required when using vsdk/BuildFFmpeg.bat with the -f option:

- Download verpatch and extract the verpatch.exe file into the vsdk\verpatch\bin folder.

#### Build the VSDK files

- Open a command prompt in the vsdk folder and execute BuildFFmpeg.bat x64 -t msvc. This will download the FFmpeg source code, apply the custom patches and start the build.
- The build output will be in the vsdk\build folder with the required .dll files in the vsdk\build\bin folder. In case of errors see the vsdk\build\configure.txt and vsdk\build\make.txt files.
- Deploy the new .dll files to the …\bin and …\bin\Bosch.VideoSDK5.Core folder on each BVMS Operator Client installation.

#### Build the BVMS and TOP files

- Open a command prompt in the bvms folder and execute BuildFFmpeg.bat. This will start the build.
- Resultant .dll files can be found in the bvms\bin folder. In case of errors see the bvms\ffmpeg-4.3.1\build\configure.txt and bvms\ffmpeg-4.3.1\build\make.txt files.
- Deploy new .dll files to the …\bin folder on each BVMS Operator Client installation.
- For TOP, deploy the new avcodec-bvms-58.dll, avformat-bvms-58.dll and avutil-bvms-56.dll to the …\bin folder on each TOP installation.