From 7ea498edc879f1552cf3f05058ff8a43cf88d315 Mon Sep 17 00:00:00 2001 From: Roz K Date: Sat, 4 Oct 2025 13:51:41 +0200 Subject: [PATCH] build scripts --- make/configure-ffmpeg.sh | 3 +-- mp4/libav.py | 13 ++++++++++--- pve.sh | 22 ++++++++++++++++++++++ 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100755 pve.sh diff --git a/make/configure-ffmpeg.sh b/make/configure-ffmpeg.sh index ff6716f..6985cc7 100755 --- a/make/configure-ffmpeg.sh +++ b/make/configure-ffmpeg.sh @@ -38,10 +38,9 @@ PKG_CONFIG_PATH="${absolute_lib_directory}/pkgconfig" \ ${absolute_source_directory}/configure \ --prefix=${absolute_install_directory} \ --pkg-config-flags="--static" \ + --extra-libs="-lpthread -lm" \ --extra-cflags="-I${absolute_include_directory}" \ --extra-ldflags="-L${absolute_lib_directory}" \ - --extra-libs="-lpthread -lm" \ - --ld="g++" \ --disable-static \ --enable-shared \ --enable-rpath \ diff --git a/mp4/libav.py b/mp4/libav.py index cf9dda0..78e05ff 100644 --- a/mp4/libav.py +++ b/mp4/libav.py @@ -16,10 +16,17 @@ import errno import ctypes +from pathlib import PurePath -_avutil = ctypes.cdll.LoadLibrary('libavutil.so') -_avformat = ctypes.cdll.LoadLibrary('libavformat.so') -_avcodec = ctypes.cdll.LoadLibrary('libavcodec.so') +shared_library_path = PurePath(__file__).parent + +def load_shared_library(name): + path = str(shared_library_path / ("lib" + name + ".so")) + return ctypes.cdll.LoadLibrary(path) + +_avutil = load_shared_library("avutil") +_avformat = load_shared_library("avformat") +_avcodec = load_shared_library("avcodec") def _errtag(a, b, c, d): return -(ord(a) | (ord(b) << 8) | (ord(c) << 16) | (ord(d) << 24)) diff --git a/pve.sh b/pve.sh new file mode 100755 index 0000000..6dc6d90 --- /dev/null +++ b/pve.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# People's Video Editor: high quality, GPU accelerated mp4 editor +# Copyright (C) 2025 Roz K +# +# This file is part of People's Video Editor. +# +# People's Video Editor is free software: you can redistribute it and/or modify it under the terms of the +# GNU General Public License as published by the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# People's Video Editor is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with People's Video Editor. +# If not, see . + +shared_library_path="./mp4" +absolute_shared_library_path=$(realpath ${shared_library_path}) + +LD_LIBRARY_PATH=${absolute_shared_library_path} \ +python3 pve.py