mirror of
https://github.com/k4yt3x/video2x.git
synced 2026-02-04 11:24:41 +08:00
Compare commits
100 Commits
4.0.0-beta
...
4.5.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f2ad35d41 | ||
|
|
d688ca490e | ||
|
|
708c983c1e | ||
|
|
9b91016d98 | ||
|
|
b024581906 | ||
|
|
8fd3292cd6 | ||
|
|
e646825c57 | ||
|
|
fdf326108f | ||
|
|
e26561c56a | ||
|
|
9d7c3963c3 | ||
|
|
ce5d4051e5 | ||
|
|
9f6f1eee5b | ||
|
|
6ae7491652 | ||
|
|
d35472fbfb | ||
|
|
7166afdc0e | ||
|
|
d3db4e8cf1 | ||
|
|
f887dfe3a7 | ||
|
|
a41df138bf | ||
|
|
41833f4068 | ||
|
|
c0955ae7e4 | ||
|
|
682aeb82ff | ||
|
|
21407c831c | ||
|
|
7e34bf7516 | ||
|
|
4c5ca73e38 | ||
|
|
387a233daf | ||
|
|
781eb6686f | ||
|
|
c73edd9001 | ||
|
|
deb742ee8d | ||
|
|
5ef6eb7e8e | ||
|
|
6c5e079a1c | ||
|
|
1e384596ee | ||
|
|
4680647f1f | ||
|
|
4015db5bcf | ||
|
|
082c6d44fa | ||
|
|
de841a4636 | ||
|
|
40711a2711 | ||
|
|
0c63768165 | ||
|
|
ac2d447391 | ||
|
|
b03747dbde | ||
|
|
89740f01dc | ||
|
|
676e70f088 | ||
|
|
f57b5e9d04 | ||
|
|
f48e23a890 | ||
|
|
826b4e9829 | ||
|
|
c56be51e21 | ||
|
|
d2b3175ccd | ||
|
|
a98d1c7277 | ||
|
|
e107ddc96e | ||
|
|
289f5441eb | ||
|
|
179bd6afc8 | ||
|
|
5af49012c8 | ||
|
|
192c6ef38b | ||
|
|
0b67ec879d | ||
|
|
288f21f7ce | ||
|
|
60af2a2782 | ||
|
|
53aa27409e | ||
|
|
ab22fb2359 | ||
|
|
fc18307b22 | ||
|
|
04d598a525 | ||
|
|
748f1e5799 | ||
|
|
c384bb91c4 | ||
|
|
0882f44e1f | ||
|
|
99abb4f6df | ||
|
|
54f8f19c7e | ||
|
|
c1c96815cf | ||
|
|
98a7fbf9cb | ||
|
|
f2ba6033b7 | ||
|
|
f92d1a41a2 | ||
|
|
1b6c4b8c49 | ||
|
|
9b4ee89aee | ||
|
|
0953fc52a1 | ||
|
|
759a3c7c96 | ||
|
|
786ccaa610 | ||
|
|
0c3c136458 | ||
|
|
1be2c1ead7 | ||
|
|
180bfcab20 | ||
|
|
0cc67857f7 | ||
|
|
e07848f4bf | ||
|
|
379d699c0d | ||
|
|
e6702d4486 | ||
|
|
8f5edb720e | ||
|
|
b27e9b1fa5 | ||
|
|
0b72236d95 | ||
|
|
fdb813d6d6 | ||
|
|
417dfc5deb | ||
|
|
12673f1c37 | ||
|
|
f7d8d551b3 | ||
|
|
9cbb213e55 | ||
|
|
181e5c94e6 | ||
|
|
37547d1233 | ||
|
|
8368cb1f49 | ||
|
|
9643c96ed7 | ||
|
|
1c5bf1604f | ||
|
|
23cfba86f8 | ||
|
|
0ef0d6e161 | ||
|
|
4e43ff9086 | ||
|
|
a93d18eb09 | ||
|
|
e305d0188e | ||
|
|
5cf3271aad | ||
|
|
bcbead4d96 |
69
.github/workflows/nightly.yml
vendored
Normal file
69
.github/workflows/nightly.yml
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
# Name: Video2X Nightly Build
|
||||
# Creator: K4YT3X
|
||||
# Date Created: May 12, 2020
|
||||
# Last Modified: May 28, 2020
|
||||
|
||||
name: Video2X Nightly Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: src
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install -U pip
|
||||
pip install -U pyinstaller pywin32
|
||||
pip install -U -r requirements.txt
|
||||
- name: Build Video2X CLI
|
||||
run: |
|
||||
pyinstaller --noconfirm --log-level=WARN `
|
||||
--onefile `
|
||||
--add-data="locale;locale" `
|
||||
--add-data="wrappers;wrappers" `
|
||||
--icon="images\video2x.ico" `
|
||||
video2x.py
|
||||
- name: Build Video2X GUI
|
||||
run: |
|
||||
pyinstaller --noconfirm --log-level=WARN `
|
||||
--onefile `
|
||||
--add-data="images;images" `
|
||||
--add-data="locale;locale" `
|
||||
--add-data="video2x_gui.ui;." `
|
||||
--add-data="wrappers;wrappers" `
|
||||
--icon="images\video2x.ico" `
|
||||
video2x_gui.py
|
||||
- name: Build Video2X setup script
|
||||
run: |
|
||||
pyinstaller --noconfirm --log-level=WARN `
|
||||
--onefile `
|
||||
--additional-hooks-dir "pyinstaller\hooks" `
|
||||
--add-data="locale;locale" `
|
||||
--add-data="pyinstaller\7z1900-extra;7z" `
|
||||
--icon="images\video2x.ico" `
|
||||
video2x_setup.py
|
||||
- name: Collect artifacts into folder
|
||||
run: |
|
||||
New-Item "video2x-nightly-win32-light\" -ItemType Directory
|
||||
Copy-Item "dist\video2x.exe" -Destination "video2x-nightly-win32-light\"
|
||||
Copy-Item "dist\video2x_gui.exe" -Destination "video2x-nightly-win32-light\"
|
||||
Copy-Item "dist\video2x_setup.exe" -Destination "video2x-nightly-win32-light\"
|
||||
Copy-Item "video2x.yaml" -Destination "video2x-nightly-win32-light\"
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: video2x-nightly-win32-light
|
||||
path: src/video2x-nightly-win32-light/
|
||||
187
Dockerfile
Normal file
187
Dockerfile
Normal file
@@ -0,0 +1,187 @@
|
||||
# Name: Video2X Dockerfile
|
||||
# Creator: Danielle Douglas
|
||||
# Date Created: Unknown
|
||||
# Last Modified: January 14, 2020
|
||||
|
||||
# Editor: Lhanjian
|
||||
# Last Modified: May 24, 2020
|
||||
|
||||
# Editor: K4YT3X
|
||||
# Last Modified: May 30, 2020
|
||||
|
||||
FROM ubuntu:19.10
|
||||
#FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
|
||||
|
||||
LABEL maintainer="Danielle Douglas <ddouglas87@gmail.com>"
|
||||
LABEL maintainer="Lhanjian <lhjay1@foxmail.com>"
|
||||
LABEL maintainer="K4YT3X <k4yt3x@k4yt3x.com>"
|
||||
|
||||
# Don't ask questions during image setup.
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV NASM_VERSION 2.14
|
||||
ENV NVCODEC_VERSION 8.2.15.6
|
||||
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
|
||||
ENV FFMPEG_VERSION 4.1.2
|
||||
|
||||
# Install apt-fast, because we got gigs to download.
|
||||
RUN apt-get update && apt-get install -y apt-utils &&\
|
||||
apt-get install -y --no-install-recommends software-properties-common &&\
|
||||
add-apt-repository ppa:apt-fast/stable &&\
|
||||
add-apt-repository -y ppa:graphics-drivers/ppa &&\
|
||||
apt-get install -y --no-install-recommends apt-fast && apt-fast update
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-fast install -y --no-install-recommends autoconf ca-certificates curl ffmpeg frei0r-plugins-dev g++ gcc git-core gnupg2 gnutls-dev ladspa-sdk libass-dev libass-dev libbluray-dev libc6-dev libcaca-dev libcdio-paranoia-dev libchromaprint-dev libcodec2-dev libfdk-aac-dev libfdk-aac-dev libfontconfig1-dev libfreetype6-dev libfreetype6-dev libfreetype6-dev libfribidi-dev libgme-dev libgnutls28-dev libgsm1-dev libjack-dev libjack-dev liblilv-dev libmagic-dev libmagic1 libmodplug-dev libmp3lame-dev libmp3lame-dev libmysofa-dev libnuma-dev libopenal-dev libopencore-amrnb-dev libopencore-amrwb-dev libopenjp2-7-dev libopenmpt-dev libopus-dev libopus-dev libpulse-dev librsvg2-dev librtmp-dev librubberband-dev libsdl2-dev libsdl2-dev libshine-dev libsmbclient-dev libsnappy-dev libsoxr-dev libspeex-dev libssh-dev libtesseract-dev libtheora-dev libtool libtwolame-dev libv4l-dev libva-dev libva-dev libvdpau-dev libvdpau-dev libvo-amrwbenc-dev libvorbis-dev libvorbis-dev libvorbis-dev libvpx-dev libvpx-dev libwavpack-dev libwebp-dev libx264-dev libx264-dev libx265-dev libx265-dev libxcb-shm0-dev libxcb-shm0-dev libxcb-xfixes0-dev libxcb-xfixes0-dev libxcb1-dev libxcb1-dev libxml2-dev libxvidcore-dev libzmq3-dev libzvbi-dev nvidia-cuda-toolkit nvidia-driver-440 opencl-dev p11-kit pkg-config pkg-config python3-dev python3-pip python3-setuptools python3-wheel python3.8 texinfo texinfo wget wget yasm zlib1g-dev zlib1g-dev
|
||||
|
||||
# Install NASM
|
||||
RUN curl -vfsSLO https://www.nasm.us/pub/nasm/releasebuilds/$NASM_VERSION/nasm-$NASM_VERSION.tar.bz2 \
|
||||
&& tar -xjf nasm-$NASM_VERSION.tar.bz2 \
|
||||
&& cd nasm-$NASM_VERSION \
|
||||
&& ./autogen.sh \
|
||||
&& ./configure \
|
||||
&& make -j$(nproc) \
|
||||
&& make install
|
||||
|
||||
# Compile FFmpeg with CUDA support
|
||||
|
||||
RUN git clone --recurse-submodules -b n$NVCODEC_VERSION --depth 1 https://git.videolan.org/git/ffmpeg/nv-codec-headers \
|
||||
&& cd nv-codec-headers \
|
||||
&& make install
|
||||
|
||||
RUN curl -vfsSLO https://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2 \
|
||||
&& tar -xjf ffmpeg-$FFMPEG_VERSION.tar.bz2 \
|
||||
&& cd ffmpeg-$FFMPEG_VERSION \
|
||||
&& ./configure --enable-cuda-sdk --enable-cuvid --enable-nonfree --enable-libnpp --enable-nvenc \
|
||||
--enable-gpl --enable-version3 \
|
||||
--enable-small --enable-avisynth --enable-chromaprint \
|
||||
--enable-frei0r --enable-gmp --enable-gnutls --enable-ladspa \
|
||||
--enable-libass --enable-libcaca --enable-libcdio \
|
||||
--enable-libcodec2 --enable-libfontconfig --enable-libfreetype \
|
||||
--enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack \
|
||||
--enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb \
|
||||
--enable-libopencore-amrwb --enable-libopencore-amrwb \
|
||||
--enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse \
|
||||
--enable-librsvg --enable-librubberband --enable-librtmp --enable-libshine \
|
||||
--enable-libsnappy --enable-libsoxr --enable-libspeex \
|
||||
--enable-libssh --enable-libtesseract --enable-libtheora \
|
||||
--enable-libtwolame --enable-libv4l2 --enable-libvo-amrwbenc \
|
||||
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp \
|
||||
--enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 \
|
||||
--enable-libzmq --enable-libzvbi --enable-lv2 \
|
||||
--enable-libmysofa \
|
||||
--enable-openal --enable-opencl --enable-opengl --enable-libdrm \
|
||||
--enable-libfdk-aac --enable-libbluray \
|
||||
&& make -j$(nproc) \
|
||||
&& make install
|
||||
|
||||
# Add Nvidia's machine-learning repository for libcudnn7 and libcudnn7-dev
|
||||
RUN curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | apt-key add - &&\
|
||||
echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list
|
||||
|
||||
# Install Video2X
|
||||
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1 && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
|
||||
RUN cd / && python3.8 -m pip install --upgrade pip &&\
|
||||
git clone --recurse-submodules --progress https://github.com/k4yt3x/video2x.git --depth=1 &&\
|
||||
python3.8 -m pip install -U -r video2x/src/requirements.txt
|
||||
|
||||
# Compile drivers
|
||||
|
||||
# example: docker build -t video2x . --build-arg driver=waifu2x_ncnn_vulkan
|
||||
ARG driver=all
|
||||
|
||||
# Check if driver exists.
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
RUN drivers=(all waifu2x_caffe waifu2x_converter waifu2x_ncnn_vulkan) &&\
|
||||
case ${drivers[@]} in (*${driver,,}*) true ;; (*)\
|
||||
echo "ERROR: Unrecognized driver." >&2 &&\
|
||||
printf "%s " "Choices are: ${drivers[@]}" >&2 | printf "\n" >&2 &&\
|
||||
exit 1 ;;\
|
||||
esac
|
||||
|
||||
RUN if [ "$driver" = "all" ] || [ "$driver" = "waifu2x_caffe" ] ; then \
|
||||
# nagadomi/caffe prerequisites
|
||||
apt-fast update &&\
|
||||
apt-fast install -y --no-install-recommends build-essential cmake libboost-system-dev libboost-thread-dev libboost-filesystem-dev libboost-chrono-dev libboost-date-time-dev libboost-atomic-dev libboost-python-dev libprotobuf-dev protobuf-compiler libhdf5-dev liblmdb-dev libleveldb-dev libsnappy-dev libopencv-dev libatlas-base-dev python-numpy libgflags-dev libgoogle-glog-dev &&\
|
||||
# nagadomi/waifu2x-caffee-ubuntu prerequisites
|
||||
apt-fast install -y --no-install-recommends libboost-iostreams-dev;\
|
||||
fi
|
||||
# build waifu2x-caffe && install caffe
|
||||
RUN if [ "$driver" = "all" ] || [ "$driver" = "waifu2x_caffe" ] ; then \
|
||||
git clone --recurse-submodules --depth=1 --progress --recurse-submodules https://github.com/nagadomi/waifu2x-caffe-ubuntu.git &&\
|
||||
cd waifu2x-caffe-ubuntu &&\
|
||||
git clone --recurse-submodules --progress --depth=1 https://github.com/nagadomi/caffe.git;\
|
||||
fi
|
||||
|
||||
RUN if [ "$driver" = "all" ] || [ "$driver" = "waifu2x_caffe" ] ; then \
|
||||
apt-fast install --no-install-recommends -y gcc-8 libcudnn7 libcudnn7-dev &&\
|
||||
apt-get remove -y gcc g++ &&\
|
||||
ln -s /usr/bin/gcc-8 /usr/bin/gcc && ln -s /usr/bin/g++-8 /usr/bin/g++ &&\
|
||||
cd /waifu2x-caffe-ubuntu &&\
|
||||
mkdir build &&\
|
||||
cd build &&\
|
||||
cmake .. -DCMAKE_INSTALL_PREFIX=/usr &&\
|
||||
make -j$(nproc) install;\
|
||||
fi
|
||||
|
||||
RUN if [ "$driver" = "all" ] || [ "$driver" = "waifu2x_caffe" ] ; then \
|
||||
# install waifu2x-caffe
|
||||
cd /waifu2x-caffe-ubuntu/build &&\
|
||||
cp waifu2x-caffe ../bin/ &&\
|
||||
mv ../bin tempname &&\
|
||||
mv tempname /video2x/ &&\
|
||||
mv /video2x/tempname /video2x/waifu2x-caffe &&\
|
||||
rm -rf ../waifu2x-caffe-ubuntu ;\
|
||||
fi
|
||||
|
||||
RUN if [ "$driver" = "all" ] || [ "$driver" = "waifu2x_ncnn_vulkan" ] ; then \
|
||||
apt-fast install -y --no-install-recommends software-properties-common build-essential cmake libvulkan-dev glslang-tools libprotobuf-dev protobuf-compiler &&\
|
||||
git clone --recurse-submodules --depth=1 --progress https://github.com/Tencent/ncnn.git &&\
|
||||
cd ncnn &&\
|
||||
mkdir -p build &&\
|
||||
cd build &&\
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/usr -DNCNN_VULKAN=ON .. &&\
|
||||
make -j$(nproc) install &&\
|
||||
rm -rf ../../ncnn &&\
|
||||
cd / &&\
|
||||
# Compile waifu2x-ncnn-vulkan
|
||||
git clone --recurse-submodules --depth=1 --progress https://github.com/nihui/waifu2x-ncnn-vulkan.git &&\
|
||||
cd waifu2x-ncnn-vulkan &&\
|
||||
mkdir -p build &&\
|
||||
cd build &&\
|
||||
cmake ../src &&\
|
||||
make -j$(nproc) &&\
|
||||
# Incall waifu2x-ncnn-vulkan
|
||||
cd /waifu2x-ncnn-vulkan &&\
|
||||
mkdir waifu2x-ncnn-vulkan &&\
|
||||
mv models/models-cunet waifu2x-ncnn-vulkan/ &&\
|
||||
mv build/waifu2x-ncnn-vulkan waifu2x-ncnn-vulkan/ &&\
|
||||
mv waifu2x-ncnn-vulkan /video2x/ &&\
|
||||
rm -rf ../waifu2x-ncnn-vulkan ;\
|
||||
fi
|
||||
|
||||
RUN if [ "$driver" = "all" ] || [ "$driver" = "waifu2x_converter" ] ;\
|
||||
then \
|
||||
# Prerequisits for waifu2x-converter-cpp
|
||||
apt-fast install -y --no-install-recommends build-essential cmake libopencv-dev ocl-icd-opencl-dev &&\
|
||||
# Compile & Install
|
||||
git clone --recurse-submodules --depth=1 --progress https://github.com/DeadSix27/waifu2x-converter-cpp &&\
|
||||
cd waifu2x-converter-cpp &&\
|
||||
mkdir build &&\
|
||||
cd build &&\
|
||||
cmake .. &&\
|
||||
make -j$(nproc) &&\
|
||||
#ldconfig &&\
|
||||
cp -r ../models_rgb ./&&\
|
||||
cd / ;\
|
||||
fi
|
||||
|
||||
# Go!
|
||||
#COPY entrypoint.sh /
|
||||
#ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
WORKDIR /host
|
||||
ENTRYPOINT ["python3", "/video2x/src/video2x.py"]
|
||||
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES all
|
||||
# Docker image can ask questions now, if needed.
|
||||
ENV DEBIAN_FRONTEND teletype
|
||||
206
README.md
206
README.md
@@ -1,101 +1,115 @@
|
||||
<p align="center">
|
||||
<img src="https://user-images.githubusercontent.com/21986859/81489504-c7d1f780-9265-11ea-86c8-cc0316e2082d.png"/>
|
||||
<img src="https://user-images.githubusercontent.com/21986859/81626588-ae5ab800-93eb-11ea-918f-ebe98c2de40a.png"/>
|
||||
</p>
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
<img alt="Become a Patron!"
|
||||
src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png"
|
||||
href="https://www.patreon.com/bePatron?u=34970782"
|
||||
height=20 />
|
||||

