├── .gitignore ├── LICENSE ├── QuickCut ├── QuickCut.py ├── languages │ ├── README.md │ ├── assets │ │ ├── image-20200731135839898.png │ │ ├── image-20200731135944600.png │ │ └── image-20200731140036406.png │ ├── create_ts.bat │ ├── en.qm │ ├── en.qph │ ├── en.ts │ └── project.pro ├── misc │ ├── Quick Cut 美化教程.md │ ├── README_en.html │ ├── README_zh.html │ ├── assets │ │ ├── image-20200724211333904.png │ │ ├── image-20200725102850979.png │ │ ├── image-20200725103013287.png │ │ ├── image-20200725103107328.png │ │ ├── image-20200725103137457.png │ │ ├── image-20200725103228908.png │ │ ├── image-20200725103257140.png │ │ ├── image-20200725103322509.png │ │ ├── image-20200725103345859.png │ │ ├── image-20200725104724393.png │ │ ├── image-20200725104814559.png │ │ ├── image-20200725104901324.png │ │ ├── image-20200725105113317.png │ │ ├── image-20200725105214629.png │ │ ├── image-20200725105301248.png │ │ ├── image-20200725110050437.png │ │ ├── image-20200725110307123.png │ │ ├── image-20200726203040942.png │ │ ├── image-20200801204028907.png │ │ ├── image-20200801204230301.png │ │ └── sponsor.jpg │ ├── icon.icns │ ├── icon.ico │ ├── icon_listning.icns │ ├── icon_listning.ico │ ├── 不使用预设.md │ ├── 关于 H264.html │ ├── 关于 H264.md │ ├── 关于 H265.md │ ├── 关于 h264 二压.md │ ├── 关于使用硬件加速.html │ ├── 关于使用硬件加速.md │ ├── 关于指定码率压制.md │ ├── 吾爱发帖.md │ ├── 复制视频流到mp4容器.md │ └── 疑难记录 │ │ └── 我这里用下面:.md ├── requirements.txt ├── sponsor.jpg └── style.css ├── README.md ├── README_en.md ├── assets ├── image-20200724211333904.png ├── image-20200725102850979.png ├── image-20200725103013287.png ├── image-20200725103107328.png ├── image-20200725103137457.png ├── image-20200725103228908.png ├── image-20200725103257140.png ├── image-20200725103322509.png ├── image-20200725103345859.png ├── image-20200725104724393.png ├── image-20200725104814559.png ├── image-20200725104901324.png ├── image-20200725105113317.png ├── image-20200725105214629.png ├── image-20200725105301248.png ├── image-20200725110050437.png ├── image-20200725110307123.png ├── image-20200726203040942.png ├── image-20200801204028907.png ├── image-20200801204230301.png └── sponsor.jpg ├── compile ├── Pyinstaller 编译和打包 Win64.bat └── 暂时弃用的脚本 │ ├── Pyinstaller 和 Nuitka 打包 7z Win64.bat │ └── Pyinstaller 和 Nuitka 编译 Win64.bat └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.db 2 | *.spec 3 | *.exe 4 | __pycache__ 5 | dist* 6 | QuickCut/misc/*.png 7 | QuickCut/misc/*.afphoto 8 | build* 9 | fileList.txt 10 | TEMP* 11 | text.py 12 | out 13 | *.log 14 | *.spec 15 | test.py 16 | README.html 17 | *.7z 18 | *.mp4 19 | *.mkv 20 | *.wav 21 | .DS_Store 22 | .idea 23 | *build 24 | *dist 25 | *info 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Mozilla Public License Version 2.0 2 | ================================== 3 | 4 | 1. Definitions 5 | -------------- 6 | 7 | 1.1. "Contributor" 8 | means each individual or legal entity that creates, contributes to 9 | the creation of, or owns Covered Software. 10 | 11 | 1.2. "Contributor Version" 12 | means the combination of the Contributions of others (if any) used 13 | by a Contributor and that particular Contributor's Contribution. 14 | 15 | 1.3. "Contribution" 16 | means Covered Software of a particular Contributor. 17 | 18 | 1.4. "Covered Software" 19 | means Source Code Form to which the initial Contributor has attached 20 | the notice in Exhibit A, the Executable Form of such Source Code 21 | Form, and Modifications of such Source Code Form, in each case 22 | including portions thereof. 23 | 24 | 1.5. "Incompatible With Secondary Licenses" 25 | means 26 | 27 | (a) that the initial Contributor has attached the notice described 28 | in Exhibit B to the Covered Software; or 29 | 30 | (b) that the Covered Software was made available under the terms of 31 | version 1.1 or earlier of the License, but not also under the 32 | terms of a Secondary License. 33 | 34 | 1.6. "Executable Form" 35 | means any form of the work other than Source Code Form. 36 | 37 | 1.7. "Larger Work" 38 | means a work that combines Covered Software with other material, in 39 | a separate file or files, that is not Covered Software. 40 | 41 | 1.8. "License" 42 | means this document. 43 | 44 | 1.9. "Licensable" 45 | means having the right to grant, to the maximum extent possible, 46 | whether at the time of the initial grant or subsequently, any and 47 | all of the rights conveyed by this License. 48 | 49 | 1.10. "Modifications" 50 | means any of the following: 51 | 52 | (a) any file in Source Code Form that results from an addition to, 53 | deletion from, or modification of the contents of Covered 54 | Software; or 55 | 56 | (b) any new file in Source Code Form that contains any Covered 57 | Software. 58 | 59 | 1.11. "Patent Claims" of a Contributor 60 | means any patent claim(s), including without limitation, method, 61 | process, and apparatus claims, in any patent Licensable by such 62 | Contributor that would be infringed, but for the grant of the 63 | License, by the making, using, selling, offering for sale, having 64 | made, import, or transfer of either its Contributions or its 65 | Contributor Version. 66 | 67 | 1.12. "Secondary License" 68 | means either the GNU General Public License, Version 2.0, the GNU 69 | Lesser General Public License, Version 2.1, the GNU Affero General 70 | Public License, Version 3.0, or any later versions of those 71 | licenses. 72 | 73 | 1.13. "Source Code Form" 74 | means the form of the work preferred for making modifications. 75 | 76 | 1.14. "You" (or "Your") 77 | means an individual or a legal entity exercising rights under this 78 | License. For legal entities, "You" includes any entity that 79 | controls, is controlled by, or is under common control with You. For 80 | purposes of this definition, "control" means (a) the power, direct 81 | or indirect, to cause the direction or management of such entity, 82 | whether by contract or otherwise, or (b) ownership of more than 83 | fifty percent (50%) of the outstanding shares or beneficial 84 | ownership of such entity. 85 | 86 | 2. License Grants and Conditions 87 | -------------------------------- 88 | 89 | 2.1. Grants 90 | 91 | Each Contributor hereby grants You a world-wide, royalty-free, 92 | non-exclusive license: 93 | 94 | (a) under intellectual property rights (other than patent or trademark) 95 | Licensable by such Contributor to use, reproduce, make available, 96 | modify, display, perform, distribute, and otherwise exploit its 97 | Contributions, either on an unmodified basis, with Modifications, or 98 | as part of a Larger Work; and 99 | 100 | (b) under Patent Claims of such Contributor to make, use, sell, offer 101 | for sale, have made, import, and otherwise transfer either its 102 | Contributions or its Contributor Version. 103 | 104 | 2.2. Effective Date 105 | 106 | The licenses granted in Section 2.1 with respect to any Contribution 107 | become effective for each Contribution on the date the Contributor first 108 | distributes such Contribution. 109 | 110 | 2.3. Limitations on Grant Scope 111 | 112 | The licenses granted in this Section 2 are the only rights granted under 113 | this License. No additional rights or licenses will be implied from the 114 | distribution or licensing of Covered Software under this License. 115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 116 | Contributor: 117 | 118 | (a) for any code that a Contributor has removed from Covered Software; 119 | or 120 | 121 | (b) for infringements caused by: (i) Your and any other third party's 122 | modifications of Covered Software, or (ii) the combination of its 123 | Contributions with other software (except as part of its Contributor 124 | Version); or 125 | 126 | (c) under Patent Claims infringed by Covered Software in the absence of 127 | its Contributions. 128 | 129 | This License does not grant any rights in the trademarks, service marks, 130 | or logos of any Contributor (except as may be necessary to comply with 131 | the notice requirements in Section 3.4). 132 | 133 | 2.4. Subsequent Licenses 134 | 135 | No Contributor makes additional grants as a result of Your choice to 136 | distribute the Covered Software under a subsequent version of this 137 | License (see Section 10.2) or under the terms of a Secondary License (if 138 | permitted under the terms of Section 3.3). 139 | 140 | 2.5. Representation 141 | 142 | Each Contributor represents that the Contributor believes its 143 | Contributions are its original creation(s) or it has sufficient rights 144 | to grant the rights to its Contributions conveyed by this License. 145 | 146 | 2.6. Fair Use 147 | 148 | This License is not intended to limit any rights You have under 149 | applicable copyright doctrines of fair use, fair dealing, or other 150 | equivalents. 151 | 152 | 2.7. Conditions 153 | 154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted 155 | in Section 2.1. 156 | 157 | 3. Responsibilities 158 | ------------------- 159 | 160 | 3.1. Distribution of Source Form 161 | 162 | All distribution of Covered Software in Source Code Form, including any 163 | Modifications that You create or to which You contribute, must be under 164 | the terms of this License. You must inform recipients that the Source 165 | Code Form of the Covered Software is governed by the terms of this 166 | License, and how they can obtain a copy of this License. You may not 167 | attempt to alter or restrict the recipients' rights in the Source Code 168 | Form. 169 | 170 | 3.2. Distribution of Executable Form 171 | 172 | If You distribute Covered Software in Executable Form then: 173 | 174 | (a) such Covered Software must also be made available in Source Code 175 | Form, as described in Section 3.1, and You must inform recipients of 176 | the Executable Form how they can obtain a copy of such Source Code 177 | Form by reasonable means in a timely manner, at a charge no more 178 | than the cost of distribution to the recipient; and 179 | 180 | (b) You may distribute such Executable Form under the terms of this 181 | License, or sublicense it under different terms, provided that the 182 | license for the Executable Form does not attempt to limit or alter 183 | the recipients' rights in the Source Code Form under this License. 184 | 185 | 3.3. Distribution of a Larger Work 186 | 187 | You may create and distribute a Larger Work under terms of Your choice, 188 | provided that You also comply with the requirements of this License for 189 | the Covered Software. If the Larger Work is a combination of Covered 190 | Software with a work governed by one or more Secondary Licenses, and the 191 | Covered Software is not Incompatible With Secondary Licenses, this 192 | License permits You to additionally distribute such Covered Software 193 | under the terms of such Secondary License(s), so that the recipient of 194 | the Larger Work may, at their option, further distribute the Covered 195 | Software under the terms of either this License or such Secondary 196 | License(s). 197 | 198 | 3.4. Notices 199 | 200 | You may not remove or alter the substance of any license notices 201 | (including copyright notices, patent notices, disclaimers of warranty, 202 | or limitations of liability) contained within the Source Code Form of 203 | the Covered Software, except that You may alter any license notices to 204 | the extent required to remedy known factual inaccuracies. 205 | 206 | 3.5. Application of Additional Terms 207 | 208 | You may choose to offer, and to charge a fee for, warranty, support, 209 | indemnity or liability obligations to one or more recipients of Covered 210 | Software. However, You may do so only on Your own behalf, and not on 211 | behalf of any Contributor. You must make it absolutely clear that any 212 | such warranty, support, indemnity, or liability obligation is offered by 213 | You alone, and You hereby agree to indemnify every Contributor for any 214 | liability incurred by such Contributor as a result of warranty, support, 215 | indemnity or liability terms You offer. You may include additional 216 | disclaimers of warranty and limitations of liability specific to any 217 | jurisdiction. 218 | 219 | 4. Inability to Comply Due to Statute or Regulation 220 | --------------------------------------------------- 221 | 222 | If it is impossible for You to comply with any of the terms of this 223 | License with respect to some or all of the Covered Software due to 224 | statute, judicial order, or regulation then You must: (a) comply with 225 | the terms of this License to the maximum extent possible; and (b) 226 | describe the limitations and the code they affect. Such description must 227 | be placed in a text file included with all distributions of the Covered 228 | Software under this License. Except to the extent prohibited by statute 229 | or regulation, such description must be sufficiently detailed for a 230 | recipient of ordinary skill to be able to understand it. 231 | 232 | 5. Termination 233 | -------------- 234 | 235 | 5.1. The rights granted under this License will terminate automatically 236 | if You fail to comply with any of its terms. However, if You become 237 | compliant, then the rights granted under this License from a particular 238 | Contributor are reinstated (a) provisionally, unless and until such 239 | Contributor explicitly and finally terminates Your grants, and (b) on an 240 | ongoing basis, if such Contributor fails to notify You of the 241 | non-compliance by some reasonable means prior to 60 days after You have 242 | come back into compliance. Moreover, Your grants from a particular 243 | Contributor are reinstated on an ongoing basis if such Contributor 244 | notifies You of the non-compliance by some reasonable means, this is the 245 | first time You have received notice of non-compliance with this License 246 | from such Contributor, and You become compliant prior to 30 days after 247 | Your receipt of the notice. 248 | 249 | 5.2. If You initiate litigation against any entity by asserting a patent 250 | infringement claim (excluding declaratory judgment actions, 251 | counter-claims, and cross-claims) alleging that a Contributor Version 252 | directly or indirectly infringes any patent, then the rights granted to 253 | You by any and all Contributors for the Covered Software under Section 254 | 2.1 of this License shall terminate. 255 | 256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all 257 | end user license agreements (excluding distributors and resellers) which 258 | have been validly granted by You or Your distributors under this License 259 | prior to termination shall survive termination. 260 | 261 | ************************************************************************ 262 | * * 263 | * 6. Disclaimer of Warranty * 264 | * ------------------------- * 265 | * * 266 | * Covered Software is provided under this License on an "as is" * 267 | * basis, without warranty of any kind, either expressed, implied, or * 268 | * statutory, including, without limitation, warranties that the * 269 | * Covered Software is free of defects, merchantable, fit for a * 270 | * particular purpose or non-infringing. The entire risk as to the * 271 | * quality and performance of the Covered Software is with You. * 272 | * Should any Covered Software prove defective in any respect, You * 273 | * (not any Contributor) assume the cost of any necessary servicing, * 274 | * repair, or correction. This disclaimer of warranty constitutes an * 275 | * essential part of this License. No use of any Covered Software is * 276 | * authorized under this License except under this disclaimer. * 277 | * * 278 | ************************************************************************ 279 | 280 | ************************************************************************ 281 | * * 282 | * 7. Limitation of Liability * 283 | * -------------------------- * 284 | * * 285 | * Under no circumstances and under no legal theory, whether tort * 286 | * (including negligence), contract, or otherwise, shall any * 287 | * Contributor, or anyone who distributes Covered Software as * 288 | * permitted above, be liable to You for any direct, indirect, * 289 | * special, incidental, or consequential damages of any character * 290 | * including, without limitation, damages for lost profits, loss of * 291 | * goodwill, work stoppage, computer failure or malfunction, or any * 292 | * and all other commercial damages or losses, even if such party * 293 | * shall have been informed of the possibility of such damages. This * 294 | * limitation of liability shall not apply to liability for death or * 295 | * personal injury resulting from such party's negligence to the * 296 | * extent applicable law prohibits such limitation. Some * 297 | * jurisdictions do not allow the exclusion or limitation of * 298 | * incidental or consequential damages, so this exclusion and * 299 | * limitation may not apply to You. * 300 | * * 301 | ************************************************************************ 302 | 303 | 8. Litigation 304 | ------------- 305 | 306 | Any litigation relating to this License may be brought only in the 307 | courts of a jurisdiction where the defendant maintains its principal 308 | place of business and such litigation shall be governed by laws of that 309 | jurisdiction, without reference to its conflict-of-law provisions. 310 | Nothing in this Section shall prevent a party's ability to bring 311 | cross-claims or counter-claims. 312 | 313 | 9. Miscellaneous 314 | ---------------- 315 | 316 | This License represents the complete agreement concerning the subject 317 | matter hereof. If any provision of this License is held to be 318 | unenforceable, such provision shall be reformed only to the extent 319 | necessary to make it enforceable. Any law or regulation which provides 320 | that the language of a contract shall be construed against the drafter 321 | shall not be used to construe this License against a Contributor. 322 | 323 | 10. Versions of the License 324 | --------------------------- 325 | 326 | 10.1. New Versions 327 | 328 | Mozilla Foundation is the license steward. Except as provided in Section 329 | 10.3, no one other than the license steward has the right to modify or 330 | publish new versions of this License. Each version will be given a 331 | distinguishing version number. 332 | 333 | 10.2. Effect of New Versions 334 | 335 | You may distribute the Covered Software under the terms of the version 336 | of the License under which You originally received the Covered Software, 337 | or under the terms of any subsequent version published by the license 338 | steward. 339 | 340 | 10.3. Modified Versions 341 | 342 | If you create software not governed by this License, and you want to 343 | create a new license for such software, you may create and use a 344 | modified version of this License if you rename the license and remove 345 | any references to the name of the license steward (except to note that 346 | such modified license differs from this License). 347 | 348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 349 | Licenses 350 | 351 | If You choose to distribute Source Code Form that is Incompatible With 352 | Secondary Licenses under the terms of this version of the License, the 353 | notice described in Exhibit B of this License must be attached. 354 | 355 | Exhibit A - Source Code Form License Notice 356 | ------------------------------------------- 357 | 358 | This Source Code Form is subject to the terms of the Mozilla Public 359 | License, v. 2.0. If a copy of the MPL was not distributed with this 360 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 361 | 362 | If it is not possible or desirable to put the notice in a particular 363 | file, then You may include the notice in a location (such as a LICENSE 364 | file in a relevant directory) where a recipient would be likely to look 365 | for such a notice. 366 | 367 | You may add additional accurate notices of copyright ownership. 368 | 369 | Exhibit B - "Incompatible With Secondary Licenses" Notice 370 | --------------------------------------------------------- 371 | 372 | This Source Code Form is "Incompatible With Secondary Licenses", as 373 | defined by the Mozilla Public License, v. 2.0. 374 | -------------------------------------------------------------------------------- /QuickCut/languages/README.md: -------------------------------------------------------------------------------- 1 | ## Translation Help 2 | 3 | ### Before Translate 4 | 5 | Each class of the QuickCut is a part of translation. Check out whick part is under translation in issue page. If you decide to translate some parts, please first open an issue to notify every that this part is under work, so that others won't repeat the wheels. 6 | 7 | ### How to Translate 8 | 9 | Different language translation have the same process, so I'll just take translating to English as example. 10 | 11 | First make sure you have `pyside2` installed by executing `pip install pyside2` 12 | 13 | ![image-20200731135839898](assets/image-20200731135839898.png) 14 | 15 | If you are on Windows, run `create_ts.bat`, it will read the config from `project.pro`, and then generate a `en.ts` file, which can be opened by `Linguist` . 16 | 17 | After installing `PySide2`, the `Linguist` is also installed, you just run `linguist` in command line, it will launch. 18 | 19 | Use `Linguist` to open `en.ts`, and then translate the items: 20 | 21 | ![image-20200731135944600](assets/image-20200731135944600.png) 22 | 23 | After translating each item, don't forget to click the `√` to tell `Linguist` that this item translation is complete, and most importantly, add it to the dictionary `en.qph` by pressing `Ctrl + T` . 24 | 25 | The next time `QuickCut` commits, you may need to run `create_ts.bat` again, the `en.ts` will be updated, but the translation inside of it will also be deleted. 26 | 27 | You can use the dictionary `en.qph` (which you have added translated items to it) to quickly fill blanks by using `Linguist`'s batch translation: 28 | 29 | ![image-20200731140036406](assets/image-20200731140036406.png) 30 | 31 | After that, use `Linguist` to generated a `en.qm` which is the final language file can be load by `QuickCut.py` 32 | 33 | When your translation is finished, you can pull a request to the [QuickCut](https://github.com/HaujetZhao/QuickCut). Or send an email to 1292756898@qq.com -------------------------------------------------------------------------------- /QuickCut/languages/assets/image-20200731135839898.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/languages/assets/image-20200731135839898.png -------------------------------------------------------------------------------- /QuickCut/languages/assets/image-20200731135944600.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/languages/assets/image-20200731135944600.png -------------------------------------------------------------------------------- /QuickCut/languages/assets/image-20200731140036406.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/languages/assets/image-20200731140036406.png -------------------------------------------------------------------------------- /QuickCut/languages/create_ts.bat: -------------------------------------------------------------------------------- 1 | pyside2-lupdate -noobsolete project.pro 2 | pause -------------------------------------------------------------------------------- /QuickCut/languages/en.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/languages/en.qm -------------------------------------------------------------------------------- /QuickCut/languages/en.qph: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FFmpeg 5 | FFmpeg 6 | 7 | 8 | 帮助 9 | Help 10 | 11 | 12 | 分割视频 13 | Split 14 | 15 | 16 | 合并片段 17 | Concat 18 | 19 | 20 | 设置 21 | Settings 22 | 23 | 24 | 下载视频 25 | Download 26 | 27 | 28 | 语音输入 29 | VoiceInput 30 | 31 | 32 | 自动剪辑 33 | AutoEdit 34 | 35 | 36 | 自动字幕 37 | AutoSrt 38 | 39 | 40 | 例如 “00:05.00”、“23.189”、“12:03:45”的形式都是有效的,注意冒号是英文冒号 41 | Such as 00:05.00, 23.189, 12:03:45 are all valid. 42 | 43 | 44 | 命令运行输出窗口 45 | Command Line Output Window 46 | 47 | 48 | 退出 49 | Exit 50 | 51 | 52 | 53 | 初始化完成,现在可以将本工具最小化,在需要输入的界面,按住 CapsLock 键 0.3 秒后开始说话,松开 CapsLock 键后识别结果会自动输入 54 | 55 | Initiation complete, from now on, you can long press Caps Lock key more than 0.3 seconds and then speak, when the key is released, the words will be input automaticlly. 56 | 57 | 58 | 点击交换横纵分辨率 59 | Click to exchange resolution values 60 | 61 | 62 | 输入文件 63 | Input File 64 | 65 | 66 | 输出路径 67 | Output Path 68 | 69 | 70 | 选择保存位置 71 | Choose Save Path 72 | 73 | 74 | 安静片段倍速: 75 | Quiet Clips Speed: 76 | 77 | 78 | 响亮片段倍速: 79 | Sounded Clips Speed: 80 | 81 | 82 | 片段间缓冲帧数: 83 | Margin of Clips: 84 | 85 | 86 | 声音检测相对阈值: 87 | Silence Threshold: 88 | 89 | 90 | 提取帧选项: 91 | Extract Option: 92 | 93 | 94 | 这里可以选择硬件加速编码器、调整提取帧的质量 95 | Here you can select hardware accelerating codecs, adjust frame quality 96 | 97 | 98 | 提取帧质量: 99 | Frame Quality: 100 | 101 | 102 | 输出文件选项: 103 | Output Option: 104 | 105 | 106 | 在这里可以选择对应你设备的硬件加速编码器,Intel 对应 qsv,AMD 对应 amf,Nvidia 对应 nvenc, 苹果电脑对应 videotoolbox 107 | 108 | 109 | 110 | 生成自动字幕并依据字幕中的关键句自动剪辑 111 | Auto generate subtitles and auto edit video by keywords in subtitles. 112 | 113 | 114 | 字幕语音 API: 115 | Voice to Subtitle Engine: 116 | 117 | 118 | 剪去片段关键句: 119 | Keywords indicates cut: 120 | 121 | 122 | 切掉 123 | delete 124 | 125 | 126 | 保留片段关键句: 127 | Keywords indicates save: 128 | 129 | 130 | 保留 131 | save 132 | 133 | 134 | 运行 135 | Run 136 | 137 | 138 | 所有文件(*) 139 | All Files(*) 140 | 141 | 142 | 设置输出保存的文件名 143 | Set the output file path 144 | 145 | 146 | 输出视频.mp4 147 | Output.mp4 148 | 149 | 150 | 删除预设 151 | Delete Template 152 | 153 | 154 | 将要删除“%s”预设,是否确认? 155 | About to delete "%s" template, confirm? 156 | 157 | 158 | 还没有选择要删除的预设 159 | You haven't choose a template. 160 | 161 | 162 | 预设描述 163 | Template Description 164 | 165 | 166 | 添加或更新 Api 167 | Add or update API 168 | 169 | 170 | 引擎名字: 171 | Engine Name: 172 | 173 | 174 | 例如:阿里-中文 175 | Example: Alibaba-English 176 | 177 | 178 | 服务商: 179 | Provider: 180 | 181 | 182 | 取消 183 | Cancel 184 | 185 | 186 | 由 Api 的云端配置决定 187 | Controled by API cloud config 188 | 189 | 190 | 添加Api 191 | Add API 192 | 193 | 194 | 新Api添加失败,你可以把失败过程重新操作记录一遍,然后发给作者 195 | Failed to add new API, you may record your process adn send it to the developer. 196 | 197 | 198 | 覆盖Api 199 | Overwrite API 200 | 201 | 202 | 已经存在名字相同的Api,你可以选择换一个Api名称或者覆盖旧的Api。是否要覆盖? 203 | An API with the same name already exists, you could overwrite it or change the new API name. 204 | Do you want to overwrite? 205 | 206 | 207 | 更新Api 208 | Update API 209 | 210 | 211 | Api更新成功 212 | API updated successfully! 213 | 214 | 215 | Api更新失败,你可以把失败过程重新操作记录一遍,然后发给作者 216 | Failed to update API, you may record your operation and send it to the developer. 217 | 218 | 219 | 录音文件识别请求成功响应! 220 | 221 | The request of recognition was responded successfully! 222 | 223 | 224 | 录音文件识别请求失败! 225 | 226 | The request of recognition failed! 227 | 228 | 229 | 云端任务正在排队中,3 秒后重新查询 230 | 231 | The cloud task is queeing, query again 3 seconds later. 232 | 233 | 234 | 音频转文字中,3 秒后重新查询 235 | 236 | The cloud task is on work, query again 3 seconds later. 237 | 238 | 239 | 录音文件识别成功! 240 | 241 | The recognition task succeded! 242 | 243 | 244 | 录音文件识别失败! 245 | 246 | The recognition task failed! 247 | 248 | 249 | 上传 oss 目标路径: 250 | OSS destinition of uploading: 251 | 252 | 253 | 上传音频中 254 | 255 | Uploading audio 256 | 257 | 258 | 音频上传完毕,路径是:%s 259 | 260 | Audio uploaded, the url is: %s 261 | 262 | 263 | 正在识别中 264 | 265 | Recognizing 266 | 267 | 268 | 识别完成,现在删除 oss 上的音频文件: 269 | Recognition complete, now deleting the audio file is oss: 270 | 271 | 272 | 云端数据转字幕的过程中出错了,可能是没有识别到文字 273 | 274 | Audio to srt process went wrong, maybe it's because the recognition result has no words. 275 | 276 | 277 | 现在开始生成单声道、 16000Hz 的 wav 音频:%s 278 | 279 | Now generation monochannel, 16000Hz wav file. 280 | 281 | 282 | 已删除 oss 音频文件 283 | 284 | OSS audio file deleted successfully! 285 | 286 | 287 | 删除临时文件夹 %s 失败 288 | Failed to delete TEMP folder: %s 289 | 290 | 291 | 正在清除产生的临时文件夹:%s 292 | Deleting the temp folder: %s 293 | 294 | 295 | 临时文件目录:%s 296 | 297 | Temp folder path: %s 298 | 299 | 300 | 临时文件夹(%s)创建失败,请检查权限 301 | 302 | Failed to create temp folder: %s, please check out the permissions. 303 | 304 | 305 | 新建临时文件夹:%s 306 | 307 | Create new temp folder: %s 308 | 309 | 310 | 视频帧率是: 311 | The fps of video is: 312 | 313 | 314 | 音频采样率是: 315 | The audio samplerate is: 316 | 317 | 318 | 319 | 320 | 将所有视频帧提取到临时文件夹:%s 321 | 322 | 323 | Extracting all video frames to temp folder: %s 324 | 325 | 326 | 327 | 328 | 分离出音频流:%s 329 | 330 | 331 | Extracting audio stream: %s 332 | 333 | 334 | 335 | 336 | 正在分析音频 337 | 338 | 339 | Analysing audio 340 | 341 | 342 | 静音、响亮片段分析完成 343 | 344 | The anylization of silent and sounded clips completed. 345 | 346 | 347 | 开始根据字幕中的关键词处理片段 348 | 349 | Now start to process clips according to the keywords in subtitle file. 350 | 351 | 352 | 上一区间的结尾是: %s 353 | 354 | The end of last region is: %s 355 | 356 | 357 | 这是区间是: %s 到 %s 358 | 359 | This region is : %s to %s 360 | 361 | 362 | 363 | 364 | 开始根据分段信息处理音频 365 | 366 | Process audio by chunks info. 367 | 368 | 369 | 370 | 371 | 现在开始合并音频片段 372 | 373 | 374 | 375 | Concat all the audio clips. 376 | 377 | 378 | 379 | 380 | 现在开始合并音视频 381 | 382 | 383 | 384 | Combine audio and video. 385 | 386 | 387 | 388 | 389 | 390 | 自动剪辑处理完成! 391 | 392 | 393 | 394 | Auto edit complete! 395 | 396 | 397 | 自动剪辑过程出错了,可能是因为启用了在线语音识别引擎,但是填写的 oss 和 api 有误,如果是其它原因,你可以将问题出现过程记录下,在帮助页面加入 QQ 群向作者反馈。 398 | Auto edit process failed. You may record the process and send it to the developer. 399 | 400 | 401 | 启用 CapsWirter 语音输入 402 | Enable CapsWrite Speech-To-Text service 403 | 404 | 405 | 停用 CapsWirter 语音输入 406 | Disable CapsWrite Speech-To-Text service 407 | 408 | 409 | {}:按住 CapsLock 键 0.3 秒后开始说话... 410 | {}:long press Caps Lock over 0.3s and then speak... 411 | 412 | 413 | 414 | {}:在听了,说完了请松开 CapsLock 键... 415 | {}:Listning... After speaking, release the CapsLock key. 416 | 417 | 418 | 点击交换“截取时长”和“截止时刻” 419 | Click to exchange "Cut Duration" and "End time". 420 | 421 | 422 | 截取时长: 423 | Cut Duration: 424 | 425 | 426 | 比特率 427 | bitrate 428 | 429 | 430 | 出错了,本次运行的命令是: 431 | 432 | %s 433 | 434 | 你可以将上面这行命令复制到 cmd 窗口运行下,看看报什么错,如果自己解决不了,把那个报错信息发给开发者 435 | Some thing went wrong, the command runs this time is: %s , you can run it in your shell to check out the error information. If it can't be resolved, you may record it and send it to the developer. 436 | 437 | 438 | 大小 439 | size 440 | 441 | 442 | 开始执行命令 443 | 444 | Command started. 445 | 446 | 447 | 命令运行出错了,估计是你的 you-get、youtube-dl 没有安装上。快去看下视频教程的下载视频这一节吧,里面有安装 you-get 和 youtube-dl 的命令 448 | Command went wrong. Please go checkout video tutorial in Help tab. 449 | 450 | 451 | 452 | 命令执行完毕 453 | 454 | Command complete. 455 | 456 | 457 | 时间 458 | time 459 | 460 | 461 | 速度 462 | speed 463 | 464 | 465 | 帧数 466 | frame 467 | 468 | 469 | OSS对象存储设置: 470 | OSS config: 471 | 472 | 473 | 阿里OSS 474 | Alibaba OSS 475 | 476 | 477 | 安装 you-get 和 youtube-dl 478 | Install you-get and youtube-dl 479 | 480 | 481 | 保存OSS配置 482 | Save OSS config 483 | 484 | 485 | 打开 FFmpeg 下载页面 486 | Open FFmpeg download page 487 | 488 | 489 | 打开 Python 下载页面 490 | Open Python download page 491 | 492 | 493 | 点击关闭按钮时隐藏到托盘 494 | Hide to tray when close. 495 | 496 | 497 | 服务商 498 | Provider 499 | 500 | 501 | 更改的语言会在重启软件后生效 502 | The language will take effect after relaunching the software. 503 | 504 | 505 | 更改语言 506 | Change Language 507 | 508 | 509 | 将要删除选中的 Api,是否确认? 510 | About to delete selected API, confirm? 511 | 512 | 513 | 删除 Api 514 | Delete API 515 | 516 | 517 | 删除失败 518 | Detetion fail 519 | 520 | 521 | 腾讯OSS 522 | Tencent OSS 523 | 524 | 525 | 引擎名称 526 | Engine Name 527 | 528 | 529 | 语言 530 | Language 531 | 532 | 533 | 语言: 534 | Language: 535 | 536 | 537 | 语音 Api: 538 | SpeechToText API: 539 | 540 | 541 | 保存路径: 542 | Save path: 543 | 544 | 545 | 不填则默认下载最高画质 546 | Blank means the default highest quality 547 | 548 | 549 | 不填则使用默认下载名 550 | Blank means the default filename 551 | 552 | 553 | 代理: 554 | Proxy: 555 | 556 | 557 | 格式id: 558 | Format id: 559 | 560 | 561 | 开始下载视频 562 | Start 563 | 564 | 565 | 列出格式id 566 | List Format Id 567 | 568 | 569 | 列出流id 570 | List Stream Id 571 | 572 | 573 | 默认不用填 574 | Optional 575 | 576 | 577 | 使用 Annie 下载视频: 578 | Download videos using Annie: 579 | 580 | 581 | 使用 You-Get 下载视频: 582 | Download videos using You-Get: 583 | 584 | 585 | 使用 Youtube-dl 下载视频: 586 | Download Videos using YouTube-dl 587 | 588 | 589 | 视频链接: 590 | Video link: 591 | 592 | 593 | 所有文件(*) 594 | All Files(*) 595 | 596 | 597 | 文件命名格式: 598 | File name format: 599 | 600 | 601 | 下载格式(流id): 602 | Stream Id: 603 | 604 | 605 | 下载视频列表 606 | Download the video list 607 | 608 | 609 | 只下载字幕 610 | Only download subtitles 611 | 612 | 613 | 导出完成 614 | 615 | Export complete 616 | 617 | 618 | 总共要处理的时长:%s 秒 导出的每个片段时长:%s 秒 619 | 620 | Total time length to process: %s seconds Time length of each exported clip: %s seconds 621 | 622 | 623 | 总共有 %s 个片段要导出,现在导出第 %s 个…… 624 | 625 | %s clips need to be exported, now exporting number %s ...... 626 | 627 | 628 | 输入法休息时间: 629 | Rest time after audio: 630 | 631 | 632 | 声音能量阈值: 633 | Voice energy threshold: 634 | 635 | 636 | 起始时间: 637 | Start time: 638 | 639 | 640 | 片段最长时间: 641 | Max clip duration: 642 | 643 | 644 | 片段最短时间: 645 | Min clip duration: 646 | 647 | 648 | 每次输入完需要休息一下,否则在文字出来后很快再按下快捷键,语音输入法有可能响应不过来 649 | Each time the audio finished, wait some time, to let VoiceInputMethod app give out result. 650 | 651 | 652 | 可选截取片段: 653 | Choose one clip 654 | 655 | 656 | 开始运行 657 | Start to run 658 | 659 | 660 | 开始全自动运行 661 | Run automaticlly 662 | 663 | 664 | 开始半自动运行 665 | Run semi-automaticlly 666 | 667 | 668 | 结束时间: 669 | End time: 670 | 671 | 672 | 段内静音最长时间: 673 | Max silence duration in clip: 674 | 675 | 676 | 打开文件 677 | Open File 678 | 679 | 680 | 查看帮助 681 | Checkout Help 682 | 683 | 684 | https://www.bilibili.com/video/BV1wT4y177kD/ 685 | 686 | 687 | 688 | 输入文件: 689 | Input file: 690 | 691 | 692 | 输入文件有误 693 | Input error 694 | 695 | 696 | 输入文件有误,请检查输入文件路径 697 | Input file is not a valid file, please check out the input path. 698 | 699 | 700 | 它是用 log10 dot(x, x) / |x| 计算出的能量的 log 值 701 | It is the energy computed by log10 dot(x, x) / |x| 702 | 703 | 704 | 通过录音文件识别引擎转字幕: 705 | Transcribe audio to srt subtitle by SpeechToText engine: 706 | 707 | 708 | 通过语音输入法转字幕: 709 | Transcribe audio to srt subtitle by VoiceInputMethod app: 710 | 711 | 712 | 语音输入快捷键: 713 | VoiceInputMethod shortcut: 714 | 715 | 716 | 字幕输出文件: 717 | Subtitle output file: 718 | 719 | 720 | 覆盖确认 721 | Overwrite confirm 722 | 723 | 724 | 截取片段 725 | Cut clip 726 | 727 | 728 | 起始时间: 729 | Start time: 730 | 731 | 732 | 输出路径对应的文件已存在,是否要覆盖? 733 | The file of output alreads exists, confirm overwrite? 734 | 735 | 736 | 输入1路径: 737 | Input 1 path: 738 | 739 | 740 | 输入1选项: 741 | Input 1 option: 742 | 743 | 744 | 输入2路径: 745 | Input 2 path: 746 | 747 | 748 | 这里输入要处理的视频、音频文件 749 | Drop in video, audio files 750 | 751 | 752 | 对字幕中的每一句剪出对应的视频片段: 753 | Split video clips by using subtitle file: 754 | 755 | 756 | 根据指定大小分割片段: 757 | Split clips by specifized size: 758 | 759 | 760 | 根据指定时长分割片段: 761 | Split clips by specifized size: 762 | 763 | 764 | 截止时刻: 765 | End Time: 766 | 767 | 768 | 每多少句剪为一段: 769 | How many subs in one clip: 770 | 771 | 772 | 片段大小(MB): 773 | Clip size(MB): 774 | 775 | 776 | 片段时长: 777 | Clip duration: 778 | 779 | 780 | 起始时刻: 781 | Start time: 782 | 783 | 784 | 输出文件夹: 785 | Output folder: 786 | 787 | 788 | 输出文件选项(默认可为空,但可选硬件加速): 789 | Output option(hardware acceleration codec): 790 | 791 | 792 | 输入路径: 793 | Input path: 794 | 795 | 796 | 输入视频: 797 | Input Video: 798 | 799 | 800 | 输入字幕: 801 | Input subtitle: 802 | 803 | 804 | 所有文件(*) 805 | All Files(*) 806 | 807 | 808 | 同时导出分段srt字幕 809 | Split srt file 810 | 811 | 812 | 选择文件 813 | Choose File 814 | 815 | 816 | 运行 817 | Run 818 | 819 | 820 | 在这里可以选择对应你设备的硬件加速编码器,Intel 对应 qsv,AMD 对应 amf,Nvidia 对应 nvenc, 苹果电脑对应 videotoolbox 821 | 822 | 823 | 824 | 支持 srt、ass 字幕,或者内置字幕的 mkv 825 | Support srt, ass, or mkv contains subtitle stream 826 | 827 | 828 | 指定时间段 829 | Cut clip 830 | 831 | 832 | 字幕时间偏移: 833 | Subtitle timeline offset: 834 | 835 | 836 | 双击列表项可以清空文件列表 837 | Double list items can clear the list 838 | 839 | 840 | API 填写有误,请核实。无法继续转字幕,任务取消。 841 | API info is not valid, please check. 842 | 843 | 844 | 转字幕出问题了,有可能是 oss 填写错误,或者语音引擎出错误,总之,请检查你的 api 和 KeyAccess 的权限 845 | 846 | 这次用到的 oss AccessKeyId 是:%s, 847 | 这次用到的 oss AccessKeySecret 是:%s 848 | 849 | 这次用到的语音引擎 AppKey 是:%s, 850 | 这次用到的语音引擎 AccessKeyId 是:%s, 851 | 这次用到的语音引擎 AccessKeySecret 是:%s, 852 | Transcribe process went wrong. Your API maybe invalid. 853 | 854 | OSS AccessKeyId: %s 855 | OSS AccessKeySecret: %s 856 | 857 | SpeechToText engine AppKey:%s 858 | SpeechToText engine AccessKeyId:%s 859 | SpeechToText engine AccessKeySecret:%s 860 | 861 | 862 | 863 | 864 | 转字幕完成 865 | 866 | 867 | Transcribe complete! 868 | 869 | 870 | ./README.html 871 | ./README_en.html 872 | 873 | 874 | 查看视频教程 875 | Watch Video Tutorial 876 | 877 | 878 | 查看作者的 FFmpeg 笔记 879 | Check out the developer's FFmpeg note 880 | 881 | 882 | 打开帮助文档 883 | Open Help Document 884 | 885 | 886 | 当前版本是 %s,到 Gitee 检查新版本 887 | The current version is %s, goto Gitee for new version 888 | 889 | 890 | 当前版本是 %s,到 Github 检查新版本 891 | The current version is %s, goto Github for new version 892 | 893 | 894 | 加入 QQ 群 895 | Join QQ Group 896 | 897 | 898 | 选择分辨率预设 899 | Resolution Preset 900 | 901 | 902 | 负数表示自适应。例如,“ 720 × -2 ” 表示横轴分辨率为 720,纵轴分辨率为自适应且能够整除 -2 903 | Negative number means adapt.720 × -2 indicates horizontal 720, vertical automaticlly adapt to the multiple of 2 904 | 905 | 906 | 结果: %s 907 | Result: %s 908 | 909 | 910 | 任务信息: task_id: %s, result: %s 911 | Task_Id: %s, Result: %s 912 | 913 | 914 | 识别任务失败: %s 915 | Task failed: %s 916 | 917 | 918 | 额外代码: 919 | Extrad code: 920 | 921 | 922 | 覆盖预设 923 | Overwrite Template 924 | 925 | 926 | 更新预设 927 | Update Template 928 | 929 | 930 | 描述: 931 | Description: 932 | 933 | 934 | 确定 935 | OK 936 | 937 | 938 | 输出后缀名: 939 | Output extention: 940 | 941 | 942 | 输出选项: 943 | Output option: 944 | 945 | 946 | 输入2选项: 947 | Input 2 option: 948 | 949 | 950 | 添加或更新预设 951 | Add or update template 952 | 953 | 954 | 添加预设 955 | Add template 956 | 957 | 958 | 新预设添加成功 959 | Add template succeed! 960 | 961 | 962 | 新预设添加失败,你可以把失败过程重新操作记录一遍,然后发给作者 963 | Add template failed, you could record the process and send it to the developer. 964 | 965 | 966 | 已经存在名字相同的预设,你可以选择换一个预设名字或者覆盖旧的预设。是否要覆盖? 967 | A template with same name already exists, you may overwrite it or set a new name. Confirm overwrite? 968 | 969 | 970 | 预设更新成功 971 | Template update succeed! 972 | 973 | 974 | 预设更新失败,你可以把失败过程重新操作记录一遍,然后发给作者 975 | Template update failed, you could record the process and send it to the developer. 976 | 977 | 978 | 预设名称: 979 | Template name: 980 | 981 | 982 | 这里是用于实现一些比较复杂的预设的,普通用户不用管这个框 983 | Here is meant for some complex template, normal users don't need to fill this. 984 | 985 | 986 | 创建输出文件夹失败,可能是已经创建上了 987 | 988 | Failed to create output folder, maybe it already exists. 989 | 990 | 991 | 打赏作者 992 | Sponsor the Developer 993 | 994 | 995 | 导出完成。 996 | 997 | Export finished. 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 还有 %s 秒时长的片段要导出,总共已经导出 %s 秒的视频,目前正在导出的是第 %s 个片段…… 1008 | 1009 | %s seconds remains to export. %s seconds have already been exported. Number %s is being exporting. 1010 | 1011 | 1012 | 需要知晓的是:最后导出的视频体积一般会略微超过您预设的大小,比如你设置每个片段为 20MB,实际导出的片段可能会达到 21MB 左右。 1013 | 1014 | Note: the final size may slightly bigger than the size you set. 1015 | 1016 | 1017 | 应导出 %s 秒,实际导出 %s 秒。 1018 | 1019 | %s seconds should be exported. %s seconds was actually exported. 1020 | 1021 | 1022 | 总共要处理的时长:%s 秒 导出的每个片段大小:%sMB 1023 | 1024 | Total time of the input: %s, each clip should at the size of: %sMB. 1025 | 1026 | 1027 | 这个 chunk (%s 到 %s) 在 cut 区间 %s 到 %s 右侧,下一个区间 1028 | This chunk(%s to %s) is on the right side of region(%s to %s), jump to next region. 1029 | 1030 | 1031 | 这个 chunk (%s 到 %s) 在 cut 区间 %s 到 %s 左侧,下一个 chunk 1032 | This chunk(%s to %s) is at left the region(%s to %s), jump to next chunk 1033 | 1034 | 1035 | 这个chunk 的右侧 %s 大于区间的终点 %s ,把它的左侧 %s 改成本区间的终点 %s 1036 | This chunk(%s to %s)'s right end is at the right of the current region(%s), change its left end to the end(%s) of this region. 1037 | 1038 | 1039 | 这个chunk 的右侧 %s 小于区间的终点 %s ,删掉 1040 | This chunk's right end(%s) is at the left of the current region end(%s), delete it. 1041 | 1042 | 1043 | 这个区间 (%s 到 %s) 的左侧,在起点 %s 和终点 %s 之间,修改区间左侧为 %s 1044 | The left end of this region(%s to %s), is between the chunk(%s to %s), hange the left side of region to %s 1045 | 1046 | 1047 | 这个区间 (%s 到 %s) 横跨了 %s 到 %s ,分成两个:从 %s 到 %s ,从 %s 到 %s 1048 | This region (%s to %s) is from %s to %s, split into two: %s to %s, %s to %s 1049 | 1050 | 1051 | 这个区间 (%s 到 %s) 整个在起点 %s 和终点 %s 之间,删除 1052 | This region(%s to %s) is between start %s and end %s, delete it. 1053 | 1054 | 1055 | 这个区间 (%s 到 %s) 的右侧,在起点 %s 和终点 %s 之间,修改区间右侧为 %s 1056 | This region(%s to %s) is at the right side of the current chunk(%s to %s), change its right end to %s 1057 | 1058 | 1059 | 1060 | 命令执行完毕 1061 | 1062 | Command complete. 1063 | 1064 | 1065 | 第 %s 句识别完毕! 1066 | 1067 | Number %s clip is recognized successfully! 1068 | 1069 | 1070 | 安装 you-get 和 youtube-dl 失败了。安装教程请看:https://www.bilibili.com/video/BV18T4y1E7FF?p=5 1071 | Failed to install you-get and youtue-dl. Please watch video tutorial: https://www.bilibili.com/video/BV18T4y1E7FF?p=5 1072 | 1073 | 1074 | 该功能需要设置电脑一番,所以请确保已看过视频教程: 1075 | 1076 | This function requires some pre-work in your computer, make sure you've watched the video tutorial: 1077 | 1078 | 1079 | 1080 | 关闭本页面后,下方输入框的内容会自动保存到 %s 中 1081 | 1082 | After closing this page, the contents below will be saved to %s automaticlly. 1083 | 1084 | 1085 | 1086 | 继续 1087 | Continue 1088 | 1089 | 1090 | 检测到已存在同名字幕文件,已有 %s 条字幕,将会自动载入到下面的编辑框 1091 | 1092 | A subtitle with same name already exists, it has %s subtitles, they will be automaticlly loaded to the box below 1093 | 1094 | 1095 | 1096 | 片段识别结果是空白,有可能音频设置有误,请查看视频教程:https://www.bilibili.com/video/BV1wT4y177kD/ 1097 | 1098 | The result is blank, please make sure you've watched the video tutorial: https://www.bilibili.com/video/BV1wT4y177kD/ 1099 | 1100 | 1101 | 如果不希望接着已有内容做字幕,请手动删除已存在的字幕文件 1102 | 1103 | If you don't want to append to the existing subtitles, you may delete the content in the box below. 1104 | 1105 | 1106 | 现在按下 继续 键开始听写音频 1107 | 1108 | Now hit "Continue" button to transcribe audio. 1109 | 1110 | 1111 | 已得到 wav 文件,并分段,共有 %s 段 1112 | 1113 | wav file has been generated and sliced to %s clips. 1114 | 1115 | 1116 | 语音输入法转写字幕工作窗口 1117 | VoiceInputMethod transcribe subtitle window 1118 | 1119 | 1120 | 暂停 1121 | Pause 1122 | 1123 | 1124 | 正在生成 wav 文件 1125 | 1126 | Generating wav file... 1127 | 1128 | 1129 | 正在生成 wav 文件 1130 | 1131 | Generating wav file... 1132 | 1133 | 1134 | 转字幕出问题了,有可能是 oss 填写错误,或者语音引擎出错误,总之,请检查你的 api 和 KeyAccess 的权限 1135 | Failed to transcribe the subtitles, maybe it's the OSS or API info is not correct. Please check your API info. 1136 | 1137 | 1138 | 1139 | {}:按住 CapsLock 键 0.3 秒后开始说话... 1140 | {}:long press Caps Lock over 0.3s and then speak... 1141 | 1142 | 1143 | 点击交换横竖分辨率 1144 | Click to exchange resolution values. 1145 | 1146 | 1147 | 点击列表右下边的加号添加要合并的视频片段: 1148 | Click "+" button to add clips you want to concat: 1149 | 1150 | 1151 | 倒序 1152 | Revert 1153 | 1154 | 1155 | 输出: 1156 | Output: 1157 | 1158 | 1159 | concat格式衔接,不重新解码、编码(快、无损、要求格式一致) 1160 | concat format, no decode and reencode 1161 | 1162 | 1163 | 先转成 ts 格式,再衔接,要解码、编码(用于合并不同格式) 1164 | Transcode to ts then concat 1165 | 1166 | 1167 | concat滤镜衔接(视频为Stream0),要解码、编码 1168 | concat filter, stram 0 is video 1169 | 1170 | 1171 | concat滤镜衔接(音频为Stream0),要解码、编码 1172 | concat filter, stram 0 is audio 1173 | 1174 | 1175 | 这里是自动生成的总命令 1176 | Here is the auto-generated command 1177 | 1178 | 1179 | 清空列表 1180 | Clear list 1181 | 1182 | 1183 | 是否确认清空列表? 1184 | Confirm to clear list? 1185 | 1186 | 1187 | 添加音视频文件 1188 | Add media file 1189 | 1190 | 1191 | 字幕是ass格式,先转换成srt格式 1192 | 1193 | The subtitle format is ass, transform to srt first. 1194 | 1195 | 1196 | 格式转换完成 1197 | 1198 | Format transformation finished. 1199 | 1200 | 1201 | 删除生成的srt字幕失败 1202 | Failed to delete generated srt subtitle. 1203 | 1204 | 1205 | 字幕是 mkv 格式,先转换成srt格式 1206 | 1207 | The subtitle format is mkv, transform to srt first. 1208 | 1209 | 1210 | 字幕格式只支持 srt 和 ass,以及带内置字幕的 mkv 文件,暂不支持您所选的字幕。 1211 | 1212 | 如果您的字幕输入是 mkv 而失败了,则有可能您的 mkv 视频没有字幕流,画面中的字幕是烧到画面中的。 1213 | The subtitle format only supports srt, ass, or mkv contains subtitle stream. Your current subtitle file is not supported. 1214 | 1215 | 1216 | 总共有 %s 段要处理,现在开始导出第 %s 段…… 1217 | 1218 | We got %s clips to process, now exporting number %s. 1219 | 1220 | 1221 | 即将识别: 1222 | About to recognize: 1223 | 1224 | 1225 | 服务器有点错误,错误原因是: 1226 | Server error, reason: 1227 | 1228 | 1229 | 云端任务排队中,10秒之后再次查询 1230 | 1231 | Cloud mission is queeing, require again after 10 seconds. 1232 | 1233 | 1234 | 任务进行中,3秒之后再次查询 1235 | 1236 | Mission is under work, require again after 3 seconds. 1237 | 1238 | 1239 | 1240 | 上传目标路径: 1241 | Upload destination: 1242 | 1243 | 1244 | 正在读取结果中 1245 | 1246 | Reading the result 1247 | 1248 | 1249 | 现在开始生成单声道、 16000Hz 的 wav 音频: 1250 | 1251 | Now generate monochannel, 16000Hz wav audio file: 1252 | 1253 | 1254 | 选择阿里云 api 的引擎,启用 CapsWriter 语音输入后,只要在任意界面长按大写大写锁定键(Caps Lk)超过 0.3 秒,就会开始进行语音识别,说几句话,再松开大写锁定键,请别结果就会自动输入。你可以在这个输入框试试效果 1255 | Choose an Alibaba SpeechToText engine, enable CapsWriter, then in any interface, as long as you press Caps Lock more than 0.3 seconds, it will start recording, after releasing the Caps Lock, the recognition result will be typed immediately. You can try it in this text edit box. 1256 | 1257 | 1258 | 文件名填什么后缀,就会输出什么格式 1259 | Output will be in the format you set here. 1260 | 1261 | 1262 | 输入2是选填的,只有涉及同时处理两个文件的操作才需要输入2 1263 | Input two is optional. Only requires when needed. 1264 | 1265 | 1266 | 这里填写输出文件保存路径 1267 | Here you set output path. 1268 | 1269 | 1270 | 新分辨率 1271 | New resolution 1272 | 1273 | 1274 | 分辨率预设 1275 | Resolution Template 1276 | 1277 | 1278 | 选择预设: 1279 | Choose template 1280 | 1281 | 1282 | 查看该预设帮助 1283 | Open help of this template 1284 | 1285 | 1286 | 不使用预设 1287 | Default preset 1288 | 1289 | 1290 | H264压制 1291 | H264 compress 1292 | 1293 | 1294 | H264压制 Intel 硬件加速 1295 | H264 compress(Intel accelerate) 1296 | 1297 | 1298 | H264压制 AMD 硬件加速 1299 | H264 compress(AMD accelerate) 1300 | 1301 | 1302 | H264压制 Nvidia 硬件加速 1303 | H264 compress(Nvidia accelerate) 1304 | 1305 | 1306 | H264压制 Mac 硬件加速 1307 | H264 compress(Mac accelerate) 1308 | 1309 | 1310 | H265压制 1311 | H265 compress 1312 | 1313 | 1314 | H265压制 Intel 硬件加速 1315 | H265 compress(Intel accelerate) 1316 | 1317 | 1318 | H265压制 AMD 硬件加速 1319 | H265 compress(AMD accelerate) 1320 | 1321 | 1322 | H265压制 Nvidia 硬件加速 1323 | H265 compress(Nvidia accelerate) 1324 | 1325 | 1326 | H265压制 Mac 硬件加速 1327 | H265 compress(Mac accelerate) 1328 | 1329 | 1330 | H264 二压 目标比特率2000k 1331 | H264 compress 2 pass target 2000 bit/s 1332 | 1333 | 1334 | H264压制目标比特率6000k 1335 | H264 compress target 6000 bit/s 1336 | 1337 | 1338 | H265压制 Mac 硬件加速 1339 | H265 compress(Mac accelerate) 1340 | 1341 | 1342 | 复制视频流到mp4容器 1343 | Copy stream to mp4 container 1344 | 1345 | 1346 | 将输入文件打包到mkv格式容器 1347 | Package to mkv container 1348 | 1349 | 1350 | 转码到mp3格式 1351 | Transcode to mp3 1352 | 1353 | 1354 | GIF (15fps 480p) 1355 | GIF (15fps, 480p) 1356 | 1357 | 1358 | 区域模糊 1359 | Boxblur 1360 | 1361 | 1362 | 视频两倍速 1363 | 2x video 1364 | 1365 | 1366 | 音频两倍速 1367 | 2x audio 1368 | 1369 | 1370 | 视频0.5倍速 + 光流法补帧到60帧 1371 | 0.5x video + interpolate to 60 fps 1372 | 1373 | 1374 | 光流法补帧到60帧 1375 | Interpolate to 60 fps 1376 | 1377 | 1378 | 视频倒放 1379 | Revert video 1380 | 1381 | 1382 | 音频倒放 1383 | Revert audio 1384 | 1385 | 1386 | 设置画面比例 1387 | Set video ratio 1388 | 1389 | 1390 | 视频流时间戳偏移,用于同步音画 1391 | Timestamp offset 1392 | 1393 | 1394 | 从视频区间每秒提取n张照片 1395 | Extract n images per second 1396 | 1397 | 1398 | 截取指定数量的帧保存为图片 1399 | Extract n images 1400 | 1401 | 1402 | 一图流 1403 | One picture video 1404 | 1405 | 1406 | 裁切视频画面 1407 | Cut video frame 1408 | 1409 | 1410 | 视频旋转度数 1411 | Rotate video 1412 | 1413 | 1414 | 水平翻转画面 1415 | Flip video horizontally 1416 | 1417 | 1418 | 垂直翻转画面 1419 | Flip video vertically 1420 | 1421 | 1422 | 设定至指定分辨率,并且自动填充黑边 1423 | Set to specified resolution and fill black edge 1424 | 1425 | 1426 | 视频或音乐添加封面图片 1427 | Add a cover to video or music 1428 | 1429 | 1430 | 声音响度标准化 1431 | Sound normalization 1432 | 1433 | 1434 | 音量大小调节 1435 | Adjust sound volume 1436 | 1437 | 1438 | 静音第一个声道 1439 | Mute the first audio channel 1440 | 1441 | 1442 | 静音所有声道 1443 | Mute all audio channel 1444 | 1445 | 1446 | 交换左右声道 1447 | Exchange left and right channel 1448 | 1449 | 1450 | 两个音频流混合到一个文件 1451 | Mix two audio to one file 1452 | 1453 | 1454 | 删除预设 1455 | Delete Template 1456 | 1457 | 1458 | 将要删除“%s”预设,是否确认? 1459 | About to delete "%s" template, confirm? 1460 | 1461 | 1462 | 重置 FFmpeg 预设 1463 | Reset FFmpeg Tab template 1464 | 1465 | 1466 | 将要重置 FFmpeg Tab 的预设列表,是否确认? 1467 | About to reset FFmpeg Tab template, confirm? 1468 | 1469 | 1470 | 重置 FFmpeg 预设成功 1471 | Reset FFmpeg Tab template succeed! 1472 | 1473 | 1474 | 重置 FFmpeg 预设失败 1475 | Reset FFmpeg Tab template failed! 1476 | 1477 | 1478 | -------------------------------------------------------------------------------- /QuickCut/languages/project.pro: -------------------------------------------------------------------------------- 1 | SOURCES = ../QuickCut.py 2 | TRANSLATIONS= ./en.ts 3 | CODECFORTR=UTF-8 -------------------------------------------------------------------------------- /QuickCut/misc/Quick Cut 美化教程.md: -------------------------------------------------------------------------------- 1 | **Quick Cut v1.6.1** 新增了自定义主题。在软件的根目录有一个 `style.css` 文件,在里面可以更改软件界面的样式。在主界面按下 `F5` 就可以刷新样式。所以,用户可以在更改 `style.css` 后,在主界面按下 `F5` ,立马看到实际效果。 2 | 3 | Quick Cut 使用了 Qt 做的图形界面,其样式可以通过一个叫 QSS 的样式表控制,其实也就是一张 css 表。 4 | 5 | ### QssStylesheetEditor 6 | 7 | GitHub 上有一个开源工具,可以方便地制作 QSS 表:[QssStylesheetEditor](https://github.com/hustlei/QssStylesheetEditor/) 8 | 9 | 这里是它的中文文档:[简体中文](https://github.com/hustlei/QssStylesheetEditor/blob/master/readme_zh-CN.md) 10 | 11 | Windows 端只要下载,运行就可以用了,其它端只要下载 `whl` 文件,用 `pip install` 安装就可以用了。 12 | 13 | ### QUI 14 | 15 | [QSS-Skin-Builder](https://github.com/satchelwu/QSS-Skin-Builder) 这也是一个开源工具。 -------------------------------------------------------------------------------- /QuickCut/misc/README_zh.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | README 578 | 579 | 580 |

icon.ico Quick Cut

Quick Cut 是一款轻量、强大、好用的视频处理软件。它是一个轻量的工具,而不是像 Davinci Resolve、Adobe Premiere 那样专业的、复杂的庞然大物。Quick Cut 可以满足普通人一般的视频处理需求:压缩视频、转码视频、倒放视频、合并片段、根据字幕裁切片段、自动配字幕、自动剪辑……

它是开源的,你可以免费使用它。

界面预览:

image-20200725091927151

📝 背景

好几年前,有一次想将一个视频中的片段剪出来,才发现,市面上根本没有给普通用户用的视频处理软件。

我去百度、知乎上搜【视频剪辑软件】,陆续得到了以下结果:

我就只想剪一小个片段啊!专业软件学不起、买不起、电脑太卡带不起!可是其它小软件、许多国产剪辑软件,都有这一些问题:

用的最好的还是 格式工厂小丸工具箱 。但他们都功能很少,还有小丸工具箱,官网的下载地址是百度网盘链接已经挂了,也不知道从第三方下载的版本有没有木马、广告……

后来,从视频压制这个话题,我知道了 FFmpeg 这个神级开源工具,它的功能之强大、应用之广泛到惊了我的下巴!但它是个命令行工具,到百度上一搜,也只是些文章说怎样怎样的命令可以做什么、常用命令有什么。相关的图形界面工具,一个好用的都没有!(当然要点名表扬下 Lossless Cut,它还是很好用的,只是功能太少)。没有一个软件能让 FFmpeg 在普通大众用户手中发挥潜力,真是可惜了!

于是一通操作,把 FFmpeg 的官方文档逐句做了翻译,记了笔记,然后用它来处理视频,真是畅快!免费、无广告,剪出来的视频也可以画质无损。100 兆的视频压缩到 10 兆,肉眼画质无损,那是一个巴适!

但是有一个问题!每次要处理一个视频,都要手动输入命令行,非常的麻烦,有时候忘记执行某个操作是用哪个参数了,还要去翻笔记,难受!于是我就想做一个图形界面工具,想要做什么,在里面点两下,命令参数啥的都是自动生成,最后点击运行就好。于是先后做了基于 Tasker 的安卓端 FFmpeg GUI Tool、基于 Quicker 的 FFmpeg GUI Tool。

但是上面两个平台都局限太多,想要好用,还是得自己做 GUI。我自己只是入门 python 的水平,只能硬着头皮花了几天在学习平台 B 站看完了 PyQt 的入门。然后边查边做,因为 PyQt 的注释很少,有时一个简单的小细节要花半天到一天处理。最后,成品还是出来了!

当然,除了 FFmpeg 的功能外,我还做了 语音自动转字幕 功能。这里,我要不指名地 Diss 一些商家:

在 Quick Cut 里,我做了 语音自动转字幕 功能,可以使用阿里或腾讯的 Api。就以阿里的 API 为例,普通元套餐的商用价格是 2.5 元/小时,四十五几乎就是不要钱!下面的帮助里,我写下了申请阿里 API 的教程,只要填入 API,就可以使用语音转字幕了。

另外,我还将另一个 自动剪辑神器 放进了 Quick Cut,将你的 Vlog、视频教程一键自动剪好。下面会有详细介绍。

同时,推荐 Quick Cut 中一个对学习外语的同学非常有用的功能:将字幕中的每一句话对应的视频剪成片段提取出来。用于制作外语学习的视频素材爽的不要不要的!应该算是 Anki 用户的一个福利功能吧!

 

✨ 特性

 

🔮 界面和功能介绍

FFmpeg 界面

在这个界面,你可以使用许多 ffmpeg 预设,对音视频进行处理,比如说:

我想将手机上录制的视频压制下,减小它的大小,那么只需要:先在 输入1 框输入待压制的视频文件(此时会自动生成输出文件名),再在右侧预设列表选择 H264压制 预设(此时会自动生成总命令),最后点击底部的 运行 按钮,就会启动压制了。

点击去查看 Quick Cut 压制的视频教程

点击去查看 Quick Cut 预设讲解视频教程

分割视频界面

这个界面有三个功能:根据字幕分割视频、根据大小分割视频、根据时长分割视频。

根据字幕分割视频是个神级功能,尤其适合于制作外语学习的视频素材。将例如美剧的视频放进去,再把相应的字幕文件放进去,就可以将每一句字幕对应的视频片段剪出来!如果你的字幕时间轴和视频时间轴有偏差,还可以进行手动的校准。

根据时间分割视频和根据大小分割视频主要是针对分享到短视频平台和微信平台的。

点击去查看 Quick Cut 分割视频的视频教程

image-20200725103345859

合并片段界面

这个简单,要合并的视频拖进去,调整下顺序,点击运行,就可以将这些视频合并成一个文件。从 ig 下载的 15 秒 story 视频片段就可以轻松合并啦!

点击去查看 Quick Cut 合并片段的视频教程

image-20200725103322509

下载视频界面

这个界面提供了两个命令行工具的图形界面用于下载视频,最简单的用法就是将链接复制进去,然后点击下载。支持的网站有很多比如优酷、B站、YouTube、P站(逃)……

另外你还可以在里面设置cookies,就能够用你大会员身份登录的 cookie 信息下载大会员视频画质了。

点击去查看 Quick Cut 下载视频的视频教程

image-20200725103257140

自动剪辑界面

自动剪辑的原理是通过给视频中有声音的片段和没有声音的片段施加不同的播放速度,达到只保留有关键信息部分的效果,非常适合做vlog和视频教程。

同时你也可以选择使用阿里云或者腾讯云的语音服务,先将视频转出字幕之后,再根据字幕中的关键词对视频片段进行保留和删除操作。

除了下面那个演示视频,在本教程中的所有视频,都使用了自动剪辑,然后才上传的。

点击去查看 Quick Cut 自动剪辑的效果演示视频

点击去查看 Quick Cut 自动剪辑的视频教程

image-20200725103228908

自动转字幕界面

只要将你的视频或者音频文件拖进去,然后点击运行,就可以生成一个srt格式的字幕。

语音识别方面使用了阿里云或者腾讯云的引擎,准确率有95%以上。如果想给自己的视频配字幕,就可以先用这个功能,自动转出字幕之后,再手动修改一下里边偶尔的错别字,效率非常高。

语音识别引擎需要用户自己去阿里云官网申请 API 才能用(对申请过程我做了视频教程)。阿里云的语音服务开通后,每个新用户有3个月的免费试用时间,在这3个月内,每天都有两小时的录音文件转换额度。试用期过后,商业版的价格是每小时音频转换2.5元,随着使用量的增加,这个价格还会更低。如果买1000小时的套餐,价格可以低到1.5元每小时。

如果你对比一下目前网上能找到的视频转字幕服务,你就会知道 Quick Cut 的这个转字幕功能有多便宜:

来对比一下:阿里云 2.5 元每小时,前三个月每天免费用两小时,用得越多价,格还会更低。

腾讯云方面的价格还会更低,只是转换速度没有阿里云快。所以推荐使用阿里云。就算是用商业版每小时2.5元的价格也不心疼。

如果你急着把最新的美剧视频下载下来,字幕组还没有出字幕,但是生肉太难啃,就可以用这个转字幕功能,将英文字幕转出来,配合着看。

如果你是视频工作者、UP主、视频公司负责人,平常有大量的视频需要转换字幕,用这个就可以舍去使用其他网上平台导致的每小时几十元的成本,一个月下来成本或许能节约到上千元。。

哎,说实话,要是这软件推广开来,对一些视频转字幕的服务商,真的是断人财路,杀人父母。

点击去查看 Quick Cut 自动转字幕的演示

image-20200725103137457

语音识别输入界面

如果你已经添加上阿里云的语音引擎,就可以使用阿里云的一句话识别服务进行语音识别输入。在任意界面,只要长按键盘上的盗窃锁定键超过0.3秒钟,就可以开始说话,进行语音识别。松开按键之后,识别结果会自动打到输入框。

有人推荐使用讯飞的语音识别,但是讯飞语音识别的快捷键在 F6 那个位置,离主键盘的位置非常远,手指够过去费劲;而且那里有很多大小一样的按键,这个快捷键也不好找;他还会和很多软件的快捷键冲突。

而长按大写锁定键进行语音识别就非常方便,离打字的手非常近,需要的时候很轻松就能按到,也不会有快捷键冲突。

阿里云语音识别的准确率非常高,这篇文章大部分都是用这个语音识别功能打的,然后修改了少量错字。

点击去查看 Quick Cut 语音识别输入的演示

image-20200725103107328

设置界面

在设置界面你就可以在这里配置语音识别的引擎。

勾选上 点击关闭按钮时隐藏到托盘 ,就可以让软件常驻到后台,方便快捷的调出来剪辑视频、语音输入。Quick Cut 的资源占用量非常少,可以放心的放到后台,不影响性能。

点击去查看 Quick Cut 配置阿里云语音识别引擎的视频教程

image-20200725103013287

帮助界面

在帮助见面里,有如下按钮,见名知意:

image-20200725102850979

 

 

🔨 开发

这一节普通用户就不用看了。你们只要到发布界面下载使用已打包好的软件就行了,如果你想对源代码进行修改,就可以看下这一节。

搭建环境

你需要 pip 安装这些包:

其中,pyaudio 很难安装!编译成功有很多要求。所以我们可以直接到 这里 下载上它已经被志愿者编译好的 whl 包,用 pip 安装,注意下载对应你 python 版本的包。

阿里云语音识别 sdk

然后还需要安装阿里云语音识别引擎的 sdk,这个 sdk 是无法通过 pip 安装的,而是要通过 这篇阿里云官方文档 的方法进行安装:

下载Python SDK

 

运行问题:

安装完依赖之后开始运行脚本,你可能会遇到这些问题:

这些问题的原因是一些模块用了其它依赖,而这些其它依赖已经好久没更新了。只能遇到一个问题就搜一下,解决掉。上面这些问题都是我遇到后,在网上找了解法,根据自己的情况做了改动,使得问题得以解决。

 

搭建好环境可以运行之后,如果修改了源代码然,后要进行发布,就应当打包成可以独立运行的exe文件,下面提供两种方法进行编译打包:

使用 nuitka 编译:

使用它打包出来的程序运行更快,只是相对步骤多一些。

先下载安装上 MinGW64 8.1

再安装上 nuitka:

在实际编译的时候,先使用这个命令进行编译:

这时,可能会遇到如下错误:

image-20200724211333904

就是因为代码里面有中文字符,默认使用的英文编码在转码时出现了错误,你就需要找到并打开最后指示的那个 MainControl.py 文件,将里面出错的那一行的 latin1 修改为 utf-8 ,然后就可以编译成功。

以后其实还并不能运行,因为 nuitka 对于某些包并不会自动导入,还需要你手动导入才行。

所以在实际编译的时候,还是先使用这个命令进行编译:

然后再编译的导出目录在命令行窗口中将 QuickCut.exe 打开,会看到类似这样的错误:

image-20200725104724393

这时候,就需要亲自到 Python 的安装目录下找到这个包:

image-20200725104814559

 

将它手动复制到导出目录的根目录中:

image-20200725104901324

重复运行,再次出现包缺失:

image-20200725105214629

都需要找到这个包:

image-20200725105301248

粘贴到编译导出目录的根目录中。这个过程要重复很多次,直到将所有缺失的包都复制到导出目录。

你可以将这些需要手动导入的包都再复制到另一个文件夹做备份,再次编译后,直接复制进去就行。

编译完成,你启动后可能是这个样子的:

image-20200725110050437

长得很丑对吧。这是因为缺失了 styles 文件夹,你需要到 PyQt5 的安装目录,找到 styles 文件夹:

image-20200725110307123

将其复制到编译导出目录的根目录之后,再次启动就正常了。

还有,记得将 icon.ico 、sponsor.jpg、README.html 复制到编译导出的文件夹,没有图标文件的话,就无法启动托盘。

再次编译。测试成功后,就可以使用下面这个命令进行编译:

这样就可以将命令行窗口隐藏。

pyinstaller 编译:

先安装上 pyinstaller :

直接使用这个命令进行编译:

其中,--hide-import pkg_resources.py2_warn 这一句比较重要,其实整个软件并没有用到这个模块,但是 pyinstaller 他会自动的编译进去,可是电脑上又没有安装这个模块,最后编译出来的软件就无法运行,所以一定要加上这个选项。

 

☕ 打赏

万水千山总是情,一块几块都是情。本软件完全开源,用爱发电,如果你愿意,可以以打赏的方式支持我一下:

sponsor

 

😀 交流

如果有软件方面的反馈可以提交 issues,或者加入 QQ 群:1146626791

 

🙏 鸣谢

感谢知乎上的 @Python与模具 的帮助,让我得以用 nuitka 对软件进行打包。

581 | 582 | -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200724211333904.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200724211333904.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725102850979.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725102850979.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725103013287.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725103013287.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725103107328.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725103107328.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725103137457.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725103137457.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725103228908.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725103228908.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725103257140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725103257140.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725103322509.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725103322509.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725103345859.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725103345859.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725104724393.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725104724393.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725104814559.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725104814559.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725104901324.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725104901324.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725105113317.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725105113317.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725105214629.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725105214629.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725105301248.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725105301248.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725110050437.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725110050437.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200725110307123.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200725110307123.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200726203040942.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200726203040942.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200801204028907.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200801204028907.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/image-20200801204230301.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/image-20200801204230301.png -------------------------------------------------------------------------------- /QuickCut/misc/assets/sponsor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/assets/sponsor.jpg -------------------------------------------------------------------------------- /QuickCut/misc/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/icon.icns -------------------------------------------------------------------------------- /QuickCut/misc/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/icon.ico -------------------------------------------------------------------------------- /QuickCut/misc/icon_listning.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/icon_listning.icns -------------------------------------------------------------------------------- /QuickCut/misc/icon_listning.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/misc/icon_listning.ico -------------------------------------------------------------------------------- /QuickCut/misc/不使用预设.md: -------------------------------------------------------------------------------- 1 | 说是不使用预设,其实输出选项里还是加上了 `-c copy`,因为如果输出选项什么都不填的话,FFmpeg 会使用默认的视频编码器 libx264 和音频编码器 aac 进行重新编码。加上 `-c copy` 就表示对视频内容不要做重新编码。 2 | 3 | 不做重新编码的好处是速度快,但缺点是指定位置不精确。因为没有重新编码,所以在指定时刻剪切片段时,FFmpeg 会寻找最接近指定时刻的关键帧所在的时刻,比如你希望从第20秒到第30秒剪切出一个片段,实际上可能因为关键帧的关系,你实际剪出的片段可能是第18秒到第32秒。 4 | 5 | 如果你希望精确的剪切片段,就需要进行重新编码,只要将输出选项中的 `-c copy` 删掉,FFmpeg 会使用默认的编码器和画质参数进行重新编码,精确的剪裁出你想要的片段。 6 | 7 | 你也可以参考h264预设帮助中的内容,设置自己想要的参数。 8 | 9 | -------------------------------------------------------------------------------- /QuickCut/misc/关于 H264.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 关于 H264 6 |

H264压制视频

7 |

输入文件一,模板中选择 Video ( h264 ) ,输出选项会自动设置好,点击 Run ,粘贴编码,等待压制完成即可。

8 |

9 |

选项帮助:

10 |
输出文件选项:
11 |

-c:v 设置视频编码器

12 |

-crf 恒定视频质量的参数

13 |

-preset 压制速度,可选项:ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo

14 |

-qcomp 量化曲线压缩因子(Quantizer curve compression factor)

15 |

-psy-rd 用 psy-rd:psy-trellis 的格式设置 心理视觉优化强度( strength of psychovisual optimization, in psy-rd:psy-trellis format)

16 |

-aq-mode 设置 AQ 方法,可选值为:

17 | 23 |

-aq-strength 设置 AQ 强度,在平面和纹理区域 减少 方块和模糊。

24 |

25 |

26 |

注意事项

27 |

注意,压制视频的话,输入文件放一个就行了哈,别放两个输入,FFmpeg 会自动把最高分辨率的视频流和声道数最多的音频流合并输出的。

28 |

29 |

相关科普

30 |

压制过程中你可以从命令行看到实时压制速度、总码率、体积、压制到视频几分几秒了。

31 |

相关解释:H264是一个很成熟的视频编码格式,兼容性也很好,一般你所见到的视频多数都是这个编码,小白压制视频无脑选这个就行了。

32 |

这个参数下,画质和体积能得到较好的平衡,一般能把手机相机拍摄的视频压制到原来体积的1/3左右,甚至更小,画质也没有明显的损失。

33 |

控制视频大小有两种方法:

34 | 42 |

这时,编码器会根据你的要求,给每一秒都分配相同的码率,可以准确预测输出文件的大小。但是,由于码率恒定,可能有些复杂的片段,你分配的码率不够用,就会画质下降,有些静态部分多的画面,就浪费了很多码率,所以一般不推荐用。如果你想用这个方案,请参阅 控制码率压制视频

43 |

针对恒定码率的缺点,有个改进方案就是 2-pass (二压),详见 h264 二压视频(两次操作)

44 |

此处输出选项里的 -crf 23 是画质控制参数。取值 0 - 51 ,越小画质越高,同时体积越大。 0 代表无损画质,体积超大。一般认为, -crf 18 的时候,人眼就几乎无法看出画质有损失了,大于 -crf 28 的时候,人眼就开始看到比较明显的画质损失。没有特殊要求的话,默认用 -crf 23 就行了。压制画质要求很高的视频就用 -crf 18 。

45 |

此处输出选项里的 -preset medium 代表压制编码速度适中,可选值有 ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo ,设置越慢,压制时间越长,画质控制越出色,设置越快,信息丢失就越严重,图像质量越差。

46 |

为什么 placebo 是纯粹的浪费时间?

47 |

相同码率下,相比于 veryslow,placebo 只提升不到 1% 的视频质量(同样码率下),但消耗非常多的时间。veryslow 比 slower 提升 3% ; slower 比 slow 提升 5% ,slow 比 medium 提升 5%-10% 。

48 |

相同码率下,相较于 medium:slow 编码所需时间增加大约 40% ;到 slower 增加大约 100% ,到 veryslow 增加大约 280% 。

49 |

相同码率下,相较于 medium : fast 节约 10% 编码时间; faster 节约 25% ; ultrafast 节约 55%(但代价是更低的画质)

50 |

如果你的原视频是 rgb 像素格式的,建议使用 -c:v libx264rgb ,来避免转化成 yuv420 时的画质损失。

51 | 52 | -------------------------------------------------------------------------------- /QuickCut/misc/关于 H264.md: -------------------------------------------------------------------------------- 1 | #### H264压制视频 2 | 3 | 输入文件一,模板中选择 Video ( h264 ) ,输出选项会自动设置好,点击 Run ,粘贴编码,等待压制完成即可。 4 | 5 | 6 | 7 | #### 选项帮助: 8 | 9 | ##### 输出文件选项: 10 | 11 | -c:v 设置视频编码器,-c:v libx264 表示使用 libx264 编码器输出 h264 编码的视频 12 | 13 | -crf 恒定视频质量的参数,-crf 23 表示输出视频质量为 crf 23 。 14 | 15 | -preset 压制速度,可选项:ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo 16 | 17 | -qcomp 量化曲线压缩因子(Quantizer curve compression factor) 18 | 19 | -psy-rd 用 psy-rd:psy-trellis 的格式设置 心理视觉优化强度( strength of psychovisual optimization, in psy-rd:psy-trellis format) 20 | 21 | -aq-mode 设置 AQ 方法,可选值为: 22 | 23 | - none (*0*) 帧内宏块全部使用同一或者固定的表 24 | - variance (*1*) 使用方差动态计算每个宏块的 25 | - autovariance (*2*) 方差自适应模式,会先遍历一次全部宏块,统计出一些中间参数,之后利用这些参数,对每个宏块计算 26 | 27 | -aq-strength 设置 AQ 强度,在平面和纹理区域 减少 方块和模糊。 28 | 29 | **以上所有参数你都可以手工修改,以达到需要的视频质量和体积** 30 | 31 | 32 | 33 | #### 注意事项 34 | 35 | 注意,压制视频的话,输入文件放一个就行了哈,别放两个输入,FFmpeg 会自动把最高分辨率的视频流和声道数最多的音频流合并输出的。 36 | 37 | 38 | 39 | #### 相关科普 40 | 41 | 压制过程中你可以从命令行看到实时压制速度、总码率、体积、压制到视频几分几秒了。 42 | 43 | 相关解释:H264是一个很成熟的视频编码格式,兼容性也很好,一般你所见到的视频多数都是这个编码,小白压制视频无脑选这个就行了。 44 | 45 | 这个参数下,画质和体积能得到较好的平衡,一般能把手机相机拍摄的视频压制到原来体积的1/3左右,甚至更小,画质也没有明显的损失。 46 | 47 | 但是注意,**自己录制的视频**压缩率很低,压制后会有很好的效果,从**视频网站下载的**电影、电视剧就**不要再压制**了,人家一集视频,都是已经用**性能拔尖的服务器**使用**最费时**、**压缩率最高**的参数压制了**几小时甚至几天**的,压缩率已经到了极致了,再让你用手上的设备解码重新压制一下,体积可能**不减反增**。 48 | 49 | 控制视频大小有两种方法: 50 | 51 | - 恒定画面质量,可变码率。也就是 crf 方式 52 | 53 | 这时,编码器会根据你要求的画面质量,自动分配码率,给复杂的画面部分多分配点码率,给简单的画面少分配点码率,可以得到画面质量均一的输出视频,这是最推荐的压制方式。不过无法准确预测输出文件的大小。假如你的视频全程都是非常复杂、包含大量背景运动的画面,那么可能压制出来的视频,比原视频还要大。这里的压制方式用的就是 恒定画面质量 的方式。 54 | 55 | - 恒定码率 56 | 57 | 这时,编码器会根据你的要求,给每一秒都分配相同的码率,可以准确预测输出文件的大小。但是,由于码率恒定,可能有些复杂的片段,你分配的码率不够用,就会画质下降,有些静态部分多的画面,就浪费了很多码率,所以一般不推荐用。如果你想用这个方案,请参阅 控制码率压制视频 58 | 59 | 针对恒定码率的缺点,有个改进方案就是 2-pass (二压),详见 h264 二压视频(两次操作) 60 | 61 | 此处输出选项里的 -crf 23 是画质控制参数。取值 0 - 51 ,越小画质越高,同时体积越大。 0 代表无损画质,体积超大。一般认为, -crf 18 的时候,人眼就几乎无法看出画质有损失了,大于 -crf 28 的时候,人眼就开始看到比较明显的画质损失。没有特殊要求的话,默认用 -crf 23 就行了。压制画质要求很高的视频就用 -crf 18 。 62 | 63 | 此处输出选项里的 -preset medium 代表压制编码速度适中,可选值有 ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo ,设置越慢,压制时间越长,画质控制越出色,设置越快,信息丢失就越严重,图像质量越差。 64 | 65 | 为什么 placebo 是纯粹的浪费时间? 66 | 67 | 相同码率下,相比于 veryslow,placebo 只提升不到 1% 的视频质量(同样码率下),但消耗非常多的时间。veryslow 比 slower 提升 3% ; slower 比 slow 提升 5% ,slow 比 medium 提升 5%-10% 。 68 | 69 | 相同码率下,相较于 medium:slow 编码所需时间增加大约 40% ;到 slower 增加大约 100% ,到 veryslow 增加大约 280% 。 70 | 71 | 相同码率下,相较于 medium : fast 节约 10% 编码时间; faster 节约 25% ; ultrafast 节约 55%(但代价是更低的画质) 72 | 73 | 如果你的原视频是 rgb 像素格式的,建议使用 -c:v libx264rgb ,来避免转化成 yuv420 时的画质损失。 -------------------------------------------------------------------------------- /QuickCut/misc/关于 H265.md: -------------------------------------------------------------------------------- 1 | #### H265压制视频 2 | 3 | 输入文件一,模板中选择 H265 压制,输出选项会自动设置好,点击 Run ,粘贴编码,等待压制完成即可。 4 | 5 | 6 | 7 | #### 选项帮助: 8 | 9 | ##### 输出文件选项: 10 | 11 | -c:v 设置视频编码器,-c:v libx265 表示使用 libx265 编码器输出 h265 编码的视频 12 | 13 | -crf 恒定视频质量的参数,-crf 28 表示输出视频质量为 crf 28 。 14 | 15 | -c:a 设置音频编码器,-c:a copy 表示复制音频流,不做任何重新编码。你也可以改成:-c:a aac,-c:a mp3 16 | 17 | **以上所有参数你都可以手工修改,以达到需要的视频质量和体积** 18 | 19 | 20 | 21 | #### 注意事项 22 | 23 | 注意,压制视频的话,输入文件放一个就行了哈,别放两个输入,FFmpeg 会自动把最高分辨率的视频流和声道数最多的音频流合并输出的。 24 | 25 | 26 | 27 | #### 相关科普 28 | 29 | 压制过程中你可以从命令行看到实时压制速度、总码率、体积、压制到视频几分几秒了。 30 | 31 | 相关解释:H264是一个很成熟的视频编码格式,兼容性也很好,一般你所见到的视频多数都是这个编码,小白压制视频无脑选 H264 就行了。而 H265 是一个比较新的编码,压缩率高,但由于授权费较贵,目前支持的设备不多,兼容性差,但如果对体积压制有较大的要求,可以用 H265 进行压制。 32 | 33 | 这个参数下,画质和体积能得到较好的平衡,一般能把手机相机拍摄的视频压制到原来体积的1/5左右,甚至更小,画质也没有明显的损失。 34 | 35 | 但是注意,**自己录制的视频**压缩率很低,压制后会有很好的效果,从**视频网站下载的**电影、电视剧就**不要再压制**了,人家一集视频,都是已经用**性能拔尖的服务器**使用**最费时**、**压缩率最高**的参数压制了**几小时甚至几天**的,压缩率已经到了极致了,再让你用手上的设备解码重新压制一下,体积可能**不减反增**。 36 | 37 | 控制视频大小有两种方法: 38 | 39 | - 恒定画面质量,可变码率。也就是 crf 方式 40 | 41 | 这时,编码器会根据你要求的画面质量,自动分配码率,给复杂的画面部分多分配点码率,给简单的画面少分配点码率,可以得到画面质量均一的输出视频,这是最推荐的压制方式。不过无法准确预测输出文件的大小。假如你的视频全程都是非常复杂、包含大量背景运动的画面,那么可能压制出来的视频,比原视频还要大。这里的压制方式用的就是 恒定画面质量 的方式。 42 | 43 | - 恒定码率 44 | 45 | 这时,编码器会根据你的要求,给每一秒都分配相同的码率,可以准确预测输出文件的大小。但是,由于码率恒定,可能有些复杂的片段,你分配的码率不够用,就会画质下降,有些静态部分多的画面,就浪费了很多码率,所以一般不推荐用。如果你想用这个方案,请参阅 [控制码率压制视频](#控制码率压制视频) 46 | 47 | 此处输出选项里的 -crf 28 是画质控制参数。越小画质越高,同时体积越大。 0 代表无损画质,体积超大。H265 编码效率比较高,-crf 28 就可以达到 H264 的 crf 23 相同的画质,同时缩小一半的体积。 48 | 49 | -------------------------------------------------------------------------------- /QuickCut/misc/关于 h264 二压.md: -------------------------------------------------------------------------------- 1 | 控制视频大小有两种方法: 2 | 3 | - 恒定画面质量,可变码率。也就是 crf 方式 4 | 5 | 这时,编码器会根据你要求的画面质量,自动分配码率,给复杂的画面部分多分配点码率,给简单的画面少分配点码率,可以得到画面质量均一的输出视频,这是最推荐的压制方式。不过无法准确预测输出文件的大小。假如你的视频全程都是非常复杂、包含大量背景运动的画面,那么可能压制出来的视频,比原视频还要大。这里的压制方式用的就是 恒定画面质量 的方式。 6 | 7 | - 恒定码率 8 | 9 | 这时,编码器会根据你的要求,给每一秒都分配相同的码率,可以准确预测输出文件的大小。但是,由于码率恒定,可能有些复杂的片段,你分配的码率不够用,就会画质下降,有些静态部分多的画面,就浪费了很多码率,所以一般不推荐用。 10 | 11 | 这个预设就是使用恒定码率的方法进行压制,但是使用的是二压,也是就 2-pass 的方法。 12 | 13 | -b:a 256k 表示音频码率为 256kb,也就是音频每秒钟会占 $256 / 8 = 42kB$ 大小,没有用 -c:a 指定音频编码器,则默认用 aac 音频编码器。 14 | 15 | -b:v 2000k 表示视频码率为 2000kb,也就是视频每秒钟会占 $2000 / 8 = 250kB$ 大小,使用 -c:v libx264 指定了视频编码器 libx264,没有用 -c:a 指定音频编码器,则默认用 aac 音频编码器。 16 | 17 | 在这个预设中,FFmpeg 会先进行一轮压制,但不输出任何视频,而是输出一个文本文件,描述了视频里哪些时间画面比较复杂,需要较多的码率,哪些时间画面比较简单需,需要的码率不多,然后第二次压制的时候,就会根据这个文本的码率信息,将马路进行合理分配,使最后的平均码率达到目标码率。 18 | 19 | **以上所有参数你都可以手工修改,以达到需要的视频质量和体积** -------------------------------------------------------------------------------- /QuickCut/misc/关于使用硬件加速.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 关于使用硬件加速 6 |

关于使用硬件加速:

7 |

目前硬件加速支持两种编码格式:H264 和 H265

8 |

有3种加速方法,分别对应三家的硬件:Inter、AMD、Nvidia

9 |

不过在苹果电脑上,不管你用的哪家的硬件,都是使用 videotoolbox 编码器。

10 |

需要注意的是,即便你的电脑拥有 Nvidia 显卡,可能也用不了 Nvidia 的硬件加速编码,因为 Nvidia 硬件加速依赖于显卡内部的一种特定的 GPU 的物理部分,专用于编码。只有在 GTX10 和 RTX20 以上的显卡才搭载有这个物理部分。

11 |

使用硬件编码器进行编码,只需要将输出选项中的编码器改成硬件编码器即可,其中:

12 | 23 |

-c:v 表示视频(Video)的编码器(codec)

24 |

在使用硬件加速编码器的时候,控制输出视频的质量是使用 qscale 参数,他的数值可以从 0.1 - 255 不等,数值越小,画质越高,码率越大,输出文件体积越大。同一个数值对于不同的编码器画质的影响效果不同。所以你需要自己测试,在玛律大小和视频画质之间找到一个平衡的 qscale 数值。

25 |

目前所有的硬件加速选项都是类似这样的:-c:v h264_qsv -qscale 15 ,这表示使用英特尔 h264 硬件加速编码器,视频质量参数为15。你可以更改里面的数值,以达到你期望的画质效果。

26 | 27 | -------------------------------------------------------------------------------- /QuickCut/misc/关于使用硬件加速.md: -------------------------------------------------------------------------------- 1 | 关于使用硬件加速: 2 | 3 | 目前硬件加速支持两种编码格式:H264 和 H265 4 | 5 | 有3种加速方法,分别对应三家的硬件:Inter、AMD、Nvidia 6 | 7 | 不过在苹果电脑上,不管你用的哪家的硬件,都是使用 videotoolbox 编码器。 8 | 9 | 需要注意的是,即便你的电脑拥有 Nvidia 显卡,可能也用不了 Nvidia 的硬件加速编码,因为 Nvidia 硬件加速依赖于显卡内部的一种特定的 GPU 的物理部分,专用于编码。只有在 GTX10 和 RTX20 以上的显卡才搭载有这个物理部分。 10 | 11 | 使用硬件编码器进行编码,只需要将输出选项中的编码器改成硬件编码器即可,其中: 12 | 13 | - `-c:v h264_qsv` 对应 Intel H264 编码 14 | - `-c:v h264_amf` 对应 AMD H264 编码 15 | - `-c:v h264_nvenc` 对应 Nvidia H264 编码 16 | - `-c:v h264_videotoolbox` 对应苹果电脑的 H264 编码 17 | - `-c:v hevc_qsv` 对应 Intel H265 编码 18 | - `-c:v hevc_amf` 对应 AMDH265 编码 19 | - `-c:v hevc_nvenc` 对应 Nvidia H265 编码 20 | - `-c:v hevc_videotoolbox` 对应苹果电脑的 H265 编码 21 | 22 | `-c:v` 表示视频(Video)的编码器(codec) 23 | 24 | 在使用硬件加速编码器的时候,控制输出视频的质量是使用 `qscale` 参数,他的数值可以从 `0.1 - 255` 不等,数值越小,画质越高,码率越大,输出文件体积越大。同一个数值对于不同的编码器画质的影响效果不同。所以你需要自己测试,在玛律大小和视频画质之间找到一个平衡的 `qscale` 数值。 25 | 26 | 目前所有的硬件加速选项都是类似这样的:`-c:v h264_qsv -qscale 15` ,这表示使用英特尔 h264 硬件加速编码器,视频质量参数为15。你可以更改里面的数值,以达到你期望的画质效果。 27 | 28 | **以上所有参数你都可以手工修改,以达到需要的视频质量和体积** -------------------------------------------------------------------------------- /QuickCut/misc/关于指定码率压制.md: -------------------------------------------------------------------------------- 1 | 控制视频大小有两种方法: 2 | 3 | - 恒定画面质量,可变码率。也就是 crf 方式 4 | 5 | 这时,编码器会根据你要求的画面质量,自动分配码率,给复杂的画面部分多分配点码率,给简单的画面少分配点码率,可以得到画面质量均一的输出视频,这是最推荐的压制方式。不过无法准确预测输出文件的大小。假如你的视频全程都是非常复杂、包含大量背景运动的画面,那么可能压制出来的视频,比原视频还要大。这里的压制方式用的就是 恒定画面质量 的方式。 6 | 7 | - 恒定码率 8 | 9 | 这时,编码器会根据你的要求,给每一秒都分配相同的码率,可以准确预测输出文件的大小。但是,由于码率恒定,可能有些复杂的片段,你分配的码率不够用,就会画质下降,有些静态部分多的画面,就浪费了很多码率,所以一般不推荐用。 10 | 11 | 这个预设就是使用恒定码率的方法进行压制,-b:a 256k 表示音频码率为 256kb,也就是音频每秒钟会占 $256 / 8 = 42kB$ 大小, -b:v 6000k 表示视频码率为 6000kb,也就是视频每秒钟会占 $6000 / 8 = 750kB$ 大小。这里没有使用 -c:v 指定视频编码器,此时编码器默认是 libx264,没有用 -c:a 指定音频编码器,则默认用 aac 音频编码器。 12 | 13 | **以上所有参数你都可以手工修改,以达到需要的视频质量和体积** -------------------------------------------------------------------------------- /QuickCut/misc/吾爱发帖.md: -------------------------------------------------------------------------------- 1 | 我是作者。先将最重要的信息写在前面: 2 | 3 | Quick Cut 开源的,你可以免费使用它,但正因为开源,因此插入恶意代码是很容易的事,所以请认准仓库发行页面的下载地址: 4 | 5 | - 仓库地址:[Gitee](https://gitee.com/haujet/QuickCut) 和 [GitHub](https://github.com/HaujetZhao/QuickCut) 6 | - 发行版发布地址:[Gitee releases](https://gitee.com/haujet/QuickCut/releases) 和 [Github releases](https://github.com/HaujetZhao/QuickCut/releases) 7 | - Win64 绿色版下载地址:https://wwe.lanzous.com/b015n2n5a 密码:f4t3 8 | - Python pip 安装:`pip install Quick-Cut` 9 | 10 | > Quick Cut 是用 Python 写的,所以我将 Quick Cut 也发布在了 [pypi](https://pypi.org/project/Quick-Cut/) 库,只要你装了 python,使用 `pip install Quick-Cut` 就可以安装上 Quick Cut,不过 pypi 库中的版本没有自带 FFmpeg,需要你手动安装。(都会用 pip 安装东西了,相信安装 FFmpeg 就不用教了吧) 11 | > 12 | > 我没有 Win32 、MacOS、Linux 系统的电脑,所以这些系统打包不了。但你们可以通过 pip 方法安装。 13 | > 14 | > Windows 系统用 pip 安装时,可能会遇到 pyaudio 的安装问题,可以参照 [这篇文章](https://blog.csdn.net/Sau_Hit/article/details/85938063) 解决。 15 | 16 | 另外,每一个页面我都做了 [视频教程](https://www.bilibili.com/video/BV18T4y1E7FF),基本所有的问题看了视频都能解决,在主页面的预设列表下方有 `查看预设帮助` 按钮,有关于压制方面的帮助,可以解决你关于转码清晰不清晰的问题,也瞅瞅,所以不要连官方解答都不看,就无脑提问。 17 | 18 | # icon.ico Quick Cut 19 | 20 | **Quick Cut** 是一款轻量、强大、好用的视频处理软件。它是一个轻量的工具,而不是像 Davinci Resolve、Adobe Premiere 那样专业的、复杂的庞然大物。Quick Cut 可以满足普通人一般的视频处理需求:压缩视频、转码视频、倒放视频、合并片段、根据字幕裁切片段、自动配字幕、自动剪辑…… 21 | 22 | 它是开源的,你可以免费使用它。 23 | 24 | Gitee 地址:https://gitee.com/haujet/QuickCut 25 | 26 | GitHub 地址:https://github.com/HaujetZhao/QuickCut 27 | 28 | 界面预览: 29 | 30 | image-20200726203040942 31 | 32 | ## 📝 背景 33 | 34 | 好几年前,有一次想将一个视频中的片段剪出来,才发现,市面上根本没有给普通用户用的视频处理软件。 35 | 36 | 我去百度、知乎上搜【视频剪辑软件】,陆续得到了以下结果: 37 | 38 | - **Adobe Premiere**,正版一年上千元、随时【停止运行】的专业剪辑软件 39 | - **Vegas** 等专业软件就不再列了 40 | - **爱剪辑**,一个导出就带推广片头的中文剪辑软件 41 | - **格式工厂**,一个老牌的国产转码编辑软件 42 | - **小丸工具箱**,一个从 Bilibili 知道的压制软件 43 | - 还有大大小小的其它软件 44 | 45 | 我就只想剪一小个片段啊!专业软件学不起、买不起、电脑太卡带不起!可是其它小软件、许多国产剪辑软件,都有这一些问题: 46 | 47 | - 国外软件选项太多,各种参数看不懂。 48 | - 多数免费软件都带水印,或者导出后画质会下降,要么导出的体积巨大,耗时长不说,还不是无损剪辑。 49 | 50 | 用的最好的还是 **格式工厂** 和 **小丸工具箱** 。但他们都功能很少,还有小丸工具箱,官网的下载地址是百度网盘链接已经挂了,也不知道从第三方下载的版本有没有木马、广告…… 51 | 52 | 后来,从视频压制这个话题,我知道了 **FFmpeg** 这个神级开源工具,它的功能之强大、应用之广泛到惊掉了我的下巴!但它是个命令行工具,到百度上一搜,也只是些文章说怎样怎样的命令可以做什么、常用命令有什么。相关的图形界面工具,一个好用的都没有!(当然要点名表扬下 Lossless Cut,它还是很好用的,只是功能太少)。没有一个软件能让 FFmpeg 在普通大众用户手中发挥潜力,真是可惜了! 53 | 54 | 于是一通操作,把 FFmpeg 的官方文档逐句做了翻译,记了笔记,然后用它来处理视频,真是畅快!免费、无广告,剪出来的视频也可以画质无损。100 兆的视频压缩到 10 兆,肉眼画质无损,那是一个巴适! 55 | 56 | 但是有一个问题!每次要处理一个视频,都要手动输入命令行,非常的麻烦,有时候忘记执行某个操作是用哪个参数了,还要去翻笔记,难受!于是我就想做一个图形界面工具,想要做什么,在里面点两下,命令参数啥的都是自动生成,最后点击运行就好。于是先后做了基于 **Tasker** 的安卓端 FFmpeg GUI Tool、基于 **Quicker** 的 FFmpeg GUI Tool。 57 | 58 | 但是上面两个平台都局限太多,想要好用,还是得自己做 GUI。我自己只是入门 python 的水平,只能硬着头皮花了几天在学习平台 B 站看完了 PyQt 的入门。然后边查边做,因为 PyQt 的注释很少,有时一个简单的小细节要花半天到一天处理。最后,成品还是出来了! 59 | 60 | 当然,除了 **FFmpeg** 的功能外,我还做了 **语音自动转字幕** 功能。这里,我要不指名地 Diss 一些商家: 61 | 62 | - 首先是价格,贵的要 1元/分钟,便宜些的也要 4毛/分钟!转个 20 分钟的视频,就要收我 8 元,抢钱呐!啊?你们是没有语音引擎的,都是用的 API,大批量采购,你们用的 API 价格也就 1.2 元/小时 左右吧!用 API 成本几十倍的价格提供服务,这吃相,真是难看。 63 | - 然后是上传视频。语音转字幕,上传音频便足够了,一些商家却需要上传完整视频!2GB 的视频,通常其音频只有几十 MB 左右。你们是觉得:用户见转写了几十 MB 的视频,会觉得这么小的文件,1元/分钟的价格不值,转写了 2GB 的视频,一看这转写体积,就觉得花钱花的值? 64 | 65 | 在 Quick Cut 里,我做了 **语音自动转字幕** 功能,可以使用阿里或腾讯的 Api。就以阿里的 API 为例,普通元套餐的商用价格是 2.5 元/小时,四十五几乎就是不要钱!下面的帮助里,我写下了申请阿里 API 的教程,只要填入 API,就可以使用语音转字幕了。 66 | 67 | 另外,我还将另一个 **自动剪辑神器** 放进了 Quick Cut,将你的 Vlog、视频教程一键自动剪好。下面会有详细介绍。 68 | 69 | 同时,推荐 Quick Cut 中一个对学习外语的同学非常有用的功能:**将字幕中的每一句话对应的视频剪成片段提取出来**。用于制作外语学习的视频素材爽得不要不要的!应该算是 **Anki** 用户的一个福利功能吧! 70 | 71 | ## ✨ 特性 72 | 73 | - 简单的界面 74 | - FFmpeg 预设丰富 75 | - 可自定义预设 76 | - 合并视频片段 77 | - 逐句提取每句字幕对应的视频片段 78 | - 自动转字幕 79 | - 自动剪辑 80 | - ……更多待探索 81 | 82 | ## 🔮 界面和功能介绍 83 | 84 | ### FFmpeg 界面 85 | 86 | 在这个界面,你可以使用许多 ffmpeg 预设,对音视频进行处理,比如说: 87 | 88 | 我想将手机上录制的视频压制下,减小它的大小,那么只需要:先在 **输入1** 框输入待压制的视频文件(此时会自动生成输出文件名),再在右侧预设列表选择 **H264压制** 预设(此时会自动生成总命令),最后点击底部的 **运行** 按钮,就会启动压制了。 89 | 90 | **还有啊,转格式是基本操作!输出框的后缀名填什么,就会输出对应的格式!** 91 | 92 | [点击去查看 Quick Cut 压制的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=1) 93 | 94 | [点击去查看 Quick Cut 预设讲解视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=2) 95 | 96 | ### 分割视频界面 97 | 98 | 这个界面有三个功能:根据字幕分割视频、根据大小分割视频、根据时长分割视频。 99 | 100 | 根据字幕分割视频是个神级功能,尤其适合于制作外语学习的视频素材。将例如美剧的视频放进去,再把相应的字幕文件放进去,就可以将每一句字幕对应的视频片段剪出来!如果你的字幕时间轴和视频时间轴有偏差,还可以进行手动的校准。 101 | 102 | 根据时间分割视频和根据大小分割视频主要是针对分享到短视频平台和微信平台的。 103 | 104 | [点击去查看 Quick Cut 分割视频的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=3) 105 | 106 | image-20200725103345859 107 | 108 | ### 合并片段界面 109 | 110 | 这个简单,要合并的视频拖进去,调整下顺序,点击运行,就可以将这些视频合并成一个文件。从 ig 下载的 15 秒 story 视频片段就可以轻松合并啦! 111 | 112 | [点击去查看 Quick Cut 合并片段的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=4) 113 | 114 | image-20200725103322509 115 | 116 | ### 下载视频界面 117 | 118 | 这个界面提供了两个命令行工具的图形界面用于下载视频,最简单的用法就是将链接复制进去,然后点击下载。支持的网站有很多比如优酷、B站、YouTube、P站(逃)…… 119 | 120 | 另外你还可以在里面设置cookies,就能够用你大会员身份登录的 cookie 信息下载大会员视频画质了。 121 | 122 | [点击去查看 Quick Cut 下载视频的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=5) 123 | 124 | image-20200725103257140 125 | 126 | ### 自动剪辑界面 127 | 128 | 自动剪辑的原理是通过给视频中有声音的片段和没有声音的片段施加不同的播放速度,达到只保留有关键信息部分的效果,非常适合做vlog和视频教程。 129 | 130 | 同时你也可以选择使用阿里云或者腾讯云的语音服务,先将视频转出字幕之后,再根据字幕中的关键词对视频片段进行保留和删除操作。 131 | 132 | 除了下面那个演示视频,在本教程中的所有视频,都使用了自动剪辑,然后才上传的。 133 | 134 | [点击去查看 Quick Cut 自动剪辑的效果演示视频](https://www.bilibili.com/video/BV18T4y1E7FF?p=6) 135 | 136 | [点击去查看 Quick Cut 自动剪辑的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=7) 137 | 138 | image-20200725103228908 139 | 140 | ### 自动转字幕界面 141 | 142 | 只要将你的视频或者音频文件拖进去,然后点击运行,就可以生成一个srt格式的字幕。 143 | 144 | 语音识别方面使用了阿里云或者腾讯云的引擎,准确率有95%以上。如果想给自己的视频配字幕,就可以先用这个功能,自动转出字幕之后,再手动修改一下里边偶尔的错别字,效率非常高。 145 | 146 | 语音识别引擎需要用户自己去阿里云官网申请 API 才能用(对申请过程我做了[视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=11))。阿里云的语音服务开通后,每个新用户有3个月的免费试用时间,在这3个月内,每天都有两小时的录音文件转换额度。试用期过后,商业版的价格是每小时音频转换2.5元,随着使用量的增加,这个价格还会更低。如果买1000小时的套餐,价格可以低到1.5元每小时。 147 | 148 | 如果你对比一下目前网上能找到的视频转字幕服务,你就会知道 Quick Cut 的这个转字幕功能有多便宜: 149 | 150 | - 网易见外工作台,普通的视频转字幕,收费1元每分钟,60元每小时。英文转字幕价格翻倍。 151 | - 号称全网最低价的突字幕,收费0.005元每秒,3毛每分钟,18元每小时。 152 | - Arctime 收费30积分每分钟,也就是3毛每分钟,18元每小时。 153 | 154 | 来对比一下:阿里云 2.5 元每小时,前三个月每天免费用两小时,用得越多价,格还会更低。 155 | 156 | 腾讯云方面的价格还会更低,只是转换速度没有阿里云快。所以推荐使用阿里云。就算是用商业版每小时2.5元的价格也不心疼。 157 | 158 | 如果你急着把最新的美剧视频下载下来,字幕组还没有出字幕,但是生肉太难啃,就可以用这个转字幕功能,将英文字幕转出来,配合着看。 159 | 160 | 如果你是视频工作者、UP主、视频公司负责人,平常有大量的视频需要转换字幕,用这个就可以舍去使用其他网上平台导致的每小时几十元的成本,一个月下来成本或许能节约到上千元。。 161 | 162 | 哎,说实话,要是这软件推广开来,对一些视频转字幕的服务商,真的是断人财路,杀人父母。 163 | 164 | [点击去查看 Quick Cut 自动转字幕的演示](https://www.bilibili.com/video/BV18T4y1E7FF?p=8) 165 | 166 | image-20200725103137457 167 | 168 | ### 语音识别输入界面 169 | 170 | 如果你已经添加上阿里云的语音引擎,就可以使用阿里云的一句话识别服务进行语音识别输入。在任意界面,只要长按键盘上的大写锁定键超过0.3秒钟,就可以开始说话,进行语音识别。松开按键之后,识别结果会自动打到输入框。 171 | 172 | 有人推荐使用讯飞的语音识别,但是讯飞语音识别的快捷键在 F6 那个位置,离主键盘的位置非常远,手指够过去费劲;而且那里有很多大小一样的按键,这个快捷键也不好找;他还会和很多软件的快捷键冲突。 173 | 174 | 而长按大写锁定键进行语音识别就非常方便,离打字的手非常近,需要的时候很轻松就能按到,也不会有快捷键冲突。 175 | 176 | 阿里云语音识别的准确率非常高,这篇文章大部分都是用这个语音识别功能打的,然后修改了少量错字。 177 | 178 | [点击去查看 Quick Cut 语音识别输入的演示](https://www.bilibili.com/video/BV18T4y1E7FF?p=9) 179 | 180 | image-20200725103107328 181 | 182 | ### 设置界面 183 | 184 | 在设置界面你就可以在这里配置语音识别的引擎。 185 | 186 | 勾选上 **点击关闭按钮时隐藏到托盘** ,就可以让软件常驻到后台,方便快捷的调出来剪辑视频、语音输入。Quick Cut 的资源占用量非常少,可以放心地放到后台,不影响性能。 187 | 188 | [点击去查看 Quick Cut 配置阿里云语音识别引擎的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=9) 189 | 190 | image-20200725103013287 191 | 192 | ### 帮助界面 193 | 194 | 在帮助界面里,有如下按钮,见名知意: 195 | 196 | image-20200725102850979 197 | 198 | ## 🔨 开发 199 | 200 | 这一节普通用户就不用看了。软件是使用 Python 进行开发的,如果你想从源码运行,可以参考仓库的 README 页面的开发一节。 201 | 202 | 203 | 204 | ## 😀 交流 205 | 206 | 如果有软件方面的反馈可以提交 issues 207 | 208 | ## 🙏 鸣谢 209 | 210 | 感谢知乎上的 @[Python与模具](https://www.zhihu.com/people/xuhui112-ben) 的帮助,让我得以用 nuitka 对软件进行打包。 -------------------------------------------------------------------------------- /QuickCut/misc/复制视频流到mp4容器.md: -------------------------------------------------------------------------------- 1 | 这个预设会首先把输出文件的后缀名改成mp4 2 | 3 | 在输出选项一栏,-c:v copy 表示对视频不要重新编码,直接将原始数据复制到输出文件, -b:a 256k,表示使用默认的音频编码器 aac 输出比特率为 256k 的音频。 4 | 5 | 因为 mp4 对某些音频格式不兼容,所以就没有使用 -c:a copy,而是对所有音频进行重新编码,FFmpeg mp4对音频的默认编码是 aac,默认音频输出比特率是 128k,为了不降低音频质量,所以手动将音频比特率设为了 256k。 6 | 7 | -------------------------------------------------------------------------------- /QuickCut/misc/疑难记录/我这里用下面:.md: -------------------------------------------------------------------------------- 1 | 我这里用下面: 2 | 3 | ```python 4 | import io 5 | wrapper = io.TextIOWrapper(self.process.stdout, encoding='utf-8') 6 | for line in wrapper: 7 | print(line) 8 | ``` 9 | 10 | 时: 11 | 12 | ``` 13 | ffmpeg -y -hide_banner -i "C:/Users/24401/Videos/QuickCut打包问题解决指南.mp4" "C:/Users/24401/Videos/QuickCut打包问题解决指南_out.mp4" 14 | ``` 15 | 16 | 可以正常打印,但: 17 | 18 | ``` 19 | echo 中文 20 | ``` 21 | 22 | 就提示 utf-8 无法解析字符。。。。 23 | 24 | 如果我用: 25 | 26 | ```python 27 | import io 28 | wrapper = io.TextIOWrapper(self.process.stdout, encoding='gbk') 29 | for line in wrapper: 30 | print(line) 31 | ``` 32 | 33 | 情况就反过来了。。。 -------------------------------------------------------------------------------- /QuickCut/requirements.txt: -------------------------------------------------------------------------------- 1 | srt 2 | keyboard 3 | numpy 4 | setuptools 5 | aliyun-python-sdk-core 6 | alibabacloud-nls-java-sdk 7 | PyQt5 8 | audiotsm 9 | scipy 10 | cos-python-sdk-v5 11 | tencentcloud-sdk-python 12 | oss2 13 | pyaudio 14 | auditok @ git+https://github.com/amsehili/auditok@v0.1.8 15 | requests 16 | -------------------------------------------------------------------------------- /QuickCut/sponsor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/QuickCut/sponsor.jpg -------------------------------------------------------------------------------- /QuickCut/style.css: -------------------------------------------------------------------------------- 1 | /*切换到分割视频 Tab,里面有几个上面带字的功能框,那些框框就是 QGroupBox */ 2 | QGroupBox{ 3 | border: 1px solid #ccc; 4 | border-radius:6px; 5 | margin-top: 2ex; 6 | margin-bottom: 0.5ex; 7 | padding: 0.3em 0.4em 0.4em 0.3em; /* 上 右 下 左*/ 8 | } 9 | 10 | /* 这就是 QGroupBox 上面的标题 */ 11 | QGroupBox:title { 12 | color: #005980; 13 | subcontrol-origin: margin; 14 | margin-top: 0.5ex; 15 | left: 2ex; 16 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## About Translation 2 | 3 | **[English Mannual](./README_en.md)** 4 | 5 | **Developer**: My home language is Chinese, so the original UI is in Chinese, if you want to help translating this software, you can open the **[./QuickCut/languages/README.md](./QuickCut/languages/README.md)** to check out how you can help. 6 | 7 | 8 | 9 | # icon.ico Quick Cut 10 | 11 | **Quick Cut** 是一款轻量、强大、好用的视频处理软件。它是一个轻量的工具,而不是像 Davinci Resolve、Adobe Premiere 那样专业的、复杂的庞然大物。Quick Cut 可以满足普通人一般的视频处理需求:压缩视频、转码视频、倒放视频、合并片段、根据字幕裁切片段、自动配字幕、自动剪辑…… 12 | 13 | Quick Cut 开源的,你可以免费使用它,但正因为开源,因此插入恶意代码是很容易的事,所以请认准仓库发行页面的下载地址: 14 | 15 | - 仓库地址:[Gitee](https://gitee.com/haujet/QuickCut) 和 [GitHub](https://github.com/HaujetZhao/QuickCut) 16 | - 发行版发布地址:[Gitee releases](https://gitee.com/haujet/QuickCut/releases) 和 [Github releases](https://github.com/HaujetZhao/QuickCut/releases) 17 | - Win64 绿色版下载地址:https://wwe.lanzous.com/b015n2n5a 密码:f4t3 18 | - Python pip 安装:`pip install Quick-Cut` 19 | 20 | > Quick Cut 是用 Python 写的,所以我将 Quick Cut 也发布在了 [pypi](https://pypi.org/project/Quick-Cut/) 库,只要你装了 python,使用 `pip install Quick-Cut` 就可以安装上 Quick Cut,不过 pypi 库中的版本没有自带 FFmpeg,需要你手动安装。(都会用 pip 安装东西了,相信安装 FFmpeg 就不用教了吧) 21 | > 22 | > 我没有 Win32 、MacOS、Linux 系统的电脑,所以这些系统打包不了。但你们可以通过 pip 方法安装。 23 | > 24 | > Windows 系统用 pip 安装时,可能会遇到 pyaudio 的安装问题,可以参照 [这篇文章](https://blog.csdn.net/Sau_Hit/article/details/85938063) 解决。 25 | 26 | 另外,每一个页面我都做了 [视频教程](https://www.bilibili.com/video/BV18T4y1E7FF),基本所有的问题看了视频都能解决,在主页面的预设列表下方有 `查看预设帮助` 按钮,有关于压制方面的帮助,可以解决你关于转码清晰不清晰的问题,也瞅瞅,所以不要连官方解答都不看,就无脑提问。 27 | 28 | 界面预览: 29 | 30 | image-20200726203040942 31 | 32 | 33 | 34 | 35 | 36 | ## 📝 背景 37 | 38 | 好几年前,有一次想将一个视频中的片段剪出来,才发现,市面上根本没有给普通用户用的视频处理软件。 39 | 40 | 我去百度、知乎上搜【视频剪辑软件】,陆续得到了以下结果: 41 | 42 | - **Adobe Premiere**,正版一年上千元、随时【停止运行】的专业剪辑软件 43 | - **Vegas** 等专业软件就不再列了 44 | - **爱剪辑**,一个导出就带推广片头的中文剪辑软件 45 | - **格式工厂**,一个老牌的国产转码编辑软件 46 | - **小丸工具箱**,一个从 Bilibili 知道的压制软件 47 | - 还有大大小小的其它软件 48 | 49 | 我就只想剪一小个片段啊!专业软件学不起、买不起、电脑太卡带不起!可是其它小软件、许多国产剪辑软件,都有这一些问题: 50 | 51 | - 国外软件选项太多,各种参数看不懂。 52 | - 多数免费软件都带水印,或者导出后画质会下降,要么导出的体积巨大,耗时长不说,还不是无损剪辑。 53 | 54 | 用的最好的还是 **格式工厂** 和 **小丸工具箱** 。但他们都功能很少,还有小丸工具箱,官网的下载地址是百度网盘链接已经挂了,也不知道从第三方下载的版本有没有木马、广告…… 55 | 56 | 后来,从视频压制这个话题,我知道了 **FFmpeg** 这个神级开源工具,它的功能之强大、应用之广泛到惊掉了我的下巴!但它是个命令行工具,到百度上一搜,也只是些文章说怎样怎样的命令可以做什么、常用命令有什么。相关的图形界面工具,一个好用的都没有!(当然要点名表扬下 Lossless Cut,它还是很好用的,只是功能太少)。没有一个软件能让 FFmpeg 在普通大众用户手中发挥潜力,真是可惜了! 57 | 58 | 于是一通操作,把 FFmpeg 的官方文档逐句做了翻译,记了笔记,然后用它来处理视频,真是畅快!免费、无广告,剪出来的视频也可以画质无损。100 兆的视频压缩到 10 兆,肉眼画质无损,那是一个巴适! 59 | 60 | 但是有一个问题!每次要处理一个视频,都要手动输入命令行,非常的麻烦,有时候忘记执行某个操作是用哪个参数了,还要去翻笔记,难受!于是我就想做一个图形界面工具,想要做什么,在里面点两下,命令参数啥的都是自动生成,最后点击运行就好。于是先后做了基于 **Tasker** 的安卓端 FFmpeg GUI Tool、基于 **Quicker** 的 FFmpeg GUI Tool。 61 | 62 | 但是上面两个平台都局限太多,想要好用,还是得自己做 GUI。我自己只是入门 python 的水平,只能硬着头皮花了几天在学习平台 B 站看完了 PyQt 的入门。然后边查边做,因为 PyQt 的注释很少,有时一个简单的小细节要花半天到一天处理。最后,成品还是出来了! 63 | 64 | 当然,除了 **FFmpeg** 的功能外,我还做了 **语音自动转字幕** 功能。这里,我要不指名地 Diss 一些商家: 65 | 66 | - 首先是价格,贵的要 1元/分钟,便宜些的也要 4毛/分钟!转个 20 分钟的视频,就要收我 8 元,抢钱呐!啊?你们是没有语音引擎的,都是用的 API,大批量采购,你们用的 API 价格也就 1.2 元/小时 左右吧!用 API 成本几十倍的价格提供服务,这吃相,真是难看。 67 | - 然后是上传视频。语音转字幕,上传音频便足够了,一些商家却需要上传完整视频!2GB 的视频,通常其音频只有几十 MB 左右。你们是觉得:用户见转写了几十 MB 的视频,会觉得这么小的文件,1元/分钟的价格不值,转写了 2GB 的视频,一看这转写体积,就觉得花钱花的值? 68 | 69 | 在 Quick Cut 里,我做了 **语音自动转字幕** 功能,可以使用阿里或腾讯的 Api。就以阿里的 API 为例,普通元套餐的商用价格是 2.5 元/小时,四十五几乎就是不要钱!下面的帮助里,我写下了申请阿里 API 的教程,只要填入 API,就可以使用语音转字幕了。 70 | 71 | 另外,我还将另一个 **自动剪辑神器** 放进了 Quick Cut,将你的 Vlog、视频教程一键自动剪好。下面会有详细介绍。 72 | 73 | 同时,推荐 Quick Cut 中一个对学习外语的同学非常有用的功能:**将字幕中的每一句话对应的视频剪成片段提取出来**。用于制作外语学习的视频素材爽得不要不要的!应该算是 **Anki** 用户的一个福利功能吧! 74 | 75 | 76 | 77 | ## ✨ 特性 78 | 79 | - 简单的界面 80 | - FFmpeg 预设丰富 81 | - 可自定义预设 82 | - 合并视频片段 83 | - 逐句提取每句字幕对应的视频片段 84 | - 自动转字幕 85 | - 自动剪辑 86 | - ……更多待探索 87 | 88 | 89 | 90 | ## 🔮 界面和功能介绍 91 | 92 | ### FFmpeg 界面 93 | 94 | 在这个界面,你可以使用许多 ffmpeg 预设,对音视频进行处理,比如说: 95 | 96 | 我想将手机上录制的视频压制下,减小它的大小,那么只需要:先在 **输入1** 框输入待压制的视频文件(此时会自动生成输出文件名),再在右侧预设列表选择 **H264压制** 预设(此时会自动生成总命令),最后点击底部的 **运行** 按钮,就会启动压制了。 97 | 98 | **还有啊,转格式是基本操作!输出框的后缀名填什么,就会输出对应的格式!** 99 | 100 | [点击去查看 Quick Cut 压制的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=1) 101 | 102 | [点击去查看 Quick Cut 预设讲解视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=2) 103 | 104 | ### 分割视频界面 105 | 106 | 这个界面有三个功能:根据字幕分割视频、根据大小分割视频、根据时长分割视频。 107 | 108 | 根据字幕分割视频是个神级功能,尤其适合于制作外语学习的视频素材。将例如美剧的视频放进去,再把相应的字幕文件放进去,就可以将每一句字幕对应的视频片段剪出来!如果你的字幕时间轴和视频时间轴有偏差,还可以进行手动的校准。 109 | 110 | 根据时间分割视频和根据大小分割视频主要是针对分享到短视频平台和微信平台的。 111 | 112 | [点击去查看 Quick Cut 分割视频的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=3) 113 | 114 | image-20200725103345859 115 | 116 | ### 合并片段界面 117 | 118 | 这个简单,要合并的视频拖进去,调整下顺序,点击运行,就可以将这些视频合并成一个文件。从 ig 下载的 15 秒 story 视频片段就可以轻松合并啦! 119 | 120 | [点击去查看 Quick Cut 合并片段的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=4) 121 | 122 | image-20200725103322509 123 | 124 | ### 下载视频界面 125 | 126 | 这个界面提供了两个命令行工具的图形界面用于下载视频,最简单的用法就是将链接复制进去,然后点击下载。支持的网站有很多比如优酷、B站、YouTube、P站(逃)…… 127 | 128 | 另外你还可以在里面设置cookies,就能够用你大会员身份登录的 cookie 信息下载大会员视频画质了。 129 | 130 | [点击去查看 Quick Cut 下载视频的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=5) 131 | 132 | image-20200725103257140 133 | 134 | ### 自动剪辑界面 135 | 136 | 自动剪辑的原理是通过给视频中有声音的片段和没有声音的片段施加不同的播放速度,达到只保留有关键信息部分的效果,非常适合做vlog和视频教程。 137 | 138 | 同时你也可以选择使用阿里云或者腾讯云的语音服务,先将视频转出字幕之后,再根据字幕中的关键词对视频片段进行保留和删除操作。 139 | 140 | 除了下面那个演示视频,在本教程中的所有视频,都使用了自动剪辑,然后才上传的。 141 | 142 | [点击去查看 Quick Cut 自动剪辑的效果演示视频](https://www.bilibili.com/video/BV18T4y1E7FF?p=6) 143 | 144 | [点击去查看 Quick Cut 自动剪辑的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=7) 145 | 146 | image-20200725103228908 147 | 148 | ### 自动转字幕界面 149 | 150 | 只要将你的视频或者音频文件拖进去,然后点击运行,就可以生成一个srt格式的字幕。 151 | 152 | 语音识别方面使用了阿里云或者腾讯云的引擎,准确率有95%以上。如果想给自己的视频配字幕,就可以先用这个功能,自动转出字幕之后,再手动修改一下里边偶尔的错别字,效率非常高。 153 | 154 | 语音识别引擎需要用户自己去阿里云官网申请 API 才能用(对申请过程我做了[视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=11))。阿里云的语音服务开通后,每个新用户有3个月的免费试用时间,在这3个月内,每天都有两小时的录音文件转换额度。试用期过后,商业版的价格是每小时音频转换2.5元,随着使用量的增加,这个价格还会更低。如果买1000小时的套餐,价格可以低到1.5元每小时。 155 | 156 | 如果你对比一下目前网上能找到的视频转字幕服务,你就会知道 Quick Cut 的这个转字幕功能有多便宜: 157 | 158 | - 网易见外工作台,普通的视频转字幕,收费1元每分钟,60元每小时。英文转字幕价格翻倍。 159 | - 号称全网最低价的突字幕,收费0.005元每秒,3毛每分钟,18元每小时。 160 | - Arctime 收费30积分每分钟,也就是3毛每分钟,18元每小时。 161 | 162 | 来对比一下:阿里云 2.5 元每小时,前三个月每天免费用两小时,用得越多价,格还会更低。 163 | 164 | 腾讯云方面的价格还会更低,只是转换速度没有阿里云快。所以推荐使用阿里云。就算是用商业版每小时2.5元的价格也不心疼。 165 | 166 | 如果你急着把最新的美剧视频下载下来,字幕组还没有出字幕,但是生肉太难啃,就可以用这个转字幕功能,将英文字幕转出来,配合着看。 167 | 168 | 如果你是视频工作者、UP主、视频公司负责人,平常有大量的视频需要转换字幕,用这个就可以舍去使用其他网上平台导致的每小时几十元的成本,一个月下来成本或许能节约到上千元。。 169 | 170 | 哎,说实话,要是这软件推广开来,对一些视频转字幕的服务商,真的是断人财路,杀人父母。 171 | 172 | [点击去查看 Quick Cut 自动转字幕的演示](https://www.bilibili.com/video/BV18T4y1E7FF?p=8) 173 | 174 | image-20200725103137457 175 | 176 | ### 语音识别输入界面 177 | 178 | 如果你已经添加上阿里云的语音引擎,就可以使用阿里云的一句话识别服务进行语音识别输入。在任意界面,只要长按键盘上的大写锁定键超过0.3秒钟,就可以开始说话,进行语音识别。松开按键之后,识别结果会自动打到输入框。 179 | 180 | 有人推荐使用讯飞的语音识别,但是讯飞语音识别的快捷键在 F6 那个位置,离主键盘的位置非常远,手指够过去费劲;而且那里有很多大小一样的按键,这个快捷键也不好找;他还会和很多软件的快捷键冲突。 181 | 182 | 而长按大写锁定键进行语音识别就非常方便,离打字的手非常近,需要的时候很轻松就能按到,也不会有快捷键冲突。 183 | 184 | 阿里云语音识别的准确率非常高,这篇文章大部分都是用这个语音识别功能打的,然后修改了少量错字。 185 | 186 | [点击去查看 Quick Cut 语音识别输入的演示](https://www.bilibili.com/video/BV18T4y1E7FF?p=9) 187 | 188 | image-20200725103107328 189 | 190 | ### 设置界面 191 | 192 | 在设置界面你就可以在这里配置语音识别的引擎。 193 | 194 | 勾选上 **点击关闭按钮时隐藏到托盘** ,就可以让软件常驻到后台,方便快捷的调出来剪辑视频、语音输入。Quick Cut 的资源占用量非常少,可以放心地放到后台,不影响性能。 195 | 196 | [点击去查看 Quick Cut 配置阿里云语音识别引擎的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=9) 197 | 198 | image-20200725103013287 199 | 200 | ### 帮助界面 201 | 202 | 在帮助界面里,有如下按钮,见名知意: 203 | 204 | image-20200725102850979 205 | 206 | 207 | 208 | 209 | 210 | ## 🔨 开发 211 | 212 | 这一节普通用户就不用看了。你们只要到发布界面下载使用已打包好的软件就行了,如果你想对源代码进行修改,就可以看下这一节。 213 | 214 | ### 搭建环境 215 | 216 | 你需要 pip 安装这些包: 217 | 218 | ``` 219 | srt 220 | keyboard 221 | numpy 222 | setuptools 223 | aliyun-python-sdk-core 224 | PyQt5 225 | audiotsm 226 | scipy 227 | cos-python-sdk-v5 228 | tencentcloud-sdk-python 229 | oss2 230 | pyaudio 231 | auditok @ git+https://github.com/amsehili/auditok@v0.1.8 232 | requests 233 | ``` 234 | 235 | 其中,pyaudio 很难安装!编译成功有很多要求。所以 Windows 用户可以直接到 [这里](https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio) 下载已经被志愿者编译好的 whl 包,用 pip 安装,注意下载对应你 python 版本的包。 236 | 237 | Linux 的用户,经 @**[shniubobo](https://github.com/shniubobo)** 的测试,Ubuntu 用户在安装 pyaudio 前只要装这个就行了: 238 | 239 | ``` 240 | sudo apt install portaudio19-dev 241 | ``` 242 | 243 | 244 | 245 | 其他包可以通过[requirements.txt](requirements.txt)安装: 246 | 247 | ``` 248 | pip install -r requirements.txt 249 | ``` 250 | 251 | #### 阿里云语音识别 sdk 252 | 253 | 然后还需要安装阿里云语音识别引擎的sdk, [这篇阿里云官方文档](https://help.aliyun.com/document_detail/120693.html?spm=a2c4g.11186623.6.569.27675df0FENQ6O) 只说了用下面的方法安装: 254 | 255 | ``` 256 | pip install setuptools 257 | ``` 258 | 259 | [下载Python SDK](http://download.taobaocdn.com/freedom/33762/compress/alibabacloud-nls-python-sdk.zip)。 260 | 261 | ``` 262 | # 打包 python setup.py bdist_egg # 安装 python setup.py install 263 | ``` 264 | 265 | 不过有用户反馈可以用下面这个命令直接安装,不过我还没试验: 266 | 267 | ``` 268 | pip install aliyun-python-sdk-nls-cloud-meta 269 | ``` 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | ### 运行问题: 280 | 281 | 安装完依赖之后开始运行脚本,你可能会遇到这些问题: 282 | 283 | - 安装完依赖后,你运行脚本,却发现 `import oss2` 时提示出错:`No module named 'winrandom'`,这时,你需要修改 `Python38\Lib\site-packages\Crypto\Random\OSRNG` 下的 `nt.py` 文件,将 `import winrandom` 修改为:`from Crypto.Random.OSRNG import winrandom` 284 | 285 | 这些问题的原因是一些模块用了其它依赖,而这些其它依赖已经好久没更新了。只能遇到一个问题就搜一下,解决掉。上面这些问题都是我遇到后,在网上找了解法,根据自己的情况做了改动,使得问题得以解决。 286 | 287 | **Mac 和 Linux 用户请注意:** 288 | 289 | 为了在 Windows 上运行时候不弹黑窗口,我在用 subprocess 的时候用了一个 `subprocess.STARTUPINFO()` 类,但是在 Linux 或 Mac 上好像不能用它,所以你们在使用前,要删除几段代码: 290 | 291 | 首先是末尾的这三行: 292 | 293 | ``` 294 | subprocessStartUpInfo = subprocess.STARTUPINFO() 295 | subprocessStartUpInfo.dwFlags = subprocess.STARTF_USESHOWWINDOW 296 | subprocessStartUpInfo.wShowWindow = subprocess.SW_HIDE 297 | ``` 298 | 299 | 然后再全局搜索 `, startupinfo=subprocessStartUpInfo` 将其删掉。理论上就好了。 300 | 301 | 搭建好环境可以运行之后,如果修改了源代码然,后要进行发布,就应当打包成可以独立运行的exe文件,下面提供两种方法进行编译打包: 302 | 303 | ### 使用 nuitka 编译: 304 | 305 | 使用它打包出来的程序运行更快,只是相对步骤多一些。 306 | 307 | 先下载安装上 [MinGW64 8.1](https://sourceforge.net/projects/mingw-w64/files/) 308 | 309 | 再安装上 nuitka: 310 | 311 | ``` 312 | pip install nuitka 313 | ``` 314 | 315 | 在实际编译的时候,先使用这个命令进行编译: 316 | 317 | ``` 318 | nuitka --mingw64 --standalone --show-progress --show-memory --plugin-enable=qt-plugins --plugin-enable=pylint-warnings --recurse-all --recurse-not-to=numpy,jinja2 --windows-icon=icon.ico --nofollow-imports --assume-yes-for-downloads --output-dir=out QuickCut.py 319 | ``` 320 | 321 | 这时,可能会遇到如下错误: 322 | 323 | ![image-20200724211333904](assets/image-20200724211333904.png) 324 | 325 | 就是因为代码里面有中文字符,默认使用的英文编码在转码时出现了错误,你就需要找到并打开最后指示的那个 **MainControl.py** 文件,将里面出错的那一行的 **latin1** 修改为 **utf-8** ,然后就可以编译成功。 326 | 327 | 以后其实还并不能运行,因为 nuitka 对于某些包并不会自动导入,还需要你手动导入才行。 328 | 329 | 所以在实际编译的时候,还是先使用这个命令进行编译: 330 | 331 | ``` 332 | nuitka --mingw64 --standalone --show-progress --show-memory --plugin-enable=qt-plugins --plugin-enable=pylint-warnings --recurse-all --recurse-not-to=numpy,jinja2 --windows-icon=icon.ico --nofollow-imports --assume-yes-for-downloads --output-dir=out QuickCut.py 333 | ``` 334 | 335 | 然后再编译的导出目录在命令行窗口中将 **QuickCut.exe** 打开,会看到类似这样的错误: 336 | 337 | ![image-20200725104724393](assets/image-20200725104724393.png) 338 | 339 | 这时候,就需要亲自到 Python 的安装目录下找到这个包: 340 | 341 | ![image-20200725104814559](assets/image-20200725104814559.png) 342 | 343 | 344 | 345 | 将它手动复制到导出目录的根目录中: 346 | 347 | ![image-20200725104901324](assets/image-20200725104901324.png) 348 | 349 | 重复运行,再次出现包缺失: 350 | 351 | ![image-20200725105214629](assets/image-20200725105214629.png) 352 | 353 | 都需要找到这个包: 354 | 355 | ![image-20200725105301248](assets/image-20200725105301248.png) 356 | 357 | 粘贴到编译导出目录的根目录中。这个过程要重复很多次,直到将所有缺失的包都复制到导出目录。 358 | 359 | 你可以将这些需要手动导入的包都再复制到另一个文件夹做备份,再次编译后,直接复制进去就行。 360 | 361 | 编译完成,你启动后可能是这个样子的: 362 | 363 | image-20200725110050437 364 | 365 | 长得很丑对吧。这是因为缺失了 styles 文件夹,你需要到 PyQt5 的安装目录,找到 styles 文件夹: 366 | 367 | ![image-20200725110307123](assets/image-20200725110307123.png) 368 | 369 | 将其复制到编译导出目录的根目录之后,再次启动就正常了。 370 | 371 | 还有,记得将 icon.ico 、sponsor.jpg、README.html 复制到编译导出的文件夹,没有图标文件的话,就无法启动托盘。 372 | 373 | 再次编译。测试成功后,就可以使用下面这个命令进行编译: 374 | 375 | ``` 376 | nuitka --mingw64 --windows-disable-console --standalone --show-progress --show-memory --plugin-enable=qt-plugins --plugin-enable=pylint-warnings --plugin-enable=numpy --recurse-all --recurse-not-to=numpy,jinja2 --windows-icon=icon.ico --nofollow-imports --assume-yes-for-downloads --output-dir=out QuickCut.py 377 | ``` 378 | 379 | 这样就可以将命令行窗口隐藏。 380 | 381 | 如果你是 Mac 编译,为了图标格式兼容,要使用: 382 | 383 | ``` 384 | nuitka --mingw64 --windows-disable-console --standalone --show-progress --show-memory --plugin-enable=qt-plugins --plugin-enable=pylint-warnings --plugin-enable=numpy --recurse-all --recurse-not-to=numpy,jinja2 --windows-icon=icon.icns --nofollow-imports --assume-yes-for-downloads --output-dir=out QuickCut.py 385 | ``` 386 | 387 | 388 | 389 | ### pyinstaller 编译: 390 | 391 | 先安装上 pyinstaller : 392 | 393 | ``` 394 | pip install pyinstaller 395 | ``` 396 | 397 | 直接使用这个命令进行编译: 398 | 399 | ``` 400 | pyinstaller --hidden-import pkg_resources.py2_warn --noconfirm -w -i icon.ico QuickCut.py 401 | ``` 402 | 403 | 如果你是 Mac 编译,为了图标格式兼容,要使用: 404 | 405 | ``` 406 | pyinstaller --hidden-import pkg_resources.py2_warn --noconfirm -w -i icon.icns QuickCut.py 407 | ``` 408 | 409 | 其中,`--hide-import pkg_resources.py2_warn` 这一句比较重要,其实整个软件用到了这个模块,但是 pyinstaller 没有自动编译进去。当你电脑上的 setuptools 版本在 45.0.0 到 49.1.1 之间时,会出现这个问题。将 setuptools 升级到最新,应该就不会有这个问题了: 410 | 411 | ```python 412 | pip install pyinstaller 413 | pip install setuptools --upgrade 414 | pyinstaller -wy -i icon.ico QuickCut.py # Windows 用户用这个 415 | pyinstaller -wy -i icon.icns QuickCut.py # 为了图标格式兼容,Mac 用户请用这个 416 | ``` 417 | 418 | 419 | 420 | ### 编译后打包后要做的事 421 | 422 | 编译完成后,还有几个事要做,首先,下载对应系统的 [ffmpeg 和 ffprobe](http://ffmpeg.org/download.html) 放到编译根目录,再把本 `README.md` 导出成 `README.html` ,同 `icon.ico`、`sponsor.jpg`、`languages` 一起放入编译根目录(Mac 用户放 `icon.icns`),再下载对应系统的 [annie](https://github.com/iawia002/annie/releases) 放入编译根目录。 423 | 424 | 如果是 Mac 、Linux 打包的,那一定要给编译目录下的可执行文件用 `chmod +x` 授予可执行权限! 425 | 426 | 然后就可以打包了,Windows 下可以打包成 `7z` 格式,Mac、Linux 用户不要打包` zip`、`7z` 格式!因为这会让可执行文件的权限消失!Mac、Linux 用户可以用 `tar.gz` 或者 `dmg` 格式打包。 427 | 428 | 建议打包后的命名成类似 `QuickCut_Mac_v1.2.0_pyinstaller.dmg` 这样的。如果你是志愿者,为这个项目打包,你也可以在命名后面加上你的 id 等信息。 429 | 430 | 在发包的时候,建议上传到蓝奏云、天翼云,新建一个文件夹,将包放到这个文件夹里,再把这个文件夹的分享链接发出来,这样,以后要更新的话,只要把新版本放到那个文件夹,分享链接就不用变了。 431 | 432 | 你可以将打包好的云盘文件夹链接发给作者,作者会把这个链接放到 release 页面。 433 | 434 | ## ☕ 打赏 435 | 436 | 万水千山总是情,一块几块都是情。本软件完全开源,用爱发电,如果你愿意,可以以打赏的方式支持我一下: 437 | 438 | ![sponsor](assets/sponsor.jpg) 439 | 440 | 441 | 442 | ## 😀 交流 443 | 444 | 如果有软件方面的反馈可以提交 issues,或者加入 QQ 群:[1146626791](https://qm.qq.com/cgi-bin/qm/qr?k=DgiFh5cclAElnELH4mOxqWUBxReyEVpm&jump_from=webapi) 445 | 446 | 447 | 448 | ## 🙏 鸣谢 449 | 450 | 感谢知乎上的 @[Python与模具](https://www.zhihu.com/people/xuhui112-ben) 的帮助,让我得以用 nuitka 对软件进行打包。 451 | -------------------------------------------------------------------------------- /README_en.md: -------------------------------------------------------------------------------- 1 | # icon.ico Quick Cut 2 | 3 | **Quick Cut** is a light yet powerful and handy video processing software. Unlike professional an huge giants such as **Davinci Resolve** or **Premiere Pro**, **Quick Cut** is just a light tool that can satisfy the need of simply processing videos such as: 4 | 5 | - compress a video 6 | - transcode a video 7 | - revert a video 8 | - concat clips 9 | - auto split a video by corresponding subtitle file 10 | - auto edit (remove silence clips) 11 | - download a video from YouTube 12 | - ... 13 | 14 | Gitee:https://gitee.com/haujet/QuickCut 15 | 16 | GitHub:https://github.com/HaujetZhao/QuickCut 17 | 18 | 19 | 20 | ## About Translation 21 | 22 | **Developer**: My home language is Chinese so the original UI is in Chinese, if you want to help translating this software, you can open the **[./QuickCut/languages/README.md](./QuickCut/languages/README.md)** to check out how you can help. 23 | 24 | ## How to change language 25 | 26 | The first time you open Quick Cut, the UI should be language. If you are non-Chinese user, here is how to switch English UI: 27 | 28 | image-20200801204028907 29 | 30 | After the two steps above, a pop-up will show, says you need to relaunch Quick Cut. Just do it, and then you will have the English UI. 31 | 32 | Quick Cut 开源的,你可以免费使用它,但正因为开源,因此插入恶意代码是很容易的事,所以请认准仓库发行页面的下载地址: 33 | 34 | - 仓库地址:[Gitee](https://gitee.com/haujet/QuickCut) 和 [GitHub](https://github.com/HaujetZhao/QuickCut) 35 | - 发行版发布地址:[Gitee releases](https://gitee.com/haujet/QuickCut/releases) 和 [Github releases](https://github.com/HaujetZhao/QuickCut/releases) 36 | - Win64 绿色版下载地址:https://wwe.lanzous.com/b015n2n5a 密码:f4t3 37 | - Python pip 安装:`pip install Quick-Cut` 38 | 39 | > Quick Cut 是用 Python 写的,所以我将 Quick Cut 也发布在了 [pypi](https://pypi.org/project/Quick-Cut/) 库,只要你装了 python,使用 `pip install Quick-Cut` 就可以安装上 Quick Cut,不过 pypi 库中的版本没有自带 FFmpeg,需要你手动安装。(都会用 pip 安装东西了,相信安装 FFmpeg 就不用教了吧) 40 | > 41 | > 我没有 Win32 、MacOS、Linux 系统的电脑,所以这些系统打包不了。但你们可以通过 pip 方法安装。 42 | > 43 | > Windows 系统用 pip 安装时,可能会遇到 pyaudio 的安装问题,可以参照 [这篇文章](https://blog.csdn.net/Sau_Hit/article/details/85938063) 解决。 44 | 45 | 另外,每一个页面我都做了 [视频教程](https://www.bilibili.com/video/BV18T4y1E7FF),基本所有的问题看了视频都能解决,在主页面的预设列表下方有 `查看预设帮助` 按钮,有关于压制方面的帮助,可以解决你关于转码清晰不清晰的问题,也瞅瞅,所以不要连官方解答都不看,就无脑提问。 46 | 47 | 界面预览: 48 | 49 | image-20200801204230301 50 | 51 | ## 📝 背景 52 | 53 | 好几年前,有一次想将一个视频中的片段剪出来,才发现,市面上根本没有给普通用户用的视频处理软件。 54 | 55 | 我去百度、知乎上搜【视频剪辑软件】,陆续得到了以下结果: 56 | 57 | - **Adobe Premiere**,正版一年上千元、随时【停止运行】的专业剪辑软件 58 | - **Vegas** 等专业软件就不再列了 59 | - **爱剪辑**,一个导出就带推广片头的中文剪辑软件 60 | - **格式工厂**,一个老牌的国产转码编辑软件 61 | - **小丸工具箱**,一个从 Bilibili 知道的压制软件 62 | - 还有大大小小的其它软件 63 | 64 | 我就只想剪一小个片段啊!专业软件学不起、买不起、电脑太卡带不起!可是其它小软件、许多国产剪辑软件,都有这一些问题: 65 | 66 | - 国外软件选项太多,各种参数看不懂。 67 | - 多数免费软件都带水印,或者导出后画质会下降,要么导出的体积巨大,耗时长不说,还不是无损剪辑。 68 | 69 | 用的最好的还是 **格式工厂** 和 **小丸工具箱** 。但他们都功能很少,还有小丸工具箱,官网的下载地址是百度网盘链接已经挂了,也不知道从第三方下载的版本有没有木马、广告…… 70 | 71 | 后来,从视频压制这个话题,我知道了 **FFmpeg** 这个神级开源工具,它的功能之强大、应用之广泛到惊了我的下巴!但它是个命令行工具,到百度上一搜,也只是些文章说怎样怎样的命令可以做什么、常用命令有什么。相关的图形界面工具,一个好用的都没有!(当然要点名表扬下 Lossless Cut,它还是很好用的,只是功能太少)。没有一个软件能让 FFmpeg 在普通大众用户手中发挥潜力,真是可惜了! 72 | 73 | 于是一通操作,把 FFmpeg 的官方文档逐句做了翻译,记了笔记,然后用它来处理视频,真是畅快!免费、无广告,剪出来的视频也可以画质无损。100 兆的视频压缩到 10 兆,肉眼画质无损,那是一个巴适! 74 | 75 | 但是有一个问题!每次要处理一个视频,都要手动输入命令行,非常的麻烦,有时候忘记执行某个操作是用哪个参数了,还要去翻笔记,难受!于是我就想做一个图形界面工具,想要做什么,在里面点两下,命令参数啥的都是自动生成,最后点击运行就好。于是先后做了基于 **Tasker** 的安卓端 FFmpeg GUI Tool、基于 **Quicker** 的 FFmpeg GUI Tool。 76 | 77 | 但是上面两个平台都局限太多,想要好用,还是得自己做 GUI。我自己只是入门 python 的水平,只能硬着头皮花了几天在学习平台 B 站看完了 PyQt 的入门。然后边查边做,因为 PyQt 的注释很少,有时一个简单的小细节要花半天到一天处理。最后,成品还是出来了! 78 | 79 | 当然,除了 **FFmpeg** 的功能外,我还做了 **语音自动转字幕** 功能。这里,我要不指名地 Diss 一些商家: 80 | 81 | - 首先是价格,贵的要 1元/分钟,便宜些的也要 4毛/分钟!转个 20 分钟的视频,就要收我 8 元,抢钱呐!啊?你们是没有语音引擎的,都是用的 API,大批量采购,你们用的 API 价格也就 1.2 元/小时 左右吧!用 API 成本几十倍的价格提供服务,这吃相,真是难看。 82 | - 然后是上传视频。语音转字幕,上传音频便足以,一些商家却需要上传完整视频!2GB 的视频,通常其音频只有几十 MB 左右。你们是你们觉得:用户见转写了几十 MB 的视频,会觉得这么小的文件,1元/分钟的价格不值,转写了 2GB 的视频,一看这转写体积,就觉得花钱花的值? 83 | 84 | 在 Quick Cut 里,我做了 **语音自动转字幕** 功能,可以使用阿里或腾讯的 Api。就以阿里的 API 为例,普通元套餐的商用价格是 2.5 元/小时,四十五几乎就是不要钱!下面的帮助里,我写下了申请阿里 API 的教程,只要填入 API,就可以使用语音转字幕了。 85 | 86 | 另外,我还将另一个 **自动剪辑神器** 放进了 Quick Cut,将你的 Vlog、视频教程一键自动剪好。下面会有详细介绍。 87 | 88 | 同时,推荐 Quick Cut 中一个对学习外语的同学非常有用的功能:**将字幕中的每一句话对应的视频剪成片段提取出来**。用于制作外语学习的视频素材爽的不要不要的!应该算是 **Anki** 用户的一个福利功能吧! 89 | 90 | 91 | 92 | ## ✨ 特性 93 | 94 | - 简单的界面 95 | - FFmpeg 预设丰富 96 | - 可自定义预设 97 | - 合并视频片段 98 | - 逐句提取每句字幕对应的视频片段 99 | - 自动转字幕 100 | - 自动剪辑 101 | - ……更多待探索 102 | 103 | 104 | 105 | ## 🔮 界面和功能介绍 106 | 107 | ### FFmpeg 界面 108 | 109 | 在这个界面,你可以使用许多 ffmpeg 预设,对音视频进行处理,比如说: 110 | 111 | 我想将手机上录制的视频压制下,减小它的大小,那么只需要:先在 **输入1** 框输入待压制的视频文件(此时会自动生成输出文件名),再在右侧预设列表选择 **H264压制** 预设(此时会自动生成总命令),最后点击底部的 **运行** 按钮,就会启动压制了。 112 | 113 | **还有啊,转格式是基本操作!输出框的后缀名填什么,就会输出对应的格式!** 114 | 115 | [点击去查看 Quick Cut 压制的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=1) 116 | 117 | [点击去查看 Quick Cut 预设讲解视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=2) 118 | 119 | ### 分割视频界面 120 | 121 | 这个界面有三个功能:根据字幕分割视频、根据大小分割视频、根据时长分割视频。 122 | 123 | 根据字幕分割视频是个神级功能,尤其适合于制作外语学习的视频素材。将例如美剧的视频放进去,再把相应的字幕文件放进去,就可以将每一句字幕对应的视频片段剪出来!如果你的字幕时间轴和视频时间轴有偏差,还可以进行手动的校准。 124 | 125 | 根据时间分割视频和根据大小分割视频主要是针对分享到短视频平台和微信平台的。 126 | 127 | [点击去查看 Quick Cut 分割视频的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=3) 128 | 129 | image-20200725103345859 130 | 131 | ### 合并片段界面 132 | 133 | 这个简单,要合并的视频拖进去,调整下顺序,点击运行,就可以将这些视频合并成一个文件。从 ig 下载的 15 秒 story 视频片段就可以轻松合并啦! 134 | 135 | [点击去查看 Quick Cut 合并片段的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=4) 136 | 137 | image-20200725103322509 138 | 139 | ### 下载视频界面 140 | 141 | 这个界面提供了两个命令行工具的图形界面用于下载视频,最简单的用法就是将链接复制进去,然后点击下载。支持的网站有很多比如优酷、B站、YouTube、P站(逃)…… 142 | 143 | 另外你还可以在里面设置cookies,就能够用你大会员身份登录的 cookie 信息下载大会员视频画质了。 144 | 145 | [点击去查看 Quick Cut 下载视频的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=5) 146 | 147 | image-20200725103257140 148 | 149 | ### 自动剪辑界面 150 | 151 | 自动剪辑的原理是通过给视频中有声音的片段和没有声音的片段施加不同的播放速度,达到只保留有关键信息部分的效果,非常适合做vlog和视频教程。 152 | 153 | 同时你也可以选择使用阿里云或者腾讯云的语音服务,先将视频转出字幕之后,再根据字幕中的关键词对视频片段进行保留和删除操作。 154 | 155 | 除了下面那个演示视频,在本教程中的所有视频,都使用了自动剪辑,然后才上传的。 156 | 157 | [点击去查看 Quick Cut 自动剪辑的效果演示视频](https://www.bilibili.com/video/BV18T4y1E7FF?p=6) 158 | 159 | [点击去查看 Quick Cut 自动剪辑的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=7) 160 | 161 | image-20200725103228908 162 | 163 | ### 自动转字幕界面 164 | 165 | 只要将你的视频或者音频文件拖进去,然后点击运行,就可以生成一个srt格式的字幕。 166 | 167 | 语音识别方面使用了阿里云或者腾讯云的引擎,准确率有95%以上。如果想给自己的视频配字幕,就可以先用这个功能,自动转出字幕之后,再手动修改一下里边偶尔的错别字,效率非常高。 168 | 169 | 语音识别引擎需要用户自己去阿里云官网申请 API 才能用(对申请过程我做了[视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=11))。阿里云的语音服务开通后,每个新用户有3个月的免费试用时间,在这3个月内,每天都有两小时的录音文件转换额度。试用期过后,商业版的价格是每小时音频转换2.5元,随着使用量的增加,这个价格还会更低。如果买1000小时的套餐,价格可以低到1.5元每小时。 170 | 171 | 如果你对比一下目前网上能找到的视频转字幕服务,你就会知道 Quick Cut 的这个转字幕功能有多便宜: 172 | 173 | - 网易见外工作台,普通的视频转字幕,收费1元每分钟,60元每小时。英文转字幕价格翻倍。 174 | - 号称全网最低价的突字幕,收费0.005元每秒,3毛每分钟,18元每小时。 175 | - Arctime 收费30积分每分钟,也就是3毛每分钟,18元每小时。 176 | 177 | 来对比一下:阿里云 2.5 元每小时,前三个月每天免费用两小时,用得越多价,格还会更低。 178 | 179 | 腾讯云方面的价格还会更低,只是转换速度没有阿里云快。所以推荐使用阿里云。就算是用商业版每小时2.5元的价格也不心疼。 180 | 181 | 如果你急着把最新的美剧视频下载下来,字幕组还没有出字幕,但是生肉太难啃,就可以用这个转字幕功能,将英文字幕转出来,配合着看。 182 | 183 | 如果你是视频工作者、UP主、视频公司负责人,平常有大量的视频需要转换字幕,用这个就可以舍去使用其他网上平台导致的每小时几十元的成本,一个月下来成本或许能节约到上千元。。 184 | 185 | 哎,说实话,要是这软件推广开来,对一些视频转字幕的服务商,真的是断人财路,杀人父母。 186 | 187 | [点击去查看 Quick Cut 自动转字幕的演示](https://www.bilibili.com/video/BV18T4y1E7FF?p=8) 188 | 189 | image-20200725103137457 190 | 191 | ### 语音识别输入界面 192 | 193 | 如果你已经添加上阿里云的语音引擎,就可以使用阿里云的一句话识别服务进行语音识别输入。在任意界面,只要长按键盘上的大写锁定键超过0.3秒钟,就可以开始说话,进行语音识别。松开按键之后,识别结果会自动打到输入框。 194 | 195 | 有人推荐使用讯飞的语音识别,但是讯飞语音识别的快捷键在 F6 那个位置,离主键盘的位置非常远,手指够过去费劲;而且那里有很多大小一样的按键,这个快捷键也不好找;他还会和很多软件的快捷键冲突。 196 | 197 | 而长按大写锁定键进行语音识别就非常方便,离打字的手非常近,需要的时候很轻松就能按到,也不会有快捷键冲突。 198 | 199 | 阿里云语音识别的准确率非常高,这篇文章大部分都是用这个语音识别功能打的,然后修改了少量错字。 200 | 201 | [点击去查看 Quick Cut 语音识别输入的演示](https://www.bilibili.com/video/BV18T4y1E7FF?p=9) 202 | 203 | image-20200725103107328 204 | 205 | ### 设置界面 206 | 207 | 在设置界面你就可以在这里配置语音识别的引擎。 208 | 209 | 勾选上 **点击关闭按钮时隐藏到托盘** ,就可以让软件常驻到后台,方便快捷的调出来剪辑视频、语音输入。Quick Cut 的资源占用量非常少,可以放心的放到后台,不影响性能。 210 | 211 | [点击去查看 Quick Cut 配置阿里云语音识别引擎的视频教程](https://www.bilibili.com/video/BV18T4y1E7FF?p=9) 212 | 213 | image-20200725103013287 214 | 215 | ### 帮助界面 216 | 217 | 在帮助见面里,有如下按钮,见名知意: 218 | 219 | image-20200725102850979 220 | 221 | 222 | 223 | 224 | 225 | ## 🔨 开发 226 | 227 | 这一节普通用户就不用看了。你们只要到发布界面下载使用已打包好的软件就行了,如果你想对源代码进行修改,就可以看下这一节。 228 | 229 | ### 搭建环境 230 | 231 | 你需要 pip 安装这些包: 232 | 233 | ``` 234 | srt 235 | keyboard 236 | numpy 237 | setuptools 238 | aliyun-python-sdk-core 239 | PyQt5 240 | audiotsm 241 | scipy 242 | cos-python-sdk-v5 243 | tencentcloud-sdk-python 244 | oss2 245 | pyaudio 246 | ``` 247 | 248 | 其中,pyaudio 很难安装!编译成功有很多要求。所以我们可以直接到 [这里](https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio) 下载上它已经被志愿者编译好的 whl 包,用 pip 安装,注意下载对应你 python 版本的包。 249 | 250 | 另外,还需要安装 `auditok` ,但你不能使用 `pip install auditok`,因为这会下载到 0.1.5 版本(2016年更新)的,你需要使用 `pip install git+https://github.com/amsehili/auditok` 安装最新的 0.1.8 版本(2018年更新)。详情可查看 [Github of Auditok](https://github.com/amsehili/auditok) 251 | 252 | #### 阿里云语音识别 sdk 253 | 254 | 然后还需要安装阿里云语音识别引擎的 sdk,这个 sdk 是无法通过 pip 安装的,而是要通过 [这篇阿里云官方文档](https://help.aliyun.com/document_detail/120693.html?spm=a2c4g.11186623.6.569.27675df0FENQ6O) 的方法进行安装: 255 | 256 | ``` 257 | pip install setuptools 258 | ``` 259 | 260 | [下载Python SDK](http://download.taobaocdn.com/freedom/33762/compress/alibabacloud-nls-python-sdk.zip)。 261 | 262 | ``` 263 | # 打包 python setup.py bdist_egg # 安装 python setup.py install 264 | ``` 265 | 266 | 267 | 268 | ### 运行问题: 269 | 270 | 安装完依赖之后开始运行脚本,你可能会遇到这些问题: 271 | 272 | - 安装完依赖后,你运行脚本,却发现 `import oss2` 时提示出错:`No module named 'winrandom'`,这时,你需要修改 `Python38\Lib\site-packages\Crypto\Random\OSRNG` 下的 `nt.py` 文件,将 `import winrandom` 修改为:`from Crypto.Random.OSRNG import winrandom` 273 | 274 | 这些问题的原因是一些模块用了其它依赖,而这些其它依赖已经好久没更新了。只能遇到一个问题就搜一下,解决掉。上面这些问题都是我遇到后,在网上找了解法,根据自己的情况做了改动,使得问题得以解决。 275 | 276 | **Mac 和 Linux 用户请注意:** 277 | 278 | 为了在 Windows 上运行时候不弹黑窗口,我在用 subprocess 的时候用了一个 `subprocess.STARTUPINFO()` 类,但是在 Linux 或 Mac 上好像不能用它,所以你们在使用前,要删除几段代码: 279 | 280 | 首先是末尾的这三行: 281 | 282 | ``` 283 | subprocessStartUpInfo = subprocess.STARTUPINFO() 284 | subprocessStartUpInfo.dwFlags = subprocess.STARTF_USESHOWWINDOW 285 | subprocessStartUpInfo.wShowWindow = subprocess.SW_HIDE 286 | ``` 287 | 288 | 然后再全局搜索 `, startupinfo=subprocessStartUpInfo` 将其删掉。理论上就好了。 289 | 290 | 搭建好环境可以运行之后,如果修改了源代码然,后要进行发布,就应当打包成可以独立运行的exe文件,下面提供两种方法进行编译打包: 291 | 292 | ### 使用 nuitka 编译: 293 | 294 | 使用它打包出来的程序运行更快,只是相对步骤多一些。 295 | 296 | 先下载安装上 [MinGW64 8.1](https://sourceforge.net/projects/mingw-w64/files/) 297 | 298 | 再安装上 nuitka: 299 | 300 | ``` 301 | pip install nuitka 302 | ``` 303 | 304 | 在实际编译的时候,先使用这个命令进行编译: 305 | 306 | ``` 307 | nuitka --mingw64 --standalone --show-progress --show-memory --plugin-enable=qt-plugins --plugin-enable=pylint-warnings --recurse-all --recurse-not-to=numpy,jinja2 --windows-icon=icon.ico --nofollow-imports --assume-yes-for-downloads --output-dir=out QuickCut.py 308 | ``` 309 | 310 | 这时,可能会遇到如下错误: 311 | 312 | ![image-20200724211333904](assets/image-20200724211333904.png) 313 | 314 | 就是因为代码里面有中文字符,默认使用的英文编码在转码时出现了错误,你就需要找到并打开最后指示的那个 **MainControl.py** 文件,将里面出错的那一行的 **latin1** 修改为 **utf-8** ,然后就可以编译成功。 315 | 316 | 以后其实还并不能运行,因为 nuitka 对于某些包并不会自动导入,还需要你手动导入才行。 317 | 318 | 所以在实际编译的时候,还是先使用这个命令进行编译: 319 | 320 | ``` 321 | nuitka --mingw64 --standalone --show-progress --show-memory --plugin-enable=qt-plugins --plugin-enable=pylint-warnings --recurse-all --recurse-not-to=numpy,jinja2 --windows-icon=icon.ico --nofollow-imports --assume-yes-for-downloads --output-dir=out QuickCut.py 322 | ``` 323 | 324 | 然后再编译的导出目录在命令行窗口中将 **QuickCut.exe** 打开,会看到类似这样的错误: 325 | 326 | ![image-20200725104724393](assets/image-20200725104724393.png) 327 | 328 | 这时候,就需要亲自到 Python 的安装目录下找到这个包: 329 | 330 | ![image-20200725104814559](assets/image-20200725104814559.png) 331 | 332 | 333 | 334 | 将它手动复制到导出目录的根目录中: 335 | 336 | ![image-20200725104901324](assets/image-20200725104901324.png) 337 | 338 | 重复运行,再次出现包缺失: 339 | 340 | ![image-20200725105214629](assets/image-20200725105214629.png) 341 | 342 | 都需要找到这个包: 343 | 344 | ![image-20200725105301248](assets/image-20200725105301248.png) 345 | 346 | 粘贴到编译导出目录的根目录中。这个过程要重复很多次,直到将所有缺失的包都复制到导出目录。 347 | 348 | 你可以将这些需要手动导入的包都再复制到另一个文件夹做备份,再次编译后,直接复制进去就行。 349 | 350 | 编译完成,你启动后可能是这个样子的: 351 | 352 | image-20200725110050437 353 | 354 | 长得很丑对吧。这是因为缺失了 styles 文件夹,你需要到 PyQt5 的安装目录,找到 styles 文件夹: 355 | 356 | ![image-20200725110307123](assets/image-20200725110307123.png) 357 | 358 | 将其复制到编译导出目录的根目录之后,再次启动就正常了。 359 | 360 | 还有,记得将 icon.ico 、sponsor.jpg、README.html 复制到编译导出的文件夹,没有图标文件的话,就无法启动托盘。 361 | 362 | 再次编译。测试成功后,就可以使用下面这个命令进行编译: 363 | 364 | ``` 365 | nuitka --mingw64 --windows-disable-console --standalone --show-progress --show-memory --plugin-enable=qt-plugins --plugin-enable=pylint-warnings --plugin-enable=numpy --recurse-all --recurse-not-to=numpy,jinja2 --windows-icon=icon.ico --nofollow-imports --assume-yes-for-downloads --output-dir=out QuickCut.py 366 | ``` 367 | 368 | 这样就可以将命令行窗口隐藏。 369 | 370 | 如果你是 Mac 编译,为了图标格式兼容,要使用: 371 | 372 | ``` 373 | nuitka --mingw64 --windows-disable-console --standalone --show-progress --show-memory --plugin-enable=qt-plugins --plugin-enable=pylint-warnings --plugin-enable=numpy --recurse-all --recurse-not-to=numpy,jinja2 --windows-icon=icon.icns --nofollow-imports --assume-yes-for-downloads --output-dir=out QuickCut.py 374 | ``` 375 | 376 | 377 | 378 | ### pyinstaller 编译: 379 | 380 | 先安装上 pyinstaller : 381 | 382 | ``` 383 | pip install pyinstaller 384 | ``` 385 | 386 | 直接使用这个命令进行编译: 387 | 388 | ``` 389 | pyinstaller --hidden-import pkg_resources.py2_warn --noconfirm -w -i icon.ico QuickCut.py 390 | ``` 391 | 392 | 如果你是 Mac 编译,为了图标格式兼容,要使用: 393 | 394 | ``` 395 | pyinstaller --hidden-import pkg_resources.py2_warn --noconfirm -w -i icon.icns QuickCut.py 396 | ``` 397 | 398 | 其中,`--hide-import pkg_resources.py2_warn` 这一句比较重要,其实整个软件并没有用到这个模块,但是 pyinstaller 他会自动的编译进去,可是电脑上又没有安装这个模块,最后编译出来的软件就无法运行,所以一定要加上这个选项。 399 | 400 | ### 编译后打包后要做的事 401 | 402 | 编译完成后,还有几个事要做,首先,下载对应系统的 [ffmpeg 和 ffprobe](http://ffmpeg.org/download.html) 放到编译根目录,再把本 README.md 导出成 README.html ,同 icon.ico、sponsor.jpg 一起放入编译根目录,再下载对应系统的 [annie](https://github.com/iawia002/annie/releases) 放入编译根目录。 403 | 404 | 如果是 Mac 、Linux 打包的,那一定要给编译目录下的可执行文件用 `chmod +x` 授予可执行权限! 405 | 406 | 然后就可以打包了,Windows 下可以打包成 `7z` 格式,Mac、Linux 用户不要打包` zip`、`7z` 格式!因为这会让可执行文件的权限消失!Mac、Linux 用户可以用 `tar.gz` 或者 `dmg` 格式打包。 407 | 408 | 建议打包后的命名成类似 `QuickCut_Mac_v1.2.0_compiled_by_pyinstaller.dmg` 这样的。如果你是志愿者,为这个项目打包,你也可以在命名后面加上你的 id 等信息。 409 | 410 | 在发包的时候,建议上传到蓝奏云、天翼云,新建一个文件夹,将包放到这个文件夹里,再把这个文件夹的分享链接发出来,这样,以后要更新的话,只要把新版本放到那个文件夹,分享链接就不用变了。 411 | 412 | 你可以将打包好的云盘文件夹链接发给作者,作者会把这个链接放到 release 页面。 413 | 414 | ## ☕ 打赏 415 | 416 | 万水千山总是情,一块几块都是情。本软件完全开源,用爱发电,如果你愿意,可以以打赏的方式支持我一下: 417 | 418 | ![sponsor](assets/sponsor.jpg) 419 | 420 | 421 | 422 | ## 😀 交流 423 | 424 | 如果有软件方面的反馈可以提交 issues,或者加入 QQ 群:[1146626791](https://qm.qq.com/cgi-bin/qm/qr?k=DgiFh5cclAElnELH4mOxqWUBxReyEVpm&jump_from=webapi) 425 | 426 | 427 | 428 | ## 🙏 鸣谢 429 | 430 | 感谢知乎上的 @[Python与模具](https://www.zhihu.com/people/xuhui112-ben) 的帮助,让我得以用 nuitka 对软件进行打包。 431 | -------------------------------------------------------------------------------- /assets/image-20200724211333904.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200724211333904.png -------------------------------------------------------------------------------- /assets/image-20200725102850979.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725102850979.png -------------------------------------------------------------------------------- /assets/image-20200725103013287.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725103013287.png -------------------------------------------------------------------------------- /assets/image-20200725103107328.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725103107328.png -------------------------------------------------------------------------------- /assets/image-20200725103137457.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725103137457.png -------------------------------------------------------------------------------- /assets/image-20200725103228908.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725103228908.png -------------------------------------------------------------------------------- /assets/image-20200725103257140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725103257140.png -------------------------------------------------------------------------------- /assets/image-20200725103322509.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725103322509.png -------------------------------------------------------------------------------- /assets/image-20200725103345859.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725103345859.png -------------------------------------------------------------------------------- /assets/image-20200725104724393.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725104724393.png -------------------------------------------------------------------------------- /assets/image-20200725104814559.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725104814559.png -------------------------------------------------------------------------------- /assets/image-20200725104901324.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725104901324.png -------------------------------------------------------------------------------- /assets/image-20200725105113317.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725105113317.png -------------------------------------------------------------------------------- /assets/image-20200725105214629.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725105214629.png -------------------------------------------------------------------------------- /assets/image-20200725105301248.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725105301248.png -------------------------------------------------------------------------------- /assets/image-20200725110050437.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725110050437.png -------------------------------------------------------------------------------- /assets/image-20200725110307123.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200725110307123.png -------------------------------------------------------------------------------- /assets/image-20200726203040942.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200726203040942.png -------------------------------------------------------------------------------- /assets/image-20200801204028907.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200801204028907.png -------------------------------------------------------------------------------- /assets/image-20200801204230301.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/image-20200801204230301.png -------------------------------------------------------------------------------- /assets/sponsor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaujetZhao/QuickCut/fffcd799c5ee6bb457dddbf0acfcbbea3522a36a/assets/sponsor.jpg -------------------------------------------------------------------------------- /compile/Pyinstaller 编译和打包 Win64.bat: -------------------------------------------------------------------------------- 1 | pyinstaller --hidden-import pkg_resources.py2_warn --noconfirm -w -i "../QuickCut/icon.ico" "../QuickCut/QuickCut.py" 2 | 3 | echo d | xcopy /y /s .\dist\rely .\dist\QuickCut 4 | 5 | del /F /Q QuickCut_Win64_pyinstaller.7z 6 | 7 | 7z a -t7z QuickCut_Win64_pyinstaller.7z .\dist\QuickCut -mx=9 -ms=200m -mf -mhc -mhcf -mmt -r 8 | 9 | echo d | xcopy /y /s .\dist\QuickCut C:\Portable_Programes\QuickCut 10 | 11 | pause -------------------------------------------------------------------------------- /compile/暂时弃用的脚本/Pyinstaller 和 Nuitka 打包 7z Win64.bat: -------------------------------------------------------------------------------- 1 | echo d | xcopy /y /s .\dist\rely .\dist\QuickCut 2 | 3 | del /F /Q QuickCut_Windows_pyinstaller.7z 4 | 5 | 7z a -t7z QuickCut_Windows_pyinstaller.7z .\dist\QuickCut -mx=9 -ms=200m -mf -mhc -mhcf -mmt -r 6 | 7 | 8 | 9 | 10 | echo d | xcopy /y /s .\out\rely .\out\QuickCut.dist 11 | 12 | del /F /Q QuickCut_Windows_nuitka.7z 13 | 14 | 7z a -t7z QuickCut_Windows_nuitka.7z .\out\QuickCut.dist -mx=9 -ms=200m -mf -mhc -mhcf -mmt -r 15 | 16 | echo d | xcopy /y /s .\out\QuickCut.dist C:\Portable_Programes\QuickCut 17 | 18 | pause -------------------------------------------------------------------------------- /compile/暂时弃用的脚本/Pyinstaller 和 Nuitka 编译 Win64.bat: -------------------------------------------------------------------------------- 1 | pyinstaller --hidden-import pkg_resources.py2_warn --noconfirm -w -i icon.ico QuickCut.py 2 | 3 | 4 | nuitka --mingw64 --windows-disable-console --standalone --show-progress --show-memory --plugin-enable=qt-plugins --plugin-enable=pylint-warnings --plugin-enable=numpy --recurse-all --recurse-not-to=numpy,jinja2 --windows-icon=icon.ico --nofollow-imports --assume-yes-for-downloads --output-dir=out QuickCut.py 5 | 6 | 7 | 8 | pause -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # python setup.py sdist build 3 | # python setup.py sdist –formats = gztar,zip 4 | # twine upload "dist/Quick-Cut-1.6.10.tar.gz" 5 | # 这是用于上传 pypi 前打包用的 6 | 7 | 8 | from setuptools import setup, find_packages 9 | import pathlib 10 | 11 | here = pathlib.Path(__file__).parent.resolve() 12 | with open('README.md', 'r', encoding='utf-8') as f: 13 | long_description = f.read() 14 | 15 | 16 | setup( 17 | name='Quick-Cut', 18 | version='1.6.10', 19 | description=( 20 | '一款轻量、强大、好用的视频处理软件。' 21 | ), 22 | long_description=long_description, 23 | long_description_content_type='text/markdown', 24 | url='https://github.com/HaujetZhao/QuickCut', 25 | author='Haujet Zhao', 26 | author_email='1292756898@qq.com', 27 | maintainer='Haujet Zhao', 28 | maintainer_email='1292756898@qq.com', 29 | license='MPL-2.0 License', 30 | install_requires=[ # 需要额外安装的包 31 | 'srt', 32 | 'keyboard', 33 | 'numpy', 34 | 'scipy', 35 | 'aliyun-python-sdk-core', 36 | 'alibabacloud-nls-java-sdk', 37 | 'PyQt5', 38 | 'audiotsm', 39 | 'cos-python-sdk-v5', 40 | 'tencentcloud-sdk-python', 41 | 'oss2', 42 | 'pyaudio', 43 | 'auditok', 44 | 'pymediainfo', 45 | 'you-get', 46 | 'youtube-dl' 47 | ], 48 | packages=['QuickCut', 'QuickCut/languages', 'QuickCut/misc'], # 需要打包的本地包(package) 49 | package_data={ # 每个本地包中需要包含的另外的文件 50 | 'QuickCut': ['*.md', 51 | '*.ico', 52 | '*.icns', 53 | 'style.css', 54 | 'sponsor.jpg'], 55 | 'QuickCut/languages':['*.*'], 56 | 'QuickCut/misc':['README*.html', 'assets/*.*']}, 57 | 58 | entry_points={ # Optional 59 | 'gui_scripts': [ 60 | 'QuickCut=QuickCut.QuickCut:main', 61 | 'Quick-Cut=QuickCut.QuickCut:main', 62 | 'Quickcut=QuickCut.QuickCut:main', 63 | 'quickcut=QuickCut.QuickCut:main' 64 | ]}, 65 | 66 | 67 | platforms=["all"], 68 | 69 | classifiers=[ 70 | # Optional 71 | # How mature is this project? Common values are 72 | # 3 - Alpha 73 | # 4 - Beta 74 | # 5 - Production/Stable 75 | 'Development Status :: 4 - Beta', 76 | 77 | # Indicate who your project is intended for 78 | 'Intended Audience :: End Users/Desktop', 79 | 'Topic :: Multimedia :: Video', 80 | 81 | # Pick your license as you wish 82 | 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 83 | 84 | # Specify the Python versions you support here. In particular, ensure 85 | # that you indicate you support Python 3. These classifiers are *not* 86 | # checked by 'pip install'. See instead 'python_requires' below. 87 | 'Programming Language :: Python :: 3', 88 | 'Programming Language :: Python :: 3.5', 89 | 'Programming Language :: Python :: 3.6', 90 | 'Programming Language :: Python :: 3.7', 91 | 'Programming Language :: Python :: 3.8', 92 | 'Programming Language :: Python :: 3 :: Only', 93 | ], 94 | python_requires='>=3.5, <4', 95 | 96 | ) --------------------------------------------------------------------------------