Py’otrMuhammad Toheed Sahar

TikTok batch video generator from a Google Sheet

A Windows tool that turns a Google Sheet of song links, video links and captions into finished 1080x1920 vertical videos from one double-click.

Client
A social media content operator
Year
2026
Type
AI video & media

The problem

The client wanted to produce many short vertical videos made the same way, each a clip, a song and a line of on-screen text per spreadsheet row, with no editor and no code, run from one double-click.

How I built it

A Python script reads the sheet through a Google service account, downloads each clip and song from Google Drive, crops any source video to 9:16, replaces the audio with the song, adds the text in the client's chosen font and renders 1080x1920 at 30 fps. Rendering uses the NVIDIA hardware encoder when the machine has one and falls back to CPU encoding when it does not. I delivered it with install and run scripts, a packaged EXE and a numbered setup guide.

What got hard

  1. GPU availability varies by machine, and checking that an NVIDIA card exists does not prove the hardware encoder will work.

    At start-up the tool test-encodes a tiny frame with the hardware encoder and only uses it if that succeeds. Otherwise it says so and switches to CPU encoding.

  2. Source clips come in every shape and size.

    Each clip is auto-cropped and scaled onto a 9:16 canvas before the text and song are added.

  3. The setup involves a Google Cloud service account, FFmpeg on the system path and Drive sharing, which is a lot for a non-developer.

    I shipped install.bat and run.bat, a pinned requirements list, a packaged EXE and a numbered setup guide that walks through the service account and sharing steps.

The result

Delivered on 4 March 2026 as v1.0. A sample render in the project is 1080x1920 at 30 fps, about three minutes long, H.264 with AAC audio.