{"id":13817737,"url":"https://github.com/chinanf-boy/ffmpeg-concat-zh","last_synced_at":"2025-03-20T14:30:40.927Z","repository":{"id":90548283,"uuid":"143412314","full_name":"chinanf-boy/ffmpeg-concat-zh","owner":"chinanf-boy","description":"🇨🇳翻译: ffmpeg-concat  拼接 一组视频.,通过使用 ffmpeg和 性感的 OpenGL 过渡 (动画效果) ❤️ 校对 ✅","archived":false,"fork":false,"pushed_at":"2019-03-29T04:54:38.000Z","size":5,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T17:04:16.417Z","etag":null,"topics":["concat","docs","ffmpeg","opengl","video","zh"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chinanf-boy.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-08-03T10:12:27.000Z","updated_at":"2025-03-07T10:00:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9c32d24-bee4-40ce-97e2-a6167f8514e3","html_url":"https://github.com/chinanf-boy/ffmpeg-concat-zh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fffmpeg-concat-zh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fffmpeg-concat-zh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fffmpeg-concat-zh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fffmpeg-concat-zh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinanf-boy","download_url":"https://codeload.github.com/chinanf-boy/ffmpeg-concat-zh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244629999,"owners_count":20484295,"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":["concat","docs","ffmpeg","opengl","video","zh"],"created_at":"2024-08-04T06:00:54.448Z","updated_at":"2025-03-20T14:30:40.561Z","avatar_url":"https://github.com/chinanf-boy.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# ffmpeg-concat [![explain]][source] [![translate-svg]][translate-list]\n\n[explain]: http://llever.com/explain.svg\n[source]: https://github.com/chinanf-boy/Source-Explain\n[translate-svg]: http://llever.com/translate.svg\n[translate-list]: https://github.com/chinanf-boy/chinese-translate-list  \n\n「 拼接 一组视频.,通过使用 ffmpeg和 性感的 OpenGL 过渡 (动画效果) 」\n\n[more]: https://github.com/chinanf-boy/chinese-translate-list\n\n---\n\n## 校对 ✅\n\n\u003c!-- doc-templite START generated --\u003e\n\u003c!-- time = '2018 7.16' --\u003e\n翻译的原文 | 与日期 | 最新更新 | 更多\n---|---|---|---\n[commit] | ⏰ 2018 7.16 | ![last] | [中文翻译][translate-list]\n\n[last]: https://img.shields.io/github/last-commit/.svg\n[commit]: https://github.com//tree/\n\n\u003c!-- doc-templite END generated --\u003e\n\n[last]: https://img.shields.io/github/last-commit/transitive-bullshit/awesome-puppeteer.svg\n[commit]:  https://github.com/transitive-bullshit/ffmpeg-concat/tree/a229bea669c8955c373e32ca35b40c852edefcc8\n\n### 贡献\n\n欢迎 👏 勘误/校对/更新贡献 😊 [具体贡献请看](https://github.com/chinanf-boy/chinese-translate-list#贡献)\n\n## 生活\n\n[If help, **buy** me coffee —— 营养跟不上了，给我来瓶营养快线吧! 💰](https://github.com/chinanf-boy/live-need-money)\n\n---\n\n### 目录\n\n\u003cdetails\u003e\n\n\u003csummary\u003e info \u003c/summary\u003e\n\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [ffmpeg-concat](#ffmpeg-concat)\n  - [介绍](#%E4%BB%8B%E7%BB%8D)\n  - [安装](#%E5%AE%89%E8%A3%85)\n  - [CLI](#cli)\n  - [用法](#%E7%94%A8%E6%B3%95)\n  - [API](#api)\n    - [concat(options)](#concatoptions)\n      - [options](#options)\n        - [videos](#videos)\n        - [output](#output)\n        - [transition](#transition)\n        - [transitions](#transitions)\n        - [audio](#audio)\n        - [frameFormat](#frameformat)\n        - [concurrency](#concurrency)\n        - [log](#log)\n        - [cleanupFrames](#cleanupframes)\n        - [tempDir](#tempdir)\n  - [过渡](#%E8%BF%87%E6%B8%A1)\n  - [有关](#%E6%9C%89%E5%85%B3)\n  - [执照](#%E6%89%A7%E7%85%A7)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\n\u003c/details\u003e\n\n# ffmpeg-concat\n\n\u003e 拼接 一组视频.,通过使用 ffmpeg和 性感的 OpenGL 过渡 (动画效果)\n\n[![NPM](https://img.shields.io/npm/v/ffmpeg-concat.svg)](https://www.npmjs.com/package/ffmpeg-concat) [![Build Status](https://travis-ci.com/transitive-bullshit/ffmpeg-concat.svg?branch=master)](https://travis-ci.com/transitive-bullshit/ffmpeg-concat) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n![](https://raw.githubusercontent.com/transitive-bullshit/ffmpeg-concat/master/media/example.gif)\n\n*9个视频 与 独特过渡 连接在一起的示例*\n\n*请注意,由于GIF预览,质量和fps很差;[这个](https://raw.githubusercontent.com/transitive-bullshit/ffmpeg-concat/master/media/example.mp4)是源文件*\n\n## 介绍\n\n[FFmpeg](http://ffmpeg.org/)是命令行视频编辑中的事实标准,但使用 非平凡过渡 将视频连接在一起真的很困难. 这里有一些[错综复杂](https://superuser.com/questions/778762/crossfade-between-2-videos-using-ffmpeg) [的例子](https://video.stackexchange.com/questions/17502/concate-two-video-file-with-fade-effect-with-ffmpeg-in-linux)两个视频之间的简单交叉淡入淡出. FFmpeg过滤图非常强大,但是为了实现过渡动画,它们太复杂且容易出错. \n\n另一方面,[GL Transitions](https://gl-transitions.com/),是一个伟大的开源由[Gaëtan Renaudeau](https://github.com/gre)倡议,旨在使用 GLSL 建立一个普遍的过渡[集合](https://gl-transitions.com/gallery),它非常简单的规范使得定制现有过渡或编写自己的过渡非常容易,而不是使用复杂的ffmpeg过滤图. \n\n**使用 gl-transitions 这个模块和CLI轻松地将视频连接在一起.**\n\n## 安装\n\n这个模块需要[ffmpeg](http://ffmpeg.org/)要安装. \n\n```bash\nnpm install --save ffmpeg-concat\n\n# 或者 想使用 cli\nnpm install -g ffmpeg-concat\n```\n\n## CLI\n\n```sh\n  Usage: ffmpeg-concat [options] \u003cvideos...\u003e\n\n  Options:\n\n    -V, --version                         输出版本号\n    -o, --output \u003coutput\u003e                 要写入的mp4文件的路径（默认值：out.mp4）\n    -t, --transition-name \u003cname\u003e          要使用的gl-transition名称（默认值：淡入淡出）\n    -d, --transition-duration \u003cduration\u003e  过渡持续时间以毫秒为单位（默认值：500）\n    -T, --transitions \u003cfile\u003e              json文件加载 过渡配置\n    -f, --frame-format \u003cformat\u003e           用于临时帧图像的格式（默认值：raw）\n    -c, --concurrency \u003cnumber\u003e            要并行处理的视频数量（默认值：4）\n    -C, --no-cleanup-frames               禁用清除临时帧图像\n    -O, --temp-dir \u003cdir\u003e                  用于存储帧数据的临时工作目录\n    -h, --help                            输出使用信息\n\n  Example:\n\n    ffmpeg-concat -t circleopen -d 750 -o huzzah.mp4 0.mp4 1.mp4 2.mp4\n```\n\n## 用法\n\n```js\nconst concat = require('ffmpeg-concat')\n\n// 拼接 3 个 mp4s 使用 2  个 500ms directionalWipe 过渡\nawait concat({\n  output: 'test.mp4',\n  videos: [\n    'media/0.mp4',\n    'media/1.mp4',\n    'media/2.mp4'\n  ],\n  transition: {\n    name: 'directionalWipe',\n    duration: 500\n  }\n})\n```\n\n```js\n// 拼接 5 个 mp4 使用 4种不同的过渡\nawait concat({\n  output: 'test.mp4',\n  videos: [\n    'media/0.mp4',\n    'media/1.mp4',\n    'media/2.mp4',\n    'media/0.mp4',\n    'media/1.mp4'\n  ],\n  transitions: [\n    {\n      name: 'circleOpen',\n      duration: 1000\n    },\n    {\n      name: 'crossWarp',\n      duration: 800\n    },\n    {\n      name: 'directionalWarp',\n      duration: 500,\n      // 将自定义参数传递给过渡\n      params: { direction: [ 1, -1 ] }\n    },\n    {\n      name: 'squaresWire',\n      duration: 2000\n    }\n  ]\n})\n```\n\n## API\n\n### concat(options)\n\n将 视频文件 与 OpenGL过渡 连接在一起. 返回一个`Promise`用于输出视频的时间. \n\n请注意,您必须指定`videos`,`output`,或者`transition`要么`transitions`. \n\n请注意,输出视频的大小 和 fps 由 第一个输入视频决定. \n\n#### options\n\n##### videos\n\n类型: `Array\u003cString\u003e`\n**必需**\n\n要连接的视频数组,其中每个 item 都是视频文件的路径或URL. \n\n##### output\n\n类型: `String`\n**必需**\n\n输出的`mp4`视频文件路径. \n\n注意: 我们目前只支持输出到mp4;如果您希望获得更多格式的支持,请打开一个问题. \n\n##### transition\n\n类型: `Object`\n\n指定在每个视频之间使用的默认过渡. \n\n请注意,您必须指定其中一个`transition`要么`transitions`,取决于您对每次过渡的控制程度. 如果同时指定,`transitions`优先. \n\n```js\n// 例\nconst transition = {\n  duration: 1000, // ms\n  name: 'directionalwipe', // 要使用的 gl-transition名称（小写匹配）\n  params: { direction: [1, -1] } // 可选地覆盖默认参数\n}\n```\n\n##### transitions\n\n类型: `Array\u003cObject\u003e`\n\n指定每个视频之间的 (可能唯一的) 过渡. 如果有N个视频,则应该有N-1个过渡. \n\n请注意,您必须指定其中一个`transition`要么`transitions`,取决于您对每次过渡的控制程度. 如果同时指定,`transitions`优先. \n\n```js\n// 例\nconst transitions = [\n  {\n    duration: 1000,\n    name: 'fade'\n  },\n  {\n    duration: 500,\n    name: 'swap'\n  }\n]\n```\n\n##### audio\n\n类型: `String`\n**必需**\n\n音频文件的路径或URL,用作 输出视频 的音轨. \n\n##### frameFormat\n\n类型: `string`默认: `raw`\n\n临时帧图像的格式. 例如,您可以使用`png`要么`jpg`. \n\n注意: 出于性能原因默认为`raw`,写入和读取 原始二进制像素数据 比 编码和解码`png`帧快得多. 原始格式很难预览和调试,在另一种情况下,您可能想要更改`frameFormat`至`png`. \n\n##### concurrency\n\n类型: `Number`默认: `4`\n\n要并行处理的最大视频数量. \n\n##### log\n\n类型: `Function`默认: `noop`\n\n用于记录进度和底层ffmpeg命令的可选功能. 例如,您可以使用`console.log`\n\n##### cleanupFrames\n\n类型: `boolean`默认: `true`\n\n默认情况下,我们清理临时帧图像. 如果你需要调试中间结果,将此设置为`false`. \n\n##### tempDir\n\n类型: `string`默认值: `/tmp`下的随机目录\n\n用于存储中间帧数据的临时工作目录. 这是`cleanupFrames`时,帧被保存的位置. \n\n## 过渡\n\n这里有一些[gl-transitions](https://gl-transitions.com/)我发现对高质量的视频过渡 特别有用: \n\n-   [fade](https://gl-transitions.com/editor/fade)\n-   [fadegrayscale](https://gl-transitions.com/editor/fadegrayscale)\n-   [circleopen](https://gl-transitions.com/editor/circleopen)\n-   [directionalwarp](https://gl-transitions.com/editor/directionalwarp)\n-   [directionalwipe](https://gl-transitions.com/editor/directionalwipe)\n-   [crosswarp](https://gl-transitions.com/editor/crosswarp)\n-   [crosszoom](https://gl-transitions.com/editor/CrossZoom)\n-   [dreamy](https://gl-transitions.com/editor/Dreamy)\n-   [squareswire](https://gl-transitions.com/editor/squareswire)\n-   [angular](https://gl-transitions.com/editor/angular)\n-   [radial](https://gl-transitions.com/editor/Radial)\n-   [cube](https://gl-transitions.com/editor/cube)\n-   [swap](https://gl-transitions.com/editor/swap)\n\n## 有关\n\n-   [ffmpeg-gl-transition](https://github.com/transitive-bullshit/ffmpeg-gl-transition)- 用于在视频流之间 应用GLSL过渡 的 低级ffmpeg过滤器 ([gl-transitions](https://gl-transitions.com/)) . 它允许使用更高级和可自定义的过滤器图形,但它需要您构建自定义版本的ffmpeg. \n-   [gl-transitions](https://gl-transitions.com/)-  GLSL过渡的集合. \n-   [fluent-ffmpeg](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg)- 底层ffmpeg包装库. \n-   [awesome-ffmpeg](https://github.com/transitive-bullshit/awesome-ffmpeg)- ffmpeg资源的精选列表,重点关注JavaScript. \n\n## 执照\n\n麻省理工学院©[Travis Fischer](https://github.com/transitive-bullshit)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fffmpeg-concat-zh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinanf-boy%2Fffmpeg-concat-zh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fffmpeg-concat-zh/lists"}