Compare commits

..

4 Commits

Author SHA1 Message Date
087e488ae9 fix: likely update all deprecated fucntion calls
Signed-off-by: Alix von Schirp <github@avonschirp.bootmedia.de>
2026-02-19 10:04:35 +01:00
73cb05f572 fix: replace deprecated flag to supported version
Signed-off-by: Alix von Schirp <github@avonschirp.bootmedia.de>
2026-02-19 09:50:26 +01:00
3b2c5877ad fix: use versioned llvm binaries
Signed-off-by: Alix von Schirp <github@avonschirp.bootmedia.de>
2026-02-19 09:49:32 +01:00
1615115ea8 WIP: Fix build 2026-02-18 23:46:20 +01:00
3 changed files with 22 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
FROM emscripten/emsdk:5.0.1 as build
FROM emscripten/emsdk:5.0.1 AS build
ARG FFMPEG_VERSION=8.0.1
ARG X264_COMMIT=b35605a
@@ -7,7 +7,12 @@ ARG LAME_VERSION=3.100
ARG PREFIX=/opt/ffmpeg
ARG MAKEFLAGS="-j4"
RUN apt-get update && apt-get install -y autoconf libtool build-essential
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
RUN echo "deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main\ndeb-src https://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main" > /etc/apt/sources.list.d/llvm.list
RUN apt-get update
RUN apt-get install -y libllvm-20-ocaml-dev libllvm20 llvm-20 llvm-20-dev llvm-20-runtime
RUN apt-get install -y libclang-rt-20-dev-wasm32 libclang-rt-20-dev-wasm64 libc++-20-dev-wasm32 libc++abi-20-dev-wasm32 libclang-rt-20-dev-wasm32 libclang-rt-20-dev-wasm64
RUN apt-get update && apt-get install -y autoconf libtool build-essential pkgconf
# libx264
WORKDIR /tmp/
@@ -49,6 +54,7 @@ RUN wget -O ffmpeg-${FFMPEG_VERSION}.tar.gz http://ffmpeg.org/releases/ffmpeg-${
ARG CFLAGS="-s USE_PTHREADS=1 -O3 -I${PREFIX}/include"
ARG LDFLAGS="$CFLAGS -L${PREFIX}/lib -s INITIAL_MEMORY=33554432"
ENV EM_PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig"
# Compile ffmpeg.
WORKDIR /tmp/ffmpeg-${FFMPEG_VERSION}
@@ -70,7 +76,6 @@ RUN emconfigure ./configure \
--enable-avdevice \
--enable-avutil \
--enable-swresample \
--enable-postproc \
--enable-swscale \
--enable-protocol=file \
--enable-decoder=h264,aac,pcm_s16le,mp3 \
@@ -82,10 +87,10 @@ RUN emconfigure ./configure \
--extra-cflags="$CFLAGS" \
--extra-cxxflags="$CFLAGS" \
--extra-ldflags="$LDFLAGS" \
--nm="llvm-nm -g" \
--nm="llvm-nm-20 -g" \
--ar=emar \
--as=llvm-as \
--ranlib=llvm-ranlib \
--ranlib=llvm-ranlib-20 \
--cc=emcc \
--cxx=em++ \
--objcc=emcc \

View File

@@ -4,7 +4,7 @@ dist/ffprobe-wasm.js:
-O3 \
-L/opt/ffmpeg/lib \
-I/opt/ffmpeg/include/ \
-s EXTRA_EXPORTED_RUNTIME_METHODS="[FS, cwrap, ccall, getValue, setValue, writeAsciiToMemory]" \
-s EXPORTED_RUNTIME_METHODS="[FS, cwrap, ccall, getValue, setValue, writeAsciiToMemory]" \
-s INITIAL_MEMORY=268435456 \
-lavcodec -lavformat -lavfilter -lavdevice -lswresample -lswscale -lavutil -lm -lx264 \
-pthread \

View File

@@ -149,7 +149,7 @@ FileInfoResponse get_file_info(std::string filename) {
.level = (int)pLocalCodecParameters->level,
.width = (int)pLocalCodecParameters->width,
.height = (int)pLocalCodecParameters->height,
.channels = (int)pLocalCodecParameters->channels,
.channels = (int)pLocalCodecParameters->ch_layout.nb_channels,
.sample_rate = (int)pLocalCodecParameters->sample_rate,
.frame_size = (int)pLocalCodecParameters->frame_size,
};
@@ -165,7 +165,6 @@ FileInfoResponse get_file_info(std::string filename) {
}
r.streams.push_back(stream);
free(fourcc);
}
// Loop through the chapters (if any).
@@ -227,7 +226,7 @@ FramesResponse get_frames(std::string filename, int timestamp) {
}
// Get streams data.
AVCodec *pCodec = NULL;
const AVCodec *pCodec = NULL;
AVCodecParameters *pCodecParameters = NULL;
int video_stream_index = -1;
int nb_frames = 0;
@@ -238,7 +237,7 @@ FramesResponse get_frames(std::string filename, int timestamp) {
pLocalCodecParameters = pFormatContext->streams[i]->codecpar;
// Print out the decoded frame info.
AVCodec *pLocalCodec = avcodec_find_decoder(pLocalCodecParameters->codec_id);
const AVCodec *pLocalCodec = avcodec_find_decoder(pLocalCodecParameters->codec_id);
if (pLocalCodecParameters->codec_type == AVMEDIA_TYPE_VIDEO) {
if (video_stream_index == -1) {
video_stream_index = i;
@@ -296,7 +295,7 @@ FramesResponse get_frames(std::string filename, int timestamp) {
}
// Track keyframes so we paginate by each GOP.
if (pFrame->key_frame == 1) key_frames++;
if (pFrame->flags & AV_FRAME_FLAG_KEY) key_frames++;
// Break at the next keyframe found.
if (key_frames > 1) break;
@@ -307,7 +306,7 @@ FramesResponse get_frames(std::string filename, int timestamp) {
.pts = (int) pPacket->pts,
.dts = (int) pPacket->dts,
.pos = (int) pPacket->pos,
.pkt_size = pFrame->pkt_size,
.pkt_size = pPacket->size,
};
r.frames.push_back(f);