Skip to content

Commit

Permalink
Document Windows FFmpeg build, etc.
Browse files Browse the repository at this point in the history
Statically link FFmpeg on Windows. This requires building a slimmed-down
version of FFmpeg from source. The build process is documented in the
README.

Also add ffmpeg dependency to the nix flake.
  • Loading branch information
nunuhara committed Apr 3, 2023
1 parent 8437a87 commit baae8f5
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,40 @@ First install MSYS2, and then open the MINGW64 shell and run the following comma
mingw-w64-x86_64-libsndfile \
mingw-w64-x86_64-glew

To build with FFmpeg support, you must compile FFmpeg as a static library:

git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg
git checkout n6.0
./configure --disable-everything \
--enable-decoder=mpegvideo \
--enable-decoder=mpeg1video \
--enable-decoder=mpeg2video \
--enable-decoder=mp2 \
--enable-parser=mpegaudio \
--enable-parser=mpegvideo \
--enable-demuxer=mpegps \
--enable-demuxer=mpegts \
--enable-demuxer=mpegtsraw \
--enable-demuxer=mpegvideo \
--enable-decoder=vc1 \
--enable-decoder=wmapro \
--enable-parser=vc1 \
--enable-hwaccel=vc1_d3d11va \
--enable-hwaccel=vc1_d3d11va2 \
--enable-hwaccel=vc1_dxva2 \
--enable-demuxer=asf \
--enable-protocol=file \
--enable-filter=scale \
--enable-static \
--disable-shared \
--extra-libs=-static \
--extra-cflags=--static
make
make install
cd ..
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"

Then build the xsystem4 executable with meson,

mkdir build
Expand Down
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
chibi
flex
bison
ffmpeg
];
}
);
Expand Down Expand Up @@ -65,6 +66,7 @@
chibi
flex
bison
ffmpeg
];
};
}
Expand Down
8 changes: 4 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ png = dependency('libpng', static : static_libs)
cglm = dependency('cglm', version : '>=0.8.3', fallback : ['cglm', 'cglm_dep'])
sndfile = dependency('sndfile', static : static_libs)

avcodec = dependency('libavcodec', required: false)
avformat = dependency('libavformat', required: false)
avutil = dependency('libavutil', required: false)
swscale = dependency('libswscale', required: false)
avcodec = dependency('libavcodec', required: false, static : static_libs)
avformat = dependency('libavformat', required: false, static : static_libs)
avutil = dependency('libavutil', required: false, static : static_libs)
swscale = dependency('libswscale', required: false, static : static_libs)

gles = dependency('glesv2', version : '>=3', required: get_option('opengles'))
if gles.found()
Expand Down
2 changes: 1 addition & 1 deletion subprojects/libsys4

0 comments on commit baae8f5

Please sign in to comment.