fix: fail build for older versions
This commit is contained in:
parent
94658cd808
commit
a2c0e3374b
34
Dockerfile
Normal file
34
Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
FROM rust:bookworm
|
||||
WORKDIR /src
|
||||
RUN apt update && \
|
||||
apt install -y \
|
||||
build-essential \
|
||||
libx264-dev \
|
||||
libx265-dev \
|
||||
libwebp-dev \
|
||||
libvpx-dev \
|
||||
libopus-dev \
|
||||
libdav1d-dev \
|
||||
nasm \
|
||||
libclang-dev && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN git clone --single-branch --branch release/7.1 https://git.v0l.io/ffmpeg/FFmpeg.git && \
|
||||
cd FFmpeg && \
|
||||
./configure \
|
||||
--prefix=${FFMPEG_DIR} \
|
||||
--disable-programs \
|
||||
--disable-doc \
|
||||
--disable-network \
|
||||
--enable-gpl \
|
||||
--enable-libx264 \
|
||||
--enable-libx265 \
|
||||
--enable-libwebp \
|
||||
--enable-libvpx \
|
||||
--enable-libopus \
|
||||
--enable-libdav1d \
|
||||
--disable-static \
|
||||
--disable-postproc \
|
||||
--enable-shared && \
|
||||
make -j$(nproc) install
|
||||
COPY . .
|
||||
RUN cargo build --release
|
1
build.rs
1
build.rs
@ -6,7 +6,6 @@ fn main() {
|
||||
for (name, _value) in env::vars() {
|
||||
if name.starts_with("DEP_FFMPEG_") && !name.starts_with("DEP_FFMPEG_CHECK_") {
|
||||
let feature_name = name["DEP_FFMPEG_".len()..name.len()].to_lowercase();
|
||||
println!(r#"cargo::rustc-check-cfg=cfg(feature, values("{feature_name}"))"#);
|
||||
println!(r#"cargo::rustc-cfg=feature="{feature_name}""#);
|
||||
}
|
||||
}
|
||||
|
@ -265,7 +265,6 @@ impl Encoder {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::generate_test_frame;
|
||||
use ffmpeg_sys_the_third::AVPixelFormat::AV_PIX_FMT_YUV420P;
|
||||
|
||||
#[test]
|
||||
fn test_encode_png() -> Result<(), Error> {
|
||||
|
@ -18,6 +18,11 @@ mod scale;
|
||||
mod stream_info;
|
||||
mod transcode;
|
||||
|
||||
#[cfg(not(feature = "avcodec_version_greater_than_59_24"))]
|
||||
compile_error!("avcodec version too old, < 59.24");
|
||||
#[cfg(not(feature = "avutil_version_greater_than_57_24"))]
|
||||
compile_error!("avutil version too old, <57.24");
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! bail_ffmpeg {
|
||||
($x:expr) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user