diff --git a/.gitignore b/.gitignore index ff1527d..6f49b73 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,8 @@ __pycache__/ # Distribution / packaging .Python -build/ +/build/ +/install/ develop-eggs/ dist/ downloads/ @@ -173,4 +174,6 @@ cython_debug/ # PyPI configuration file .pypirc + +# PVE /test.mp4 diff --git a/make/configure-x264.sh b/make/configure-x264.sh new file mode 100755 index 0000000..48613cb --- /dev/null +++ b/make/configure-x264.sh @@ -0,0 +1,48 @@ +#!/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 . + +source_directory="codecs/x264" +build_directory="build/${source_directory}" +install_directory="build/codecs" + +if ! [ -d ${source_directory} ] ; then + echo "This script must be executed from the root directory: ./make/configure-x264.sh" + exit 1 +fi + +mkdir -p ${build_directory} +mkdir -p ${install_directory} + +absolute_source_directory=$(realpath ${source_directory}) +absolute_build_directory=$(realpath ${build_directory}) +absolute_install_directory=$(realpath ${install_directory}) + +cd "${absolute_build_directory}" +${absolute_source_directory}/configure \ + --prefix=${absolute_install_directory} \ + --disable-cli \ + --enable-static \ + --disable-bashcompletion \ + --bit-depth=all \ + --chroma-format=all \ + --enable-lto \ + --disable-avs \ + --disable-swscale \ + --disable-lavf \ + --disable-ffms \ + --disable-gpac \ + --disable-lsmash diff --git a/make/configure-x265.sh b/make/configure-x265.sh new file mode 100755 index 0000000..c8ff0a3 --- /dev/null +++ b/make/configure-x265.sh @@ -0,0 +1,59 @@ +#!/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 . + +source_directory="codecs/x265" +build_directory="build/${source_directory}" +install_directory="build/codecs" + +if ! [ -d ${source_directory} ] ; then + echo "This script must be executed from the root directory: ./make/configure-x265.sh" + exit 1 +fi + +mkdir -p ${build_directory}/8bit +mkdir -p ${build_directory}/10bit +mkdir -p ${build_directory}/12bit +mkdir -p ${install_directory} + +absolute_source_directory=$(realpath ${source_directory}) +absolute_build_directory=$(realpath ${build_directory}) +absolute_install_directory=$(realpath ${install_directory}) + +cmake -S ${absolute_source_directory}/source -B ${absolute_build_directory}/12bit \ + -Wno-dev \ + -DHIGH_BIT_DEPTH=ON \ + -DEXPORT_C_API=OFF \ + -DENABLE_SHARED=OFF \ + -DENABLE_CLI=OFF \ + -DMAIN12=ON + +cmake -S ${absolute_source_directory}/source -B ${absolute_build_directory}/10bit \ + -Wno-dev \ + -DHIGH_BIT_DEPTH=ON \ + -DEXPORT_C_API=OFF \ + -DENABLE_SHARED=OFF \ + -DENABLE_CLI=OFF + +cmake -S ${absolute_source_directory}/source -B ${absolute_build_directory}/8bit \ + --install-prefix ${absolute_install_directory} \ + -Wno-dev \ + -DEXTRA_LIB="x265_main10.a;x265_main12.a" \ + -DEXTRA_LINK_FLAGS=-L. \ + -DLINKED_10BIT=ON \ + -DLINKED_12BIT=ON \ + -DENABLE_SHARED=OFF \ + -DENABLE_CLI=OFF diff --git a/make/make-x264.sh b/make/make-x264.sh new file mode 100755 index 0000000..901ca5d --- /dev/null +++ b/make/make-x264.sh @@ -0,0 +1,31 @@ +#!/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 . + +source_directory="codecs/x264" +build_directory="build/${source_directory}" + +if ! [ -d ${source_directory} ] ; then + echo "This script must be executed from the root directory: ./make/make-x264.sh" + exit 1 +fi + +if ! [ -d ${build_directory} ] ; then + ./make/configure-x264.sh || exit 1 +fi + +cd ${build_directory} +make && make install diff --git a/make/make-x265.sh b/make/make-x265.sh new file mode 100755 index 0000000..2039bb0 --- /dev/null +++ b/make/make-x265.sh @@ -0,0 +1,61 @@ +#!/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 . + +source_directory="codecs/x265" +build_directory="build/${source_directory}" + +if ! [ -d ${source_directory} ] ; then + echo "This script must be executed from the root directory: ./make/make-x264.sh" + exit 1 +fi + +if ! [ -d ${build_directory} ] ; then + ./make/configure-x265.sh || exit 1 +fi + +absolute_build_directory=$(realpath ${build_directory}) + +cd ${absolute_build_directory}/12bit +make || exit 1 + +cd ${absolute_build_directory}/10bit +make || exit1 + +cd ${absolute_build_directory}/8bit + +ln -sf ../10bit/libx265.a libx265_main10.a +ln -sf ../12bit/libx265.a libx265_main12.a + +make || exit 1 + +mv -f libx265.a libx265_main.a + +uname=`uname` +if [ "$uname" = "Linux" ] ; then +ar -M </dev/null +fi + +make install