Coder Social home page Coder Social logo

penskealt's Introduction

penskealt

Offline web-based Meme generator with database capabilities.
MKV/MP4 (really anything that can be split with FFMPEG) file and associated subtitle (.srt) file required.

Requirements:
A webserver, PHP 5+, a database of some sort, ability to extract frames/subtitles using FFMPEG
For Windows, it is recommended you install WAMP as this installs everything you need, download here: https://www.wampserver.com/en/

Installation:
Make sure your web server/WAMP is running.
Then for WAMP, go to the install directory, then "www", delete everything in there and replace with the files in this repository.
In the "www" folder, create a "images" directory.

You will need to create a "penskealt" database.
If you have just installed WAMP, left click green "WAMP" icon in your taskbar then click "PhpMysqlAdmin".
Login using the default user/pass of "root" and "" (blank, no password).
Click the "New" button on the left hand side, above "information_scema".
Type "penskealt" in the "Database Name" field and press "Create".
Congrats, you're ready to horde funny jery pictures.

Usage:
SCRIPT INGESTION/FRAME GENERATION:
Go to http://127.0.0.1
This is the busted-ass web 1.0 interface that I cludged together.

The process of making this work and not explode is this order of actions.

  1. Create a new show catagory, at the top of the page type in a show name eg; "seinfeld", keep it lowercase and replace spaces with underscores.
    You are not limited to seinfeld, literally any show that you have the video files and subtitle (.srt) for can be added.
    Movies can be added, just treat them as S01E01 of a show catagory, the rest of the process is the same.

  2. You will need to manually extract video frames using FFMPEG, download from here: http://www.ffmpeg.org/
    penskealt is designed to use 2 frames per second intervals, the FFMPEG command for 23.97fps video is:
    ffmpeg -i Seinfeld.S01E01.mkv -vf "select=not(mod(n,12))" -vsync vfr -q:v 2 %d.jpg
    or to change the size of the picture it generates
    ffmpeg -i Seinfeld.S01E01.mkv -vf "scale=1280:720,setsar=1,select=not(mod(n,12))" -vsync vfr -q:v 2 %d.jpg (change the "1280:720" part to whatever you want)

Replace "Seinfeld.S01E01.mkv" with the name of the video you are processing and run the command
It will spit out thousands of frames and will take about 2 minutes to process.
It is recommended you use a new folder to do this in, so the frames don't invade another folder.

  1. In the root directory of you webserver, go to your "images" folder.
    Create a folder exactly the same name as the show catagory you've just create in step 1 eg; "seinfeld"
    Go into that folder and create a folder for the season of that show eg; "01" (for season 1)
    Go into that folder and create a folder for the episode of that season eg; "01" (for episode 1)
    Place the thosands of frames you've just generated into this folder eg "{root}/images/seinfeld/01/01/1.jpg 2.jpg etc..."
    Repeat this for every episode for every show (have fun).

  2. Extract .srt with FFMPEG with this command
    ffmpeg -i Seinfeld.S01E01.mkv -map 0:s:0 S01E01.srt
    Subs file name must be formatted in SXXEXX format, eg; "S01E01.srt"

  3. Go back to http://127.0.0.1
    Go to the "Script/File" section.
    Select the show the episode is related to using the dropdown menu
    Select the .srt file you just extracted using "Choose File"
    It will automatically load the .srt and find the related frames, you can double check things line up by scrolling down and manually checking.
    To finalise, click the "Scrape .srt" button at the top of the page.

  4. Repeat for process for each show and/or episode. I'm currently looking for ways to make this more automated.

MEME GENERATION:

  1. The last section is the "Search by quote" area, select a show using the dropdown menu.
  2. Type in a quote from the show you've just scraped, it will find those frames and display them with the original script text, scroll down to see more.
  3. You can change the text of the image using the textbox next to the image, limited to 4 lines.
  4. You can right-click copy/save this image, the text will be retain so you can paste it into photoshop/straight to facebook etc.

KNOWN BUGS:
If you try to load "http://127.0.0.1/search.php" directly, it will break. Reload http://127.0.0.1 and don't do that, search using the text box on the main page only.

penskealt's People

Contributors

jeddyhhh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.