Skip to main content

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:

  1. Intercepts video file on TikTok upload page
  2. Sends to their server for container manipulation
  3. Server returns "enhanced" file
  4. Extension replaces the file in TikTok's upload form

This tool replicates the exact server output - byte-for-byte identical.

proof

1080p60 upload quality confirmed via re:TikTok Checker & Downloader bot.

License

MIT see LICENSE file for details.

Metadata

Release files for tiktok-quality 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tiktok-quality 1.0.0
File Size Uploaded
tiktok_quality-1.0.0.tar.gz 69.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tiktok-quality 1.0.0
File Interpreter ABI Platform
tiktok_quality-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 83.4 kB

Release files / tiktok_quality-1.0.0.tar.gz

Download URL tiktok_quality-1.0.0.tar.gz
Size 69.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a8a2caf1169bdef8107dd72a918c47b6dbd98500a03b96d7e607987a8917037d
BLAKE2b-256 checksum
How to use checksums
33fc10fae5701bcc13cd272faefe0e2ff25c932ab1c9a0dc7fa762fdf0fbfd6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 16, 2026.

Transparency log

Release files / tiktok_quality-1.0.0-py3-none-any.whl

Download URL tiktok_quality-1.0.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73628216b97c5906e833464cda11fb10b4f4fa063725b93cc7812b7af9d12f5e
BLAKE2b-256 checksum
How to use checksums
154f8606004de73acc744b5d14de60825539f62dc7d52c1961be5e3656ec9783
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page