Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/ci-meson.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Meson Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-meson:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cc: gcc
cxx: g++
- os: ubuntu-latest
cc: clang
cxx: clang++
- os: macos-latest
cc: clang
cxx: clang++
- os: windows-latest
cc: gcc
cxx: g++

name: "Test (${{ matrix.os }}, ${{ matrix.cc }})"
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
defaults:
run:
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Install deps (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg7 -y
sudo apt-get update
sudo apt-get install autoconf automake wget ffmpeg libavformat-dev libavcodec-dev libswscale-dev libavutil-dev libswresample-dev meson

- name: Install deps (macOS)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install autoconf automake libtool wget ffmpeg meson

- name: Setup MSYS2 (MINGW64)
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: >-
mingw-w64-x86_64-ca-certificates
mingw-w64-x86_64-ffmpeg
mingw-w64-x86_64-meson
mingw-w64-x86_64-toolchain

- name: Configure with Meson
run: >
meson setup builddir -Dtest=enabled

- name: Build
run: meson compile -C builddir --verbose

- name: Run tests
run: meson test -C builddir --verbose
51 changes: 51 additions & 0 deletions .github/workflows/ci-on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: On Release

on:
release:
types: [published]

jobs:
call-build-win:
uses: ./.github/workflows/ci-windows.yml

release-win:
name: Release Windows artifacts
runs-on: windows-latest
needs: call-build-win
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Download wheel artifact
uses: actions/download-artifact@v7

- name: Set RELEASE_TAG environment variable
run: |
$release_tag = "ffms2-${{ github.event.release.tag_name }}-msvc"
echo "RELEASE_TAG=$release_tag" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Create package
run: |
mkdir $env:RELEASE_TAG
cd $env:RELEASE_TAG
Copy-Item -Path "..\ffms2_windows_x64\share\doc\ffms2" -Destination "doc" -Recurse
Copy-Item -Path "..\ffms2_windows_x64\include" -Destination "include" -Recurse
Copy-Item -Path "..\etc\*" -Destination "."
mkdir x86
Copy-Item -Path "..\ffms2_windows_x86\bin\ffms2.dll" -Destination "x86"
Copy-Item -Path "..\ffms2_windows_x86\bin\ffmsindex.exe" -Destination "x86"
Copy-Item -Path "..\ffms2_windows_x86\lib\ffms2.lib" -Destination "x86"
mkdir x64
Copy-Item -Path "..\ffms2_windows_x64\bin\ffms2.dll" -Destination "x64"
Copy-Item -Path "..\ffms2_windows_x64\bin\ffmsindex.exe" -Destination "x64"
Copy-Item -Path "..\ffms2_windows_x64\lib\ffms2.lib" -Destination "x64"
cd ..
7z a "$env:RELEASE_TAG.7z" $env:RELEASE_TAG

- name: Upload artifact to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: gh release upload '${{ github.ref_name }}' "$env:RELEASE_TAG.7z"
73 changes: 73 additions & 0 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build on Windows

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_call:

jobs:
build-win:
strategy:
fail-fast: false
matrix:
arch: [x86, x64]

name: "Test Windows MSVC (${{ matrix.arch }})"
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Install Meson
run: pip install meson

- name: Install ffmpeg
run: vcpkg install ffmpeg[avcodec,avdevice,avfilter,avformat,swresample,swscale,zlib,bzip2,core,dav1d,gpl,version3,lzma,openssl,xml2]:${{ matrix.arch }}-windows-static

- name: Set VCPKG_PATH environment variable
run: |
$vcpkg_path = Split-Path (Get-Command vcpkg).Source -Parent
echo "VCPKG_PATH=$vcpkg_path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Install pkgconf
uses: msys2/setup-msys2@v2
id: msys2
with:
msystem: MINGW64
install: mingw-w64-x86_64-pkgconf

- name: Setup MSVC Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}

- name: Configure with Meson
env:
PKG_CONFIG: "${{ steps.msys2.outputs.msys2-location }}\\mingw64\\bin\\pkg-config.EXE"
run: >
meson setup builddir
--buildtype=release
--vsenv
-Dtest=enabled
-Davisynth=enabled
--pkg-config-path="$env:VCPKG_PATH\installed\${{ matrix.arch }}-windows-static\lib\pkgconfig"
-Db_vscrt=mt
# Use "-Db_vscrt=mt" to avoid this warning: LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

- name: Build
run: meson compile -C builddir --verbose

- name: Run tests
run: meson test -C builddir --verbose

- name: Install
run: meson install -C builddir --destdir install

- name: Upload Build
uses: actions/upload-artifact@v6
with:
name: ffms2_windows_${{ matrix.arch }}
path: builddir/install
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,7 @@ m4/lt~obsolete.m4

# Generated Makefile
Makefile

# Meson
/subprojects/*
!/subprojects/*.wrap
8 changes: 4 additions & 4 deletions doc/ffms2-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ FFMS2 has the following dependencies:
- Further recommended configuration options: `--disable-debug --disable-muxers --disable-encoders --disable-filters --disable-hwaccels --disable-network --disable-devices
- **[zlib][zlib]**

Compiling the library on non-Windows is trivial; the usual `./configure && make && make install` will suffice if FFmpeg and zlib are installed to the default locations.
Compiling the library is trivial; the usual `meson setup builddir && meson install -C builddir` will suffice if FFmpeg and zlib are installed to the default locations.

### Windows-specific compilation notes
You have several options on how to build FFMS2 on Windows.

You can build both FFmpeg and FFMS2 with MinGW-w64, FFmpeg with clang-cl and FFMS2 with VC++ (shared only), or both with VC++.
The standard Avisynth 2.5 plugin requires building FFMS2 with VC++, while the Avisynth C plugin (which supports Avisynth 2.6) requires building with MinGW (and using the `c_plugin`branch). VapouSynth works as-is with MinGW-w64.
You can build both FFmpeg and FFMS2 with MinGW-w64, FFmpeg with clang-cl and FFMS2 with VC++ or both with VC++.

These days building everything with MinGW works without doing anything unusual.

You'll have to manually add the location which you installed the headers and libraries to to VC++'s search paths (and if you're building both 32-bit and 64-bit, be sure to add the correct ones).
If you wanna use clang-cl or VC++, you will need to install pkgconf, so meson can found where you installed ffmpeg.
The easiest way is to download the latest pkgconf `.msi` from their [CI](https://github.com/pkgconf/pkgconf/actions?query=branch:master).

[ffmpeg]: http://www.ffmpeg.org
[zlib]: http://www.zlib.net
Expand Down
1 change: 1 addition & 0 deletions doc/ffms2-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- FFmpeg 7.1 is now the minimum requirement.
- Added layered decoding support, for e.g. spatial MV-HEVC.
- Added LastEndPTS to FFMS_VideoProperties. This field is the equivalent of LastEndTime, but it is expressed in the video timebase.
- Added meson build system. It will eventually replace autotools and MSBuild.

- 5.0
- Fixed all issues with FFmpeg 6.1 which is now the minimum requirement
Expand Down
Loading
Loading