I created a twitter bot that posts a random frame from a selected movie every 6 hour. In my case, it uses frames from the movie Whiplash (2014).
- Clone the repository
- Add to "./frames" all selected frames from the movie
- Create .env with credentials for Twitter development with the following format:
APPKEY="..."
APPSECRET="..."
ACCESSTOKEN="..."
ACCESSSECRET="..."
- Run to install dependencies:
npm install
- Run to start:
node index
I'm writing a mini how-to if someone wants to do something similar with a favourite movie of theirs.
- Get VLC, the movie's mp4 and subtitles.
- Test the subtitles timing with the movie by (in VLC) pressing Subtitle->Add Subtitle File and select the .srt of your choice. (If the timing isn't right you can use the keybinds G and H to increase or decrease subtitle's delay, I used this page to change the .srt file)
- Then on Media->Stream add movie and subtitles and Stream (You'll need to setup output).
- Now, for getting the frames, open VLC, go to Tools->Preferences select "All", click in Filters (Video) and select "Scene video filter". Then open the dropdown for Filter (Video), "Scene video filter" and config.
- Open the movie and let it run for the entire runtime.
I have a problem with the timestamp calculator for each frame, the movie standard fps is 24, by doing (frame number / 24) you get the timestamp in seconds. But testing it I noticed it is 60 seconds behind, so I added 60s in the calculation.