Upload 1080p 60fps on TikTok
Project description
Tiktok-Quality
Installation
pip install tiktok-quality
Or from source:
git clone https://github.com/BastienGimbert/tiktok-quality.git
cd tiktok-quality
pip install -e .
Requirements
- Python 3.10+ - zero third-party dependencies
- FFmpeg - optional, for output verification only
# Check dependencies
tiktok-quality --check-deps
# Install FFmpeg if needed:
# Windows: winget install Gyan.FFmpeg
# macOS: brew install ffmpeg
# Linux: sudo apt install ffmpeg
Usage
CLI
# Transform a video (10x frame inflation)
tiktok-quality input.mp4 output.mp4
# Custom multiplier
tiktok-quality input.mp4 output.mp4 -m 15
# Custom metadata tag
tiktok-quality input.mp4 output.mp4 --comment "MyTag123"
# Quiet mode
tiktok-quality input.mp4 output.mp4 -q
Verification
# Verify output with ffprobe
tiktok-quality --verify output.mp4
# Byte-compare with a reference file
tiktok-quality --compare output.mp4 reference.mp4
Python API
from tiktok_quality import transform
stats = transform("input.mp4", "output.mp4", multiplier=10)
print(f"Declared frames: {stats['declared_frames']}")
How It Works
Manipulates the MP4 container metadata to inflate the declared frame count by adding "ghost frames" - filler NALUs pointing to a single 8-byte padding block.
Input: 1920x1080 60fps, 1494 real frames, 50.7 MB
Output: Same video, 14940 declared frames, 50.8 MB (+107 KB overhead)
No pixels are changed. No re-encoding. The video data is byte-for-byte identical but tiktok-quality tricks TikTok into thinking the video has more frames, allowing it to be uploaded at 1080p60.
Transformations Applied
| # | What | Detail |
|---|---|---|
| 1 | Brand | mp42 -> isom |
| 2 | Box order | moov moved before mdat (fast-start) |
| 3 | First frame | SEI NALUs stripped, IDR slice kept |
| 4 | avcC | High profile extension bytes added |
| 5 | Video STTS | Ghost frame timing entries appended |
| 6 | Video STSZ | 8-byte entries for each ghost frame |
| 7 | Video STSC | New chunk entry for padding region |
| 8 | Video STCO | Ghost chunks point to single filler NAL |
| 9 | Padding NAL | 8 bytes appended: 00 00 00 04 00 00 00 00 |
| 10 | Audio handler | Renamed to "SoundHandler", lang -> und |
| 11 | Audio timing | Last sample trimmed to align with video |
| 12 | Metadata | iTunes-style comment tag in ilst |
| 13 | Bitrates | Recalculated for both tracks |
Ghost Frame Mechanism
All ghost frames reference a single 8-byte filler NALU at the end of mdat:
00 00 00 04 <- NALU length (4 bytes payload)
00 00 00 00 <- type 0 (filler) + empty content
13,446 ghost "frames" share this one block via STCO. Only 8 bytes of media data added. Metadata tables grow by ~107 KB.
Project Structure
tiktok-quality/
├── pyproject.toml
├── README.md
├── LICENSE
├── proof.png
├── .github/workflows/publish.yml
├── src/tiktok_quality/
│ ├── __init__.py
│ ├── __main__.py
│ ├── cli.py
│ ├── transform.py
│ └── mp4/
│ ├── parser.py
│ └── builder.py
└── tests/
└── test_mp4.py
Background
Reverse-engineered from the "TikTok Enhancer" Chrome extension (Editing News v2.1.4) which uses a server at v2.editingnews.com to apply this container manipulation. The extension:
- Intercepts video file on TikTok upload page
- Sends to their server for container manipulation
- Server returns "enhanced" file
- Extension replaces the file in TikTok's upload form
This tool replicates the exact server output - byte-for-byte identical.
1080p60 upload quality confirmed via re:TikTok Checker & Downloader bot.
License
MIT see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tiktok_quality-1.0.0.tar.gz.
File metadata
- Download URL: tiktok_quality-1.0.0.tar.gz
- Upload date:
- Size: 69.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8a2caf1169bdef8107dd72a918c47b6dbd98500a03b96d7e607987a8917037d
|
|
| MD5 |
9c1a9487dcc3dc1425a65391455a8382
|
|
| BLAKE2b-256 |
33fc10fae5701bcc13cd272faefe0e2ff25c932ab1c9a0dc7fa762fdf0fbfd6e
|
Provenance
The following attestation bundles were made for tiktok_quality-1.0.0.tar.gz:
Publisher:
publish.yml on BastienGimbert/tiktok-quality
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tiktok_quality-1.0.0.tar.gz -
Subject digest:
a8a2caf1169bdef8107dd72a918c47b6dbd98500a03b96d7e607987a8917037d - Sigstore transparency entry: 1841237810
- Sigstore integration time:
-
Permalink:
BastienGimbert/tiktok-quality@5fc3907734a464c9c064233bfc3d341d8f4dbfdb -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/BastienGimbert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5fc3907734a464c9c064233bfc3d341d8f4dbfdb -
Trigger Event:
push
-
Statement type:
File details
Details for the file tiktok_quality-1.0.0-py3-none-any.whl.
File metadata
- Download URL: tiktok_quality-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73628216b97c5906e833464cda11fb10b4f4fa063725b93cc7812b7af9d12f5e
|
|
| MD5 |
b13a4c46c69ecb853dbb4146e89eb94f
|
|
| BLAKE2b-256 |
154f8606004de73acc744b5d14de60825539f62dc7d52c1961be5e3656ec9783
|
Provenance
The following attestation bundles were made for tiktok_quality-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on BastienGimbert/tiktok-quality
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tiktok_quality-1.0.0-py3-none-any.whl -
Subject digest:
73628216b97c5906e833464cda11fb10b4f4fa063725b93cc7812b7af9d12f5e - Sigstore transparency entry: 1841237912
- Sigstore integration time:
-
Permalink:
BastienGimbert/tiktok-quality@5fc3907734a464c9c064233bfc3d341d8f4dbfdb -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/BastienGimbert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5fc3907734a464c9c064233bfc3d341d8f4dbfdb -
Trigger Event:
push
-
Statement type: