- tiktok-scraper: Scraper to download videos from Tik Tok with various settings (from user, hashtags, sounds...)
- ffmpeg: Library to manipulate videos through a CLI
- Python dependencies:
pip install numpy
pip install Pillow
pip install os-sys
pip install natsort
Install tiktok-scraper through npm
npm install tiktok-scraper
Run tiktok-scraper with your settings, copy the links to the videos and download them (I use DownThemAll on Firefox)
Once you have your videos, open Terminal and go to the folder where they have been downloaded. Now, copy extract-frames.sh
(inside the src
folder; it currently runs only on macOS, but it's based on this bat script) to your video directory and run it:
cd /path/to/video/folder
/path/to/video/folder % sh extract-frames.sh
It will create a folder named as each video: it will extract one frame every two seconds.
Copy stitch.py
to the folder of the video you want to create the frametage (frame montage) for.
cd /path/to/frame/folder
/path/to/frame/folder % python stitch.py
The script will generate a horizontal stitching of all the images inside the folder. It will be called as the folder and it will placed in its parent directory.
Video frametage from the hashtag "coronavirus"
Implement Google Vision ORC to extract text from the single frames.
Isolate hashtags (regex): #[^\s]+
, #[^\s"]+
to exclude the content after the " delimitator
Create column of hashtags in OpenRefine (clojure): (apply str (interpose ";" (filter #(contains? #{\# \@} (first %)) (.split value ""))))