Generates meme video from input
Go to file
2023-03-20 20:50:50 +07:00
ronaldo update 2023-03-20 19:50:47 +07:00
check.php config 2022-10-25 14:46:33 +07:00
contoh.mp4 add 2022-10-25 12:17:56 +07:00
index.php move setcookie to above 2022-10-25 18:02:45 +07:00
output.mp4 first 2022-10-23 18:15:14 +07:00
process.php update 2022-10-25 14:18:36 +07:00
readme.md Update readme.md 2023-03-20 20:50:50 +07:00
renderDB.py try adding built in Alpine fonts 2022-10-25 18:46:54 +07:00
teks.txt add 2022-10-25 12:23:09 +07:00
video.mp4 first 2022-10-23 18:15:14 +07:00

Video meme generator

Generate subtitle and render it to a video

Table structure (optional):

Process flow:

Preview:

Installation with Docker LEMP Stack:

1. Create a file, named docker-compose.yml. Insert with these contents:

# ./docker-compose.yml
version: '3'

services:
  app:
    image: adhocore/lemp:7.4
    # For different app you can use different names. (eg: )
    container_name: some-app
    volumes:
      # app source code
      - ./meme:/var/www/html
      # db data persistence
      - db_data:/var/lib/mysql
      # Here you can also volume php ini settings
      # - /path/to/zz-overrides:/usr/local/etc/php/conf.d/zz-overrides.ini
    ports:
      - 8080:80
    environment:
      MYSQL_ROOT_PASSWORD: supersecurepwd
      MYSQL_DATABASE: appdb
      MYSQL_USER: dbusr
      MYSQL_PASSWORD: securepwd
      # for postgres you can pass in similar env as for mysql but with PGSQL_ prefix

volumes:
  db_data: {}

2. Then compose

docker-compose up -d

3. Navigate to meme folder (volume), then clone my repo, navigate to meme-generator and then change to docker branch

cd meme
git clone https://github.com/gabrielkheisa/meme-generator.git
cd meme-generator
git checkout docker

4. Bash into container, to run it as detached output (in background) use screen

screen
docker exec -u root -t -i some-app /bin/bash

5. Login to MySQL as root with the password supersecurepwd

mysql -u root -p

6. Create table meme and meme_ronaldo in appdb database, then allow dbusr to access it

USE appdb;

CREATE TABLE meme ( id INT(10) NOT NULL AUTO_INCREMENT, session VARCHAR(20), status INT(1), timestamp TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, value TEXT, PRIMARY KEY (id) );

CREATE TABLE meme_ronaldo ( id INT(10) NOT NULL AUTO_INCREMENT, session VARCHAR(20), status INT(1), timestamp TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, value TEXT, PRIMARY KEY (id) );



GRANT ALL PRIVILEGES ON appdb.* TO 'dbusr'@'localhost' WITH GRANT OPTION;
exit;

7. Navigate to /var/www/html/meme-generator

cd /var/www/html/meme-generator

8. Install Python 3, pip3, and remaining dependencies

apk add --no-cache python3 py3-pip
apk add make automake gcc g++ subversion python3-dev
apk add ffmpeg
pip3 install --upgrade pip
pip3 install mysql-connector-python==8.0.29
pip3 install moviepy

9. Run the Python script, detach from screen by pressing Ctrl + A then Ctrl + D

python3 renderDB.py

10. Run the second Python script by creating a new screen session, detach from screen by pressing Ctrl + A then Ctrl + D

screen
docker exec -u root -t -i some-app /bin/bash
cd /var/www/html/meme-generator/ronaldo python3 renderDB.py

11. Open your browser, navigate to http://{your-ip}:8080/meme-generator/

External repo

https://repo.gabrielkheisa.xyz/gabrielkheisa/meme-generator