One Cut - Edit Video by Editing Code
One Cut will transcribe your video using fast-whisper and generate a python code like example.py. The code contains all the subtitles from ASR and allows you modify the video by changing the code.
Run onecut to transcribe your video:
uv run onecut path/to/your/video.mp4
The OneCut cli will generate code like this. You can easily fix ASR error by changing the text.
movie = Movie("a.txt", [])
SUB_1 = sub("Sub1", 0, 1)
SUB_2 = sub("Sub2", 1, 2)
SUB_3 = sub("Sub3", 2, 3)
FINAL_CLIPS = [SUB_1.to(SUB_3)]
You can cut one section of your video (Like SUB_2) by doing this.
FINAL_CLIPS = [SUB_1, SUB_3]
Or use helper function to cut it, the function is super useful if you only want to remove a portion of it.
remove_subs(movie.all_subtitles, [SUB_2])
After finish cutting & fixing, just run python {generated_file}.py to generate the final video and subtitile(.srt) file.
Dependency
- Python 3
- ffmpeg
The generated file is self-contained, it does not depend on the onecut pacakge, the only dependency is ffmpeg.
Why?
I want to share some of my videos but the only computer I have is a steamdeak. Running any modern video editors will kill my steamdeak and It's super laggy as well. There are some online services like descript but I don't want to upload the video over my slow interenet and pay 12$ per month.
Also, the coding agent is very good at spotting ASR errors and I want to generate something for them to work on. All the existing tools are based on text but I think using code as intermediate representation is much better for coding agent.
Agent Edit
Most of the time, I just ask agent to fix the ASR error in generated.py and It will think for a long time and fix most of the
ASR issues. You can ask agent to do additional things like:
- Burn-in the subtitles.
- Remove part of video.
- Only export part of the video.
Basically, the angents can do anything that supported by ffmpeg filter.
Using Deepseek-V4 Flash, fixing all the ASR errors cost about 0.1 dollar in API pricing.
Future Plans
- Support Word Level Editing: I don't know what's the best way to support that since I don't want to put a lot of timestamps in the code.
- Bugfix
LLM Usage
This project is written in the old-fashion way, LLM is used for data collection and some debugging.
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 onecut-0.2.0.tar.gz.
File metadata
- Download URL: onecut-0.2.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":"20250504.0.344409","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62aaee1b945dbc72f9f2d4a2a37e39f3cb18eaa17e04943f9173cb5b75fdd422
|
|
| MD5 |
7b35cd18e7bdd7659dfc94595bdbf87f
|
|
| BLAKE2b-256 |
1f2c062938213091cfc5c08126286be59bfe0e6ec895f756620c401c9e82881d
|
File details
Details for the file onecut-0.2.0-py3-none-any.whl.
File metadata
- Download URL: onecut-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":"20250504.0.344409","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d102d6ba07d2b1ff5fc11424538f600467b3a052966262e062d07eadbe215f46
|
|
| MD5 |
f4704e552862bc2d7ae7f72ed66f7386
|
|
| BLAKE2b-256 |
c8b915bf6b7ae521ebdc457409b30718957ea7e3deb79a2f15872072251ceb18
|