|
||||
|
||||
<!--# Video2X Lossless Video Enlarger-->
|
||||
|
||||
### Official Discussion Group (Telegram): https://t.me/video2x
|
||||
|
||||
## [Download Builds](https://github.com/k4yt3x/video2x/releases) (Windows)
|
||||
|
||||
You can go to the [releases page](https://github.com/k4yt3x/video2x/releases) to download the latest builds of Video2X. The exe files will require no Python or Python module installation. There are two editions available.
|
||||
## [Download Stable/Beta Builds](https://github.com/k4yt3x/video2x/releases) (Windows)
|
||||
|
||||
- **`Full`**: full package comes pre-configured with **all** dependencies like `FFmpeg` and `waifu2x-caffe`.
|
||||
- **`Light`**: ligt package comes with only Video2X binaries and a template configuration file. The user will either have to run the setup script or install and configure dependencies themselves.
|
||||
|
||||
Go to the [Quick Start](#quick-start) section for usages.
|
||||
Go to the **[Quick Start](#quick-start)** section for usages.
|
||||
|
||||
### [Download From Mirror](https://files.k4yt3x.com/Projects/Video2X/)
|
||||
|
||||
In case you're unable to download the releases directly from GitHub, you can try downloading from the mirror site hosted by the author. Only releases will be updated in this directory, not nightly builds.
|
||||
|
||||
## [Download Nightly Builds](https://github.com/k4yt3x/video2x/actions) (Windows)
|
||||
|
||||
Nightly builds are built automatically every time a new commit is pushed to the master branch. The lates nightly build is always up-to-date with the latest version of the code, but is less stable and may contain bugs. Nightly builds are handled by GitHub's integrated CI/CD tool, GitHub Actions.
|
||||
|
||||
To download the latest nightly build, go to the [GitHub Actions](https://github.com/k4yt3x/video2x/actions) tab, enter the last run of workflow "Video2X Nightly Build, and download the artifacts generated from the run.
|
||||
|
||||
## Introduction
|
||||
|
||||
Video2X is a video upscaling software based on Waifu2X, Anime4K and SRMD written in Python 3. It upscales videos and restores details from low-resolution videos. Below is a side-by-side preview.
|
||||
Video2X is a video/GIF/image upscaling software based on Waifu2X, Anime4K, SRMD and RealSR written in Python 3. It upscales videos, GIFs and images, restoring details from low-resolution inputs. Video2X also accepts GIF input to video output and video input to GIF output.
|
||||
|
||||

|
||||
Currently, Video2X supports the following drivers (implementations of algorithms).
|
||||
|
||||
- **Waifu2X Caffe**: Caffe implementation of waifu2x
|
||||
- **Waifu2X Converter CPP**: CPP implementation of waifu2x based on OpenCL and OpenCV
|
||||
- **Waifu2X NCNN Vulkan**: NCNN implementation of waifu2x based on Vulkan API
|
||||
- **SRMD NCNN Vulkan**: NCNN implementation of SRMD based on Vulkan API
|
||||
- **RealSR NCNN Vulkan**: NCNN implementation of RealSR based on Vulkan API
|
||||
- **Anime4KCPP**: CPP implementation of Anime4K
|
||||
|
||||
### Video Upscaling
|
||||
|
||||
\
|
||||
*Upscale Comparison Demonstration*
|
||||
|
||||
**You can watch the whole demo video on YouTube: https://youtu.be/mGEfasQl2Zo**
|
||||
|
||||
Clip is from trailer of animated movie "千と千尋の神隠し". Copyright belongs to "株式会社スタジオジブリ (STUDIO GHIBLI INC.)". Will delete immediately if use of clip is in violation of copyright.
|
||||
|
||||
## Demo Videos
|
||||
### GIF Upscaling
|
||||
|
||||
This original input GIF is 160x120 in size. This image is downsized and accelerated to 20 FPS from its [original image](https://gfycat.com/craftyeasygoingankole-capoo-bug-cat).
|
||||
|
||||
\
|
||||
*Catfru original 160x120 GIF image*
|
||||
|
||||
Below is what it looks like after getting upscaled to 640x480 (4x) using Video2X.
|
||||
|
||||
\
|
||||
*Catfru 4x upscaled GIF*
|
||||
|
||||
### Image Upscaling
|
||||
|
||||
\
|
||||
*Image upscaling example*
|
||||
|
||||
[Original image](https://72915.tumblr.com/post/173793265673) from [nananicu@twitter](https://twitter.com/nananicu/status/994546266968281088), edited by K4YT3X.
|
||||
|
||||
## All Demo Videos
|
||||
|
||||
Below is a list of all the demo videos available.
|
||||
The list is sorted from new to old.
|
||||
|
||||
- **Spirited Away (360P to 4K)**
|
||||
- Original name: 千と千尋の神隠し
|
||||
- YouTube: https://youtu.be/mGEfasQl2Zo
|
||||
- Bilibili: https://www.bilibili.com/video/BV1V5411471i/
|
||||
- **Bad Apple!!**
|
||||
- YouTube: https://youtu.be/-RKLdCELgkQ
|
||||
- Bilibili: https://www.bilibili.com/video/BV1s5411s7xV/
|
||||
- **The Pet Girl of Sakurasou 240P to 1080P 60FPS**
|
||||
- Original name: さくら荘のペットな彼女
|
||||
- YouTube: https://youtu.be/M0vDI1HH2_Y
|
||||
- Bilibili: https://www.bilibili.com/video/BV14k4y167KP/
|
||||
- **Spirited Away (360P to 4K)**
|
||||
- Original name: 千と千尋の神隠し
|
||||
- YouTube: https://youtu.be/mGEfasQl2Zo
|
||||
- Bilibili: https://www.bilibili.com/video/BV1V5411471i/
|
||||
|
||||
---
|
||||
|
||||
## Screenshots
|
||||
|
||||
### Video2X GUI
|
||||
|
||||

|
||||
|
||||
\
|
||||
*Video2X GUI Screenshot*
|
||||
|
||||
### Video2X CLI
|
||||
|
||||

|
||||
|
||||
\
|
||||
*Video2X CLI Screenshot*
|
||||
|
||||
---
|
||||
|
||||
## Documentations
|
||||
|
||||
### [Video2X Wiki](https://github.com/k4yt3x/video2x/wiki)
|
||||
|
||||
You can find all detailed user-facing and developer-facing documentations in the [Video2X Wiki](https://github.com/k4yt3x/video2x/wiki). It covers everything from step-by-step instructions for beginners, to the code structure of this program for advanced users and developers. If this README page doesn't answer all your questions, the wiki page is where you should head to.
|
||||
|
||||
### [Run From Source](https://github.com/k4yt3x/video2x/wiki/Run-From-Source)
|
||||
|
||||
Instructions for how to run this program from source code.
|
||||
|
||||
### [Step-By-Step Tutorial](https://github.com/k4yt3x/video2x/wiki/Step-By-Step-Tutorial)
|
||||
|
||||
For those who want a detailed walk-through of how to use Video2X, you can head to the [Step-By-Step Tutorial](https://github.com/k4yt3x/video2x/wiki/Step-By-Step-Tutorial) wiki page. It includes almost every step you need to perform in order to enlarge your first video.
|
||||
|
||||
### [Drivers](https://github.com/k4yt3x/video2x/wiki/Drivers)
|
||||
|
||||
Go to the [Drivers](https://github.com/k4yt3x/video2x/wiki/Drivers) wiki page if you want to see a detailed description on the different types of drivers implemented by Video2X. This wiki page contains detailed difference between different drivers, and how to download and set each of them up for Video2X.
|
||||
|
||||
### [Q&A](https://github.com/k4yt3x/video2x/wiki/Q&A)
|
||||
|
||||
If you have any questions, first try visiting our [Q&A](https://github.com/k4yt3x/video2x/wiki/Q&A) page to see if your question is answered there. If not, open an issue and we will respond to your questions ASAP. Alternatively, you can also join our [Telegram discussion group](https://t.me/video2x) and ask your questions there.
|
||||
|
||||
---
|
||||
|
||||
### Sample Videos
|
||||
|
||||
If you can't find a video clip to begin with, or if you want to see a before-after comparison, we have prepared some sample clips for you. The quick start guide down below will also be based on the name of the sample clips.
|
||||
|
||||

|
||||
|
||||
\
|
||||
*Sample Upscale Videos*
|
||||
|
||||
- [Sample Video (240P) 4.54MB](https://files.k4yt3x.com/Resources/Videos/sample_input.mp4)
|
||||
@@ -122,19 +136,23 @@ Before running Video2X, you'll need to ensure you have installed the drivers' ex
|
||||
|
||||
The easiest way to run Video2X is to use the full build. Extract the full release zip file and you'll get these files.
|
||||
|
||||

|
||||
\
|
||||
*Video2X release files*
|
||||
|
||||
Simply double click on video2x_gui.exe to launch the GUI.
|
||||
|
||||

|
||||
\
|
||||
*Video2X GUI main tab*
|
||||
|
||||
Then, drag the videos you wish to upscale into the window and select the appropriate output path.
|
||||
|
||||

|
||||
\
|
||||
*Drag and drop file into Video2X GUI*
|
||||
|
||||
Tweak the settings if you want to, then hit the start button at the bottom and the upscale will start. Now you'll just have to wait for it to complete.
|
||||
|
||||

|
||||
\
|
||||
*Video2X started processing input files*
|
||||
|
||||
### Running Video2X (CLI)
|
||||
|
||||
@@ -162,40 +180,47 @@ To see a help page for driver-specific settings, use `-d` to select the driver a
|
||||
python video2x.py -d waifu2x_caffe -- --help
|
||||
```
|
||||
|
||||
### Running Video2X (Docker)
|
||||
|
||||
Video2X can be deployed via Docker.
|
||||
|
||||
```shell
|
||||
docker pull k4yt3x/video2x
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Recent Changes
|
||||
## Documentations
|
||||
|
||||
### 4.0.0 (May 5, 2020)
|
||||
### [Video2X Wiki](https://github.com/k4yt3x/video2x/wiki)
|
||||
|
||||
- Added internationalization support
|
||||
- Added language zh_CN (简体中文)
|
||||
- Language will change automatically according to system locale settings
|
||||
- Added support for [Anime4KCPP](https://github.com/TianZerL/Anime4KCPP) in replacement for Anime4K (Java)
|
||||
- Driver-specific settings can now be specified in the command line by specifying them after a `--`
|
||||
- All driver-specific settings are parsed by the corresponding driver
|
||||
- Modularized driver wrappers in Video2X
|
||||
- Cleaned up some clutters in the code
|
||||
You can find all detailed user-facing and developer-facing documentations in the [Video2X Wiki](https://github.com/k4yt3x/video2x/wiki). It covers everything from step-by-step instructions for beginners, to the code structure of this program for advanced users and developers. If this README page doesn't answer all your questions, the wiki page is where you should head to.
|
||||
|
||||
### 3.2.0 (April 26, 2020)
|
||||
### [Step-By-Step Tutorial](https://github.com/k4yt3x/video2x/wiki/Step-By-Step-Tutorial)
|
||||
|
||||
- Added support for [SRMD-NCNN-Vulkan](https://github.com/nihui/srmd-ncnn-vulkan)
|
||||
For those who want a detailed walk-through of how to use Video2X, you can head to the [Step-By-Step Tutorial](https://github.com/k4yt3x/video2x/wiki/Step-By-Step-Tutorial) wiki page. It includes almost every step you need to perform in order to enlarge your first video.
|
||||
|
||||
### 3.1.0 (February 26, 2020)
|
||||
### [Run From Source Code](https://github.com/k4yt3x/video2x/wiki/Run-From-Source-Code)
|
||||
|
||||
- Removed the redundant layer of multi-threading since multi-process has to be implemented for launching Windows PE files in sub-processes
|
||||
- Added support for graceful exit upon `KeyboardInterrupt` or termination signals
|
||||
- Other minor improvements such as replacing `' '.join(execute)` with `shlex.join(execute)`
|
||||
This wiki page contains all instructions for how you can run Video2X directly from Python source code.
|
||||
|
||||
### Setup Script 1.8.0 (May 5, 2020)
|
||||
### [Drivers](https://github.com/k4yt3x/video2x/wiki/Drivers)
|
||||
|
||||
- Added support for Anime4KCPP
|
||||
Go to the [Drivers](https://github.com/k4yt3x/video2x/wiki/Drivers) wiki page if you want to see a detailed description on the different types of drivers implemented by Video2X. This wiki page contains detailed difference between different drivers, and how to download and set each of them up for Video2X.
|
||||
|
||||
### [Q&A](https://github.com/k4yt3x/video2x/wiki/Q&A)
|
||||
|
||||
If you have any questions, first try visiting our [Q&A](https://github.com/k4yt3x/video2x/wiki/Q&A) page to see if your question is answered there. If not, open an issue and we will respond to your questions ASAP. Alternatively, you can also join our [Telegram discussion group](https://t.me/video2x) and ask your questions there.
|
||||
|
||||
### [History](https://github.com/k4yt3x/video2x/wiki/History)
|
||||
|
||||
Are you interested in how the idea of Video2X was born? Do you want to know the stories and histories behind Video2X's development? Come into this page.
|
||||
|
||||
---
|
||||
|
||||
# Full Usage
|
||||
|
||||
## General Options:
|
||||
## Video2X Options
|
||||
|
||||
### -h, --help
|
||||
show this help message and exit
|
||||
@@ -209,6 +234,17 @@ python video2x.py -d waifu2x_caffe -- --help
|
||||
### -c CONFIG, --config CONFIG
|
||||
video2x config file path
|
||||
|
||||
### --log LOG
|
||||
log file path (default: program_directory\video2x_%Y-%m-%d_%H-%M-%S.log)
|
||||
|
||||
### --nolog
|
||||
disable logging (default: False)
|
||||
|
||||
### -v, --version
|
||||
display version, lawful information and exit
|
||||
|
||||
## Upscaling Options
|
||||
|
||||
### -d DRIVER, --driver DRIVER
|
||||
upscaling driver (default: waifu2x_caffe)
|
||||
|
||||
@@ -218,24 +254,17 @@ Available options are:
|
||||
- waifu2x_converter_cpp
|
||||
- waifu2x_ncnn_vulkan
|
||||
- srmd_ncnn_vulkan
|
||||
- realsr_ncnn_vulkan
|
||||
- anime4kcpp
|
||||
|
||||
### -r RATIO, --ratio RATIO
|
||||
scaling ratio
|
||||
|
||||
### -p PROCESSES, --processes PROCESSES
|
||||
number of processes to use for upscaling (default: 1)
|
||||
|
||||
### -v, --version
|
||||
display version, lawful information and exit
|
||||
|
||||
## Scaling Options
|
||||
|
||||
### --width WIDTH
|
||||
output video width
|
||||
|
||||
### --height HEIGHT
|
||||
output video height
|
||||
|
||||
### -r RATIO, --ratio RATIO
|
||||
scaling ratio
|
||||
### --preserve_frames
|
||||
preserve extracted and upscaled frames (default: False)
|
||||
|
||||
---
|
||||
|
||||
@@ -257,14 +286,19 @@ This project relies on the following software and projects.
|
||||
- [waifu2x-converter-cpp](https://github.com/DeadSix27/waifu2x-converter-cpp)
|
||||
- [waifu2x-ncnn-vulkan](https://github.com/nihui/waifu2x-ncnn-vulkan)
|
||||
- [srmd-ncnn-vulkan](https://github.com/nihui/srmd-ncnn-vulkan)
|
||||
- [realsr-ncnn-vulkan](https://github.com/nihui/realsr-ncnn-vulkan)
|
||||
- [Anime4K](https://github.com/bloc97/Anime4K)
|
||||
- [Anime4KCPP](https://github.com/TianZerL/Anime4KCPP)
|
||||
- [Gifski](https://github.com/ImageOptim/gifski)
|
||||
|
||||
## Special Thanks
|
||||
|
||||
Appreciations given to the following code contributors:
|
||||
Appreciations given to the following personnel who have contributed significantly to the project (specifically the technical perspective).
|
||||
|
||||
- @BrianPetkovsek
|
||||
- @SAT3LL
|
||||
- [@BrianPetkovsek](https://github.com/BrianPetkovsek)
|
||||
- [@sat3ll](https://github.com/sat3ll)
|
||||
- [@ddouglas87](https://github.com/ddouglas87)
|
||||
- [@lhanjian](https://github.com/lhanjian)
|
||||
|
||||
## Related Projects
|
||||
|
||||
|
||||
21
_config.yml
21
_config.yml
@@ -1 +1,20 @@
|
||||
theme: jekyll-theme-slate
|
||||
# site settings
|
||||
locale: "en-US"
|
||||
title: "Video2X"
|
||||
title_separator: "-"
|
||||
subtitle: "Machine learning video/GIF/image upscaling"
|
||||
name: "K4YT3X"
|
||||
description: "An amazing website."
|
||||
url: "https://video2x.org"
|
||||
repository: "k4yt3x/video2x"
|
||||
|
||||
# set rendering style to be GitHub flavor
|
||||
kramdown:
|
||||
input: GFM
|
||||
|
||||
# use Minimal Mistakes theme
|
||||
remote_theme: mmistakes/minimal-mistakes
|
||||
|
||||
# plugin required for the Minimal Mistakes theme
|
||||
plugins:
|
||||
- jekyll-include-cache
|
||||
|
||||
46
src/bilogger.py
Normal file
46
src/bilogger.py
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Creator: Video2X Bidirectional Logger
|
||||
Author: K4YT3X
|
||||
Date Created: June 4, 2020
|
||||
Last Modified: June 4, 2020
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import _io
|
||||
import pathlib
|
||||
|
||||
|
||||
class BiLogger(object):
|
||||
""" A bidirectional logger that both prints the output
|
||||
and log all output to file.
|
||||
|
||||
Original code from: https://stackoverflow.com/a/14906787
|
||||
"""
|
||||
|
||||
def __init__(self, terminal: _io.TextIOWrapper, logfile: pathlib.Path):
|
||||
""" initialize BiLogger
|
||||
|
||||
Args:
|
||||
terminal (_io.TextIOWrapper): original terminal IO wrapper
|
||||
logfile (pathlib.Path): target log file path object
|
||||
"""
|
||||
self.terminal = terminal
|
||||
self.log = logfile.open(mode='a+')
|
||||
|
||||
def write(self, message: str):
|
||||
""" write message to original terminal output and log file
|
||||
|
||||
Args:
|
||||
message (str): message to write
|
||||
"""
|
||||
self.terminal.write(message)
|
||||
self.terminal.flush()
|
||||
self.log.write(message)
|
||||
self.log.flush()
|
||||
|
||||
def flush(self):
|
||||
""" flush logger (for compability only)
|
||||
"""
|
||||
pass
|
||||
@@ -2,14 +2,14 @@
|
||||
Name: Video2X Build Script
|
||||
Creator: K4YT3X
|
||||
Date Created: May 6, 2020
|
||||
Last Modified: May 7, 2020
|
||||
Last Modified: May 13, 2020
|
||||
|
||||
Description: A PowerShell script that will build Video2X
|
||||
executable (PE) releases automatically using PyInstaller.
|
||||
This script is currently only tuned for K4YT3X's environment.
|
||||
|
||||
To start a PowerShell session with execution policy bypass
|
||||
powershell –ExecutionPolicy Bypass
|
||||
powershell -ExecutionPolicy Bypass
|
||||
#>
|
||||
|
||||
if ($args.count -ne 1){
|
||||
@@ -29,6 +29,7 @@ Building Video2X release $($VIDEO2X_VERSION)"
|
||||
Write-Host -ForegroundColor White "`nBuilding Video2X CLI"
|
||||
pyinstaller --noconfirm --log-level=WARN `
|
||||
--onefile `
|
||||
--add-data="locale;locale" `
|
||||
--add-data="wrappers;wrappers" `
|
||||
--icon="images\video2x.ico" `
|
||||
video2x.py
|
||||
@@ -48,6 +49,9 @@ pyinstaller --noconfirm --log-level=WARN `
|
||||
Write-Host -ForegroundColor White "`nBuilding Video2X setup script"
|
||||
pyinstaller --noconfirm --log-level=WARN `
|
||||
--onefile `
|
||||
--additional-hooks-dir "pyinstaller\hooks" `
|
||||
--add-data="locale;locale" `
|
||||
--add-data="pyinstaller\7z1900-extra;7z" `
|
||||
--icon="images\video2x.ico" `
|
||||
video2x_setup.py
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 14 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,8 +5,8 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"POT-Creation-Date: 2020-05-11 04:39-0400\n"
|
||||
"PO-Revision-Date: 2020-05-11 04:40-0400\n"
|
||||
"POT-Creation-Date: 2020-05-22 17:51-0400\n"
|
||||
"PO-Revision-Date: 2020-05-22 17:54-0400\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: zh_CN\n"
|
||||
@@ -21,252 +21,304 @@ msgstr ""
|
||||
msgid "Upscaling Progress"
|
||||
msgstr "放大进度"
|
||||
|
||||
#: upscaler.py:104
|
||||
#: upscaler.py:110
|
||||
msgid "Specified or default cache directory is a file/link"
|
||||
msgstr "指定或默认的缓存目录是文件/链接"
|
||||
|
||||
#: upscaler.py:110
|
||||
#: upscaler.py:116
|
||||
msgid "Creating cache directory {}"
|
||||
msgstr "创建缓存目录 {}"
|
||||
|
||||
#: upscaler.py:113
|
||||
#: upscaler.py:119
|
||||
msgid "Unable to create {}"
|
||||
msgstr "无法创建 {}"
|
||||
|
||||
#: upscaler.py:118
|
||||
#: upscaler.py:124
|
||||
msgid "Extracted frames are being saved to: {}"
|
||||
msgstr "提取的帧将被保存到:{}"
|
||||
|
||||
#: upscaler.py:120
|
||||
#: upscaler.py:126
|
||||
msgid "Upscaled frames are being saved to: {}"
|
||||
msgstr "已放大的帧将被保存到:{}"
|
||||
|
||||
#: upscaler.py:130
|
||||
#: upscaler.py:136
|
||||
msgid "Cleaning up cache directory: {}"
|
||||
msgstr "清理缓存目录:{}"
|
||||
|
||||
#: upscaler.py:133
|
||||
#: upscaler.py:141
|
||||
msgid "Unable to delete: {}"
|
||||
msgstr "无法删除:{}"
|
||||
|
||||
#: upscaler.py:139 upscaler.py:154 upscaler.py:165
|
||||
#: upscaler.py:147 upscaler.py:162 upscaler.py:173
|
||||
msgid "Input and output path type mismatch"
|
||||
msgstr "输入和输出路径类型不匹配"
|
||||
|
||||
#: upscaler.py:140
|
||||
#: upscaler.py:148
|
||||
msgid "Input is multiple files but output is not directory"
|
||||
msgstr "输入是多个文件,但输出不是目录"
|
||||
|
||||
#: upscaler.py:144
|
||||
#: upscaler.py:152
|
||||
msgid "Input path {} is neither a file nor a directory"
|
||||
msgstr "输入路径 {} 既不是文件也不是目录"
|
||||
|
||||
#: upscaler.py:148 upscaler.py:170
|
||||
#: upscaler.py:156 upscaler.py:178
|
||||
msgid "Input directory and output directory cannot be the same"
|
||||
msgstr "输入目录和输出目录不能相同"
|
||||
|
||||
#: upscaler.py:155
|
||||
#: upscaler.py:163
|
||||
msgid "Input is single file but output is directory"
|
||||
msgstr "所选的输入路径是单个文件,但输出路径是目录"
|
||||
|
||||
#: upscaler.py:158
|
||||
#: upscaler.py:166
|
||||
msgid "No suffix found in output file path"
|
||||
msgstr "在输出文件路径中未找到后缀"
|
||||
|
||||
#: upscaler.py:159
|
||||
msgid "Suffix must be specified for FFmpeg"
|
||||
msgstr "必须为 FFmpeg 指定后缀"
|
||||
#: upscaler.py:167
|
||||
msgid "Suffix must be specified"
|
||||
msgstr "必须指定文件后缀"
|
||||
|
||||
#: upscaler.py:166
|
||||
#: upscaler.py:174
|
||||
msgid "Input is directory but output is existing single file"
|
||||
msgstr "输入是目录,但输出是现有的单个文件"
|
||||
|
||||
#: upscaler.py:175
|
||||
#: upscaler.py:183
|
||||
msgid "Input path is neither a file nor a directory"
|
||||
msgstr "输入路径既不是文件也不是目录"
|
||||
|
||||
#: upscaler.py:184
|
||||
#: upscaler.py:192
|
||||
msgid "FFmpeg or FFprobe cannot be found under the specified path"
|
||||
msgstr "在指定的路径下找不到 FFmpeg 或 FFprobe"
|
||||
|
||||
#: upscaler.py:185 upscaler.py:195
|
||||
#: upscaler.py:193 upscaler.py:203
|
||||
msgid "Please check the configuration file settings"
|
||||
msgstr "请检查配置文件设置"
|
||||
|
||||
#: upscaler.py:194
|
||||
#: upscaler.py:202
|
||||
msgid "Specified driver executable directory doesn't exist"
|
||||
msgstr "指定驱动的可执行文件不存在"
|
||||
|
||||
#: upscaler.py:221
|
||||
#: upscaler.py:229
|
||||
msgid "Failed to parse driver argument: {}"
|
||||
msgstr "解析驱动程序参数失败:{}"
|
||||
|
||||
#: upscaler.py:253
|
||||
#: upscaler.py:261
|
||||
msgid "Unrecognized driver: {}"
|
||||
msgstr "无法识别的驱动名称:{}"
|
||||
|
||||
#: upscaler.py:293
|
||||
#: upscaler.py:301
|
||||
msgid "Starting progress monitor"
|
||||
msgstr "启动进度监视器"
|
||||
|
||||
#: upscaler.py:298
|
||||
#: upscaler.py:306
|
||||
msgid "Starting upscaled image cleaner"
|
||||
msgstr "启动已放大图像清理程序"
|
||||
|
||||
#: upscaler.py:307 upscaler.py:324
|
||||
#: upscaler.py:315 upscaler.py:332
|
||||
msgid "Killing progress monitor"
|
||||
msgstr "终结进度监视器"
|
||||
|
||||
#: upscaler.py:310 upscaler.py:327
|
||||
#: upscaler.py:318 upscaler.py:335
|
||||
msgid "Killing upscaled image cleaner"
|
||||
msgstr "终结已放大图像清理程序"
|
||||
|
||||
#: upscaler.py:331
|
||||
#: upscaler.py:339
|
||||
msgid "Terminating all processes"
|
||||
msgstr "正在终止所有进程"
|
||||
|
||||
#: upscaler.py:338
|
||||
#: upscaler.py:346
|
||||
msgid "Main process waiting for subprocesses to exit"
|
||||
msgstr "主进程开始等待子进程结束"
|
||||
|
||||
#: upscaler.py:357 upscaler.py:361
|
||||
#: upscaler.py:365 upscaler.py:369
|
||||
msgid "Subprocess {} exited with code {}"
|
||||
msgstr "子进程 {} 结束,返回码 {}"
|
||||
|
||||
#: upscaler.py:367
|
||||
#: upscaler.py:375
|
||||
msgid "Stop signal received"
|
||||
msgstr "收到停止信号"
|
||||
|
||||
#: upscaler.py:372
|
||||
#: upscaler.py:380
|
||||
msgid "Subprocess execution ran into an error"
|
||||
msgstr "子进程执行遇到错误"
|
||||
|
||||
#: upscaler.py:421
|
||||
msgid "Upscaling single video file: {}"
|
||||
msgstr "放大单个视频文件:{}"
|
||||
#: upscaler.py:410
|
||||
msgid "Loading files into processing queue"
|
||||
msgstr "正在将文件添加到处理队列中"
|
||||
|
||||
#: upscaler.py:443 upscaler.py:502
|
||||
msgid "Starting to upscale extracted images"
|
||||
msgstr "开始对提取的帧进行放大"
|
||||
#: upscaler.py:415
|
||||
msgid "Loading files from multiple paths"
|
||||
msgstr "正在从多个路径中导入文件"
|
||||
|
||||
#: upscaler.py:448 upscaler.py:504
|
||||
#: upscaler.py:416 upscaler.py:435 upscaler.py:442
|
||||
msgid "Input path(s): {}"
|
||||
msgstr "输入路径:{}"
|
||||
|
||||
#: upscaler.py:434
|
||||
msgid "Loading single file"
|
||||
msgstr "正在导入单个文件"
|
||||
|
||||
#: upscaler.py:441
|
||||
msgid "Loading files from directory"
|
||||
msgstr "正在从文件夹中导入文件"
|
||||
|
||||
#: upscaler.py:455
|
||||
msgid "Loaded files into processing queue"
|
||||
msgstr "文件已添加到处理队列"
|
||||
|
||||
#: upscaler.py:458
|
||||
msgid "Input file: {}"
|
||||
msgstr "输入文件:{}"
|
||||
|
||||
#: upscaler.py:485
|
||||
msgid "Starting to upscale image"
|
||||
msgstr "开始放大图像"
|
||||
|
||||
#: upscaler.py:488 upscaler.py:550
|
||||
msgid "Upscaling completed"
|
||||
msgstr "放大完成"
|
||||
|
||||
#: upscaler.py:457
|
||||
#: upscaler.py:502
|
||||
msgid "Reading video information"
|
||||
msgstr "读取视频信息"
|
||||
|
||||
#: upscaler.py:471
|
||||
#: upscaler.py:516
|
||||
msgid "Aborting: No video stream found"
|
||||
msgstr "程序中止:文件中未找到视频流"
|
||||
|
||||
#: upscaler.py:490
|
||||
msgid "Unsupported pixel format: {}"
|
||||
msgstr "不支持的像素格式:{}"
|
||||
|
||||
#: upscaler.py:493
|
||||
#: upscaler.py:521
|
||||
msgid "Framerate: {}"
|
||||
msgstr "帧率:{}"
|
||||
|
||||
#: upscaler.py:507
|
||||
msgid "Converting extracted frames into video"
|
||||
msgstr "正在将提取的帧转换为视频"
|
||||
#: upscaler.py:538
|
||||
msgid "Unsupported pixel format: {}"
|
||||
msgstr "不支持的像素格式:{}"
|
||||
|
||||
#: upscaler.py:514
|
||||
#: upscaler.py:548
|
||||
msgid "Starting to upscale extracted frames"
|
||||
msgstr "开始对提取的帧进行放大"
|
||||
|
||||
#: upscaler.py:555
|
||||
msgid "File {} ({}) neither an image nor a video"
|
||||
msgstr "文件 {} ({}) 既不是图片也不是视频"
|
||||
|
||||
#: upscaler.py:556
|
||||
msgid "Skipping this file"
|
||||
msgstr "将跳过此文件"
|
||||
|
||||
#: upscaler.py:566
|
||||
msgid "Converting extracted frames into GIF image"
|
||||
msgstr "正在将提取的帧转换为 GIF"
|
||||
|
||||
#: upscaler.py:570 upscaler.py:579
|
||||
msgid "Conversion completed"
|
||||
msgstr "转换已完成"
|
||||
|
||||
#: upscaler.py:518
|
||||
#: upscaler.py:575
|
||||
msgid "Converting extracted frames into video"
|
||||
msgstr "正在将提取的帧转换为视频"
|
||||
|
||||
#: upscaler.py:583
|
||||
msgid "Migrating audio, subtitles and other streams to upscaled video"
|
||||
msgstr "正在将音频、字幕和其他流迁移到放大后的视频"
|
||||
|
||||
#: upscaler.py:527
|
||||
#: upscaler.py:593
|
||||
msgid "Failed to migrate streams"
|
||||
msgstr "迁移流失败"
|
||||
|
||||
#: upscaler.py:528
|
||||
#: upscaler.py:594
|
||||
msgid "Trying to output video without additional streams"
|
||||
msgstr "正在尝试输出不含其他流的视频"
|
||||
|
||||
#: upscaler.py:535
|
||||
msgid "Output video file exists, aborting"
|
||||
msgstr "输出目标文件已存在,取消输出"
|
||||
#: upscaler.py:610
|
||||
msgid "Output video file exists"
|
||||
msgstr "输出目标文件已存在"
|
||||
|
||||
#: upscaler.py:539
|
||||
#: upscaler.py:614
|
||||
msgid "Created temporary directory to contain file"
|
||||
msgstr "为文件创建了临时目录"
|
||||
|
||||
#: upscaler.py:617
|
||||
msgid "Writing intermediate file to: {}"
|
||||
msgstr "正在将中间视频文件写入至:{}"
|
||||
|
||||
#: video2x.py:84
|
||||
#: video2x.py:85
|
||||
msgid ""
|
||||
"Video2X Version: {}\n"
|
||||
"Video2X CLI Version: {}\n"
|
||||
"Upscaler Version: {}\n"
|
||||
"Author: K4YT3X\n"
|
||||
"License: GNU GPL v3\n"
|
||||
"Github Page: https://github.com/k4yt3x/video2x\n"
|
||||
"Contact: k4yt3x@k4yt3x.com"
|
||||
msgstr ""
|
||||
"Video2X 版本: {}\n"
|
||||
"放大组件版本:{}\n"
|
||||
"作者: K4YT3X\n"
|
||||
"开源许可: GNU GPL v3\n"
|
||||
"GitHub 主页:https://github.com/k4yt3x/video2x\n"
|
||||
"联系方式:k4yt3x@k4yt3x.com"
|
||||
|
||||
#: video2x.py:106
|
||||
#: video2x.py:108
|
||||
msgid "Video2X Options"
|
||||
msgstr "Video2X 选项"
|
||||
|
||||
#: video2x.py:107
|
||||
#: video2x.py:109
|
||||
msgid "show this help message and exit"
|
||||
msgstr "显示此帮助消息并退出"
|
||||
|
||||
#: video2x.py:108
|
||||
#: video2x.py:110
|
||||
msgid "source video file/directory"
|
||||
msgstr "源视频文件/目录"
|
||||
|
||||
#: video2x.py:109
|
||||
#: video2x.py:111
|
||||
msgid "output video file/directory"
|
||||
msgstr "输出视频文件/目录"
|
||||
|
||||
#: video2x.py:110
|
||||
#: video2x.py:112
|
||||
msgid "video2x config file path"
|
||||
msgstr "video2x 配置文件路径"
|
||||
|
||||
#: video2x.py:112
|
||||
#: video2x.py:114
|
||||
msgid "display version, lawful information and exit"
|
||||
msgstr "显示版本和法律信息并退出"
|
||||
|
||||
#: video2x.py:115
|
||||
#: video2x.py:117
|
||||
msgid "Upscaling Options"
|
||||
msgstr "视频放大选项"
|
||||
|
||||
#: video2x.py:116
|
||||
#: video2x.py:118
|
||||
msgid "upscaling driver"
|
||||
msgstr "视频放大驱动"
|
||||
|
||||
#: video2x.py:117
|
||||
#: video2x.py:119
|
||||
msgid "scaling ratio"
|
||||
msgstr "缩放比"
|
||||
|
||||
#: video2x.py:118
|
||||
#: video2x.py:120
|
||||
msgid "number of processes to use for upscaling"
|
||||
msgstr "并发进程数"
|
||||
|
||||
#: video2x.py:119
|
||||
#: video2x.py:121
|
||||
msgid "preserve extracted and upscaled frames"
|
||||
msgstr "保留提取的和放大的帧"
|
||||
|
||||
#: video2x.py:159
|
||||
#: video2x.py:161
|
||||
msgid "This file cannot be imported"
|
||||
msgstr "此文件无法被当作模块导入"
|
||||
|
||||
#: video2x.py:229
|
||||
#: video2x.py:236
|
||||
msgid "Program completed, taking {} seconds"
|
||||
msgstr "程序执行完毕,总计花费 {} 秒"
|
||||
|
||||
#: video2x.py:232
|
||||
#: video2x.py:239
|
||||
msgid "An exception has occurred"
|
||||
msgstr "发生了异常"
|
||||
|
||||
#~ msgid "Anime4KCPP doesn't yet support GIF processing"
|
||||
#~ msgstr "Anime4KCPP 尚不支持GIF处理"
|
||||
|
||||
#~ msgid "Starting to upscale video with Anime4KCPP"
|
||||
#~ msgstr "开始用 Anime4KCPP 放大视频"
|
||||
|
||||
#~ msgid "output video width"
|
||||
#~ msgstr "输出视频宽度"
|
||||
|
||||
@@ -293,6 +345,3 @@ msgstr "发生了异常"
|
||||
|
||||
#~ msgid "You must specify both width and height"
|
||||
#~ msgstr "您必须同时指定宽度和高度"
|
||||
|
||||
#~ msgid "Upscaling videos in directory: {}"
|
||||
#~ msgstr "放大该文件夹中的所有视频:{}"
|
||||
|
||||
0
src/progress_monitor.py
Normal file → Executable file
0
src/progress_monitor.py
Normal file → Executable file
BIN
src/pyinstaller/7z1900-extra/7za.dll
Normal file
BIN
src/pyinstaller/7z1900-extra/7za.dll
Normal file
Binary file not shown.
BIN
src/pyinstaller/7z1900-extra/7za.exe
Normal file
BIN
src/pyinstaller/7z1900-extra/7za.exe
Normal file
Binary file not shown.
BIN
src/pyinstaller/7z1900-extra/7zxa.dll
Normal file
BIN
src/pyinstaller/7z1900-extra/7zxa.dll
Normal file
Binary file not shown.
85
src/pyinstaller/7z1900-extra/Far/7-ZipEng.hlf
Normal file
85
src/pyinstaller/7z1900-extra/Far/7-ZipEng.hlf
Normal file
@@ -0,0 +1,85 @@
|
||||
.Language=English,English
|
||||
.PluginContents=7-Zip Plugin
|
||||
|
||||
@Contents
|
||||
$^#7-Zip Plugin 19.00#
|
||||
$^#Copyright (c) 1999-2019 Igor Pavlov#
|
||||
This FAR module performs transparent #archive# processing.
|
||||
Files in the archive are handled in the same manner as if they
|
||||
were in a folder.
|
||||
|
||||
~Extracting from the archive~@Extract@
|
||||
|
||||
~Add files to the archive~@Update@
|
||||
|
||||
~7-Zip Plugin configuration~@Config@
|
||||
|
||||
|
||||
Web site: #www.7-zip.org#
|
||||
|
||||
@Extract
|
||||
$ #Extracting from the archive#
|
||||
|
||||
In this dialog you may enter extracting mode.
|
||||
|
||||
Path mode
|
||||
|
||||
#Full pathnames# Extract files with full pathnames.
|
||||
|
||||
#Current pathnames# Extract files with all relative paths.
|
||||
|
||||
#No pathnames# Extract files without folder paths.
|
||||
|
||||
|
||||
Overwrite mode
|
||||
|
||||
#Ask before overwrite# Ask before overwriting existing files.
|
||||
|
||||
#Overwrite without prompt# Overwrite existing files without prompt.
|
||||
|
||||
#Skip existing files# Skip extracting of existing files.
|
||||
|
||||
|
||||
Files
|
||||
|
||||
#Selected files# Extract only selected files.
|
||||
|
||||
#All files# Extract all files from archive.
|
||||
|
||||
@Update
|
||||
$ #Add files to the archive#
|
||||
|
||||
This dialog allows you to specify options for process of updating archive.
|
||||
|
||||
|
||||
Compression method
|
||||
|
||||
#Store# Files will be copied to archive without compression.
|
||||
|
||||
#Normal# Files will be compressed.
|
||||
|
||||
#Maximum# Files will be compressed with method that gives
|
||||
maximum compression ratio.
|
||||
|
||||
|
||||
Update mode
|
||||
|
||||
#Add and replace files# Add all specified files to the archive.
|
||||
|
||||
#Update and add files# Update older files in the archive and add
|
||||
files that are new to the archive.
|
||||
|
||||
#Freshen existing files# Update specified files in the archive that
|
||||
are older than the selected disk files.
|
||||
|
||||
#Synchronize files# Replace specified files only if
|
||||
added files are newer. Always add those
|
||||
files, which are not present in the
|
||||
archive. Delete from archive those files,
|
||||
which are not present on the disk.
|
||||
|
||||
@Config
|
||||
$ #7-Zip Plugin configuration#
|
||||
In this dialog you may change following parameters:
|
||||
|
||||
#Plugin is used by default# Plugin is used by default.
|
||||
211
src/pyinstaller/7z1900-extra/Far/7-ZipEng.lng
Normal file
211
src/pyinstaller/7z1900-extra/Far/7-ZipEng.lng
Normal file
@@ -0,0 +1,211 @@
|
||||
.Language=English,English
|
||||
|
||||
"Ok"
|
||||
"&Cancel"
|
||||
|
||||
"Warning"
|
||||
"Error"
|
||||
|
||||
"Format"
|
||||
|
||||
"Properties"
|
||||
|
||||
"Yes"
|
||||
"No"
|
||||
|
||||
"Get password"
|
||||
"Enter password"
|
||||
|
||||
"Extract"
|
||||
"&Extract to"
|
||||
|
||||
"Path mode"
|
||||
"&Full pathnames"
|
||||
"C&urrent pathnames"
|
||||
"&No pathnames"
|
||||
|
||||
"Overwrite mode"
|
||||
"As&k before overwrite"
|
||||
"&Overwrite without prompt"
|
||||
"Sk&ip existing files"
|
||||
"A&uto rename"
|
||||
"A&uto rename existing files"
|
||||
|
||||
"Extract"
|
||||
"&Selected files"
|
||||
"A&ll files"
|
||||
|
||||
"&Password"
|
||||
|
||||
"Extr&act"
|
||||
"&Cancel"
|
||||
|
||||
"Can not open output file '%s'."
|
||||
|
||||
"Unsupported compression method for '%s'."
|
||||
"CRC failed in '%s'."
|
||||
"Data error in '%s'."
|
||||
"CRC failed in encrypted file '%s'. Wrong password?"
|
||||
"Data error in encrypted file '%s'. Wrong password?"
|
||||
|
||||
"Confirm File Replace"
|
||||
"Destination folder already contains processed file."
|
||||
"Would you like to replace the existing file"
|
||||
"with this one"
|
||||
|
||||
"bytes"
|
||||
"modified on"
|
||||
|
||||
|
||||
"&Yes"
|
||||
"Yes to &All"
|
||||
"&No"
|
||||
"No to A&ll"
|
||||
"A&uto rename"
|
||||
"&Cancel"
|
||||
|
||||
|
||||
"Update operations are not supported for this archive."
|
||||
|
||||
|
||||
"Delete from archive"
|
||||
"Delete \"%.40s\" from the archive"
|
||||
"Delete selected files from the archive"
|
||||
"Delete %d files from the archive"
|
||||
"Delete"
|
||||
"Cancel"
|
||||
|
||||
"Add files to archive"
|
||||
|
||||
"Add to %s a&rchive:"
|
||||
|
||||
"Compression method"
|
||||
"&Store"
|
||||
"Fas&test"
|
||||
"&Fast"
|
||||
"&Normal"
|
||||
"&Maximum"
|
||||
"&Ultra"
|
||||
|
||||
"Update mode"
|
||||
"A&dd and replace files"
|
||||
"&Update and add files"
|
||||
"&Freshen existing files"
|
||||
"S&ynchronize files"
|
||||
|
||||
"&Add"
|
||||
"Se&lect archiver"
|
||||
|
||||
"Select archive format"
|
||||
|
||||
"Wait"
|
||||
"Reading the archive"
|
||||
"Extracting from the archive"
|
||||
"Deleting from the archive"
|
||||
"Updating the archive"
|
||||
|
||||
"Move operation is not supported"
|
||||
|
||||
"7-Zip"
|
||||
"7-Zip (add to archive)"
|
||||
|
||||
"7-Zip"
|
||||
|
||||
"Plugin is used by default"
|
||||
|
||||
"0"
|
||||
"1"
|
||||
"2"
|
||||
"Path"
|
||||
"Name"
|
||||
"Extension"
|
||||
"Is Folder"
|
||||
"Size"
|
||||
"Packed Size"
|
||||
"Attributes"
|
||||
"Created"
|
||||
"Accessed"
|
||||
"Modified"
|
||||
"Solid"
|
||||
"Commented"
|
||||
"Encrypted"
|
||||
"Splited Before"
|
||||
"Splited After"
|
||||
"Dictionary Size"
|
||||
"CRC"
|
||||
"Type"
|
||||
"Anti"
|
||||
"Method"
|
||||
"Host OS"
|
||||
"File System"
|
||||
"User"
|
||||
"Group"
|
||||
"Block"
|
||||
"Comment"
|
||||
"Position"
|
||||
"Path Prefix"
|
||||
"Folders"
|
||||
"Files"
|
||||
"Version"
|
||||
"Volume"
|
||||
"Multivolume"
|
||||
"Offset"
|
||||
"Links"
|
||||
"Blocks"
|
||||
"Volumes"
|
||||
"Time Type"
|
||||
"64-bit"
|
||||
"Big-endian"
|
||||
"CPU"
|
||||
"Physical Size"
|
||||
"Headers Size"
|
||||
"Checksum"
|
||||
"Characteristics"
|
||||
"Virtual Address"
|
||||
"ID"
|
||||
"Short Name"
|
||||
"Creator Application"
|
||||
"Sector Size"
|
||||
"Mode"
|
||||
"Symbolic Link"
|
||||
"Error"
|
||||
"Total Size"
|
||||
"Free Space"
|
||||
"Cluster Size"
|
||||
"Label"
|
||||
"Local Name"
|
||||
"Provider"
|
||||
"NT Security"
|
||||
"Alternate Stream"
|
||||
"Aux"
|
||||
"Deleted"
|
||||
"Tree"
|
||||
"SHA-1"
|
||||
"SHA-256"
|
||||
"Error Type"
|
||||
"Errors"
|
||||
"Errors"
|
||||
"Warnings"
|
||||
"Warning"
|
||||
"Streams"
|
||||
"Alternate Streams"
|
||||
"Alternate Streams Size"
|
||||
"Virtual Size"
|
||||
"Unpack Size"
|
||||
"Total Physical Size"
|
||||
"Volume Index"
|
||||
"SubType"
|
||||
"Short Comment"
|
||||
"Code Page"
|
||||
"Is not archive type"
|
||||
"Physical Size can't be detected"
|
||||
"Zeros Tail Is Allowed"
|
||||
"Tail Size"
|
||||
"Embedded Stub Size"
|
||||
"Link"
|
||||
"Hard Link"
|
||||
"iNode"
|
||||
"Stream ID"
|
||||
"Read-only"
|
||||
"Out Name"
|
||||
"Copy Link"
|
||||
BIN
src/pyinstaller/7z1900-extra/Far/7-ZipFar.dll
Normal file
BIN
src/pyinstaller/7z1900-extra/Far/7-ZipFar.dll
Normal file
Binary file not shown.
BIN
src/pyinstaller/7z1900-extra/Far/7-ZipFar64.dll
Normal file
BIN
src/pyinstaller/7z1900-extra/Far/7-ZipFar64.dll
Normal file
Binary file not shown.
84
src/pyinstaller/7z1900-extra/Far/7-ZipRus.hlf
Normal file
84
src/pyinstaller/7z1900-extra/Far/7-ZipRus.hlf
Normal file
@@ -0,0 +1,84 @@
|
||||
.Language=Russian,Russian (<28><><EFBFBD>᪨<EFBFBD>)
|
||||
.PluginContents=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 7-Zip
|
||||
|
||||
@Contents
|
||||
$^#7-Zip Plugin 19.00#
|
||||
$^#Copyright (c) 1999-2019 Igor Pavlov#
|
||||
<20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FAR <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠡ<><E0A0A1><EFBFBD><EFBFBD><EFBFBD> <20> #<23><>娢<EFBFBD><E5A8A2><EFBFBD>#. <20><><EFBFBD> <20><><EFBFBD>짮<EFBFBD><ECA7AE>⥫<EFBFBD>
|
||||
䠩<EFBFBD><EFBFBD> <20> <20><>娢<EFBFBD><E5A8A2> <20><> <20>⫨<EFBFBD><E2ABA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 䠩<><E4A0A9><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
|
||||
~<7E><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20><> <20><>娢<EFBFBD>~@Extract@
|
||||
|
||||
~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20> <20><>娢<EFBFBD>~@Update@
|
||||
|
||||
~<7E><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> <20><>娢<EFBFBD><E5A8A2><EFBFBD>~@Config@
|
||||
|
||||
|
||||
Web site: #www.7-zip.org#
|
||||
|
||||
@Extract
|
||||
$ #<23><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20><> <20><>娢<EFBFBD>#
|
||||
<20> <20>⮬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
०<EFBFBD><EFBFBD> <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
<20><><EFBFBD><EFBFBD>
|
||||
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD># <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD>묨 <20><><EFBFBD>ﬨ.
|
||||
|
||||
#<23>⭮<EFBFBD><E2ADAE>⥫<EFBFBD><E2A5AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD># <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>⭮<EFBFBD><E2ADAE>⥫<EFBFBD><E2A5AB>묨 <20><><EFBFBD>ﬨ.
|
||||
|
||||
#<23><><EFBFBD> <20><>⥩# <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>⥩.
|
||||
|
||||
|
||||
<20><>१<EFBFBD><E0A5A7><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
#<23><><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> <20><><EFBFBD>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD># <20><><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> <20><><EFBFBD>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD> <20><>
|
||||
<20><>१<EFBFBD><E0A5A7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>饣<EFBFBD> 䠩<><E4A0A9>.
|
||||
|
||||
#<23><><EFBFBD> <20><><EFBFBD>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD># <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騩 䠩<>
|
||||
<20><><EFBFBD> <20><><EFBFBD>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD>.
|
||||
|
||||
#<23>ய<EFBFBD>᪠<EFBFBD><E1AAA0># <20>ய<EFBFBD>᪠<EFBFBD><E1AAA0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騥 䠩<><E4A0A9>.
|
||||
|
||||
|
||||
<20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
#<23><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> 䠩<><E4A0A9># <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⮫쪮 <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20><> <20><>娢<EFBFBD>.
|
||||
|
||||
#<23><><EFBFBD> 䠩<><E4A0A9># <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> 䠩<><E4A0A9> <20><> <20><>娢<EFBFBD>.
|
||||
|
||||
@Update
|
||||
$ #<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20> <20><>娢<EFBFBD>#
|
||||
|
||||
<20> <20>⮬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ०<><E0A5A6> 㯠<><E3AFA0><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
|
||||
<20><>⮤ ᦠ<><E1A6A0><EFBFBD>:
|
||||
|
||||
#<23><><EFBFBD> ᦠ<><E1A6A0><EFBFBD># <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <><E1AAAE><EFBFBD><E0AEA2><EFBFBD> <20><><EFBFBD> ᦠ<><E1A6A0><EFBFBD>.
|
||||
|
||||
#<23><>ଠ<EFBFBD>쭮<EFBFBD> ᦠ⨥# <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ᦠ<><E1A6A0>.
|
||||
|
||||
#<23><><EFBFBD>ᨬ<EFBFBD><E1A8AC>쭮<EFBFBD> ᦠ⨥# <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ᦠ<><E1A6A0> <20> <20><><EFBFBD>ᨬ<EFBFBD><E1A8AC>쭮<EFBFBD>
|
||||
<20>⥯<EFBFBD><E2A5AF><EFBFBD><EFBFBD> ᦠ<><E1A6A0><EFBFBD>.
|
||||
|
||||
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD># <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> 䠩<><E4A0A9> <20> <20><>娢.
|
||||
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD># <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ॢ訥 䠩<><E4A0A9> <20> <20><>娢<EFBFBD> <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><>娢<EFBFBD>.
|
||||
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD># <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ॢ訥 䠩<><E4A0A9> <20> <20><>娢<EFBFBD>.
|
||||
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><E0AEAD><EFBFBD><EFBFBD><E0AEA2><EFBFBD># <20><><EFBFBD><EFBFBD><EFBFBD><E0AEAD><EFBFBD><EFBFBD><E0AEA2><EFBFBD> ᮤ<>ন<EFBFBD><E0A6A8><EFBFBD> <20><>娢<EFBFBD>
|
||||
<20> <20><><EFBFBD>࠭<EFBFBD>묨 䠩<><E4A0A9><EFBFBD><EFBFBD>.
|
||||
|
||||
|
||||
@Config
|
||||
$ #<23><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 7-Zip#
|
||||
<20> <20>⮬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E1ABA5><EFBFBD>騥 <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD>:
|
||||
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 㬮<>砭<EFBFBD><E7A0AD># <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 㬮<>砭<EFBFBD><E7A0AD>
|
||||
211
src/pyinstaller/7z1900-extra/Far/7-ZipRus.lng
Normal file
211
src/pyinstaller/7z1900-extra/Far/7-ZipRus.lng
Normal file
@@ -0,0 +1,211 @@
|
||||
.Language=Russian,Russian (<28><><EFBFBD>᪨<EFBFBD>)
|
||||
|
||||
"<22>த<EFBFBD><E0AEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"&<26>⬥<EFBFBD><E2ACA5><EFBFBD><EFBFBD>"
|
||||
|
||||
"<22>।<EFBFBD><E0A5A4>०<EFBFBD><E0A5A6><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22>訡<EFBFBD><E8A8A1>"
|
||||
|
||||
"<22><>ଠ<EFBFBD>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>⢠"
|
||||
|
||||
"<22><>"
|
||||
"<22><><EFBFBD>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD> <20><><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>"
|
||||
|
||||
"<22><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"&<26><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD>"
|
||||
"<22><>&<26><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
"<22>&⭮<><E2ADAE>⥫<EFBFBD><E2A5AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
"&<26><><EFBFBD> <20><>⥩"
|
||||
|
||||
"<22><>१<EFBFBD><E0A5A7><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"&<26><><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> <20><><EFBFBD>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD>"
|
||||
"<22>&<26><> <20><><EFBFBD>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD>"
|
||||
"<22>ய&<26>᪠<EFBFBD><E1AAA0>"
|
||||
"<22><>२<EFBFBD><E0A5A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>⮬."
|
||||
"<22><>२<EFBFBD>. <20><>⮬. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
|
||||
|
||||
"<22><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22>&<26><>࠭<EFBFBD><E0A0AD><EFBFBD> 䠩<><E4A0A9>"
|
||||
"<22><><EFBFBD> &䠩<><E4A0A9>"
|
||||
|
||||
"&<26><><EFBFBD>"
|
||||
|
||||
"<22>&<26>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"&<26>⬥<EFBFBD><E2ACA5><EFBFBD><EFBFBD>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> '%s'."
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>⮤ ᦠ<><E1A6A0><EFBFBD> <20><><EFBFBD> 䠩<><E4A0A9> '%s'."
|
||||
"<22>訡<EFBFBD><E8A8A1> CRC <20> '%s'."
|
||||
"<22>訡<EFBFBD><E8A8A1> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> '%s'."
|
||||
"<22>訡<EFBFBD><E8A8A1> CRC <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> '%s'. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>?"
|
||||
"<22>訡<EFBFBD><E8A8A1> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> '%s'. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>?"
|
||||
|
||||
"<22><><EFBFBD>⢥न<E2A2A5><E0A4A8> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD> 㦥 ᮤ<>ন<EFBFBD> <20><>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> 䠩<>."
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騩 䠩<>"
|
||||
"<><E1ABA5><EFBFBD>騬 䠩<><E4A0A9><EFBFBD>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
|
||||
|
||||
"&<26><>"
|
||||
"<22><> <20><><EFBFBD> &<26><><EFBFBD><EFBFBD>"
|
||||
"&<26><><EFBFBD>"
|
||||
"<22><><EFBFBD> <20><><EFBFBD> <20>&<26><><EFBFBD>"
|
||||
"<22><>२<EFBFBD><E0A5A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>⮬<EFBFBD><E2AEAC><EFBFBD><EFBFBD><EFBFBD>᪨"
|
||||
"&<26>⬥<EFBFBD><E2ACA5><EFBFBD><EFBFBD>"
|
||||
|
||||
|
||||
"<22><><EFBFBD> <20>⮣<EFBFBD> <20><>娢<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>樨 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
|
||||
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>娢<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \"%.40s\" <20><> <20><>娢<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> 䠩<><E4A0A9> <20><> <20><>娢<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d 䠩<><E4A0A9><EFBFBD> <20><> <20><>娢<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22>⬥<EFBFBD><E2ACA5>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20> <20><>娢<EFBFBD>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> %s &<26><>娢<EFBFBD>"
|
||||
|
||||
"<22><>⮤ ᦠ<><E1A6A0><EFBFBD>"
|
||||
"<22><><EFBFBD> ᦠ<><E1A6A0><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⭮<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>ଠ<EFBFBD><E0ACA0><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD>ᨬ<EFBFBD><E1A8AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><E0AEAD><EFBFBD><EFBFBD><E0AEA2><EFBFBD>"
|
||||
|
||||
"&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22>&<26>娢<EFBFBD><E5A8A2><EFBFBD><EFBFBD>"
|
||||
|
||||
"<22>롮<EFBFBD> <20><>娢<EFBFBD><E5A8A2><EFBFBD><EFBFBD> <20><>ଠ<EFBFBD><E0ACA0>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22>⥭<EFBFBD><E2A5AD> <20><>娢<EFBFBD>"
|
||||
"<22><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
|
||||
"<22><>६<EFBFBD>饭<EFBFBD><E9A5AD> 䠩<><E4A0A9><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
|
||||
"7-Zip"
|
||||
"7-Zip (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>娢)"
|
||||
|
||||
"7-Zip configuration"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 㬮<>砭<EFBFBD><E7A0AD>"
|
||||
|
||||
"0"
|
||||
"1"
|
||||
"2"
|
||||
"<22><><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>ਡ<EFBFBD><E0A8A1><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢭<EFBFBD><EBA2AD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"CRC"
|
||||
"<22><><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD>"
|
||||
"<22><>⮤"
|
||||
"<22><><EFBFBD>⥬<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD>"
|
||||
"<22><><EFBFBD>짮<EFBFBD><ECA7AE>⥫<EFBFBD>"
|
||||
"<22><>㯯<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>⮬<EFBFBD><E2AEAC><EFBFBD>"
|
||||
"<22><><EFBFBD>饭<EFBFBD><E9A5AD>"
|
||||
"<22><>뫮<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"Time Type"
|
||||
"64-bit"
|
||||
"Big-endian"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>. <20>㬬<EFBFBD>"
|
||||
"<22><>ࠪ<EFBFBD><E0A0AA><EFBFBD><EFBFBD><EFBFBD>⨪<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD>㠫<EFBFBD><E3A0AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"ID"
|
||||
"<22><><EFBFBD><EFBFBD>⪮<EFBFBD> <20><><EFBFBD>"
|
||||
"<22>ணࠬ<E0AEA3><E0A0AC>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᥪ<><E1A5AA><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쭠<EFBFBD> <20><>뫪<EFBFBD>"
|
||||
"<22>訡<EFBFBD><E8A8A1>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>⪠"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>쭮<EFBFBD> <20><><EFBFBD>"
|
||||
"<22><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"NT <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᭮<EFBFBD><E1ADAE><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>ୠ⨢<E0ADA0><E2A8A2><EFBFBD> <20><>⮪"
|
||||
"Aux"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>ॢ<EFBFBD>"
|
||||
"SHA-1"
|
||||
"SHA-256"
|
||||
"<22><><EFBFBD> <20>訡<EFBFBD><E8A8A1>"
|
||||
"<22>訡<EFBFBD><E8A8A1>"
|
||||
"<22>訡<EFBFBD><E8A8A1>"
|
||||
"<22>।<EFBFBD><E0A5A4>०<EFBFBD><E0A5A6><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22>।<EFBFBD><E0A5A4>०<EFBFBD><E0A5A6><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>⮪<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>ୠ⨢<E0ADA0><E2A8A2><EFBFBD> <20><>⮪<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ୠ⨢<E0ADA0><E2A8A2><EFBFBD> <20><>⮪<EFBFBD><E2AEAA>"
|
||||
"<22><><EFBFBD><EFBFBD>㠫<EFBFBD><E3A0AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>騩 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD>⨯"
|
||||
"<22><><EFBFBD><EFBFBD>⪨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD>"
|
||||
"Is not archive type"
|
||||
"Physical Size can't be detected"
|
||||
"Zeros Tail Is Allowed"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⪠"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E0AEA5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>뫪<EFBFBD>"
|
||||
"<22><><EFBFBD>⪠<EFBFBD> <20><>뫪<EFBFBD>"
|
||||
"iNode"
|
||||
"ID <20><>⮪<EFBFBD>"
|
||||
"<22><><EFBFBD>쪮 <20><><EFBFBD> <20>⥭<EFBFBD><E2A5AD>"
|
||||
"Out Name"
|
||||
"Copy Link"
|
||||
67
src/pyinstaller/7z1900-extra/Far/7zToFar.ini
Normal file
67
src/pyinstaller/7z1900-extra/Far/7zToFar.ini
Normal file
@@ -0,0 +1,67 @@
|
||||
; 7z supporting for MutiArc in Far
|
||||
; Append the following strings to file
|
||||
; ..\Program Files\Far\Plugins\MultiArc\Formats\Custom.ini
|
||||
|
||||
[7z]
|
||||
TypeName=7z
|
||||
ID=37 7A BC AF 27 1C
|
||||
IDPos=
|
||||
IDOnly=1
|
||||
Extension=7z
|
||||
List=7z l -- %%AQ
|
||||
Start="^-----"
|
||||
End="^-----"
|
||||
Format0="yyyy tt dd hh mm ss aaaaa zzzzzzzzzzzz pppppppppppp nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
|
||||
Extract=7z x {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
ExtractWithoutPath=7z e {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
Test=7z t {-p%%P} -r0 -scsDOS -i@%%LQMN -- %%A
|
||||
Delete=7z d {-p%%P} -r0 -ms=off -scsDOS -i@%%LQMN -- %%A
|
||||
Add=7z a {-p%%P} -r0 -t7z {%%S} -scsDOS -i@%%LQMN -- %%A
|
||||
AddRecurse=7z a {-p%%P} -r0 -t7z {%%S} -scsDOS -i@%%LQMN -- %%A
|
||||
AllFilesMask="*"
|
||||
|
||||
[rpm]
|
||||
TypeName=rpm
|
||||
ID=ED AB EE DB
|
||||
IDPos=
|
||||
IDOnly=1
|
||||
Extension=rpm
|
||||
List=7z l -- %%AQ
|
||||
Start="^-----"
|
||||
End="^-----"
|
||||
Format0="yyyy tt dd hh mm ss aaaaa zzzzzzzzzzzz pppppppppppp nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
|
||||
Extract=7z x {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
ExtractWithoutPath=7z e {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
Test=7z t {-p%%P} -r0 -scsDOS -i@%%LQMN -- %%A
|
||||
AllFilesMask="*"
|
||||
|
||||
[cpio]
|
||||
TypeName=cpio
|
||||
ID=
|
||||
IDPos=
|
||||
IDOnly=0
|
||||
Extension=cpio
|
||||
List=7z l -- %%AQ
|
||||
Start="^-----"
|
||||
End="^-----"
|
||||
Format0="yyyy tt dd hh mm ss aaaaa zzzzzzzzzzzz pppppppppppp nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
|
||||
Extract=7z x {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
ExtractWithoutPath=7z e {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
Test=7z t {-p%%P} -r0 -scsDOS -i@%%LQMN -- %%A
|
||||
AllFilesMask="*"
|
||||
|
||||
[deb]
|
||||
TypeName=deb
|
||||
ID=
|
||||
IDPos=
|
||||
IDOnly=0
|
||||
Extension=deb
|
||||
List=7z l -- %%AQ
|
||||
Start="^-----"
|
||||
End="^-----"
|
||||
Format0="yyyy tt dd hh mm ss aaaaa zzzzzzzzzzzz pppppppppppp nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
|
||||
Extract=7z x {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
ExtractWithoutPath=7z e {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
Test=7z t {-p%%P} -r0 -scsDOS -i@%%LQMN -- %%A
|
||||
AllFilesMask="*"
|
||||
|
||||
67
src/pyinstaller/7z1900-extra/Far/far7z.reg
Normal file
67
src/pyinstaller/7z1900-extra/Far/far7z.reg
Normal file
@@ -0,0 +1,67 @@
|
||||
REGEDIT4
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\ZIP]
|
||||
"Extract"="7z x {-p%%P} -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e {-p%%P} -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t {-p%%P} -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"Delete"="7z d {-p%%P} -r0 {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Add"="7z a {-p%%P} -r0 -tzip {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AddRecurse"="7z a {-p%%P} -r0 -tzip {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\TAR]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"Delete"="7z d -r0 {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Add"="7z a -r0 -y -ttar {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AddRecurse"="7z a -r0 -y -ttar {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\GZIP]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"Delete"="7z d -r0 {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Add"="7z a -r0 -tgzip {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AddRecurse"="7z a -r0 -tgzip {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\BZIP]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"Delete"="7z d -r0 {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Add"="7z a -r0 -tbzip2 {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AddRecurse"="7z a -r0 -tbzip2 {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\ARJ]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\CAB]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\LZH]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\RAR]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\Z(Unix)]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
67
src/pyinstaller/7z1900-extra/Far/far7z.txt
Normal file
67
src/pyinstaller/7z1900-extra/Far/far7z.txt
Normal file
@@ -0,0 +1,67 @@
|
||||
7-Zip Plugin for FAR Manager
|
||||
----------------------------
|
||||
|
||||
FAR Manager is a file manager working in text mode.
|
||||
You can download "FAR Manager" from site:
|
||||
http://www.farmanager.com
|
||||
|
||||
Files:
|
||||
|
||||
far7z.txt - This file
|
||||
far7z.reg - Regisrty file for MultiArc Plugin
|
||||
7zToFar.ini - Supporting 7z for MultiArc Plugin
|
||||
7-ZipFar.dll - 7-Zip Plugin for FAR Manager
|
||||
7-ZipEng.hlf - Help file in English for FAR Manager
|
||||
7-ZipRus.hlf - Help file in Russian for FAR Manager
|
||||
7-ZipEng.lng - Plugin message strings in English for FAR Manager
|
||||
7-ZipRus.lng - Plugin message strings in Russian for FAR Manager
|
||||
|
||||
There are two ways to use 7-Zip with FAR Manager:
|
||||
|
||||
1) Via 7-Zip FAR Plugin (it's recommended way).
|
||||
2) Via standard MultiArc Plugin.
|
||||
|
||||
|
||||
7-Zip FAR Plugin
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
7-Zip FAR Plugin is first level plugin for FAR Manager, like MultiArc plugin.
|
||||
It very fast extracts and updates files in archive, since it doesn't use
|
||||
external programs. It supports all formats supported by 7-Zip:
|
||||
7z, ZIP, RAR, CAB, ARJ, GZIP, BZIP2, Z, TAR, CPIO, RPM and DEB.
|
||||
|
||||
To install 7-Zip FAR Plugin:
|
||||
1) Create "7-Zip" folder in ...\Program Files\Far\Plugins folder.
|
||||
2) Copy all files from "FAR" folder of this package to created folder.
|
||||
3) Install 7-Zip, or copy 7z.dll from 7-Zip to Program Files\Far\Plugins\7-Zip\
|
||||
4) Restart FAR.
|
||||
|
||||
You can open archives with one of the following ways:
|
||||
* Pressing Enter.
|
||||
* Pressing Ctrl-PgDown.
|
||||
* Pressing F11 and selecting 7-Zip item.
|
||||
|
||||
|
||||
You can create new archives with 7-Zip by pressing F11 and
|
||||
selecting 7-Zip (add to archive) item.
|
||||
|
||||
If you think that some operations with archives is better to do with MultiArc Plugin,
|
||||
you can disable 7-Zip plugin via Options / Pligin configuration / 7-Zip. In such mode
|
||||
opening archives by pressing Enter and Ctrl-PgDown will start MultiArc Plugin. And
|
||||
if you want to open archive with 7-Zip, press F11 and select 7-Zip item.
|
||||
|
||||
|
||||
Using command line 7-Zip via MultiArc Plugin
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you want to use 7-Zip via MultiArc Plugin, you must
|
||||
register file far7z.reg.
|
||||
|
||||
If you want to use 7z archives via MultiArc Plugin, you must
|
||||
append contents of file Far\7zToFar.ini to file
|
||||
..\Program Files\Far\Plugins\MultiArc\Formats\Custom.ini.
|
||||
|
||||
|
||||
If you want to cancel using 7-Zip by MultiArc, just remove lines that contain
|
||||
7-Zip (7z) program name from HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\ZIP
|
||||
registry key.
|
||||
31
src/pyinstaller/7z1900-extra/License.txt
Normal file
31
src/pyinstaller/7z1900-extra/License.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
7-Zip Extra
|
||||
~~~~~~~~~~~
|
||||
License for use and distribution
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Copyright (C) 1999-2019 Igor Pavlov.
|
||||
|
||||
7-Zip Extra files are under the GNU LGPL license.
|
||||
|
||||
|
||||
Notes:
|
||||
You can use 7-Zip Extra on any computer, including a computer in a commercial
|
||||
organization. You don't need to register or pay for 7-Zip.
|
||||
|
||||
|
||||
GNU LGPL information
|
||||
--------------------
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You can receive a copy of the GNU Lesser General Public License from
|
||||
http://www.gnu.org/
|
||||
|
||||
111
src/pyinstaller/7z1900-extra/history.txt
Normal file
111
src/pyinstaller/7z1900-extra/history.txt
Normal file
@@ -0,0 +1,111 @@
|
||||
7-Zip Extra history
|
||||
-------------------
|
||||
|
||||
This file contains only information about changes related to that package exclusively.
|
||||
The full history of changes is listed in history.txt in main 7-Zip program.
|
||||
|
||||
|
||||
19.00 2019-02-21
|
||||
-------------------------
|
||||
- Encryption strength for 7z archives was increased:
|
||||
the size of random initialization vector was increased from 64-bit to 128-bit,
|
||||
and the pseudo-random number generator was improved.
|
||||
- Some bugs were fixed.
|
||||
|
||||
|
||||
18.06 2018-12-30
|
||||
-------------------------
|
||||
- The speed for LZMA/LZMA2 compressing was increased by 3-10%,
|
||||
and there are minor changes in compression ratio.
|
||||
- Some bugs were fixed.
|
||||
|
||||
|
||||
18.05 2018-04-30
|
||||
-------------------------
|
||||
- The speed for LZMA/LZMA2 compressing was increased
|
||||
by 8% for fastest/fast compression levels and
|
||||
by 3% for normal/maximum compression levels.
|
||||
|
||||
|
||||
18.03 beta 2018-03-04
|
||||
-------------------------
|
||||
- The speed for single-thread LZMA/LZMA2 decoding
|
||||
was increased by 30% in x64 version and by 3% in x86 version.
|
||||
- 7-Zip now can use multi-threading for 7z/LZMA2 decoding,
|
||||
if there are multiple independent data chunks in LZMA2 stream.
|
||||
|
||||
|
||||
9.35 beta 2014-12-07
|
||||
------------------------------
|
||||
- SFX modules were moved to LZMA SDK package.
|
||||
|
||||
|
||||
9.34 alpha 2014-06-22
|
||||
------------------------------
|
||||
- Minimum supported system now is Windows 2000 for EXE and DLL files.
|
||||
- all EXE and DLL files use msvcrt.dll.
|
||||
- 7zr.exe now support AES encryption.
|
||||
|
||||
|
||||
9.18 2010-11-02
|
||||
------------------------------
|
||||
- New small SFX module for installers.
|
||||
|
||||
|
||||
9.17 2010-10-04
|
||||
------------------------------
|
||||
- New 7-Zip plugin for FAR Manager x64.
|
||||
|
||||
|
||||
9.10 2009-12-30
|
||||
------------------------------
|
||||
- 7-Zip for installers now supports LZMA2.
|
||||
|
||||
|
||||
9.09 2009-12-12
|
||||
------------------------------
|
||||
- LZMA2 compression method support.
|
||||
- Some bugs were fixed.
|
||||
|
||||
|
||||
4.65 2009-02-03
|
||||
------------------------------
|
||||
- Some bugs were fixed.
|
||||
|
||||
|
||||
4.38 beta 2006-04-13
|
||||
------------------------------
|
||||
- SFX for installers now supports new properties in config file:
|
||||
Progress, Directory, ExecuteFile, ExecuteParameters.
|
||||
|
||||
|
||||
4.34 beta 2006-02-27
|
||||
------------------------------
|
||||
- ISetProperties::SetProperties:
|
||||
it's possible to specify desirable number of CPU threads:
|
||||
PROPVARIANT: name=L"mt", vt = VT_UI4, ulVal = NumberOfThreads
|
||||
If "mt" is not defined, 7za.dll will check number of processors in system to set
|
||||
number of desirable threads.
|
||||
Now 7za.dll can use:
|
||||
2 threads for LZMA compressing
|
||||
N threads for BZip2 compressing
|
||||
4 threads for BZip2 decompressing
|
||||
Other codecs use only one thread.
|
||||
Note: 7za.dll can use additional "small" threads with low CPU load.
|
||||
- It's possible to call ISetProperties::SetProperties to specify "mt" property for decoder.
|
||||
|
||||
|
||||
4.33 beta 2006-02-05
|
||||
------------------------------
|
||||
- Compressing speed and Memory requirements were increased.
|
||||
Default dictionary size was increased: Fastest: 64 KB, Fast: 1 MB,
|
||||
Normal: 4 MB, Max: 16 MB, Ultra: 64 MB.
|
||||
- 7z/LZMA now can use only these match finders: HC4, BT2, BT3, BT4
|
||||
|
||||
|
||||
4.27 2005-09-21
|
||||
------------------------------
|
||||
- Some GUIDs/interfaces were changed.
|
||||
IStream.h:
|
||||
ISequentialInStream::Read now works as old ReadPart
|
||||
ISequentialOutStream::Write now works as old WritePart
|
||||
124
src/pyinstaller/7z1900-extra/readme.txt
Normal file
124
src/pyinstaller/7z1900-extra/readme.txt
Normal file
@@ -0,0 +1,124 @@
|
||||
7-Zip Extra 19.00
|
||||
-----------------
|
||||
|
||||
7-Zip Extra is package of extra modules of 7-Zip.
|
||||
|
||||
7-Zip Copyright (C) 1999-2019 Igor Pavlov.
|
||||
|
||||
7-Zip is free software. Read License.txt for more information about license.
|
||||
|
||||
Source code of binaries can be found at:
|
||||
http://www.7-zip.org/
|
||||
|
||||
This package contains the following files:
|
||||
|
||||
7za.exe - standalone console version of 7-Zip with reduced formats support.
|
||||
7za.dll - library for working with 7z archives
|
||||
7zxa.dll - library for extracting from 7z archives
|
||||
License.txt - license information
|
||||
readme.txt - this file
|
||||
|
||||
Far\ - plugin for Far Manager
|
||||
x64\ - binaries for x64
|
||||
|
||||
|
||||
All 32-bit binaries can work in:
|
||||
Windows 2000 / 2003 / 2008 / XP / Vista / 7 / 8 / 10
|
||||
and in any Windows x64 version with WoW64 support.
|
||||
All x64 binaries can work in any Windows x64 version.
|
||||
|
||||
All binaries use msvcrt.dll.
|
||||
|
||||
7za.exe
|
||||
-------
|
||||
|
||||
7za.exe - is a standalone console version of 7-Zip with reduced formats support.
|
||||
|
||||
Extra: 7za.exe : support for only some formats of 7-Zip.
|
||||
7-Zip: 7z.exe with 7z.dll : support for all formats of 7-Zip.
|
||||
|
||||
7za.exe and 7z.exe from 7-Zip have same command line interface.
|
||||
7za.exe doesn't use external DLL files.
|
||||
|
||||
You can read Help File (7-zip.chm) from 7-Zip package for description
|
||||
of all commands and switches for 7za.exe and 7z.exe.
|
||||
|
||||
7za.exe features:
|
||||
|
||||
- High compression ratio in 7z format
|
||||
- Supported formats:
|
||||
- Packing / unpacking: 7z, xz, ZIP, GZIP, BZIP2 and TAR
|
||||
- Unpacking only: Z, lzma, CAB.
|
||||
- Highest compression ratio for ZIP and GZIP formats.
|
||||
- Fast compression and decompression
|
||||
- Strong AES-256 encryption in 7z and ZIP formats.
|
||||
|
||||
Note: LZMA SDK contains 7zr.exe - more reduced version of 7za.exe.
|
||||
But you can use 7zr.exe as "public domain" code.
|
||||
|
||||
|
||||
|
||||
DLL files
|
||||
---------
|
||||
|
||||
7za.dll and 7zxa.dll are reduced versions of 7z.dll from 7-Zip.
|
||||
7za.dll and 7zxa.dll support only 7z format.
|
||||
Note: 7z.dll is main DLL file that works with all archive types in 7-Zip.
|
||||
|
||||
7za.dll and 7zxa.dll support the following decoding methods:
|
||||
- LZMA, LZMA2, PPMD, BCJ, BCJ2, COPY, 7zAES, BZip2, Deflate.
|
||||
|
||||
7za.dll also supports 7z encoding with the following encoding methods:
|
||||
- LZMA, LZMA2, PPMD, BCJ, BCJ2, COPY, 7zAES.
|
||||
|
||||
7za.dll and 7zxa.dll work via COM interfaces.
|
||||
But these DLLs don't use standard COM interfaces for objects creating.
|
||||
|
||||
Look also example code that calls DLL functions (in source code of 7-Zip):
|
||||
|
||||
7zip\UI\Client7z
|
||||
|
||||
Another example of binary that uses these interface is 7-Zip itself.
|
||||
The following binaries from 7-Zip use 7z.dll:
|
||||
- 7z.exe (console version)
|
||||
- 7zG.exe (GUI version)
|
||||
- 7zFM.exe (7-Zip File Manager)
|
||||
|
||||
Note: The source code of LZMA SDK also contains the code for similar DLLs
|
||||
(DLLs without BZip2, Deflate support). And these files from LZMA SDK can be
|
||||
used as "public domain" code. If you use LZMA SDK files, you don't need to
|
||||
follow GNU LGPL rules, if you want to change the code.
|
||||
|
||||
|
||||
|
||||
|
||||
License FAQ
|
||||
-----------
|
||||
|
||||
Can I use the EXE or DLL files from 7-Zip in a commercial application?
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Yes, but you are required to specify in documentation for your application:
|
||||
(1) that you used parts of the 7-Zip program,
|
||||
(2) that 7-Zip is licensed under the GNU LGPL license and
|
||||
(3) you must give a link to www.7-zip.org, where the source code can be found.
|
||||
|
||||
|
||||
Can I use the source code of 7-Zip in a commercial application?
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Since 7-Zip is licensed under the GNU LGPL you must follow the rules of that license.
|
||||
In brief, it means that any LGPL'ed code must remain licensed under the LGPL.
|
||||
For instance, you can change the code from 7-Zip or write a wrapper for some
|
||||
code from 7-Zip and compile it into a DLL; but, the source code of that DLL
|
||||
(including your modifications / additions / wrapper) must be licensed under
|
||||
the LGPL or GPL.
|
||||
Any other code in your application can be licensed as you wish. This scheme allows
|
||||
users and developers to change LGPL'ed code and recompile that DLL. That is the
|
||||
idea of free software. Read more here: http://www.gnu.org/.
|
||||
|
||||
|
||||
|
||||
Note: You can look also LZMA SDK, which is available under a more liberal license.
|
||||
|
||||
|
||||
---
|
||||
End of document
|
||||
BIN
src/pyinstaller/7z1900-extra/x64/7za.dll
Normal file
BIN
src/pyinstaller/7z1900-extra/x64/7za.dll
Normal file
Binary file not shown.
BIN
src/pyinstaller/7z1900-extra/x64/7za.exe
Normal file
BIN
src/pyinstaller/7z1900-extra/x64/7za.exe
Normal file
Binary file not shown.
BIN
src/pyinstaller/7z1900-extra/x64/7zxa.dll
Normal file
BIN
src/pyinstaller/7z1900-extra/x64/7zxa.dll
Normal file
Binary file not shown.
80
src/pyinstaller/hooks/hook-patoolib.py
Normal file
80
src/pyinstaller/hooks/hook-patoolib.py
Normal file
@@ -0,0 +1,80 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
# Copyright (c) 2013-2017, PyInstaller Development Team.
|
||||
#
|
||||
# Distributed under the terms of the GNU General Public License with exception
|
||||
# for distributing bootloader.
|
||||
#
|
||||
# The full license is in the file COPYING.txt, distributed with this software.
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
"""
|
||||
Name: PyInstaller patoolib Hook
|
||||
Original solution: https://github.com/pyinstaller/pyinstaller/issues/3013
|
||||
|
||||
PyInstaller cannot find libraries imported by patoolib,
|
||||
since it uses importlib to import these modules.
|
||||
"""
|
||||
|
||||
hiddenimports = [
|
||||
"patoolib.programs",
|
||||
"patoolib.programs.ar",
|
||||
"patoolib.programs.arc",
|
||||
"patoolib.programs.archmage",
|
||||
"patoolib.programs.bsdcpio",
|
||||
"patoolib.programs.bsdtar",
|
||||
"patoolib.programs.bzip2",
|
||||
"patoolib.programs.cabextract",
|
||||
"patoolib.programs.chmlib",
|
||||
"patoolib.programs.clzip",
|
||||
"patoolib.programs.compress",
|
||||
"patoolib.programs.cpio",
|
||||
"patoolib.programs.dpkg",
|
||||
"patoolib.programs.flac",
|
||||
"patoolib.programs.genisoimage",
|
||||
"patoolib.programs.gzip",
|
||||
"patoolib.programs.isoinfo",
|
||||
"patoolib.programs.lbzip2",
|
||||
"patoolib.programs.lcab",
|
||||
"patoolib.programs.lha",
|
||||
"patoolib.programs.lhasa",
|
||||
"patoolib.programs.lrzip",
|
||||
"patoolib.programs.lzip",
|
||||
"patoolib.programs.lzma",
|
||||
"patoolib.programs.lzop",
|
||||
"patoolib.programs.mac",
|
||||
"patoolib.programs.nomarch",
|
||||
"patoolib.programs.p7azip",
|
||||
"patoolib.programs.p7rzip",
|
||||
"patoolib.programs.p7zip",
|
||||
"patoolib.programs.pbzip2",
|
||||
"patoolib.programs.pdlzip",
|
||||
"patoolib.programs.pigz",
|
||||
"patoolib.programs.plzip",
|
||||
"patoolib.programs.py_bz2",
|
||||
"patoolib.programs.py_echo",
|
||||
"patoolib.programs.py_gzip",
|
||||
"patoolib.programs.py_lzma",
|
||||
"patoolib.programs.py_tarfile",
|
||||
"patoolib.programs.py_zipfile",
|
||||
"patoolib.programs.rar",
|
||||
"patoolib.programs.rpm",
|
||||
"patoolib.programs.rpm2cpio",
|
||||
"patoolib.programs.rzip",
|
||||
"patoolib.programs.shar",
|
||||
"patoolib.programs.shorten",
|
||||
"patoolib.programs.star",
|
||||
"patoolib.programs.tar",
|
||||
"patoolib.programs.unace",
|
||||
"patoolib.programs.unadf",
|
||||
"patoolib.programs.unalz",
|
||||
"patoolib.programs.uncompress",
|
||||
"patoolib.programs.unrar",
|
||||
"patoolib.programs.unshar",
|
||||
"patoolib.programs.unzip",
|
||||
"patoolib.programs.xdms",
|
||||
"patoolib.programs.xz",
|
||||
"patoolib.programs.zip",
|
||||
"patoolib.programs.zoo",
|
||||
"patoolib.programs.zopfli",
|
||||
"patoolib.programs.zpaq",
|
||||
]
|
||||
@@ -1,9 +1,9 @@
|
||||
avalon_framework
|
||||
colorama
|
||||
patool
|
||||
psutil
|
||||
pyqt5
|
||||
pyunpack
|
||||
python-magic; platform_system != "Windows"
|
||||
python-magic-bin; platform_system == "Windows"
|
||||
pyyaml
|
||||
requests
|
||||
tqdm
|
||||
249
src/upscaler.py
249
src/upscaler.py
@@ -4,7 +4,7 @@
|
||||
Name: Video2X Upscaler
|
||||
Author: K4YT3X
|
||||
Date Created: December 10, 2018
|
||||
Last Modified: May 10, 2020
|
||||
Last Modified: June 4, 2020
|
||||
|
||||
Description: This file contains the Upscaler class. Each
|
||||
instance of the Upscaler class is an upscaler on an image or
|
||||
@@ -16,6 +16,7 @@ from exceptions import *
|
||||
from image_cleaner import ImageCleaner
|
||||
from progress_monitor import ProgressMonitor
|
||||
from wrappers.ffmpeg import Ffmpeg
|
||||
from wrappers.gifski import Gifski
|
||||
|
||||
# built-in imports
|
||||
from fractions import Fraction
|
||||
@@ -24,7 +25,7 @@ import copy
|
||||
import gettext
|
||||
import importlib
|
||||
import locale
|
||||
import os
|
||||
import mimetypes
|
||||
import pathlib
|
||||
import queue
|
||||
import re
|
||||
@@ -36,6 +37,7 @@ import traceback
|
||||
|
||||
# third-party imports
|
||||
from avalon_framework import Avalon
|
||||
import magic
|
||||
|
||||
# internationalization constants
|
||||
DOMAIN = 'video2x'
|
||||
@@ -47,6 +49,9 @@ language = gettext.translation(DOMAIN, LOCALE_DIRECTORY, [default_locale], fallb
|
||||
language.install()
|
||||
_ = language.gettext
|
||||
|
||||
# version information
|
||||
UPSCALER_VERSION = '4.2.1'
|
||||
|
||||
# these names are consistent for
|
||||
# - driver selection in command line
|
||||
# - driver wrapper file names
|
||||
@@ -55,6 +60,7 @@ AVAILABLE_DRIVERS = ['waifu2x_caffe',
|
||||
'waifu2x_converter_cpp',
|
||||
'waifu2x_ncnn_vulkan',
|
||||
'srmd_ncnn_vulkan',
|
||||
'realsr_ncnn_vulkan',
|
||||
'anime4kcpp']
|
||||
|
||||
|
||||
@@ -67,12 +73,13 @@ class Upscaler:
|
||||
ArgumentError -- if argument is not valid
|
||||
"""
|
||||
|
||||
def __init__(self, input_path, output_path, driver_settings, ffmpeg_settings):
|
||||
def __init__(self, input_path, output_path, driver_settings, ffmpeg_settings, gifski_settings):
|
||||
# mandatory arguments
|
||||
self.input = input_path
|
||||
self.output = output_path
|
||||
self.driver_settings = driver_settings
|
||||
self.ffmpeg_settings = ffmpeg_settings
|
||||
self.gifski_settings = gifski_settings
|
||||
|
||||
# optional arguments
|
||||
self.driver = 'waifu2x_caffe'
|
||||
@@ -86,9 +93,9 @@ class Upscaler:
|
||||
self.running = False
|
||||
self.total_frames_upscaled = 0
|
||||
self.total_frames = 0
|
||||
self.total_videos = 0
|
||||
self.total_files = 0
|
||||
self.total_processed = 0
|
||||
self.current_input_video = pathlib.Path()
|
||||
self.current_input_file = pathlib.Path()
|
||||
self.last_frame_upscaled = pathlib.Path()
|
||||
|
||||
def create_temp_directories(self):
|
||||
@@ -129,7 +136,9 @@ class Upscaler:
|
||||
# therefore, plain print is used
|
||||
print(_('Cleaning up cache directory: {}').format(directory))
|
||||
shutil.rmtree(directory)
|
||||
except (OSError, FileNotFoundError):
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
except OSError:
|
||||
print(_('Unable to delete: {}').format(directory))
|
||||
traceback.print_exc()
|
||||
|
||||
@@ -154,10 +163,10 @@ class Upscaler:
|
||||
Avalon.error(_('Input and output path type mismatch'))
|
||||
Avalon.error(_('Input is single file but output is directory'))
|
||||
raise ArgumentError('input output path type mismatch')
|
||||
if not re.search(r'.*\..*$', str(self.output)):
|
||||
if self.output.suffix == '':
|
||||
Avalon.error(_('No suffix found in output file path'))
|
||||
Avalon.error(_('Suffix must be specified for FFmpeg'))
|
||||
raise ArgumentError('no output video suffix specified')
|
||||
Avalon.error(_('Suffix must be specified'))
|
||||
raise ArgumentError('no output file suffix specified')
|
||||
|
||||
# if input is a directory
|
||||
elif self.input.is_dir():
|
||||
@@ -273,7 +282,7 @@ class Upscaler:
|
||||
process_directory.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# waifu2x-converter-cpp will perform multi-threading within its own process
|
||||
if self.driver in ['waifu2x_converter_cpp', 'waifu2x_ncnn_vulkan', 'srmd_ncnn_vulkan']:
|
||||
if self.driver in ['waifu2x_converter_cpp', 'waifu2x_ncnn_vulkan', 'srmd_ncnn_vulkan', 'realsr_ncnn_vulkan', 'anime4kcpp']:
|
||||
process_directories = [self.extracted_frames]
|
||||
|
||||
else:
|
||||
@@ -393,69 +402,109 @@ class Upscaler:
|
||||
# load options from upscaler class into driver settings
|
||||
self.driver_object.load_configurations(self)
|
||||
|
||||
# parse arguments for waifu2x
|
||||
# check argument sanity
|
||||
self._check_arguments()
|
||||
# initialize FFmpeg object
|
||||
self.ffmpeg_object = Ffmpeg(self.ffmpeg_settings, image_format=self.image_format)
|
||||
|
||||
# define processing queue
|
||||
self.processing_queue = queue.Queue()
|
||||
|
||||
Avalon.info(_('Loading files into processing queue'))
|
||||
|
||||
# if input is a list of files
|
||||
if isinstance(self.input, list):
|
||||
|
||||
Avalon.info(_('Loading files from multiple paths'))
|
||||
Avalon.debug_info(_('Input path(s): {}').format(self.input))
|
||||
|
||||
# make output directory if it doesn't exist
|
||||
self.output.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
for input_path in self.input:
|
||||
|
||||
if input_path.is_file():
|
||||
output_video = self.output / input_path.name
|
||||
self.processing_queue.put((input_path.absolute(), output_video.absolute()))
|
||||
output_path = self.output / input_path.name
|
||||
self.processing_queue.put((input_path.absolute(), output_path.absolute()))
|
||||
|
||||
elif input_path.is_dir():
|
||||
for input_video in [f for f in input_path.iterdir() if f.is_file()]:
|
||||
output_video = self.output / input_video.name
|
||||
self.processing_queue.put((input_video.absolute(), output_video.absolute()))
|
||||
for input_path in [f for f in input_path.iterdir() if f.is_file()]:
|
||||
output_path = self.output / input_path.name
|
||||
self.processing_queue.put((input_path.absolute(), output_path.absolute()))
|
||||
|
||||
# if input specified is single file
|
||||
elif self.input.is_file():
|
||||
Avalon.info(_('Upscaling single video file: {}').format(self.input))
|
||||
Avalon.info(_('Loading single file'))
|
||||
Avalon.debug_info(_('Input path(s): {}').format(self.input))
|
||||
self.processing_queue.put((self.input.absolute(), self.output.absolute()))
|
||||
|
||||
# if input specified is a directory
|
||||
elif self.input.is_dir():
|
||||
|
||||
Avalon.info(_('Loading files from directory'))
|
||||
Avalon.debug_info(_('Input path(s): {}').format(self.input))
|
||||
# make output directory if it doesn't exist
|
||||
self.output.mkdir(parents=True, exist_ok=True)
|
||||
for input_video in [f for f in self.input.iterdir() if f.is_file()]:
|
||||
output_video = self.output / input_video.name
|
||||
self.processing_queue.put((input_video.absolute(), output_video.absolute()))
|
||||
for input_path in [f for f in self.input.iterdir() if f.is_file()]:
|
||||
output_path = self.output / input_path.name
|
||||
self.processing_queue.put((input_path.absolute(), output_path.absolute()))
|
||||
|
||||
# record video count for external calls
|
||||
self.total_videos = self.processing_queue.qsize()
|
||||
# check argument sanity before running
|
||||
self._check_arguments()
|
||||
|
||||
while not self.processing_queue.empty():
|
||||
self.current_input_video, output_video = self.processing_queue.get()
|
||||
# drivers that have native support for video processing
|
||||
if self.driver == 'anime4kcpp':
|
||||
# append FFmpeg path to the end of PATH
|
||||
# Anime4KCPP will then use FFmpeg to migrate audio tracks
|
||||
os.environ['PATH'] += f';{self.ffmpeg_settings["ffmpeg_path"]}'
|
||||
Avalon.info(_('Starting to upscale extracted images'))
|
||||
# record file count for external calls
|
||||
self.total_files = self.processing_queue.qsize()
|
||||
|
||||
# run Anime4KCPP
|
||||
self.process_pool.append(self.driver_object.upscale(self.current_input_video, output_video))
|
||||
self._wait()
|
||||
Avalon.info(_('Upscaling completed'))
|
||||
Avalon.info(_('Loaded files into processing queue'))
|
||||
# print all files in queue for debugging
|
||||
for job in self.processing_queue.queue:
|
||||
Avalon.debug_info(_('Input file: {}').format(job[0].absolute()))
|
||||
|
||||
else:
|
||||
try:
|
||||
while not self.processing_queue.empty():
|
||||
|
||||
# reset current processing progress for new job
|
||||
self.total_frames_upscaled = 0
|
||||
self.total_frames = 0
|
||||
|
||||
# get new job from queue
|
||||
self.current_input_file, output_path = self.processing_queue.get()
|
||||
|
||||
# get file type
|
||||
try:
|
||||
input_file_mime_type = magic.from_file(str(self.current_input_file.absolute()), mime=True)
|
||||
input_file_type = input_file_mime_type.split('/')[0]
|
||||
input_file_subtype = input_file_mime_type.split('/')[1]
|
||||
except magic.magic.MagicException:
|
||||
input_file_type = input_file_subtype = None
|
||||
|
||||
# in case python-magic fails to detect file type
|
||||
# try guessing file mime type with mimetypes
|
||||
if input_file_type not in ['image', 'video']:
|
||||
input_file_mime_type = mimetypes.guess_type(self.current_input_file.name)[0]
|
||||
input_file_type = input_file_mime_type.split('/')[0]
|
||||
input_file_subtype = input_file_mime_type.split('/')[1]
|
||||
|
||||
# start handling input
|
||||
# if input file is a static image
|
||||
if input_file_type == 'image' and input_file_subtype != 'gif':
|
||||
Avalon.info(_('Starting to upscale image'))
|
||||
self.process_pool.append(self.driver_object.upscale(self.current_input_file, output_path))
|
||||
self._wait()
|
||||
Avalon.info(_('Upscaling completed'))
|
||||
|
||||
# static images don't require GIF or video encoding
|
||||
# go to the next task
|
||||
self.processing_queue.task_done()
|
||||
self.total_processed += 1
|
||||
continue
|
||||
|
||||
# if input file is a image/gif file or a video
|
||||
elif input_file_mime_type == 'image/gif' or input_file_type == 'video':
|
||||
|
||||
self.create_temp_directories()
|
||||
|
||||
# initialize objects for ffmpeg and waifu2x-caffe
|
||||
fm = Ffmpeg(self.ffmpeg_settings, self.image_format)
|
||||
|
||||
# get video information JSON using FFprobe
|
||||
Avalon.info(_('Reading video information'))
|
||||
video_info = fm.get_video_info(self.current_input_video)
|
||||
video_info = self.ffmpeg_object.probe_file_info(self.current_input_file)
|
||||
# analyze original video with FFprobe and retrieve framerate
|
||||
# width, height = info['streams'][0]['width'], info['streams'][0]['height']
|
||||
|
||||
@@ -471,85 +520,117 @@ class Upscaler:
|
||||
Avalon.error(_('Aborting: No video stream found'))
|
||||
raise StreamNotFoundError('no video stream found')
|
||||
|
||||
# extract frames from video
|
||||
self.process_pool.append((fm.extract_frames(self.current_input_video, self.extracted_frames)))
|
||||
self._wait()
|
||||
|
||||
# get average frame rate of video stream
|
||||
framerate = float(Fraction(video_info['streams'][video_stream_index]['r_frame_rate']))
|
||||
fm.pixel_format = video_info['streams'][video_stream_index]['pix_fmt']
|
||||
Avalon.info(_('Framerate: {}').format(framerate))
|
||||
# self.ffmpeg_object.pixel_format = video_info['streams'][video_stream_index]['pix_fmt']
|
||||
|
||||
# extract frames from video
|
||||
self.process_pool.append((self.ffmpeg_object.extract_frames(self.current_input_file, self.extracted_frames)))
|
||||
self._wait()
|
||||
|
||||
# if driver is waifu2x-caffe
|
||||
# pass pixel format output depth information
|
||||
if self.driver == 'waifu2x_caffe':
|
||||
# get a dict of all pixel formats and corresponding bit depth
|
||||
pixel_formats = fm.get_pixel_formats()
|
||||
pixel_formats = self.ffmpeg_object.get_pixel_formats()
|
||||
|
||||
# try getting pixel format's corresponding bti depth
|
||||
try:
|
||||
self.driver_settings['output_depth'] = pixel_formats[fm.pixel_format]
|
||||
self.driver_settings['output_depth'] = pixel_formats[self.ffmpeg_object.pixel_format]
|
||||
except KeyError:
|
||||
Avalon.error(_('Unsupported pixel format: {}').format(fm.pixel_format))
|
||||
raise UnsupportedPixelError(f'unsupported pixel format {fm.pixel_format}')
|
||||
|
||||
Avalon.info(_('Framerate: {}').format(framerate))
|
||||
Avalon.error(_('Unsupported pixel format: {}').format(self.ffmpeg_object.pixel_format))
|
||||
raise UnsupportedPixelError(f'unsupported pixel format {self.ffmpeg_object.pixel_format}')
|
||||
|
||||
# width/height will be coded width/height x upscale factor
|
||||
original_width = video_info['streams'][video_stream_index]['width']
|
||||
original_height = video_info['streams'][video_stream_index]['height']
|
||||
scale_width = int(self.scale_ratio * original_width)
|
||||
scale_height = int(self.scale_ratio * original_height)
|
||||
# original_width = video_info['streams'][video_stream_index]['width']
|
||||
# original_height = video_info['streams'][video_stream_index]['height']
|
||||
# scale_width = int(self.scale_ratio * original_width)
|
||||
# scale_height = int(self.scale_ratio * original_height)
|
||||
|
||||
# upscale images one by one using waifu2x
|
||||
Avalon.info(_('Starting to upscale extracted images'))
|
||||
Avalon.info(_('Starting to upscale extracted frames'))
|
||||
self._upscale_frames()
|
||||
Avalon.info(_('Upscaling completed'))
|
||||
|
||||
# frames to Video
|
||||
Avalon.info(_('Converting extracted frames into video'))
|
||||
# if file is none of: image, image/gif, video
|
||||
# skip to the next task
|
||||
else:
|
||||
Avalon.error(_('File {} ({}) neither an image nor a video').format(self.current_input_file, input_file_mime_type))
|
||||
Avalon.warning(_('Skipping this file'))
|
||||
self.processing_queue.task_done()
|
||||
self.total_processed += 1
|
||||
continue
|
||||
|
||||
# use user defined output size
|
||||
self.process_pool.append(fm.assemble_video(framerate,
|
||||
f'{scale_width}x{scale_height}',
|
||||
self.upscaled_frames))
|
||||
# start handling output
|
||||
# output can be either GIF or video
|
||||
|
||||
# if the desired output is gif file
|
||||
if output_path.suffix.lower() == '.gif':
|
||||
Avalon.info(_('Converting extracted frames into GIF image'))
|
||||
gifski_object = Gifski(self.gifski_settings)
|
||||
self.process_pool.append(gifski_object.make_gif(self.upscaled_frames, output_path, framerate, self.image_format))
|
||||
self._wait()
|
||||
Avalon.info(_('Conversion completed'))
|
||||
|
||||
# if the desired output is video
|
||||
else:
|
||||
# frames to video
|
||||
Avalon.info(_('Converting extracted frames into video'))
|
||||
self.process_pool.append(self.ffmpeg_object.assemble_video(framerate, self.upscaled_frames))
|
||||
# f'{scale_width}x{scale_height}'
|
||||
self._wait()
|
||||
Avalon.info(_('Conversion completed'))
|
||||
|
||||
try:
|
||||
# migrate audio tracks and subtitles
|
||||
Avalon.info(_('Migrating audio, subtitles and other streams to upscaled video'))
|
||||
self.process_pool.append(fm.migrate_streams(self.current_input_video,
|
||||
output_video,
|
||||
self.upscaled_frames))
|
||||
self.process_pool.append(self.ffmpeg_object.migrate_streams(self.current_input_file,
|
||||
output_path,
|
||||
self.upscaled_frames))
|
||||
self._wait()
|
||||
|
||||
# if failed to copy streams
|
||||
# use file with only video stream
|
||||
except subprocess.CalledProcessError:
|
||||
traceback.print_exc()
|
||||
Avalon.error(_('Failed to migrate streams'))
|
||||
Avalon.warning(_('Trying to output video without additional streams'))
|
||||
|
||||
# construct output file path
|
||||
output_video_path = output_video.parent / f'{output_video.stem}{fm.intermediate_file_name.suffix}'
|
||||
if input_file_mime_type == 'image/gif':
|
||||
# copy will overwrite destination content if exists
|
||||
shutil.copy(self.upscaled_frames / self.ffmpeg_object.intermediate_file_name, output_path)
|
||||
|
||||
# if output file already exists, cancel
|
||||
if output_video_path.exists():
|
||||
Avalon.error(_('Output video file exists, aborting'))
|
||||
|
||||
# otherwise, rename intermediate file to the output file
|
||||
else:
|
||||
# construct output file path
|
||||
output_file_name = f'{output_path.stem}{self.ffmpeg_object.intermediate_file_name.suffix}'
|
||||
output_video_path = output_path.parent / output_file_name
|
||||
|
||||
# if output file already exists
|
||||
# create temporary directory in output folder
|
||||
# temporary directories generated by tempfile are guaranteed to be unique
|
||||
# and won't conflict with other files
|
||||
if output_video_path.exists():
|
||||
Avalon.error(_('Output video file exists'))
|
||||
|
||||
temporary_directory = pathlib.Path(tempfile.mkdtemp(dir=output_path.parent))
|
||||
output_video_path = temporary_directory / output_file_name
|
||||
Avalon.info(_('Created temporary directory to contain file'))
|
||||
|
||||
# move file to new destination
|
||||
Avalon.info(_('Writing intermediate file to: {}').format(output_video_path.absolute()))
|
||||
(self.upscaled_frames / fm.intermediate_file_name).rename(output_video_path)
|
||||
shutil.move(self.upscaled_frames / self.ffmpeg_object.intermediate_file_name, output_video_path)
|
||||
|
||||
# destroy temp directories
|
||||
self.cleanup_temp_directories()
|
||||
# increment total number of files processed
|
||||
self.cleanup_temp_directories()
|
||||
self.processing_queue.task_done()
|
||||
self.total_processed += 1
|
||||
|
||||
except (Exception, KeyboardInterrupt, SystemExit) as e:
|
||||
with contextlib.suppress(ValueError):
|
||||
self.cleanup_temp_directories()
|
||||
self.running = False
|
||||
raise e
|
||||
|
||||
# increment total number of videos processed
|
||||
self.total_processed += 1
|
||||
except (Exception, KeyboardInterrupt, SystemExit) as e:
|
||||
with contextlib.suppress(ValueError, AttributeError):
|
||||
self.cleanup_temp_directories()
|
||||
self.running = False
|
||||
raise e
|
||||
|
||||
# signal upscaling completion
|
||||
self.running = False
|
||||
|
||||
183
src/video2x.pot
183
src/video2x.pot
@@ -5,7 +5,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2020-05-11 04:39-0400\n"
|
||||
"POT-Creation-Date: 2020-05-22 17:51-0400\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -19,244 +19,289 @@ msgstr ""
|
||||
msgid "Upscaling Progress"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:104
|
||||
#: upscaler.py:110
|
||||
msgid "Specified or default cache directory is a file/link"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:110
|
||||
#: upscaler.py:116
|
||||
msgid "Creating cache directory {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:113
|
||||
#: upscaler.py:119
|
||||
msgid "Unable to create {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:118
|
||||
#: upscaler.py:124
|
||||
msgid "Extracted frames are being saved to: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:120
|
||||
#: upscaler.py:126
|
||||
msgid "Upscaled frames are being saved to: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:130
|
||||
#: upscaler.py:136
|
||||
msgid "Cleaning up cache directory: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:133
|
||||
#: upscaler.py:141
|
||||
msgid "Unable to delete: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:139 upscaler.py:154 upscaler.py:165
|
||||
#: upscaler.py:147 upscaler.py:162 upscaler.py:173
|
||||
msgid "Input and output path type mismatch"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:140
|
||||
#: upscaler.py:148
|
||||
msgid "Input is multiple files but output is not directory"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:144
|
||||
#: upscaler.py:152
|
||||
msgid "Input path {} is neither a file nor a directory"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:148 upscaler.py:170
|
||||
#: upscaler.py:156 upscaler.py:178
|
||||
msgid "Input directory and output directory cannot be the same"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:155
|
||||
#: upscaler.py:163
|
||||
msgid "Input is single file but output is directory"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:158
|
||||
#: upscaler.py:166
|
||||
msgid "No suffix found in output file path"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:159
|
||||
msgid "Suffix must be specified for FFmpeg"
|
||||
#: upscaler.py:167
|
||||
msgid "Suffix must be specified"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:166
|
||||
#: upscaler.py:174
|
||||
msgid "Input is directory but output is existing single file"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:175
|
||||
#: upscaler.py:183
|
||||
msgid "Input path is neither a file nor a directory"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:184
|
||||
#: upscaler.py:192
|
||||
msgid "FFmpeg or FFprobe cannot be found under the specified path"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:185 upscaler.py:195
|
||||
#: upscaler.py:193 upscaler.py:203
|
||||
msgid "Please check the configuration file settings"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:194
|
||||
#: upscaler.py:202
|
||||
msgid "Specified driver executable directory doesn't exist"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:221
|
||||
#: upscaler.py:229
|
||||
msgid "Failed to parse driver argument: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:253
|
||||
#: upscaler.py:261
|
||||
msgid "Unrecognized driver: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:293
|
||||
#: upscaler.py:301
|
||||
msgid "Starting progress monitor"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:298
|
||||
#: upscaler.py:306
|
||||
msgid "Starting upscaled image cleaner"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:307 upscaler.py:324
|
||||
#: upscaler.py:315 upscaler.py:332
|
||||
msgid "Killing progress monitor"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:310 upscaler.py:327
|
||||
#: upscaler.py:318 upscaler.py:335
|
||||
msgid "Killing upscaled image cleaner"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:331
|
||||
#: upscaler.py:339
|
||||
msgid "Terminating all processes"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:338
|
||||
#: upscaler.py:346
|
||||
msgid "Main process waiting for subprocesses to exit"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:357 upscaler.py:361
|
||||
#: upscaler.py:365 upscaler.py:369
|
||||
msgid "Subprocess {} exited with code {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:367
|
||||
#: upscaler.py:375
|
||||
msgid "Stop signal received"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:372
|
||||
#: upscaler.py:380
|
||||
msgid "Subprocess execution ran into an error"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:421
|
||||
msgid "Upscaling single video file: {}"
|
||||
#: upscaler.py:410
|
||||
msgid "Loading files into processing queue"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:443 upscaler.py:502
|
||||
msgid "Starting to upscale extracted images"
|
||||
#: upscaler.py:415
|
||||
msgid "Loading files from multiple paths"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:448 upscaler.py:504
|
||||
#: upscaler.py:416 upscaler.py:435 upscaler.py:442
|
||||
msgid "Input path(s): {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:434
|
||||
msgid "Loading single file"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:441
|
||||
msgid "Loading files from directory"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:455
|
||||
msgid "Loaded files into processing queue"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:458
|
||||
msgid "Input file: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:485
|
||||
msgid "Starting to upscale image"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:488 upscaler.py:550
|
||||
msgid "Upscaling completed"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:457
|
||||
#: upscaler.py:502
|
||||
msgid "Reading video information"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:471
|
||||
#: upscaler.py:516
|
||||
msgid "Aborting: No video stream found"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:490
|
||||
msgid "Unsupported pixel format: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:493
|
||||
#: upscaler.py:521
|
||||
msgid "Framerate: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:507
|
||||
msgid "Converting extracted frames into video"
|
||||
#: upscaler.py:538
|
||||
msgid "Unsupported pixel format: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:514
|
||||
#: upscaler.py:548
|
||||
msgid "Starting to upscale extracted frames"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:555
|
||||
msgid "File {} ({}) neither an image nor a video"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:556
|
||||
msgid "Skipping this file"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:566
|
||||
msgid "Converting extracted frames into GIF image"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:570 upscaler.py:579
|
||||
msgid "Conversion completed"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:518
|
||||
#: upscaler.py:575
|
||||
msgid "Converting extracted frames into video"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:583
|
||||
msgid "Migrating audio, subtitles and other streams to upscaled video"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:527
|
||||
#: upscaler.py:593
|
||||
msgid "Failed to migrate streams"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:528
|
||||
#: upscaler.py:594
|
||||
msgid "Trying to output video without additional streams"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:535
|
||||
msgid "Output video file exists, aborting"
|
||||
#: upscaler.py:610
|
||||
msgid "Output video file exists"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:539
|
||||
#: upscaler.py:614
|
||||
msgid "Created temporary directory to contain file"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:617
|
||||
msgid "Writing intermediate file to: {}"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:84
|
||||
#: video2x.py:85
|
||||
msgid ""
|
||||
"Video2X Version: {}\n"
|
||||
"Video2X CLI Version: {}\n"
|
||||
"Upscaler Version: {}\n"
|
||||
"Author: K4YT3X\n"
|
||||
"License: GNU GPL v3\n"
|
||||
"Github Page: https://github.com/k4yt3x/video2x\n"
|
||||
"Contact: k4yt3x@k4yt3x.com"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:106
|
||||
#: video2x.py:108
|
||||
msgid "Video2X Options"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:107
|
||||
#: video2x.py:109
|
||||
msgid "show this help message and exit"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:108
|
||||
#: video2x.py:110
|
||||
msgid "source video file/directory"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:109
|
||||
#: video2x.py:111
|
||||
msgid "output video file/directory"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:110
|
||||
#: video2x.py:112
|
||||
msgid "video2x config file path"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:112
|
||||
#: video2x.py:114
|
||||
msgid "display version, lawful information and exit"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:115
|
||||
#: video2x.py:117
|
||||
msgid "Upscaling Options"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:116
|
||||
#: video2x.py:118
|
||||
msgid "upscaling driver"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:117
|
||||
#: video2x.py:119
|
||||
msgid "scaling ratio"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:118
|
||||
#: video2x.py:120
|
||||
msgid "number of processes to use for upscaling"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:119
|
||||
#: video2x.py:121
|
||||
msgid "preserve extracted and upscaled frames"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:159
|
||||
#: video2x.py:161
|
||||
msgid "This file cannot be imported"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:229
|
||||
#: video2x.py:236
|
||||
msgid "Program completed, taking {} seconds"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:232
|
||||
#: video2x.py:239
|
||||
msgid "An exception has occurred"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ __ __ _ _ ___ __ __
|
||||
Name: Video2X Controller
|
||||
Creator: K4YT3X
|
||||
Date Created: Feb 24, 2018
|
||||
Last Modified: May 10, 2020
|
||||
Last Modified: June 4, 2020
|
||||
|
||||
Editor: BrianPetkovsek
|
||||
Last Modified: June 17, 2019
|
||||
@@ -49,11 +49,14 @@ smooth and edges sharp.
|
||||
"""
|
||||
|
||||
# local imports
|
||||
from bilogger import BiLogger
|
||||
from upscaler import AVAILABLE_DRIVERS
|
||||
from upscaler import UPSCALER_VERSION
|
||||
from upscaler import Upscaler
|
||||
|
||||
# built-in imports
|
||||
import argparse
|
||||
import datetime
|
||||
import gettext
|
||||
import importlib
|
||||
import locale
|
||||
@@ -78,14 +81,14 @@ language = gettext.translation(DOMAIN, LOCALE_DIRECTORY, [default_locale], fallb
|
||||
language.install()
|
||||
_ = language.gettext
|
||||
|
||||
CLI_VERSION = '4.1.0'
|
||||
|
||||
VERSION = '4.0.0'
|
||||
|
||||
LEGAL_INFO = _('''Video2X Version: {}
|
||||
LEGAL_INFO = _('''Video2X CLI Version: {}
|
||||
Upscaler Version: {}
|
||||
Author: K4YT3X
|
||||
License: GNU GPL v3
|
||||
Github Page: https://github.com/k4yt3x/video2x
|
||||
Contact: k4yt3x@k4yt3x.com''').format(VERSION)
|
||||
Contact: k4yt3x@k4yt3x.com''').format(CLI_VERSION, UPSCALER_VERSION)
|
||||
|
||||
LOGO = r'''
|
||||
__ __ _ _ ___ __ __
|
||||
@@ -105,10 +108,20 @@ def parse_arguments():
|
||||
# video options
|
||||
video2x_options = parser.add_argument_group(_('Video2X Options'))
|
||||
video2x_options.add_argument('-h', '--help', action='help', help=_('show this help message and exit'))
|
||||
video2x_options.add_argument('-i', '--input', type=pathlib.Path, help=_('source video file/directory'))
|
||||
video2x_options.add_argument('-o', '--output', type=pathlib.Path, help=_('output video file/directory'))
|
||||
|
||||
# if help is in arguments list
|
||||
# do not require input and output path to be specified
|
||||
require_input_output = True
|
||||
if '-h' in sys.argv or '--help' in sys.argv:
|
||||
require_input_output = False
|
||||
video2x_options.add_argument('-i', '--input', type=pathlib.Path, help=_('source video file/directory'), required=require_input_output)
|
||||
video2x_options.add_argument('-o', '--output', type=pathlib.Path, help=_('output video file/directory'), required=require_input_output)
|
||||
|
||||
video2x_options.add_argument('-c', '--config', type=pathlib.Path, help=_('video2x config file path'), action='store',
|
||||
default=pathlib.Path(__file__).parent.absolute() / 'video2x.yaml')
|
||||
video2x_options.add_argument('--log', type=pathlib.Path, help=_('log file path'),
|
||||
default=pathlib.Path(__file__).parent.absolute() / f'video2x_{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}.log')
|
||||
video2x_options.add_argument('--nolog', help=_('disable logging'), action='store_true')
|
||||
video2x_options.add_argument('-v', '--version', help=_('display version, lawful information and exit'), action='store_true')
|
||||
|
||||
# scaling options
|
||||
@@ -135,7 +148,7 @@ def print_logo():
|
||||
"""print video2x logo"""
|
||||
print(LOGO)
|
||||
print(f'\n{"Video2X Video Enlarger".rjust(40, " ")}')
|
||||
print(f'\n{Avalon.FM.BD}{f"Version {VERSION}".rjust(36, " ")}{Avalon.FM.RST}\n')
|
||||
print(f'\n{Avalon.FM.BD}{f"Version {CLI_VERSION}".rjust(36, " ")}{Avalon.FM.RST}\n')
|
||||
|
||||
|
||||
def read_config(config_file: pathlib.Path) -> dict:
|
||||
@@ -170,6 +183,13 @@ if video2x_args.version:
|
||||
print(LEGAL_INFO)
|
||||
sys.exit(0)
|
||||
|
||||
# redirect output to both terminal and log file
|
||||
if video2x_args.nolog is False:
|
||||
LOGFILE = video2x_args.log
|
||||
Avalon.debug_info(_('Redirecting console logs to {}').format(LOGFILE))
|
||||
sys.stdout = BiLogger(sys.stdout, LOGFILE)
|
||||
sys.stderr = BiLogger(sys.stderr, LOGFILE)
|
||||
|
||||
# read configurations from configuration file
|
||||
config = read_config(video2x_args.config)
|
||||
|
||||
@@ -181,6 +201,10 @@ driver_settings['path'] = os.path.expandvars(driver_settings['path'])
|
||||
ffmpeg_settings = config['ffmpeg']
|
||||
ffmpeg_settings['ffmpeg_path'] = os.path.expandvars(ffmpeg_settings['ffmpeg_path'])
|
||||
|
||||
# read Gifski configuration
|
||||
gifski_settings = config['gifski']
|
||||
gifski_settings['gifski_path'] = os.path.expandvars(gifski_settings['gifski_path'])
|
||||
|
||||
# load video2x settings
|
||||
image_format = config['video2x']['image_format'].lower()
|
||||
preserve_frames = config['video2x']['preserve_frames']
|
||||
@@ -213,7 +237,8 @@ try:
|
||||
upscaler = Upscaler(input_path=video2x_args.input,
|
||||
output_path=video2x_args.output,
|
||||
driver_settings=driver_settings,
|
||||
ffmpeg_settings=ffmpeg_settings)
|
||||
ffmpeg_settings=ffmpeg_settings,
|
||||
gifski_settings=gifski_settings)
|
||||
|
||||
# set upscaler optional options
|
||||
upscaler.driver = video2x_args.driver
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Name: Video2X Configuration File
|
||||
# Creator: K4YT3X
|
||||
# Date Created: October 23, 2018
|
||||
# Last Modified: May 9, 2020
|
||||
# Last Modified: May 29, 2020
|
||||
# Values here are the default values. Change the value here to
|
||||
# save the default value permanently.
|
||||
# Items commented out are parameters irrelevant to this context
|
||||
@@ -76,6 +76,17 @@ srmd_ncnn_vulkan:
|
||||
g: 0 # gpu device to use (default=0)
|
||||
j: '1:2:2' # thread count for load/proc/save (default=1:2:2)
|
||||
x: false # enable tta mode
|
||||
realsr_ncnn_vulkan:
|
||||
path: '%LOCALAPPDATA%\video2x\realsr-ncnn-vulkan\realsr-ncnn-vulkan'
|
||||
v: null # verbose output
|
||||
#i: null # input-path: input image path (jpg/png) or directory
|
||||
#o: null # output-path: output image path (png) or directory
|
||||
s: 4 # upscale ratio (4, default=4)
|
||||
t: 0 # tile size (>=32/0=auto, default=0)
|
||||
m: null # realsr model path (default=models-DF2K)
|
||||
g: 0 # gpu device to use (default=0)
|
||||
j: '1:2:2' # thread count for load/proc/save (default=1:2:2)
|
||||
x: false # enable tta mode
|
||||
anime4kcpp:
|
||||
path: '%LOCALAPPDATA%\video2x\anime4kcpp\CLI\Anime4KCPP_CLI\Anime4KCPP_CLI'
|
||||
#input: null # File for loading (string [=./pic/p1.png])
|
||||
@@ -87,7 +98,7 @@ anime4kcpp:
|
||||
zoomFactor: 2.0 # zoom factor for resizing (double [=2])
|
||||
threads: 16 # Threads count for video processing (unsigned int [=16])
|
||||
fastMode: false # Faster but maybe low quality
|
||||
videoMode: true # Video process
|
||||
videoMode: false # Video process
|
||||
preview: null # Preview image
|
||||
preprocessing: False # Enable pre processing
|
||||
postprocessing: False # Enable post processing
|
||||
@@ -101,44 +112,61 @@ anime4kcpp:
|
||||
ffmpeg:
|
||||
ffmpeg_path: '%LOCALAPPDATA%\video2x\ffmpeg-latest-win64-static\bin'
|
||||
intermediate_file_name: 'intermediate.mkv'
|
||||
# step 1: extract all frames from original video
|
||||
# into temporary directory
|
||||
video_to_frames:
|
||||
output_options:
|
||||
'-qscale:v': null
|
||||
'-pix_fmt': rgba64be
|
||||
'-hwaccel': auto
|
||||
# Step 1: Frame Extraction
|
||||
# extract all frames from original input into temporary directory
|
||||
extract_frames:
|
||||
'-hwaccel': auto # automatically select hardware acceleration method
|
||||
'-y': true
|
||||
input_options: {} # empty dict, expand if necessary
|
||||
output_options:
|
||||
'-pix_fmt': rgba64be # extracted frames pixel format
|
||||
'-qscale:v': null # output image quality control for JPEG (1-31, 1 being highest)
|
||||
# Step 2: Video Assembly
|
||||
# assemble all frames back into a video with only a video track
|
||||
assemble_video:
|
||||
'-hwaccel': auto # automatically select hardware acceleration method
|
||||
'-y': true
|
||||
# step 2: stitch all frames back into a video
|
||||
# with only a video track
|
||||
frames_to_video:
|
||||
input_options:
|
||||
'-qscale:v': null
|
||||
'-qscale:a': null
|
||||
'-f': image2
|
||||
'-f': image2 # force image2 format
|
||||
output_options:
|
||||
'-vcodec': libx264
|
||||
'-crf': 17
|
||||
'-b:v': null
|
||||
'-pix_fmt': null
|
||||
'-hwaccel': auto
|
||||
'-vcodec': libx264 # video codec
|
||||
'-pix_fmt': 'yuv420p' # overwrite default pixel format
|
||||
'-crf': 17 # H.264 Constant Rate Factor
|
||||
'-b:v': null # target average bitrate
|
||||
'-vf': 'pad=ceil(iw/2)*2:ceil(ih/2)*2' # ensure output is divisible by 2, recommended for libx264
|
||||
'-tune': 'animation' # encoding tuning film/animation/grain/stillimage/fastdecode/zerolatency/psnr/ssim
|
||||
# Step 3: Streams Migration
|
||||
# migrate audio and subtitle streams from original
|
||||
# video into the upscaled video
|
||||
migrate_streams:
|
||||
'-hwaccel': auto # automatically select hardware acceleration method
|
||||
'-y': true
|
||||
# step 3: migrate audio and subtitle tracks from original
|
||||
# video into the upscaled video
|
||||
migrating_tracks:
|
||||
input_options: {} # empty dict, expand if necessary
|
||||
output_options:
|
||||
'-map':
|
||||
- '0:v?'
|
||||
- '1:a?'
|
||||
- '1:s?'
|
||||
- '1:d?'
|
||||
- '1:t?'
|
||||
'-c': copy
|
||||
- '0:v?' # copy video streams
|
||||
- '1:a?' # copy audio streams
|
||||
- '1:s?' # copy subtitle streams
|
||||
- '1:d?' # copy data streams
|
||||
- '1:t?' # copy fonts
|
||||
'-c': copy # copy codec for all streams
|
||||
# '-vf': 'minterpolate=''fps=60''' # minterpolate frame interpolation
|
||||
'-map_metadata': 0 # copy known metadata tags
|
||||
# '-movflags': 'use_metadata_tags' # copy custom/arbitrary metadata tags
|
||||
'-pix_fmt': null
|
||||
'-metadata': 'comment=Upscaled by Video2X'
|
||||
'-hwaccel': auto
|
||||
'-y': true
|
||||
gifski:
|
||||
gifski_path: '%LOCALAPPDATA%\video2x\gifski\win\gifski'
|
||||
# output: null # Destination file to write to
|
||||
# fps: 20 # Animation frames per second (for PNG frames only) [default: 20]
|
||||
fast: false # 3 times faster encoding, but 10% lower quality and bigger file
|
||||
quality: 100 # Lower quality may give smaller file
|
||||
width: null # Maximum width
|
||||
height: null # Maximum height (if width is also set)
|
||||
once: false # Do not loop the GIF
|
||||
nosort: false # Use files exactly in the order given, rather than sorted
|
||||
quiet: false # Do not show a progress bar
|
||||
video2x:
|
||||
video2x_cache_directory: null # default: %TEMP%\video2x
|
||||
image_format: png
|
||||
preserve_frames: false
|
||||
video2x_cache_directory: null # default: %TEMP%\video2x, directory where cache files are stored, will be deleted if preserve_frames is not set to true
|
||||
image_format: png # png/jpg intermediate file format used for extracted frames during video processing
|
||||
preserve_frames: false # if set to true, the cache directory won't be cleaned upon task completion
|
||||
|
||||
@@ -4,14 +4,20 @@
|
||||
Creator: Video2X GUI
|
||||
Author: K4YT3X
|
||||
Date Created: May 5, 2020
|
||||
Last Modified: May 10, 2020
|
||||
Last Modified: June 4, 2020
|
||||
"""
|
||||
|
||||
# local imports
|
||||
from bilogger import BiLogger
|
||||
from upscaler import UPSCALER_VERSION
|
||||
from upscaler import Upscaler
|
||||
from wrappers.ffmpeg import Ffmpeg
|
||||
|
||||
# built-in imports
|
||||
import contextlib
|
||||
import datetime
|
||||
import json
|
||||
import mimetypes
|
||||
import os
|
||||
import pathlib
|
||||
import sys
|
||||
@@ -22,14 +28,16 @@ import urllib
|
||||
import yaml
|
||||
|
||||
# third-party imports
|
||||
from PyQt5 import QtGui, uic
|
||||
from PyQt5 import uic
|
||||
from PyQt5.QtCore import *
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtWidgets import *
|
||||
# QObject, pyqtSlot, pyqtSignal, QRunnable, QThreadPool, QAbstractTableModel, Qt
|
||||
import magic
|
||||
|
||||
VERSION = '2.0.0'
|
||||
GUI_VERSION = '2.6.0'
|
||||
|
||||
LEGAL_INFO = f'''Video2X GUI Version: {VERSION}\\
|
||||
LEGAL_INFO = f'''Video2X GUI Version: {GUI_VERSION}\\
|
||||
Upscaler Version: {UPSCALER_VERSION}\\
|
||||
Author: K4YT3X\\
|
||||
License: GNU GPL v3\\
|
||||
Github Page: [https://github.com/k4yt3x/video2x](https://github.com/k4yt3x/video2x)\\
|
||||
@@ -40,6 +48,7 @@ AVAILABLE_DRIVERS = {
|
||||
'Waifu2X Converter CPP': 'waifu2x_converter_cpp',
|
||||
'Waifu2X NCNN Vulkan': 'waifu2x_ncnn_vulkan',
|
||||
'SRMD NCNN Vulkan': 'srmd_ncnn_vulkan',
|
||||
'RealSR NCNN Vulkan': 'realsr_ncnn_vulkan',
|
||||
'Anime4KCPP': 'anime4kcpp'
|
||||
}
|
||||
|
||||
@@ -110,13 +119,45 @@ class InputTableModel(QAbstractTableModel):
|
||||
def data(self, index, role):
|
||||
if role == Qt.DisplayRole:
|
||||
|
||||
file_path = self._data[index.row()]
|
||||
|
||||
if index.column() == 0:
|
||||
return str(self._data[index.row()].absolute())
|
||||
return str(file_path.absolute())
|
||||
else:
|
||||
if self._data[index.row()].is_file():
|
||||
return 'File'
|
||||
elif self._data[index.row()].is_dir():
|
||||
|
||||
# determine file type
|
||||
# if path is a folder
|
||||
if file_path.is_dir():
|
||||
return 'Folder'
|
||||
|
||||
# if path is single file
|
||||
# determine file type
|
||||
elif file_path.is_file():
|
||||
try:
|
||||
input_file_mime_type = magic.from_file(str(file_path.absolute()), mime=True)
|
||||
input_file_type = input_file_mime_type.split('/')[0]
|
||||
input_file_subtype = input_file_mime_type.split('/')[1]
|
||||
except magic.magic.MagicException:
|
||||
input_file_type = input_file_subtype = None
|
||||
|
||||
# in case python-magic fails to detect file type
|
||||
# try guessing file mime type with mimetypes
|
||||
if input_file_type not in ['image', 'video']:
|
||||
input_file_mime_type = mimetypes.guess_type(file_path.name)[0]
|
||||
input_file_type = input_file_mime_type.split('/')[0]
|
||||
input_file_subtype = input_file_mime_type.split('/')[1]
|
||||
|
||||
if input_file_type == 'image':
|
||||
if input_file_subtype == 'gif':
|
||||
return 'GIF'
|
||||
return 'Image'
|
||||
|
||||
elif input_file_type == 'video':
|
||||
return 'Video'
|
||||
|
||||
else:
|
||||
return 'Unknown'
|
||||
|
||||
else:
|
||||
return 'Unknown'
|
||||
|
||||
@@ -151,17 +192,31 @@ class Video2XMainWindow(QMainWindow):
|
||||
super().__init__(*args, **kwargs)
|
||||
uic.loadUi(str(resource_path('video2x_gui.ui')), self)
|
||||
|
||||
# generate log file name
|
||||
self.logfile = pathlib.Path(__file__).parent.absolute() / f'video2x_{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}.log'
|
||||
|
||||
# create thread pool for upscaler workers
|
||||
self.threadpool = QThreadPool()
|
||||
|
||||
# set window title and icon
|
||||
self.video2x_icon_path = str(resource_path('images/video2x.png'))
|
||||
self.setWindowTitle(f'Video2X GUI {VERSION}')
|
||||
self.setWindowIcon(QtGui.QIcon(self.video2x_icon_path))
|
||||
self.setWindowTitle(f'Video2X GUI {GUI_VERSION}')
|
||||
self.setWindowIcon(QIcon(self.video2x_icon_path))
|
||||
|
||||
# register shortcut keys
|
||||
QShortcut(QKeySequence(Qt.CTRL + Qt.Key_W), self, self.close)
|
||||
QShortcut(QKeySequence(Qt.CTRL + Qt.Key_Q), self, self.close)
|
||||
QShortcut(QKeySequence(Qt.CTRL + Qt.Key_I), self, self.select_input_file)
|
||||
QShortcut(QKeySequence(Qt.CTRL + Qt.Key_O), self, self.select_output_file)
|
||||
QShortcut(QKeySequence(Qt.CTRL + Qt.SHIFT + Qt.Key_I), self, self.select_input_folder)
|
||||
QShortcut(QKeySequence(Qt.CTRL + Qt.SHIFT + Qt.Key_O), self, self.select_output_folder)
|
||||
|
||||
# menu bar
|
||||
self.action_exit = self.findChild(QAction, 'actionExit')
|
||||
self.action_exit.triggered.connect(sys.exit)
|
||||
self.action_exit.triggered.connect(self.close)
|
||||
|
||||
self.action_shortcuts = self.findChild(QAction, 'actionShortcuts')
|
||||
self.action_shortcuts.triggered.connect(self.show_shortcuts)
|
||||
|
||||
self.action_about = self.findChild(QAction, 'actionAbout')
|
||||
self.action_about.triggered.connect(self.show_about)
|
||||
@@ -300,6 +355,17 @@ class Video2XMainWindow(QMainWindow):
|
||||
self.srmd_ncnn_vulkan_jobs_line_edit = self.findChild(QLineEdit, 'srmdNcnnVulkanJobsLineEdit')
|
||||
self.srmd_ncnn_vulkan_tta_check_box = self.findChild(QCheckBox, 'srmdNcnnVulkanTtaCheckBox')
|
||||
|
||||
# realsr-ncnn-vulkan
|
||||
self.realsr_ncnn_vulkan_path_line_edit = self.findChild(QLineEdit, 'realsrNcnnVulkanPathLineEdit')
|
||||
self.enable_line_edit_file_drop(self.realsr_ncnn_vulkan_path_line_edit)
|
||||
self.realsr_ncnn_vulkan_path_select_button = self.findChild(QPushButton, 'realsrNcnnVulkanPathSelectButton')
|
||||
self.realsr_ncnn_vulkan_path_select_button.clicked.connect(lambda: self.select_driver_binary_path(self.realsr_ncnn_vulkan_path_line_edit))
|
||||
self.realsr_ncnn_vulkan_tile_size_spin_box = self.findChild(QSpinBox, 'realsrNcnnVulkanTileSizeSpinBox')
|
||||
self.realsr_ncnn_vulkan_model_combo_box = self.findChild(QComboBox, 'realsrNcnnVulkanModelComboBox')
|
||||
self.realsr_ncnn_vulkan_gpu_id_spin_box = self.findChild(QSpinBox, 'realsrNcnnVulkanGpuIdSpinBox')
|
||||
self.realsr_ncnn_vulkan_jobs_line_edit = self.findChild(QLineEdit, 'realsrNcnnVulkanJobsLineEdit')
|
||||
self.realsr_ncnn_vulkan_tta_check_box = self.findChild(QCheckBox, 'realsrNcnnVulkanTtaCheckBox')
|
||||
|
||||
# anime4k
|
||||
self.anime4kcpp_path_line_edit = self.findChild(QLineEdit, 'anime4kCppPathLineEdit')
|
||||
self.enable_line_edit_file_drop(self.anime4kcpp_path_line_edit)
|
||||
@@ -320,42 +386,60 @@ class Video2XMainWindow(QMainWindow):
|
||||
self.anime4kcpp_post_processing_check_box = self.findChild(QCheckBox, 'anime4kCppPostProcessingCheckBox')
|
||||
self.anime4kcpp_gpu_mode_check_box = self.findChild(QCheckBox, 'anime4kCppGpuModeCheckBox')
|
||||
|
||||
# load configurations
|
||||
# FFmpeg settings
|
||||
# global options
|
||||
self.ffmpeg_path_line_edit = self.findChild(QLineEdit, 'ffmpegPathLineEdit')
|
||||
self.enable_line_edit_file_drop(self.ffmpeg_path_line_edit)
|
||||
self.ffmpeg_path_select_button = self.findChild(QPushButton, 'ffmpegPathSelectButton')
|
||||
self.ffmpeg_path_select_button.clicked.connect(lambda: self.select_driver_binary_path(self.ffmpeg_path_line_edit))
|
||||
self.ffmpeg_intermediate_file_name_line_edit = self.findChild(QLineEdit, 'ffmpegIntermediateFileNameLineEdit')
|
||||
|
||||
# extract frames
|
||||
self.ffmpeg_extract_frames_output_options_pixel_format_line_edit = self.findChild(QLineEdit, 'ffmpegExtractFramesOutputOptionsPixelFormatLineEdit')
|
||||
self.ffmpeg_extract_frames_hardware_acceleration_check_box = self.findChild(QCheckBox, 'ffmpegExtractFramesHardwareAccelerationCheckBox')
|
||||
|
||||
# assemble video
|
||||
self.ffmpeg_assemble_video_input_options_force_format_line_edit = self.findChild(QLineEdit, 'ffmpegAssembleVideoInputOptionsForceFormatLineEdit')
|
||||
self.ffmpeg_assemble_video_output_options_video_codec_line_edit = self.findChild(QLineEdit, 'ffmpegAssembleVideoOutputOptionsVideoCodecLineEdit')
|
||||
self.ffmpeg_assemble_video_output_options_pixel_format_line_edit = self.findChild(QLineEdit, 'ffmpegAssembleVideoOutputOptionsPixelFormatLineEdit')
|
||||
self.ffmpeg_assemble_video_output_options_crf_spin_box = self.findChild(QSpinBox, 'ffmpegAssembleVideoOutputOptionsCrfSpinBox')
|
||||
self.ffmpeg_assemble_video_output_options_tune_combo_box = self.findChild(QComboBox, 'ffmpegAssembleVideoOutputOptionsTuneComboBox')
|
||||
self.ffmpeg_assemble_video_output_options_bitrate_line_edit = self.findChild(QLineEdit, 'ffmpegAssembleVideoOutputOptionsBitrateLineEdit')
|
||||
self.ffmpeg_assemble_video_output_options_ensure_divisible_check_box = self.findChild(QCheckBox, 'ffmpegAssembleVideoOutputOptionsEnsureDivisibleCheckBox')
|
||||
self.ffmpeg_assemble_video_hardware_acceleration_check_box = self.findChild(QCheckBox, 'ffmpegAssembleVideoHardwareAccelerationCheckBox')
|
||||
|
||||
# migrate_streams
|
||||
self.ffmpeg_migrate_streams_output_options_mapping_video_check_box_check_box = self.findChild(QCheckBox, 'ffmpegMigrateStreamsOutputOptionsMappingVideoCheckBox')
|
||||
self.ffmpeg_migrate_streams_output_options_mapping_audio_check_box_check_box = self.findChild(QCheckBox, 'ffmpegMigrateStreamsOutputOptionsMappingAudioCheckBox')
|
||||
self.ffmpeg_migrate_streams_output_options_mapping_subtitle_check_box_check_box = self.findChild(QCheckBox, 'ffmpegMigrateStreamsOutputOptionsMappingSubtitleCheckBox')
|
||||
self.ffmpeg_migrate_streams_output_options_mapping_data_check_box_check_box = self.findChild(QCheckBox, 'ffmpegMigrateStreamsOutputOptionsMappingDataCheckBox')
|
||||
self.ffmpeg_migrate_streams_output_options_mapping_font_check_box_check_box = self.findChild(QCheckBox, 'ffmpegMigrateStreamsOutputOptionsMappingFontCheckBox')
|
||||
self.ffmpeg_migrate_streams_output_options_pixel_format_line_edit = self.findChild(QLineEdit, 'ffmpegMigrateStreamsOutputOptionsPixelFormatLineEdit')
|
||||
self.ffmpeg_migrate_streams_output_options_frame_interpolation_spin_box = self.findChild(QSpinBox, 'ffmpegMigrateStreamsOutputOptionsFrameInterpolationSpinBox')
|
||||
self.ffmpeg_migrate_streams_output_options_frame_interpolation_spin_box.valueChanged.connect(self.mutually_exclude_frame_interpolation_stream_copy)
|
||||
self.ffmpeg_migrate_streams_output_options_frame_interpolation_spin_box.textChanged.connect(self.mutually_exclude_frame_interpolation_stream_copy)
|
||||
self.ffmpeg_migrate_streams_output_options_copy_streams_check_box = self.findChild(QCheckBox, 'ffmpegMigrateStreamsOutputOptionsCopyStreamsCheckBox')
|
||||
self.ffmpeg_migrate_streams_output_options_copy_known_metadata_tags_check_box = self.findChild(QCheckBox, 'ffmpegMigrateStreamsOutputOptionsCopyKnownMetadataTagsCheckBox')
|
||||
self.ffmpeg_migrate_streams_output_options_copy_arbitrary_metadata_tags_check_box = self.findChild(QCheckBox, 'ffmpegMigrateStreamsOutputOptionsCopyArbitraryMetadataTagsCheckBox')
|
||||
self.ffmpeg_migrate_streams_hardware_acceleration_check_box = self.findChild(QCheckBox, 'ffmpegMigrateStreamsHardwareAccelerationCheckBox')
|
||||
|
||||
# Gifski settings
|
||||
self.gifski_path_line_edit = self.findChild(QLineEdit, 'gifskiPathLineEdit')
|
||||
self.enable_line_edit_file_drop(self.gifski_path_line_edit)
|
||||
self.gifski_quality_spin_box = self.findChild(QSpinBox, 'gifskiQualitySpinBox')
|
||||
self.gifski_width_spin_box = self.findChild(QSpinBox, 'gifskiWidthSpinBox')
|
||||
self.gifski_height_spin_box = self.findChild(QSpinBox, 'gifskiHeightSpinBox')
|
||||
self.gifski_fast_check_box = self.findChild(QCheckBox, 'gifskiFastCheckBox')
|
||||
self.gifski_once_check_box = self.findChild(QCheckBox, 'gifskiOnceCheckBox')
|
||||
self.gifski_quiet_check_box = self.findChild(QCheckBox, 'gifskiQuietCheckBox')
|
||||
|
||||
# Tools
|
||||
self.ffprobe_plain_text_edit = self.findChild(QPlainTextEdit, 'ffprobePlainTextEdit')
|
||||
self.ffprobe_plain_text_edit.dropEvent = self.show_ffprobe_output
|
||||
|
||||
# load configurations after GUI initialization
|
||||
self.load_configurations()
|
||||
|
||||
def dragEnterEvent(self, event):
|
||||
if event.mimeData().hasUrls():
|
||||
event.accept()
|
||||
else:
|
||||
event.ignore()
|
||||
|
||||
def dropEvent(self, event):
|
||||
input_paths = [pathlib.Path(u.toLocalFile()) for u in event.mimeData().urls()]
|
||||
for path in input_paths:
|
||||
if (path.is_file() or path.is_dir()) and not self.input_table_path_exists(path):
|
||||
self.input_table_data.append(path)
|
||||
|
||||
self.update_input_table()
|
||||
self.update_output_path()
|
||||
|
||||
def enable_line_edit_file_drop(self, line_edit: QLineEdit):
|
||||
line_edit.dragEnterEvent = self.dragEnterEvent
|
||||
line_edit.dropEvent = lambda event: line_edit.setText(str(pathlib.Path(event.mimeData().urls()[0].toLocalFile()).absolute()))
|
||||
|
||||
@staticmethod
|
||||
def read_config(config_file: pathlib.Path) -> dict:
|
||||
""" read video2x configurations from config file
|
||||
|
||||
Arguments:
|
||||
config_file {pathlib.Path} -- video2x configuration file pathlib.Path
|
||||
|
||||
Returns:
|
||||
dict -- dictionary of video2x configuration
|
||||
"""
|
||||
|
||||
with open(config_file, 'r') as config:
|
||||
return yaml.load(config, Loader=yaml.FullLoader)
|
||||
|
||||
def load_configurations(self):
|
||||
|
||||
# get config file path from line edit
|
||||
@@ -373,6 +457,10 @@ class Video2XMainWindow(QMainWindow):
|
||||
self.ffmpeg_settings = self.config['ffmpeg']
|
||||
self.ffmpeg_settings['ffmpeg_path'] = str(pathlib.Path(os.path.expandvars(self.ffmpeg_settings['ffmpeg_path'])).absolute())
|
||||
|
||||
# read Gifski configuration
|
||||
self.gifski_settings = self.config['gifski']
|
||||
self.gifski_settings['gifski_path'] = str(pathlib.Path(os.path.expandvars(self.gifski_settings['gifski_path'])).absolute())
|
||||
|
||||
# set cache directory path
|
||||
if self.config['video2x']['video2x_cache_directory'] is None:
|
||||
self.config['video2x']['video2x_cache_directory'] = str((pathlib.Path(tempfile.gettempdir()) / 'video2x').absolute())
|
||||
@@ -429,6 +517,14 @@ class Video2XMainWindow(QMainWindow):
|
||||
self.srmd_ncnn_vulkan_jobs_line_edit.setText(settings['j'])
|
||||
self.srmd_ncnn_vulkan_tta_check_box.setChecked(settings['x'])
|
||||
|
||||
# realsr-ncnn-vulkan
|
||||
settings = self.config['realsr_ncnn_vulkan']
|
||||
self.realsr_ncnn_vulkan_path_line_edit.setText(str(pathlib.Path(os.path.expandvars(settings['path'])).absolute()))
|
||||
self.realsr_ncnn_vulkan_tile_size_spin_box.setValue(settings['t'])
|
||||
self.realsr_ncnn_vulkan_gpu_id_spin_box.setValue(settings['g'])
|
||||
self.realsr_ncnn_vulkan_jobs_line_edit.setText(settings['j'])
|
||||
self.realsr_ncnn_vulkan_tta_check_box.setChecked(settings['x'])
|
||||
|
||||
# anime4k
|
||||
settings = self.config['anime4kcpp']
|
||||
self.anime4kcpp_path_line_edit.setText(str(pathlib.Path(os.path.expandvars(settings['path'])).absolute()))
|
||||
@@ -447,6 +543,40 @@ class Video2XMainWindow(QMainWindow):
|
||||
self.anime4kcpp_post_processing_check_box.setChecked(settings['postprocessing'])
|
||||
self.anime4kcpp_gpu_mode_check_box.setChecked(settings['GPUMode'])
|
||||
|
||||
# ffmpeg
|
||||
# global options
|
||||
settings = self.config['ffmpeg']
|
||||
self.ffmpeg_path_line_edit.setText(str(pathlib.Path(os.path.expandvars(settings['ffmpeg_path'])).absolute()))
|
||||
self.ffmpeg_intermediate_file_name_line_edit.setText(settings['intermediate_file_name'])
|
||||
|
||||
# extract frames
|
||||
settings = self.config['ffmpeg']['extract_frames']
|
||||
self.ffmpeg_extract_frames_output_options_pixel_format_line_edit.setText(settings['output_options']['-pix_fmt'])
|
||||
|
||||
# assemble video
|
||||
settings = self.config['ffmpeg']['assemble_video']
|
||||
self.ffmpeg_assemble_video_input_options_force_format_line_edit.setText(settings['input_options']['-f'])
|
||||
self.ffmpeg_assemble_video_output_options_video_codec_line_edit.setText(settings['output_options']['-vcodec'])
|
||||
self.ffmpeg_assemble_video_output_options_pixel_format_line_edit.setText(settings['output_options']['-pix_fmt'])
|
||||
self.ffmpeg_assemble_video_output_options_crf_spin_box.setValue(settings['output_options']['-crf'])
|
||||
self.ffmpeg_assemble_video_output_options_tune_combo_box.setCurrentText(settings['output_options']['-tune'])
|
||||
self.ffmpeg_assemble_video_output_options_bitrate_line_edit.setText(settings['output_options']['-b:v'])
|
||||
|
||||
# migrate streams
|
||||
settings = self.config['ffmpeg']['migrate_streams']
|
||||
self.ffmpeg_migrate_streams_output_options_pixel_format_line_edit.setText(settings['output_options']['-pix_fmt'])
|
||||
|
||||
# Gifski
|
||||
settings = self.config['gifski']
|
||||
self.gifski_path_line_edit.setText(str(pathlib.Path(os.path.expandvars(settings['gifski_path'])).absolute()))
|
||||
self.gifski_quality_spin_box.setValue(settings['quality'])
|
||||
if isinstance(settings['width'], int) and isinstance(settings['height'], int):
|
||||
self.gifski_width_spin_box.setValue(settings['width'])
|
||||
self.gifski_height_spin_box.setValue(settings['height'])
|
||||
self.gifski_fast_check_box.setChecked(settings['fast'])
|
||||
self.gifski_once_check_box.setChecked(settings['once'])
|
||||
self.gifski_quiet_check_box.setChecked(settings['quiet'])
|
||||
|
||||
def resolve_driver_settings(self):
|
||||
|
||||
# waifu2x-caffe
|
||||
@@ -496,6 +626,14 @@ class Video2XMainWindow(QMainWindow):
|
||||
self.config['srmd_ncnn_vulkan']['j'] = self.srmd_ncnn_vulkan_jobs_line_edit.text()
|
||||
self.config['srmd_ncnn_vulkan']['x'] = self.srmd_ncnn_vulkan_tta_check_box.isChecked()
|
||||
|
||||
# realsr-ncnn-vulkan
|
||||
self.config['realsr_ncnn_vulkan']['path'] = os.path.expandvars(self.realsr_ncnn_vulkan_path_line_edit.text())
|
||||
self.config['realsr_ncnn_vulkan']['t'] = self.realsr_ncnn_vulkan_tile_size_spin_box.value()
|
||||
self.config['realsr_ncnn_vulkan']['m'] = str((pathlib.Path(self.config['realsr_ncnn_vulkan']['path']).parent / self.realsr_ncnn_vulkan_model_combo_box.currentText()).absolute())
|
||||
self.config['realsr_ncnn_vulkan']['g'] = self.realsr_ncnn_vulkan_gpu_id_spin_box.value()
|
||||
self.config['realsr_ncnn_vulkan']['j'] = self.realsr_ncnn_vulkan_jobs_line_edit.text()
|
||||
self.config['realsr_ncnn_vulkan']['x'] = self.realsr_ncnn_vulkan_tta_check_box.isChecked()
|
||||
|
||||
# anime4k
|
||||
self.config['anime4kcpp']['path'] = os.path.expandvars(self.anime4kcpp_path_line_edit.text())
|
||||
self.config['anime4kcpp']['passes'] = self.anime4kcpp_passes_spin_box.value()
|
||||
@@ -513,6 +651,163 @@ class Video2XMainWindow(QMainWindow):
|
||||
self.config['anime4kcpp']['postprocessing'] = bool(self.anime4kcpp_post_processing_check_box.isChecked())
|
||||
self.config['anime4kcpp']['GPUMode'] = bool(self.anime4kcpp_gpu_mode_check_box.isChecked())
|
||||
|
||||
# ffmpeg
|
||||
self.config['ffmpeg']['ffmpeg_path'] = os.path.expandvars(self.ffmpeg_path_line_edit.text())
|
||||
self.config['ffmpeg']['intermediate_file_name'] = self.ffmpeg_intermediate_file_name_line_edit.text()
|
||||
|
||||
# extract frames
|
||||
self.config['ffmpeg']['extract_frames']['output_options']['-pix_fmt'] = self.ffmpeg_extract_frames_output_options_pixel_format_line_edit.text()
|
||||
if self.ffmpeg_extract_frames_hardware_acceleration_check_box.isChecked():
|
||||
self.config['ffmpeg']['extract_frames']['-hwaccel'] = 'auto'
|
||||
else:
|
||||
self.config['ffmpeg']['extract_frames'].pop('-hwaccel', None)
|
||||
|
||||
# assemble video
|
||||
self.config['ffmpeg']['assemble_video']['input_options']['-f'] = self.ffmpeg_assemble_video_input_options_force_format_line_edit.text()
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-vcodec'] = self.ffmpeg_assemble_video_output_options_video_codec_line_edit.text()
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-pix_fmt'] = self.ffmpeg_assemble_video_output_options_pixel_format_line_edit.text()
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-crf'] = self.ffmpeg_assemble_video_output_options_crf_spin_box.value()
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-tune'] = self.ffmpeg_assemble_video_output_options_tune_combo_box.currentText()
|
||||
if self.ffmpeg_assemble_video_output_options_bitrate_line_edit.text() != '':
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-b:v'] = self.ffmpeg_assemble_video_output_options_bitrate_line_edit.text()
|
||||
else:
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-b:v'] = None
|
||||
|
||||
if self.ffmpeg_assemble_video_output_options_ensure_divisible_check_box.isChecked():
|
||||
# if video filter is enabled and is not empty and is not equal to divisible by two filter
|
||||
# append divisible by two filter to the end of existing filter
|
||||
if ('-vf' in self.config['ffmpeg']['assemble_video']['output_options'] and
|
||||
len(self.config['ffmpeg']['assemble_video']['output_options']['-vf']) > 0 and
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-vf'] != 'pad=ceil(iw/2)*2:ceil(ih/2)*2'):
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-vf'] += ',pad=ceil(iw/2)*2:ceil(ih/2)*2'
|
||||
else:
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-vf'] = 'pad=ceil(iw/2)*2:ceil(ih/2)*2'
|
||||
else:
|
||||
self.config['ffmpeg']['assemble_video']['output_options'].pop('-vf', None)
|
||||
|
||||
if self.ffmpeg_assemble_video_hardware_acceleration_check_box.isChecked():
|
||||
self.config['ffmpeg']['assemble_video']['-hwaccel'] = 'auto'
|
||||
else:
|
||||
self.config['ffmpeg']['assemble_video'].pop('-hwaccel', None)
|
||||
|
||||
# migrate streams
|
||||
|
||||
self.config['ffmpeg']['migrate_streams']['output_options']['-map'] = []
|
||||
if self.ffmpeg_migrate_streams_output_options_mapping_video_check_box_check_box.isChecked():
|
||||
self.config['ffmpeg']['migrate_streams']['output_options']['-map'].append('0:v?')
|
||||
if self.ffmpeg_migrate_streams_output_options_mapping_audio_check_box_check_box.isChecked():
|
||||
self.config['ffmpeg']['migrate_streams']['output_options']['-map'].append('1:a?')
|
||||
if self.ffmpeg_migrate_streams_output_options_mapping_subtitle_check_box_check_box.isChecked():
|
||||
self.config['ffmpeg']['migrate_streams']['output_options']['-map'].append('1:s?')
|
||||
if self.ffmpeg_migrate_streams_output_options_mapping_data_check_box_check_box.isChecked():
|
||||
self.config['ffmpeg']['migrate_streams']['output_options']['-map'].append('1:d?')
|
||||
if self.ffmpeg_migrate_streams_output_options_mapping_font_check_box_check_box.isChecked():
|
||||
self.config['ffmpeg']['migrate_streams']['output_options']['-map'].append('1:t?')
|
||||
|
||||
# if the list is empty, delete the key
|
||||
# otherwise parser will run into an error (key with no value)
|
||||
if len(self.config['ffmpeg']['migrate_streams']['output_options']['-map']) == 0:
|
||||
self.config['ffmpeg']['migrate_streams']['output_options'].pop('-map', None)
|
||||
|
||||
self.config['ffmpeg']['migrate_streams']['output_options']['-pix_fmt'] = self.ffmpeg_migrate_streams_output_options_pixel_format_line_edit.text()
|
||||
|
||||
if (fps := self.ffmpeg_migrate_streams_output_options_frame_interpolation_spin_box.value()) > 0:
|
||||
if ('-vf' in self.config['ffmpeg']['migrate_streams']['output_options'] and
|
||||
len(self.config['ffmpeg']['migrate_streams']['output_options']['-vf']) > 0 and
|
||||
'minterpolate=' not in self.config['ffmpeg']['migrate_streams']['output_options']['-vf']):
|
||||
self.config['ffmpeg']['migrate_streams']['output_options']['-vf'] += f',minterpolate=\'fps={fps}\''
|
||||
else:
|
||||
self.config['ffmpeg']['migrate_streams']['output_options']['-vf'] = f'minterpolate=\'fps={fps}\''
|
||||
else:
|
||||
self.config['ffmpeg']['migrate_streams']['output_options'].pop('-vf', None)
|
||||
|
||||
# copy source codec
|
||||
if self.ffmpeg_migrate_streams_output_options_copy_streams_check_box.isChecked():
|
||||
self.config['ffmpeg']['migrate_streams']['output_options']['-c'] = 'copy'
|
||||
else:
|
||||
self.config['ffmpeg']['migrate_streams']['output_options'].pop('-c', None)
|
||||
|
||||
# copy known metadata
|
||||
if self.ffmpeg_migrate_streams_output_options_copy_known_metadata_tags_check_box.isChecked():
|
||||
self.config['ffmpeg']['migrate_streams']['output_options']['-map_metadata'] = 0
|
||||
else:
|
||||
self.config['ffmpeg']['migrate_streams']['output_options'].pop('-map_metadata', None)
|
||||
|
||||
# copy arbitrary metadata
|
||||
if self.ffmpeg_migrate_streams_output_options_copy_arbitrary_metadata_tags_check_box.isChecked():
|
||||
self.config['ffmpeg']['migrate_streams']['output_options']['-movflags'] = 'use_metadata_tags'
|
||||
else:
|
||||
self.config['ffmpeg']['migrate_streams']['output_options'].pop('-movflags', None)
|
||||
|
||||
# hardware acceleration
|
||||
if self.ffmpeg_migrate_streams_hardware_acceleration_check_box.isChecked():
|
||||
self.config['ffmpeg']['migrate_streams']['-hwaccel'] = 'auto'
|
||||
else:
|
||||
self.config['ffmpeg']['migrate_streams'].pop('-hwaccel', None)
|
||||
|
||||
# Gifski
|
||||
self.config['gifski']['gifski_path'] = os.path.expandvars(self.gifski_path_line_edit.text())
|
||||
self.config['gifski']['quality'] = self.gifski_quality_spin_box.value()
|
||||
if self.gifski_width_spin_box.value() > 0 and self.gifski_height_spin_box.value() > 0:
|
||||
self.config['gifski']['width'] = self.gifski_width_spin_box.value()
|
||||
self.config['gifski']['height'] = self.gifski_height_spin_box.value()
|
||||
else:
|
||||
self.config['gifski']['width'] = None
|
||||
self.config['gifski']['height'] = None
|
||||
self.config['gifski']['fast'] = self.gifski_fast_check_box.isChecked()
|
||||
self.config['gifski']['once'] = self.gifski_once_check_box.isChecked()
|
||||
self.config['gifski']['quiet'] = self.gifski_quiet_check_box.isChecked()
|
||||
|
||||
def dragEnterEvent(self, event):
|
||||
if event.mimeData().hasUrls():
|
||||
event.accept()
|
||||
else:
|
||||
event.ignore()
|
||||
|
||||
def dropEvent(self, event):
|
||||
input_paths = [pathlib.Path(u.toLocalFile()) for u in event.mimeData().urls()]
|
||||
for path in input_paths:
|
||||
if (path.is_file() or path.is_dir()) and not self.input_table_path_exists(path):
|
||||
self.input_table_data.append(path)
|
||||
|
||||
self.update_output_path()
|
||||
self.update_input_table()
|
||||
|
||||
def enable_line_edit_file_drop(self, line_edit: QLineEdit):
|
||||
line_edit.dragEnterEvent = self.dragEnterEvent
|
||||
line_edit.dropEvent = lambda event: line_edit.setText(str(pathlib.Path(event.mimeData().urls()[0].toLocalFile()).absolute()))
|
||||
|
||||
def show_ffprobe_output(self, event):
|
||||
input_paths = [pathlib.Path(u.toLocalFile()) for u in event.mimeData().urls()]
|
||||
if not input_paths[0].is_file():
|
||||
return
|
||||
|
||||
ffmpeg_object = Ffmpeg(self.ffmpeg_settings)
|
||||
file_info_json = ffmpeg_object.probe_file_info(input_paths[0])
|
||||
self.ffprobe_plain_text_edit.setPlainText(json.dumps(file_info_json, indent=2))
|
||||
|
||||
@staticmethod
|
||||
def read_config(config_file: pathlib.Path) -> dict:
|
||||
""" read video2x configurations from config file
|
||||
|
||||
Arguments:
|
||||
config_file {pathlib.Path} -- video2x configuration file pathlib.Path
|
||||
|
||||
Returns:
|
||||
dict -- dictionary of video2x configuration
|
||||
"""
|
||||
|
||||
with open(config_file, 'r') as config:
|
||||
return yaml.load(config, Loader=yaml.FullLoader)
|
||||
|
||||
def mutually_exclude_frame_interpolation_stream_copy(self):
|
||||
if self.ffmpeg_migrate_streams_output_options_frame_interpolation_spin_box.value() > 0:
|
||||
self.ffmpeg_migrate_streams_output_options_copy_streams_check_box.setChecked(False)
|
||||
self.ffmpeg_migrate_streams_output_options_copy_streams_check_box.setDisabled(True)
|
||||
else:
|
||||
self.ffmpeg_migrate_streams_output_options_copy_streams_check_box.setChecked(True)
|
||||
self.ffmpeg_migrate_streams_output_options_copy_streams_check_box.setDisabled(False)
|
||||
|
||||
def update_gui_for_driver(self):
|
||||
current_driver = AVAILABLE_DRIVERS[self.driver_combo_box.currentText()]
|
||||
|
||||
@@ -529,6 +824,10 @@ class Video2XMainWindow(QMainWindow):
|
||||
self.scale_ratio_double_spin_box.setMinimum(2.0)
|
||||
self.scale_ratio_double_spin_box.setMaximum(4.0)
|
||||
self.scale_ratio_double_spin_box.setValue(2.0)
|
||||
elif current_driver == 'realsr_ncnn_vulkan':
|
||||
self.scale_ratio_double_spin_box.setMinimum(4.0)
|
||||
self.scale_ratio_double_spin_box.setMaximum(4.0)
|
||||
self.scale_ratio_double_spin_box.setValue(4.0)
|
||||
|
||||
# update preferred processes/threads count
|
||||
if current_driver == 'anime4kcpp':
|
||||
@@ -543,19 +842,19 @@ class Video2XMainWindow(QMainWindow):
|
||||
self.input_table_view.setModel(self.input_table_model)
|
||||
|
||||
def input_table_delete_selected(self):
|
||||
items_to_delete = []
|
||||
for index in [i.row() for i in self.input_table_view.selectedIndexes()]:
|
||||
items_to_delete.append(self.input_table_data[index])
|
||||
indexes_to_delete = [i.row() for i in self.input_table_view.selectedIndexes()]
|
||||
for index in sorted(indexes_to_delete, reverse=True):
|
||||
del self.input_table_data[index]
|
||||
|
||||
for item in items_to_delete:
|
||||
self.input_table_data.remove(item)
|
||||
self.update_output_path()
|
||||
self.update_input_table()
|
||||
|
||||
def input_table_clear_all(self):
|
||||
self.input_table_data = []
|
||||
self.update_output_path()
|
||||
self.update_input_table()
|
||||
|
||||
def input_table_path_exists(self, input_path):
|
||||
def input_table_path_exists(self, input_path: pathlib.Path) -> bool:
|
||||
for path in self.input_table_data:
|
||||
# not using Path.samefile since file may not exist
|
||||
if str(path.absolute()) == str(input_path.absolute()):
|
||||
@@ -575,31 +874,77 @@ class Video2XMainWindow(QMainWindow):
|
||||
return pathlib.Path(folder_selected)
|
||||
|
||||
def update_output_path(self):
|
||||
# if there is more than one input
|
||||
if len(self.input_table_data) != 1:
|
||||
return
|
||||
# if input list is empty
|
||||
# clear output path
|
||||
if len(self.input_table_data) == 0:
|
||||
self.output_line_edit.setText('')
|
||||
|
||||
input_path = self.input_table_data[0]
|
||||
# give up if input path doesn't exist or isn't a file or a directory
|
||||
if not input_path.exists() or not (input_path.is_file() or input_path.is_dir()):
|
||||
return
|
||||
# if there are multiple output files
|
||||
# use cwd/output directory for output
|
||||
elif len(self.input_table_data) > 1:
|
||||
self.output_line_edit.setText(str((pathlib.Path.cwd() / 'output').absolute()))
|
||||
|
||||
if input_path.is_file():
|
||||
output_path = input_path.parent / f'{input_path.stem}_output.mp4'
|
||||
elif input_path.is_dir():
|
||||
output_path = input_path.parent / f'{input_path.stem}_output'
|
||||
# if there's only one input file
|
||||
# generate output file/directory name automatically
|
||||
elif len(self.input_table_data) == 1:
|
||||
input_path = self.input_table_data[0]
|
||||
# give up if input path doesn't exist or isn't a file or a directory
|
||||
if not input_path.exists() or not (input_path.is_file() or input_path.is_dir()):
|
||||
return
|
||||
|
||||
# try up to 1000 times
|
||||
output_path_id = 0
|
||||
while output_path.exists() and output_path_id <= 1000:
|
||||
if input_path.is_file():
|
||||
output_path = input_path.parent / pathlib.Path(f'{input_path.stem}_output_{output_path_id}.mp4')
|
||||
elif input_path.is_dir():
|
||||
output_path = input_path.parent / pathlib.Path(f'{input_path.stem}_output_{output_path_id}')
|
||||
output_path_id += 1
|
||||
|
||||
if not output_path.exists():
|
||||
self.output_line_edit.setText(str(output_path.absolute()))
|
||||
# generate suffix automatically
|
||||
try:
|
||||
input_file_mime_type = magic.from_file(str(input_path.absolute()), mime=True)
|
||||
input_file_type = input_file_mime_type.split('/')[0]
|
||||
input_file_subtype = input_file_mime_type.split('/')[1]
|
||||
except magic.magic.MagicException:
|
||||
input_file_type = input_file_subtype = None
|
||||
|
||||
# in case python-magic fails to detect file type
|
||||
# try guessing file mime type with mimetypes
|
||||
if input_file_type not in ['image', 'video']:
|
||||
input_file_mime_type = mimetypes.guess_type(input_path.name)[0]
|
||||
input_file_type = input_file_mime_type.split('/')[0]
|
||||
input_file_subtype = input_file_mime_type.split('/')[1]
|
||||
|
||||
# if input file is an image
|
||||
if input_file_type == 'image':
|
||||
|
||||
# if file is a gif, use .gif
|
||||
if input_file_subtype == 'gif':
|
||||
suffix = '.gif'
|
||||
|
||||
# otherwise, use .png by default for all images
|
||||
else:
|
||||
suffix = '.png'
|
||||
|
||||
# if input is video, use .mp4 as output by default
|
||||
elif input_file_type == 'video':
|
||||
suffix = '.mp4'
|
||||
|
||||
# if failed to detect file type
|
||||
# use input file's suffix
|
||||
else:
|
||||
suffix = input_path.suffix
|
||||
|
||||
output_path = input_path.parent / f'{input_path.stem}_output{suffix}'
|
||||
|
||||
elif input_path.is_dir():
|
||||
output_path = input_path.parent / f'{input_path.stem}_output'
|
||||
|
||||
# try up to 1000 times
|
||||
output_path_id = 0
|
||||
while output_path.exists() and output_path_id <= 1000:
|
||||
if input_path.is_file():
|
||||
output_path = input_path.parent / pathlib.Path(f'{input_path.stem}_output_{output_path_id}{suffix}')
|
||||
elif input_path.is_dir():
|
||||
output_path = input_path.parent / pathlib.Path(f'{input_path.stem}_output_{output_path_id}')
|
||||
output_path_id += 1
|
||||
|
||||
if not output_path.exists():
|
||||
self.output_line_edit.setText(str(output_path.absolute()))
|
||||
|
||||
def select_input_file(self):
|
||||
if ((input_file := self.select_file('Select Input File')) is None or
|
||||
@@ -638,15 +983,28 @@ class Video2XMainWindow(QMainWindow):
|
||||
self.config_line_edit.setText(str(config_file.absolute()))
|
||||
self.load_configurations()
|
||||
|
||||
def select_driver_binary_path(self, driver_line_edit):
|
||||
def select_driver_binary_path(self, driver_line_edit: QLineEdit):
|
||||
if (driver_binary_path := self.select_file('Select Driver Binary File')) is None:
|
||||
return
|
||||
driver_line_edit.setText(str(driver_binary_path.absolute()))
|
||||
|
||||
def show_about(self, message: str):
|
||||
def show_shortcuts(self):
|
||||
message_box = QMessageBox(self)
|
||||
message_box.setWindowTitle('Video2X Shortcuts')
|
||||
message_box.setTextFormat(Qt.MarkdownText)
|
||||
shortcut_information = '''**Ctrl+W**:\tExit application\\
|
||||
**Ctrl+Q**:\tExit application\\
|
||||
**Ctrl+I**:\tOpen select input file dialog\\
|
||||
**Ctrl+O**:\tOpen select output file dialog\\
|
||||
**Ctrl+Shift+I**:\tOpen select input folder dialog\\
|
||||
**Ctrl+Shift+O**:\tOpen select output folder dialog'''
|
||||
message_box.setText(shortcut_information)
|
||||
message_box.exec_()
|
||||
|
||||
def show_about(self):
|
||||
message_box = QMessageBox(self)
|
||||
message_box.setWindowTitle('About Video2X')
|
||||
message_box.setIconPixmap(QtGui.QPixmap(self.video2x_icon_path).scaled(64, 64))
|
||||
message_box.setIconPixmap(QPixmap(self.video2x_icon_path).scaled(64, 64))
|
||||
message_box.setTextFormat(Qt.MarkdownText)
|
||||
message_box.setText(LEGAL_INFO)
|
||||
message_box.exec_()
|
||||
@@ -673,14 +1031,15 @@ class Video2XMainWindow(QMainWindow):
|
||||
message_box.setTextFormat(Qt.MarkdownText)
|
||||
|
||||
error_message = '''Upscaler ran into an error:\\
|
||||
**{}**\\
|
||||
{}\\
|
||||
Check the console output for details.\\
|
||||
When reporting an error, please include console output.\\
|
||||
You can [submit an issue on GitHub](https://github.com/k4yt3x/video2x/issues/new?assignees=K4YT3X&labels=bug&template=bug-report.md&title={}) to report this error.'''
|
||||
message_box.setText(error_message.format(exception, urllib.parse.quote(str(exception))))
|
||||
You can [submit an issue on GitHub](https://github.com/k4yt3x/video2x/issues/new?assignees=K4YT3X&labels=bug&template=bug-report.md&title={}) to report this error.\\
|
||||
It\'s also highly recommended for you to attach the [log file]({}) under the programs\'s parent folder named {}.'''
|
||||
message_box.setText(error_message.format(exception, urllib.parse.quote(str(exception)), self.logfile.as_uri(), self.logfile.name))
|
||||
message_box.exec_()
|
||||
|
||||
def progress_monitor(self, progress_callback):
|
||||
def progress_monitor(self, progress_callback: pyqtSignal):
|
||||
|
||||
# initialize progress bar values
|
||||
upscale_begin_time = time.time()
|
||||
@@ -693,8 +1052,8 @@ You can [submit an issue on GitHub](https://github.com/k4yt3x/video2x/issues/new
|
||||
self.upscaler.total_frames_upscaled,
|
||||
self.upscaler.total_frames,
|
||||
self.upscaler.total_processed,
|
||||
self.upscaler.total_videos,
|
||||
self.upscaler.current_input_video,
|
||||
self.upscaler.total_files,
|
||||
self.upscaler.current_input_file,
|
||||
self.upscaler.last_frame_upscaled))
|
||||
time.sleep(1)
|
||||
|
||||
@@ -707,8 +1066,8 @@ You can [submit an issue on GitHub](https://github.com/k4yt3x/video2x/issues/new
|
||||
total_frames_upscaled = progress_information[1]
|
||||
total_frames = progress_information[2]
|
||||
total_processed = progress_information[3]
|
||||
total_videos = progress_information[4]
|
||||
current_input_video = progress_information[5]
|
||||
total_files = progress_information[4]
|
||||
current_input_file = progress_information[5]
|
||||
last_frame_upscaled = progress_information[6]
|
||||
|
||||
# calculate fields based on frames and time elapsed
|
||||
@@ -727,14 +1086,14 @@ You can [submit an issue on GitHub](https://github.com/k4yt3x/video2x/issues/new
|
||||
self.time_elapsed_label.setText('Time Elapsed: {}'.format(time.strftime("%H:%M:%S", time.gmtime(time_elapsed))))
|
||||
self.time_remaining_label.setText('Time Remaining: {}'.format(time.strftime("%H:%M:%S", time.gmtime(time_remaining))))
|
||||
self.rate_label.setText('Rate (FPS): {}'.format(round(rate, 2)))
|
||||
self.overall_progress_label.setText('Overall Progress: {}/{}'.format(total_processed, total_videos))
|
||||
self.overall_progress_bar.setMaximum(total_videos)
|
||||
self.overall_progress_label.setText('Overall Progress: {}/{}'.format(total_processed, total_files))
|
||||
self.overall_progress_bar.setMaximum(total_files)
|
||||
self.overall_progress_bar.setValue(total_processed)
|
||||
self.currently_processing_label.setText('Currently Processing: {}'.format(str(current_input_video.name)))
|
||||
self.currently_processing_label.setText('Currently Processing: {}'.format(str(current_input_file.name)))
|
||||
|
||||
# if show frame is checked, show preview image
|
||||
if self.frame_preview_show_preview_check_box.isChecked() and last_frame_upscaled.is_file():
|
||||
last_frame_pixmap = QtGui.QPixmap(str(last_frame_upscaled.absolute()))
|
||||
last_frame_pixmap = QPixmap(str(last_frame_upscaled.absolute()))
|
||||
# the -2 here behind geometry subtracts frame size from width and height
|
||||
self.frame_preview_label.setPixmap(last_frame_pixmap.scaled(self.frame_preview_label.width() - 2,
|
||||
self.frame_preview_label.height() - 2,
|
||||
@@ -781,6 +1140,10 @@ You can [submit an issue on GitHub](https://github.com/k4yt3x/video2x/issues/new
|
||||
self.show_warning('Output path unspecified')
|
||||
return
|
||||
|
||||
print(f'Redirecting console logs to {self.logfile}', file=sys.stderr)
|
||||
sys.stdout = BiLogger(sys.stdout, self.logfile)
|
||||
sys.stderr = BiLogger(sys.stderr, self.logfile)
|
||||
|
||||
if len(self.input_table_data) == 1:
|
||||
input_directory = self.input_table_data[0]
|
||||
else:
|
||||
@@ -798,7 +1161,8 @@ You can [submit an issue on GitHub](https://github.com/k4yt3x/video2x/issues/new
|
||||
self.upscaler = Upscaler(input_path=input_directory,
|
||||
output_path=output_directory,
|
||||
driver_settings=self.driver_settings,
|
||||
ffmpeg_settings=self.ffmpeg_settings)
|
||||
ffmpeg_settings=self.ffmpeg_settings,
|
||||
gifski_settings=self.gifski_settings)
|
||||
|
||||
# set optional options
|
||||
self.upscaler.driver = AVAILABLE_DRIVERS[self.driver_combo_box.currentText()]
|
||||
@@ -850,13 +1214,39 @@ You can [submit an issue on GitHub](https://github.com/k4yt3x/video2x/issues/new
|
||||
self.reset_progress_display()
|
||||
|
||||
def stop(self):
|
||||
with contextlib.suppress(AttributeError):
|
||||
self.upscaler.running = False
|
||||
|
||||
def closeEvent(self, event):
|
||||
try:
|
||||
# if upscaler is running, ask the user for confirmation
|
||||
if self.upscaler.running is True:
|
||||
confirmation = QMessageBox.question(self,
|
||||
'Stopping Confirmation',
|
||||
'Are you sure you want to want to stop the upscaling process?',
|
||||
QMessageBox.Yes,
|
||||
QMessageBox.No)
|
||||
# if the user indeed wants to stop processing
|
||||
if confirmation == QMessageBox.Yes:
|
||||
with contextlib.suppress(AttributeError):
|
||||
self.upscaler.running = False
|
||||
return True
|
||||
# if the user doesn't want ot stop processing
|
||||
else:
|
||||
return False
|
||||
|
||||
# if the upscaler is not running
|
||||
else:
|
||||
return True
|
||||
|
||||
# if an AttributeError happens
|
||||
# that means the upscaler object haven't been created yet
|
||||
except AttributeError:
|
||||
return True
|
||||
|
||||
def closeEvent(self, event: QCloseEvent):
|
||||
# try cleaning up temp directories
|
||||
self.stop()
|
||||
event.accept()
|
||||
if self.stop():
|
||||
event.accept()
|
||||
else:
|
||||
event.ignore()
|
||||
|
||||
|
||||
# this file shouldn't be imported
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.12.0, 2020-05-11T04:13:22. -->
|
||||
<!-- Written by QtCreator 4.12.0, 2020-05-26T06:35:20. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
||||
1208
src/video2x_gui.ui
1208
src/video2x_gui.ui
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
Name: Video2X Setup Script
|
||||
Creator: K4YT3X
|
||||
Date Created: November 28, 2018
|
||||
Last Modified: May 8, 2020
|
||||
Last Modified: May 30, 2020
|
||||
|
||||
Editor: BrianPetkovsek
|
||||
Editor: SAT3LL
|
||||
@@ -17,8 +17,9 @@ Installation Details:
|
||||
- waifu2x-caffe: %LOCALAPPDATA%\\video2x\\waifu2x-caffe
|
||||
- waifu2x-cpp-converter: %LOCALAPPDATA%\\video2x\\waifu2x-converter-cpp
|
||||
- waifu2x_ncnn_vulkan: %LOCALAPPDATA%\\video2x\\waifu2x-ncnn-vulkan
|
||||
- anime4kcpp: %LOCALAPPDATA%\\video2x\\anime4kcpp
|
||||
- srmd_ncnn_vulkan: %LOCALAPPDATA%\\video2x\\srmd-ncnn-vulkan
|
||||
- realsr_ncnn_vulkan: %LOCALAPPDATA%\\video2x\\realsr-ncnn-vulkan
|
||||
- anime4kcpp: %LOCALAPPDATA%\\video2x\\anime4kcpp
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
@@ -27,44 +28,50 @@ import argparse
|
||||
import contextlib
|
||||
import os
|
||||
import pathlib
|
||||
import platform
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
import tempfile
|
||||
import time
|
||||
import traceback
|
||||
import urllib
|
||||
import zipfile
|
||||
|
||||
# Requests doesn't come with windows, therefore
|
||||
# it will be installed as a dependency and imported
|
||||
# later in the script.
|
||||
# import requests
|
||||
# Some libraries don't come with default Python installation.
|
||||
# Therefore, they will be installed during the Python dependency
|
||||
# installation step and imported later in the script.
|
||||
|
||||
VERSION = '1.8.0'
|
||||
SETUP_VERSION = '2.2.1'
|
||||
|
||||
# global static variables
|
||||
LOCALAPPDATA = pathlib.Path(os.getenv('localappdata'))
|
||||
VIDEO2X_CONFIG = pathlib.Path(__file__).parent.absolute() / 'video2x.yaml'
|
||||
DRIVER_OPTIONS = ['all', 'ffmpeg', 'waifu2x_caffe', 'waifu2x_converter_cpp', 'waifu2x_ncnn_vulkan', 'anime4kcpp', 'srmd_ncnn_vulkan']
|
||||
DRIVER_OPTIONS = ['all',
|
||||
'ffmpeg',
|
||||
'gifski',
|
||||
'waifu2x_caffe',
|
||||
'waifu2x_converter_cpp',
|
||||
'waifu2x_ncnn_vulkan',
|
||||
'srmd_ncnn_vulkan',
|
||||
'realsr_ncnn_vulkan',
|
||||
'anime4kcpp']
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
"""Processes CLI arguments
|
||||
""" parse command line arguments
|
||||
"""
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
|
||||
# video options
|
||||
general_options = parser.add_argument_group('General Options')
|
||||
general_options.add_argument('-d', '--driver', help='driver to download and configure', action='store', choices=DRIVER_OPTIONS, default='all')
|
||||
|
||||
parser.add_argument('-d', '--driver', help='driver to download and configure', choices=DRIVER_OPTIONS, default='all')
|
||||
parser.add_argument('-u', '--uninstall', help='uninstall Video2X dependencies from default location', action='store_true')
|
||||
# parse arguments
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
class Video2xSetup:
|
||||
""" Install dependencies for video2x video enlarger
|
||||
""" install dependencies for video2x video enlarger
|
||||
|
||||
This library is meant to be executed as a stand-alone
|
||||
script. All files will be installed under %LOCALAPPDATA%\\video2x.
|
||||
@@ -76,32 +83,21 @@ class Video2xSetup:
|
||||
self.trash = []
|
||||
|
||||
def run(self):
|
||||
# regardless of which driver to install
|
||||
# always ensure Python modules are installed and up-to-date
|
||||
if self.download_python_modules:
|
||||
print('\nInstalling Python libraries')
|
||||
self._install_python_requirements()
|
||||
|
||||
# if all drivers are to be installed
|
||||
if self.driver == 'all':
|
||||
self._install_ffmpeg()
|
||||
self._install_waifu2x_caffe()
|
||||
self._install_waifu2x_converter_cpp()
|
||||
self._install_waifu2x_ncnn_vulkan()
|
||||
self._install_anime4kcpp()
|
||||
self._install_srmd_ncnn_vulkan()
|
||||
elif self.driver == 'ffmpeg':
|
||||
self._install_ffmpeg()
|
||||
elif self.driver == 'waifu2x_caffe':
|
||||
self._install_waifu2x_caffe()
|
||||
elif self.driver == 'waifu2x_converter_cpp':
|
||||
self._install_waifu2x_converter_cpp()
|
||||
elif self.driver == 'waifu2x_ncnn_vulkan':
|
||||
self._install_waifu2x_ncnn_vulkan()
|
||||
elif self.driver == 'anime4kcpp':
|
||||
self._install_anime4kcpp()
|
||||
elif self.driver == 'srmd_ncnn_vulkan':
|
||||
self._install_srmd_ncnn_vulkan()
|
||||
DRIVER_OPTIONS.remove('all')
|
||||
for driver in DRIVER_OPTIONS:
|
||||
getattr(self, f'_install_{driver}')()
|
||||
|
||||
print('\nGenerating Video2X configuration file')
|
||||
self._generate_config()
|
||||
# install only the selected driver
|
||||
else:
|
||||
getattr(self, f'_install_{self.driver}')()
|
||||
|
||||
print('\nCleaning up temporary files')
|
||||
self._cleanup()
|
||||
@@ -139,6 +135,22 @@ class Video2xSetup:
|
||||
with zipfile.ZipFile(ffmpeg_zip) as zipf:
|
||||
zipf.extractall(LOCALAPPDATA / 'video2x')
|
||||
|
||||
def _install_gifski(self):
|
||||
print('\nInstalling Gifski')
|
||||
import requests
|
||||
|
||||
# Get latest release of Gifski via Github API
|
||||
latest_release = requests.get('https://api.github.com/repos/ImageOptim/gifski/releases/latest').json()
|
||||
|
||||
for a in latest_release['assets']:
|
||||
if re.search(r'gifski-.*\.tar\.xz', a['browser_download_url']):
|
||||
gifski_tar_gz = download(a['browser_download_url'], tempfile.gettempdir())
|
||||
self.trash.append(gifski_tar_gz)
|
||||
|
||||
# extract and rename
|
||||
with tarfile.open(gifski_tar_gz) as archive:
|
||||
archive.extractall(LOCALAPPDATA / 'video2x' / 'gifski')
|
||||
|
||||
def _install_waifu2x_caffe(self):
|
||||
""" Install waifu2x_caffe
|
||||
"""
|
||||
@@ -183,7 +195,7 @@ class Video2xSetup:
|
||||
latest_release = requests.get('https://api.github.com/repos/nihui/waifu2x-ncnn-vulkan/releases/latest').json()
|
||||
|
||||
for a in latest_release['assets']:
|
||||
if re.search(r'waifu2x-ncnn-vulkan-\d*\.zip', a['browser_download_url']):
|
||||
if re.search(r'waifu2x-ncnn-vulkan-\d*-windows\.zip', a['browser_download_url']):
|
||||
waifu2x_ncnn_vulkan_zip = download(a['browser_download_url'], tempfile.gettempdir())
|
||||
self.trash.append(waifu2x_ncnn_vulkan_zip)
|
||||
|
||||
@@ -199,29 +211,6 @@ class Video2xSetup:
|
||||
# rename the newly extracted directory
|
||||
(LOCALAPPDATA / 'video2x' / zipf.namelist()[0]).rename(waifu2x_ncnn_vulkan_directory)
|
||||
|
||||
def _install_anime4kcpp(self):
|
||||
""" Install Anime4KCPP
|
||||
"""
|
||||
print('\nInstalling Anime4KCPP')
|
||||
|
||||
import pyunpack
|
||||
import requests
|
||||
|
||||
# get latest release of Anime4KCPP via Github API
|
||||
# at the time of writing this portion, Anime4KCPP doesn't yet have a stable release
|
||||
# therefore releases/latest won't work
|
||||
latest_release = requests.get('https://api.github.com/repos/TianZerL/Anime4KCPP/releases/latest').json()
|
||||
|
||||
for a in latest_release['assets']:
|
||||
if re.search(r'Anime4KCPP_CLI-.*-Win64-msvc\.7z', a['browser_download_url']):
|
||||
anime4kcpp_zip = download(a['browser_download_url'], tempfile.gettempdir())
|
||||
self.trash.append(anime4kcpp_zip)
|
||||
|
||||
# extract and rename
|
||||
# with py7zr.SevenZipFile(anime4kcpp_zip, mode='r') as archive:
|
||||
(LOCALAPPDATA / 'video2x' / 'anime4kcpp').mkdir(parents=True, exist_ok=True)
|
||||
pyunpack.Archive(anime4kcpp_zip).extractall(LOCALAPPDATA / 'video2x' / 'anime4kcpp')
|
||||
|
||||
def _install_srmd_ncnn_vulkan(self):
|
||||
""" Install srmd-ncnn-vulkan
|
||||
"""
|
||||
@@ -232,7 +221,7 @@ class Video2xSetup:
|
||||
latest_release = requests.get('https://api.github.com/repos/nihui/srmd-ncnn-vulkan/releases/latest').json()
|
||||
|
||||
for a in latest_release['assets']:
|
||||
if re.search(r'srmd-ncnn-vulkan-\d*\.zip', a['browser_download_url']):
|
||||
if re.search(r'srmd-ncnn-vulkan-\d*-windows\.zip', a['browser_download_url']):
|
||||
srmd_ncnn_vulkan_zip = download(a['browser_download_url'], tempfile.gettempdir())
|
||||
self.trash.append(srmd_ncnn_vulkan_zip)
|
||||
|
||||
@@ -248,41 +237,60 @@ class Video2xSetup:
|
||||
# rename the newly extracted directory
|
||||
(LOCALAPPDATA / 'video2x' / zipf.namelist()[0]).rename(srmd_ncnn_vulkan_directory)
|
||||
|
||||
def _generate_config(self):
|
||||
""" Generate video2x config
|
||||
def _install_realsr_ncnn_vulkan(self):
|
||||
""" Install realsr-ncnn-vulkan
|
||||
"""
|
||||
import yaml
|
||||
print('\nInstalling realsr-ncnn-vulkan')
|
||||
import requests
|
||||
|
||||
# open current video2x configuration file as template
|
||||
with open(VIDEO2X_CONFIG, 'r') as template:
|
||||
template_dict = yaml.load(template, Loader=yaml.FullLoader)
|
||||
template.close()
|
||||
# Get latest release of realsr-ncnn-vulkan via Github API
|
||||
latest_release = requests.get('https://api.github.com/repos/nihui/realsr-ncnn-vulkan/releases/latest').json()
|
||||
|
||||
# configure only the specified drivers
|
||||
if self.driver == 'all':
|
||||
template_dict['waifu2x_caffe']['path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-caffe' / 'waifu2x-caffe-cui')
|
||||
template_dict['waifu2x_converter_cpp']['path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-converter-cpp' / 'waifu2x-converter-cpp')
|
||||
template_dict['waifu2x_ncnn_vulkan']['path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-ncnn-vulkan' / 'waifu2x-ncnn-vulkan')
|
||||
template_dict['srmd_ncnn_vulkan']['path'] = str(LOCALAPPDATA / 'video2x' / 'srmd-ncnn-vulkan' / 'srmd-ncnn-vulkan')
|
||||
template_dict['anime4kcpp']['path'] = str(LOCALAPPDATA / 'video2x' / 'anime4kcpp' / 'CLI' / 'Anime4KCPP_CLI' / 'Anime4KCPP_CLI')
|
||||
elif self.driver == 'waifu2x_caffe':
|
||||
template_dict['waifu2x_caffe']['path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-caffe' / 'waifu2x-caffe-cui')
|
||||
elif self.driver == 'waifu2x_converter_cpp':
|
||||
template_dict['waifu2x_converter_cpp']['path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-converter-cpp' / 'waifu2x-converter-cpp')
|
||||
elif self.driver == 'waifu2x_ncnn_vulkan':
|
||||
template_dict['waifu2x_ncnn_vulkan']['path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-ncnn-vulkan' / 'waifu2x-ncnn-vulkan')
|
||||
elif self.driver == 'srmd_ncnn_vulkan':
|
||||
template_dict['srmd_ncnn_vulkan']['path'] = str(LOCALAPPDATA / 'video2x' / 'srmd-ncnn-vulkan' / 'srmd-ncnn-vulkan')
|
||||
elif self.driver == 'anime4kcpp':
|
||||
template_dict['anime4kcpp']['path'] = str(LOCALAPPDATA / 'video2x' / 'anime4kcpp' / 'CLI' / 'Anime4KCPP_CLI' / 'Anime4KCPP_CLI')
|
||||
for a in latest_release['assets']:
|
||||
if re.search(r'realsr-ncnn-vulkan-\d*-windows\.zip', a['browser_download_url']):
|
||||
realsr_ncnn_vulkan_zip = download(a['browser_download_url'], tempfile.gettempdir())
|
||||
self.trash.append(realsr_ncnn_vulkan_zip)
|
||||
|
||||
template_dict['ffmpeg']['ffmpeg_path'] = str(LOCALAPPDATA / 'video2x' / 'ffmpeg-latest-win64-static' / 'bin')
|
||||
template_dict['video2x']['video2x_cache_directory'] = None
|
||||
template_dict['video2x']['preserve_frames'] = False
|
||||
# extract and rename
|
||||
realsr_ncnn_vulkan_directory = LOCALAPPDATA / 'video2x' / 'realsr-ncnn-vulkan'
|
||||
with zipfile.ZipFile(realsr_ncnn_vulkan_zip) as zipf:
|
||||
zipf.extractall(LOCALAPPDATA / 'video2x')
|
||||
|
||||
# write configuration into file
|
||||
with open(VIDEO2X_CONFIG, 'w') as config:
|
||||
yaml.dump(template_dict, config)
|
||||
# if directory already exists, remove it
|
||||
if realsr_ncnn_vulkan_directory.exists():
|
||||
shutil.rmtree(realsr_ncnn_vulkan_directory)
|
||||
|
||||
# rename the newly extracted directory
|
||||
(LOCALAPPDATA / 'video2x' / zipf.namelist()[0]).rename(realsr_ncnn_vulkan_directory)
|
||||
|
||||
def _install_anime4kcpp(self):
|
||||
""" Install Anime4KCPP
|
||||
"""
|
||||
print('\nInstalling Anime4KCPP')
|
||||
|
||||
import patoolib
|
||||
import requests
|
||||
|
||||
# get latest release of Anime4KCPP via Github API
|
||||
# at the time of writing this portion, Anime4KCPP doesn't yet have a stable release
|
||||
# therefore releases/latest won't work
|
||||
latest_release = requests.get('https://api.github.com/repos/TianZerL/Anime4KCPP/releases/latest').json()
|
||||
|
||||
for a in latest_release['assets']:
|
||||
if re.search(r'Anime4KCPP_CLI-.*-Win64-msvc\.7z', a['browser_download_url']):
|
||||
anime4kcpp_7z = download(a['browser_download_url'], tempfile.gettempdir())
|
||||
self.trash.append(anime4kcpp_7z)
|
||||
|
||||
# if running in PyInstaller, add sys._MEIPASS\7z to path
|
||||
# this directory contains 7za.exe and its DLL files
|
||||
with contextlib.suppress(AttributeError):
|
||||
os.environ['PATH'] += f';{sys._MEIPASS}\\7z'
|
||||
|
||||
# (LOCALAPPDATA / 'video2x' / 'anime4kcpp').mkdir(parents=True, exist_ok=True)
|
||||
# pyunpack.Archive(anime4kcpp_7z).extractall(LOCALAPPDATA / 'video2x' / 'anime4kcpp')
|
||||
if (LOCALAPPDATA / 'video2x' / 'anime4kcpp').exists():
|
||||
shutil.rmtree(LOCALAPPDATA / 'video2x' / 'anime4kcpp')
|
||||
patoolib.extract_archive(str(anime4kcpp_7z), outdir=str(LOCALAPPDATA / 'video2x' / 'anime4kcpp'))
|
||||
|
||||
|
||||
def download(url, save_path, chunk_size=4096):
|
||||
@@ -347,25 +355,41 @@ def pip_install(file):
|
||||
return subprocess.run([sys.executable, '-m', 'pip', 'install', '-U', '-r', file]).returncode
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
# set default exit code
|
||||
EXIT_CODE = 0
|
||||
if __name__ != '__main__':
|
||||
raise ImportError('video2x_setup cannot be imported')
|
||||
|
||||
# get start time
|
||||
start_time = time.time()
|
||||
try:
|
||||
# set default exit code
|
||||
EXIT_CODE = 0
|
||||
|
||||
# check platform
|
||||
if sys.platform != 'win32':
|
||||
print('This script is currently only compatible with Windows')
|
||||
EXIT_CODE = 1
|
||||
sys.exit(1)
|
||||
# get start time
|
||||
start_time = time.time()
|
||||
|
||||
# parse command line arguments
|
||||
args = parse_arguments()
|
||||
print('Video2X Setup Script')
|
||||
print(f'Version: {VERSION}')
|
||||
# check platform
|
||||
if platform.system() != 'Windows':
|
||||
print('This script is currently only compatible with Windows')
|
||||
EXIT_CODE = 1
|
||||
sys.exit(1)
|
||||
|
||||
# parse command line arguments
|
||||
args = parse_arguments()
|
||||
print('Video2X Setup Script')
|
||||
print(f'Version: {SETUP_VERSION}')
|
||||
|
||||
# uninstall video2x dependencies
|
||||
if args.uninstall:
|
||||
if input('Are you sure you want to uninstall all Video2X dependencies? [y/N]: ').lower() == 'y':
|
||||
try:
|
||||
print(f'Removing: {LOCALAPPDATA / "video2x"}')
|
||||
shutil.rmtree(LOCALAPPDATA / 'video2x')
|
||||
print('Successfully uninstalled all dependencies')
|
||||
except FileNotFoundError:
|
||||
print(f'Dependency folder does not exist: {LOCALAPPDATA / "video2x"}')
|
||||
else:
|
||||
print('Uninstallation aborted')
|
||||
|
||||
# run installation
|
||||
else:
|
||||
# do not install pip modules if script
|
||||
# is packaged in exe format
|
||||
download_python_modules = True
|
||||
@@ -373,40 +397,49 @@ if __name__ == '__main__':
|
||||
print('\nScript is packaged as exe, skipping pip module download')
|
||||
download_python_modules = False
|
||||
|
||||
# create setup install instance and run installer
|
||||
setup = Video2xSetup(args.driver, download_python_modules)
|
||||
setup.run()
|
||||
|
||||
print('\nScript finished successfully')
|
||||
|
||||
except SystemExit:
|
||||
pass
|
||||
# let SystemExit signals pass through
|
||||
except SystemExit as e:
|
||||
raise e
|
||||
|
||||
# if PermissionError is raised
|
||||
# user needs to run this with higher privilege
|
||||
except PermissionError:
|
||||
traceback.print_exc()
|
||||
print('You might have insufficient privilege for this script to run')
|
||||
print('Try running this script with Administrator privileges')
|
||||
EXIT_CODE = 1
|
||||
# if PermissionError is raised
|
||||
# user needs to run this with higher privilege
|
||||
except PermissionError:
|
||||
traceback.print_exc()
|
||||
print('You might have insufficient privilege for this script to run')
|
||||
print('Try running this script with Administrator privileges')
|
||||
EXIT_CODE = 1
|
||||
|
||||
# for any exception in the script
|
||||
# for any exception in the script
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
print('An error has occurred')
|
||||
print('Video2X Automatic Setup has failed')
|
||||
|
||||
# in case of a failure, try cleaning up temp files
|
||||
try:
|
||||
setup._cleanup()
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
print('An error has occurred')
|
||||
print('Video2X Automatic Setup has failed')
|
||||
print('An error occurred while trying to cleanup files')
|
||||
|
||||
# in case of a failure, try cleaning up temp files
|
||||
try:
|
||||
setup._cleanup()
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
print('An error occurred while trying to cleanup files')
|
||||
EXIT_CODE = 1
|
||||
|
||||
EXIT_CODE = 1
|
||||
# regardless if script finishes successfully or not
|
||||
# print script execution summary
|
||||
finally:
|
||||
print('Script finished')
|
||||
print(f'Time taken: {timedelta(seconds=round(time.time() - start_time))}')
|
||||
|
||||
# regardless if script finishes successfully or not
|
||||
# print script execution summary
|
||||
finally:
|
||||
print('Script finished')
|
||||
print(f'Time taken: {timedelta(seconds=round(time.time() - start_time))}')
|
||||
# if the program is launched as an Windows PE file
|
||||
# it might be launched from double clicking
|
||||
# pause the window before it closes automatically
|
||||
if sys.argv[0].endswith('.exe'):
|
||||
input('Press [ENTER] to exit script')
|
||||
sys.exit(EXIT_CODE)
|
||||
|
||||
sys.exit(EXIT_CODE)
|
||||
|
||||
8
src/wrappers/anime4kcpp.py
Normal file → Executable file
8
src/wrappers/anime4kcpp.py
Normal file → Executable file
@@ -69,6 +69,10 @@ class WrapperMain:
|
||||
self.driver_settings['zoomFactor'] = upscaler.scale_ratio
|
||||
self.driver_settings['threads'] = upscaler.processes
|
||||
|
||||
# append FFmpeg path to the end of PATH
|
||||
# Anime4KCPP will then use FFmpeg to migrate audio tracks
|
||||
os.environ['PATH'] += f';{upscaler.ffmpeg_settings["ffmpeg_path"]}'
|
||||
|
||||
def upscale(self, input_file, output_file):
|
||||
"""This is the core function for WAIFU2X class
|
||||
|
||||
@@ -90,14 +94,14 @@ class WrapperMain:
|
||||
|
||||
# list to be executed
|
||||
# initialize the list with waifu2x binary path as the first element
|
||||
execute = [self.driver_settings.pop('path')]
|
||||
execute = [self.driver_settings['path']]
|
||||
|
||||
for key in self.driver_settings.keys():
|
||||
|
||||
value = self.driver_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if value is None or value is False:
|
||||
if key == 'path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
|
||||
89
src/wrappers/ffmpeg.py
Normal file → Executable file
89
src/wrappers/ffmpeg.py
Normal file → Executable file
@@ -4,7 +4,7 @@
|
||||
Name: Video2X FFmpeg Controller
|
||||
Author: K4YT3X
|
||||
Date Created: Feb 24, 2018
|
||||
Last Modified: May 9, 2020
|
||||
Last Modified: May 14, 2020
|
||||
|
||||
Description: This class handles all FFmpeg related operations.
|
||||
"""
|
||||
@@ -12,6 +12,7 @@ Description: This class handles all FFmpeg related operations.
|
||||
# built-in imports
|
||||
import json
|
||||
import pathlib
|
||||
import shlex
|
||||
import subprocess
|
||||
|
||||
# third-party imports
|
||||
@@ -26,7 +27,7 @@ class Ffmpeg:
|
||||
and inserting audio tracks to videos.
|
||||
"""
|
||||
|
||||
def __init__(self, ffmpeg_settings, image_format):
|
||||
def __init__(self, ffmpeg_settings, image_format='png'):
|
||||
self.ffmpeg_settings = ffmpeg_settings
|
||||
|
||||
self.ffmpeg_path = pathlib.Path(self.ffmpeg_settings['ffmpeg_path'])
|
||||
@@ -36,7 +37,7 @@ class Ffmpeg:
|
||||
# video metadata
|
||||
self.image_format = image_format
|
||||
self.intermediate_file_name = pathlib.Path(self.ffmpeg_settings['intermediate_file_name'])
|
||||
self.pixel_format = None
|
||||
self.pixel_format = self.ffmpeg_settings['extract_frames']['output_options']['-pix_fmt']
|
||||
|
||||
def get_pixel_formats(self):
|
||||
""" Get a dictionary of supported pixel formats
|
||||
@@ -57,7 +58,7 @@ class Ffmpeg:
|
||||
# turn elements into str
|
||||
execute = [str(e) for e in execute]
|
||||
|
||||
Avalon.debug_info(f'Executing: {" ".join(execute)}')
|
||||
Avalon.debug_info(f'Executing: {shlex.join(execute)}')
|
||||
|
||||
# initialize dictionary to store pixel formats
|
||||
pixel_formats = {}
|
||||
@@ -74,7 +75,7 @@ class Ffmpeg:
|
||||
|
||||
return pixel_formats
|
||||
|
||||
def get_video_info(self, input_video):
|
||||
def probe_file_info(self, input_video):
|
||||
""" Gets input video information
|
||||
|
||||
This method reads input video information
|
||||
@@ -104,39 +105,40 @@ class Ffmpeg:
|
||||
# turn elements into str
|
||||
execute = [str(e) for e in execute]
|
||||
|
||||
Avalon.debug_info(f'Executing: {" ".join(execute)}')
|
||||
Avalon.debug_info(f'Executing: {shlex.join(execute)}')
|
||||
json_str = subprocess.run(execute, check=True, stdout=subprocess.PIPE).stdout
|
||||
return json.loads(json_str.decode('utf-8'))
|
||||
|
||||
def extract_frames(self, input_video, extracted_frames):
|
||||
"""Extract every frame from original videos
|
||||
|
||||
This method extracts every frame from input video using FFmpeg
|
||||
|
||||
Arguments:
|
||||
input_video {string} -- input video path
|
||||
extracted_frames {string} -- video output directory
|
||||
def extract_frames(self, input_file, extracted_frames):
|
||||
""" extract frames from video or GIF file
|
||||
"""
|
||||
execute = [
|
||||
self.ffmpeg_binary
|
||||
]
|
||||
|
||||
execute.extend(self._read_configuration(phase='video_to_frames'))
|
||||
# load general options
|
||||
execute.extend(self._read_configuration(phase='extract_frames'))
|
||||
|
||||
# load input_options
|
||||
execute.extend(self._read_configuration(phase='extract_frames', section='input_options'))
|
||||
|
||||
# specify input file
|
||||
execute.extend([
|
||||
'-i',
|
||||
input_video
|
||||
input_file
|
||||
])
|
||||
|
||||
execute.extend(self._read_configuration(phase='video_to_frames', section='output_options'))
|
||||
# load output options
|
||||
execute.extend(self._read_configuration(phase='extract_frames', section='output_options'))
|
||||
|
||||
# specify output file
|
||||
execute.extend([
|
||||
extracted_frames / f'extracted_%0d.{self.image_format}'
|
||||
])
|
||||
|
||||
return(self._execute(execute))
|
||||
|
||||
def assemble_video(self, framerate, resolution, upscaled_frames):
|
||||
def assemble_video(self, framerate, upscaled_frames):
|
||||
"""Converts images into videos
|
||||
|
||||
This method converts a set of images into a video
|
||||
@@ -149,16 +151,16 @@ class Ffmpeg:
|
||||
execute = [
|
||||
self.ffmpeg_binary,
|
||||
'-r',
|
||||
str(framerate),
|
||||
'-s',
|
||||
resolution
|
||||
str(framerate)
|
||||
# '-s',
|
||||
# resolution
|
||||
]
|
||||
|
||||
# read other options
|
||||
execute.extend(self._read_configuration(phase='frames_to_video'))
|
||||
execute.extend(self._read_configuration(phase='assemble_video'))
|
||||
|
||||
# read FFmpeg input options
|
||||
execute.extend(self._read_configuration(phase='frames_to_video', section='input_options'))
|
||||
# read input options
|
||||
execute.extend(self._read_configuration(phase='assemble_video', section='input_options'))
|
||||
|
||||
# WORKAROUND FOR WAIFU2X-NCNN-VULKAN
|
||||
# Dev: SAT3LL
|
||||
@@ -176,7 +178,7 @@ class Ffmpeg:
|
||||
])
|
||||
|
||||
# read FFmpeg output options
|
||||
execute.extend(self._read_configuration(phase='frames_to_video', section='output_options'))
|
||||
execute.extend(self._read_configuration(phase='assemble_video', section='output_options'))
|
||||
|
||||
# specify output file location
|
||||
execute.extend([
|
||||
@@ -197,17 +199,28 @@ class Ffmpeg:
|
||||
self.ffmpeg_binary
|
||||
]
|
||||
|
||||
execute.extend(self._read_configuration(phase='migrating_tracks'))
|
||||
# load general options
|
||||
execute.extend(self._read_configuration(phase='migrate_streams'))
|
||||
|
||||
# load input options
|
||||
execute.extend(self._read_configuration(phase='migrate_streams', section='input_options'))
|
||||
|
||||
# load input file names
|
||||
execute.extend([
|
||||
|
||||
# input 1: upscaled intermediate file without sound
|
||||
'-i',
|
||||
upscaled_frames / self.intermediate_file_name,
|
||||
|
||||
# input 2: original video with streams to copy over
|
||||
'-i',
|
||||
input_video
|
||||
])
|
||||
|
||||
execute.extend(self._read_configuration(phase='migrating_tracks', section='output_options'))
|
||||
# load output options
|
||||
execute.extend(self._read_configuration(phase='migrate_streams', section='output_options'))
|
||||
|
||||
# load output video path
|
||||
execute.extend([
|
||||
output_video
|
||||
])
|
||||
@@ -232,16 +245,10 @@ class Ffmpeg:
|
||||
# from only that section
|
||||
if section:
|
||||
source = self.ffmpeg_settings[phase][section].keys()
|
||||
|
||||
# if pixel format is not specified, use the source pixel format
|
||||
try:
|
||||
if self.ffmpeg_settings[phase][section].get('-pix_fmt') is None:
|
||||
self.ffmpeg_settings[phase][section]['-pix_fmt'] = self.pixel_format
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
source = self.ffmpeg_settings[phase].keys()
|
||||
|
||||
# for each key in the section's dict
|
||||
for key in source:
|
||||
|
||||
if section:
|
||||
@@ -250,7 +257,7 @@ class Ffmpeg:
|
||||
value = self.ffmpeg_settings[phase][key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if value is None or value is False or isinstance(value, dict):
|
||||
if value is None or value is False or isinstance(value, dict) or value == '':
|
||||
continue
|
||||
|
||||
# if the value is a list, append the same argument and all values
|
||||
@@ -274,17 +281,7 @@ class Ffmpeg:
|
||||
return configuration
|
||||
|
||||
def _execute(self, execute):
|
||||
""" execute command
|
||||
|
||||
Arguments:
|
||||
execute {list} -- list of arguments to be executed
|
||||
|
||||
Returns:
|
||||
int -- execution return code
|
||||
"""
|
||||
# turn all list elements into string to avoid errors
|
||||
execute = [str(e) for e in execute]
|
||||
|
||||
Avalon.debug_info(f'Executing: {execute}')
|
||||
|
||||
Avalon.debug_info(f'Executing: {shlex.join(execute)}')
|
||||
return subprocess.Popen(execute)
|
||||
|
||||
70
src/wrappers/gifski.py
Executable file
70
src/wrappers/gifski.py
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: Gifski Wrapper
|
||||
Creator: K4YT3X
|
||||
Date Created: May 11, 2020
|
||||
Last Modified: May 11, 2020
|
||||
|
||||
Description: High-level wrapper for Gifski.
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import pathlib
|
||||
import subprocess
|
||||
|
||||
# third-party imports
|
||||
from avalon_framework import Avalon
|
||||
|
||||
|
||||
class Gifski:
|
||||
|
||||
def __init__(self, gifski_settings):
|
||||
self.gifski_settings = gifski_settings
|
||||
|
||||
def make_gif(self, upscaled_frames: pathlib.Path, output_path: pathlib.Path, framerate: float, image_format: str) -> subprocess.Popen:
|
||||
execute = [
|
||||
self.gifski_settings['gifski_path'],
|
||||
'-o',
|
||||
output_path,
|
||||
'--fps',
|
||||
int(round(framerate, 0))
|
||||
]
|
||||
|
||||
# load configurations from config file
|
||||
execute.extend(self._load_configuration())
|
||||
|
||||
# append frames location
|
||||
execute.extend([upscaled_frames / f'extracted_*.{image_format}'])
|
||||
|
||||
return(self._execute(execute))
|
||||
|
||||
def _load_configuration(self):
|
||||
|
||||
configuration = []
|
||||
|
||||
for key in self.gifski_settings.keys():
|
||||
|
||||
value = self.gifski_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if key == 'gifski_path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
configuration.append(f'-{key}')
|
||||
else:
|
||||
configuration.append(f'--{key}')
|
||||
|
||||
# true means key is an option
|
||||
if value is not True:
|
||||
configuration.append(str(value))
|
||||
return configuration
|
||||
|
||||
def _execute(self, execute: list) -> subprocess.Popen:
|
||||
# turn all list elements into string to avoid errors
|
||||
execute = [str(e) for e in execute]
|
||||
|
||||
Avalon.debug_info(f'Executing: {execute}')
|
||||
|
||||
return subprocess.Popen(execute)
|
||||
102
src/wrappers/realsr_ncnn_vulkan.py
Executable file
102
src/wrappers/realsr_ncnn_vulkan.py
Executable file
@@ -0,0 +1,102 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: RealSR NCNN Vulkan Driver
|
||||
Creator: K4YT3X
|
||||
Date Created: May 26, 2020
|
||||
Last Modified: May 26, 2020
|
||||
|
||||
Description: This class is a high-level wrapper
|
||||
for realsr_ncnn_vulkan.
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import argparse
|
||||
import os
|
||||
import pathlib
|
||||
import platform
|
||||
import shlex
|
||||
import subprocess
|
||||
import threading
|
||||
|
||||
# third-party imports
|
||||
from avalon_framework import Avalon
|
||||
|
||||
|
||||
class WrapperMain:
|
||||
"""This class communicates with RealSR NCNN Vulkan engine
|
||||
|
||||
An object will be created for this class, containing information
|
||||
about the binary address and the processing method. When being called
|
||||
by the main program, other detailed information will be passed to
|
||||
the upscale function.
|
||||
"""
|
||||
|
||||
def __init__(self, driver_settings):
|
||||
self.driver_settings = driver_settings
|
||||
self.print_lock = threading.Lock()
|
||||
|
||||
@staticmethod
|
||||
def parse_arguments(arguments):
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False)
|
||||
parser.error = lambda message: (_ for _ in ()).throw(AttributeError(message))
|
||||
parser.add_argument('--help', action='help', help='show this help message and exit')
|
||||
parser.add_argument('-v', action='store_true', help='verbose output')
|
||||
parser.add_argument('-i', type=str, help=argparse.SUPPRESS) # help='input image path (jpg/png) or directory')
|
||||
parser.add_argument('-o', type=str, help=argparse.SUPPRESS) # help='output image path (png) or directory')
|
||||
parser.add_argument('-s', type=int, choices=[4], help='upscale ratio')
|
||||
parser.add_argument('-t', type=int, help='tile size (>=32/0=auto)')
|
||||
parser.add_argument('-m', type=str, help='realsr model path')
|
||||
parser.add_argument('-g', type=int, help='gpu device to use')
|
||||
parser.add_argument('-j', type=str, help='thread count for load/proc/save')
|
||||
parser.add_argument('-x', action='store_true', help='enable tta mode')
|
||||
return parser.parse_args(arguments)
|
||||
|
||||
def load_configurations(self, upscaler):
|
||||
self.driver_settings['s'] = int(upscaler.scale_ratio)
|
||||
self.driver_settings['j'] = '{}:{}:{}'.format(upscaler.processes, upscaler.processes, upscaler.processes)
|
||||
|
||||
def upscale(self, input_directory, output_directory):
|
||||
"""This is the core function for RealSR NCNN Vulkan class
|
||||
|
||||
Arguments:
|
||||
input_directory {string} -- source directory path
|
||||
output_directory {string} -- output directory path
|
||||
ratio {int} -- output video ratio
|
||||
"""
|
||||
|
||||
# overwrite config file settings
|
||||
self.driver_settings['i'] = input_directory
|
||||
self.driver_settings['o'] = output_directory
|
||||
|
||||
# by default, realsr-ncnn-vulkan will look for the models under the current working directory
|
||||
# change the working directory to its containing folder if model directory not specified
|
||||
if self.driver_settings['m'] is None and platform.system() == 'Windows':
|
||||
os.chdir(pathlib.Path(self.driver_settings['path']).parent)
|
||||
|
||||
# list to be executed
|
||||
# initialize the list with the binary path as the first element
|
||||
execute = [self.driver_settings['path']]
|
||||
|
||||
for key in self.driver_settings.keys():
|
||||
|
||||
value = self.driver_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if key == 'path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
execute.append(f'-{key}')
|
||||
else:
|
||||
execute.append(f'--{key}')
|
||||
|
||||
# true means key is an option
|
||||
if value is not True:
|
||||
execute.append(str(value))
|
||||
|
||||
# return the Popen object of the new process created
|
||||
self.print_lock.acquire()
|
||||
Avalon.debug_info(f'[upscaler] Subprocess {os.getpid()} executing: {shlex.join(execute)}')
|
||||
self.print_lock.release()
|
||||
return subprocess.Popen(execute)
|
||||
4
src/wrappers/srmd_ncnn_vulkan.py
Normal file → Executable file
4
src/wrappers/srmd_ncnn_vulkan.py
Normal file → Executable file
@@ -77,14 +77,14 @@ class WrapperMain:
|
||||
|
||||
# list to be executed
|
||||
# initialize the list with the binary path as the first element
|
||||
execute = [self.driver_settings.pop('path')]
|
||||
execute = [self.driver_settings['path']]
|
||||
|
||||
for key in self.driver_settings.keys():
|
||||
|
||||
value = self.driver_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if value is None or value is False:
|
||||
if key == 'path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
|
||||
8
src/wrappers/waifu2x_caffe.py
Normal file → Executable file
8
src/wrappers/waifu2x_caffe.py
Normal file → Executable file
@@ -56,8 +56,8 @@ class WrapperMain:
|
||||
parser.add_argument('-m', '--mode', choices=['noise', 'scale', 'noise_scale', 'auto_scale'], help='image processing mode')
|
||||
parser.add_argument('-e', '--output_extention', type=str, help='extention to output image file when output_path is (auto) or input_path is folder')
|
||||
parser.add_argument('-l', '--input_extention_list', type=str, help='extention to input image file when input_path is folder')
|
||||
parser.add_argument('-o', '--output', type=str, help=argparse.SUPPRESS) # help='path to output image file (when input_path is folder, output_path must be folder)')
|
||||
parser.add_argument('-i', '--input_file', type=str, help=argparse.SUPPRESS) # help='(required) path to input image file')
|
||||
parser.add_argument('-o', '--output_path', type=str, help=argparse.SUPPRESS) # help='path to output image file (when input_path is folder, output_path must be folder)')
|
||||
parser.add_argument('-i', '--input_path', type=str, help=argparse.SUPPRESS) # help='(required) path to input image file')
|
||||
return parser.parse_args(arguments)
|
||||
|
||||
def load_configurations(self, upscaler):
|
||||
@@ -79,14 +79,14 @@ class WrapperMain:
|
||||
|
||||
# list to be executed
|
||||
# initialize the list with waifu2x binary path as the first element
|
||||
execute = [self.driver_settings.pop('path')]
|
||||
execute = [self.driver_settings['path']]
|
||||
|
||||
for key in self.driver_settings.keys():
|
||||
|
||||
value = self.driver_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if value is None or value is False:
|
||||
if key == 'path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
|
||||
4
src/wrappers/waifu2x_converter_cpp.py
Normal file → Executable file
4
src/wrappers/waifu2x_converter_cpp.py
Normal file → Executable file
@@ -93,14 +93,14 @@ class WrapperMain:
|
||||
|
||||
# list to be executed
|
||||
# initialize the list with waifu2x binary path as the first element
|
||||
execute = [self.driver_settings.pop('path')]
|
||||
execute = [self.driver_settings['path']]
|
||||
|
||||
for key in self.driver_settings.keys():
|
||||
|
||||
value = self.driver_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if value is None or value is False:
|
||||
if key == 'path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
|
||||
4
src/wrappers/waifu2x_ncnn_vulkan.py
Normal file → Executable file
4
src/wrappers/waifu2x_ncnn_vulkan.py
Normal file → Executable file
@@ -80,14 +80,14 @@ class WrapperMain:
|
||||
|
||||
# list to be executed
|
||||
# initialize the list with waifu2x binary path as the first element
|
||||
execute = [self.driver_settings.pop('path')]
|
||||
execute = [self.driver_settings['path']]
|
||||
|
||||
for key in self.driver_settings.keys():
|
||||
|
||||
value = self.driver_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if value is None or value is False:
|
||||
if key == 'path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
|
||||
Reference in New Issue
Block a user