Skip to content

Commit

Permalink
Python bindings for FFmpeg - with almost all filters support.
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiawei-dev committed May 4, 2021
0 parents commit ce3baf1
Show file tree
Hide file tree
Showing 126 changed files with 19,536 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 自定义文件
upload.sh
w_*
replace
*ttf
fonts
cc

# IDE 文件
.idea
.vscode
.vscode-test/
.vscodeignore

# Go 相关
vendor
go.sum
*.exe

# Python 相关
venv
__pycache__
build
dist
*egg-info

# JavaScript / TypeScript
out
node_modules
*.vsix
*.lock
.yarnrc

# 日志文件
*.log
logs

# 存储文件
uploads
storage
*.db
testdata/*
!testdata/*.py
!testdata/*.sh
_gsdata_

# Dropbox
*.paper

.gitignore
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This is a contributed example of how to build ffmpeg-gl-transions using Docker
# If you use Docker, this should get the job done
# if you don't use Docker, you could still run the commands
# manually and get the same result

# docker build -t rustlekarl/ffmpeg-generator:latest .
FROM rustlekarl/ffmpeg-gltransition:latest

MAINTAINER rustlekarl "rustlekarl@gmail.com"

ENV DEBIAN_FRONTEND=noninteractive

RUN echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse\n" >/etc/apt/sources.list
RUN echo "[global]\nindex-url=http://mirrors.aliyun.com/pypi/simple/\n[install]\ntrusted-host=mirrors.aliyun.com" > /etc/pip.conf

RUN apt-get update \
&& apt-get install -y python3-pip python3-dev \
&& cd /usr/local/bin \
&& ln -s /usr/bin/python3 python \
&& ln -s /usr/bin/pip3 pip \
&& pip3 --no-cache-dir install --upgrade pip

WORKDIR /root

COPY requirements.txt .
RUN pip install -r requirements.txt

WORKDIR /generator

COPY . /generator

RUN (cd /generator; python run_examples.py)

RUN rm -rf /generator/* && rm -rf /var/lib/apt/lists/* && apt-get -y purge

# Overlay parent's ENTRYPOINT
RUN echo "#!/bin/bash\nXvfb -ac :1 -screen 0 1280x1024x16 > /dev/null 2>&1" > /entrypoint.sh

RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2021 Rustle Karl

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.PHONY: ;
.SILENT: ; # no need for @
.ONESHELL: ; # recipes execute in same shell
.NOTPARALLEL: ; # wait for target to finish
.EXPORT_ALL_VARIABLES: ; # send all vars to shell

VERSION = 1.0.0
PACKAGE = ffmpeg-generator

# While console windows in Windows 10 do support VT (Virtual Terminal) / ANSI
# escape sequences in principle, support is turned OFF by default.
# Set-ItemProperty HKCU:\Console VirtualTerminalLevel -Type DWORD 1
# reg add HKCU\Console /v VirtualTerminalLevel /t REG_DWORD /d 1

all: dep

dep:
pip install twine
pip install -r requirements.txt

setup: dep
python setup.py sdist
python setup.py bdist_wheel
pip install dist/$(PACKAGE)-$(VERSION).tar.gz

uninstall:
pip uninstall -y $(PACKAGE)

upload: setup
twine upload dist/$(PACKAGE)-$(VERSION).tar.gz

docker-build:
docker build -t rustlekarl/ffmpeg-generator:latest .

docker-exec:
docker-compose up -d
docker exec -it ffmpeg-generator_ffmpeg_1 bash
Loading

0 comments on commit ce3baf1

Please sign in to comment.