{"id":15286965,"url":"https://github.com/emosheeep/capcut-export","last_synced_at":"2025-04-13T02:33:07.785Z","repository":{"id":224773474,"uuid":"764072207","full_name":"emosheeep/capcut-export","owner":"emosheeep","description":"Export video clips from CapCut editor tracks, helps archive materials.","archived":false,"fork":false,"pushed_at":"2024-12-11T14:46:14.000Z","size":6491,"stargazers_count":32,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T20:55:42.172Z","etag":null,"topics":["achieve","capcut","ffmpeg","jianying","video","video-processing","wrapper"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emosheeep.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-27T12:35:29.000Z","updated_at":"2025-03-15T06:12:25.000Z","dependencies_parsed_at":"2024-04-22T15:27:43.441Z","dependency_job_id":"f39013cd-bdfa-4582-aa86-6c2ed46ed980","html_url":"https://github.com/emosheeep/capcut-export","commit_stats":null,"previous_names":["emosheeep/capcut-export"],"tags_count":2,"template":false,"template_full_name":"emosheeep/cli-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emosheeep%2Fcapcut-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emosheeep%2Fcapcut-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emosheeep%2Fcapcut-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emosheeep%2Fcapcut-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emosheeep","download_url":"https://codeload.github.com/emosheeep/capcut-export/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657831,"owners_count":21140842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["achieve","capcut","ffmpeg","jianying","video","video-processing","wrapper"],"created_at":"2024-09-30T15:19:44.557Z","updated_at":"2025-04-13T02:33:07.215Z","avatar_url":"https://github.com/emosheeep.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CapCut/Jianying Video Clips Export\n\n\u003e **2024-04-15** Lately I find that `CapCut/Jianying Pro` starts to encrypt the draft file in the latest release version to prevent from being used illegally. This project is also affected and will enter  the end of life unfortunately 🙁.\n\n[![npm version](https://img.shields.io/npm/v/capcut-export)](https://npmjs.com/package/capcut-export)\n![weekly downloads](https://img.shields.io/npm/dw/capcut-export)\n![license](https://img.shields.io/npm/l/capcut-export)\n\nThis project is based on [ffmpeg](https://ffmpeg.org/), which is a very well-known low-level tool for cross-platform video processing. **Please manually install it and add `ffmpeg` to your `PATH` first**.\n\n\u003e Tips: It's convenient to use `brew install ffmpeg` to get ffmpeg installed on MacOS.\n\nHere's the running example:\n\n\u003cimg alt=\"example.gif\" width=\"480\" src=\"https://raw.githubusercontent.com/emosheeep/capcut-export/HEAD/example.gif\"\u003e\n\n## Features\n\n- ⚡️ Based on ffmpeg, which is fast and reliable.\n- 💡 Stream copy, without re-encoding and loss of quality.\n\n## Quick Start\n\n```shell\npnpm i -g capcut-export # or npm/yarn\n```\n\nThen you got `ccexp` command in you `PATH`\n\n```\nUsage: ccexp [options] \u003cfile\u003e [output]\n\nExport video clips from CapCut editor tracks, helps archive materials.\n\nArguments:\n  file                      CapCut/Jianying draft info json file.\n  output                    The output directory, default is cwd.\n\nOptions:\n  -V, --version             output the version number\n  -p,--concurrent \u003cnumber\u003e  The number of tasks processed in parallel, the default is number of CPU.\n  --offset \u003cnumber\u003e         Expand the video clips' time range to both sides for about specific seconds, default is 2s.\n  --verbose                 To be verbose. (default: false)\n  -h, --help                display help for command\n```\n\n## Example\n\n```shell\nccexp /path/to/draft_info.json # output video clips into current directory.\nccexp /path/to/draft_info.json ./video # output into `./video` folder.\nccexp /path/to/draft_info.json --offset 5 # expand the time range of the segment by 5 seconds on each side.\nccexp /path/to/draft_info.json -p 1 --verbose # set the concurrency to 1 and show the verbose log, usually uses to debug.\n```\n\n# Draft Info File\n\nSearch for a draft info json file in your CapCut/Jianying project folder.\n\n## On MacOS\n\nThe file is called `draft_info.json` and is located in\n\n```\n/Users/user/Movies/CapCut/User Data/Projects/com.lveditor.draft\n```\n\n## On Windows\n\nThe file is named `draft_content.json` and the default location is:\n\n```\nC:\\Users\\user\\AppData\\Local\\CapCut\\User Data\\Projects\\com.lveditor.draft\\\n```\n\n# How it works\n\nFirst, the tool will extract **the start time**, **the duration** of the clips, and **the video path** from the draft info file.\n\nThen it use `ffmpeg` to export specific clips, the command is like:\n\n```shell\nffmpeg -ss 1 -t 3 -i /path/to/input.mp4 -c copy /path/to/output.mp4 -y\n```\n\nIn the above command:\n\n- `-ss` means the start time of video.\n- `-t` means the duration of the video clip.\n- `-c copy` means copy media steam without re-encoding, so it's a lossless and fast process and won't lose video quality.\n- `-y` means automatic confirmation when needed, used to override if a file of the same name exists.\n\nIt means *export a 3s' video clip to output.mp4 from 1s of input.mp4*, and overwrite the output file if it already exists.\n\n# Motivation\n\nSometimes when we finished video edit, there’ll be many clips in your editor track, and *they usually comes from a single video*. Anyway, we have a lot of video clips to export.\n\n**Assume that you want to archive the materials**, how will you do? Just export one by one? \n\nActually most of editors don’t provide this functionality such as Jianying/CapCut, even if they do, **the quality of the video will suffer after they re-encoded it**.\n\nSo we need a lossless, fast, and simple way to manage to do it, this tool is made for this. **It based on ffmpeg using stream copy without re-encoding, which won't lose quality**.\n\n# Question\n\n## Why is the time range of exported video clips not accurate enough?\n\nIn FFmpeg, when performing video editing or extracting, precision issues may arise due to two primary reasons:\n\n1. **Video Keyframes**: FFmpeg uses the `-ss` option to jump to a specific timestamp, and **by default, it seeks to the nearest keyframe**. *A keyframe is a frame that can be fully decoded without the need for other frames*. Normally, a video would have a keyframe every few seconds. **If the timestamp you chose does not directly fall on a keyframe, FFmpeg will choose to start from the nearest keyframe before the chosen timestamp, which can cause precision issues**.\n\n2. **The video's codec**: Different video codecs and container formats support precise seeking to different extents. Some formats (such as MP4 and MKV) allow relatively accurate seeking, while others may not.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femosheeep%2Fcapcut-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femosheeep%2Fcapcut-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femosheeep%2Fcapcut-export/lists"}