├── .github └── workflows │ └── python-app.yml ├── .gitignore ├── LICENSE ├── README.md ├── app.ico ├── appveyor.yml ├── qenc.py ├── qencoder ├── av1anworkarounds.py ├── mainwindow.py ├── mainwindow.ui └── window.py ├── requirements.txt ├── screenshots ├── complex.png ├── cores.png ├── queue.png ├── simple.png └── vmaf.png ├── setup.py └── window.pyproject /.github/workflows/python-app.yml: -------------------------------------------------------------------------------- 1 | # This workflow will install Python dependencies, run tests and lint with a single version of Python 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions 3 | 4 | name: PyInstaller 5 | 6 | on: [push] 7 | 8 | jobs: 9 | build: 10 | 11 | runs-on: windows-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v1 15 | - name: Set up Python 3.8 16 | uses: actions/setup-python@v1 17 | with: 18 | python-version: 3.8 19 | - name: Install dependencies 20 | run: | 21 | python -m pip install --upgrade pip 22 | pip install -r requirements.txt 23 | pip install pyinstaller 24 | - name: build with pyinstaller 25 | run: | 26 | pyinstaller --onefile qenc.py --icon=app.ico 27 | - uses: actions/upload-artifact@v2 28 | with: 29 | name: qencoder.exe 30 | path: dist/qenc.exe 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | cmake-build-debug 3 | build 4 | lib 5 | .kdev4 6 | shine.kdev4 7 | __pycache__/ 8 | temp/ 9 | temp_*/ 10 | enkode.spec 11 | window.pyproject.user* 12 | dist/ 13 | qencoder.egg-info/ 14 | *.autosave 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cross platform video encoding gui 2 | 3 | ### Encoding video is slow. qencoder makes it fast! 4 | ![Coreeeees](/screenshots/cores.png) 5 | 6 | The most efficient av1 and vp9/vp8 encoders do not scale very well across lots of cpu cores. By intelligently splitting the video into multiple chunks, qencoder allows you encode better videos than with svt in much less time. qencoder is inspired by and uses code from [Av1an](https://github.com/master-of-zen/Av1an/), while delivering a more familiar gui experience for Windows and Linux. 7 | 8 | ### Simple and easy to use 9 | ![Simple view](/screenshots/simple.png) 10 | 11 | You don't need to have a deep understanding of how video works to take advantage of qencoder. With extremely easy to use and powerful presets, qencoder is for everyone. 12 | 13 | ### Powerful for those who need it 14 | ![Advanced view](/screenshots/complex.png) 15 | 16 | qencoder features many useful features which make it a powerful tool. With scene based splitting, qencoder is the first ever gui to take advantage of systems with hundreds of cores. By splitting at the right moments, qencoder ensures your videos do not have any overhead from unneeded keyframes. 17 | 18 | It also is the first gui capable of boosting dark scenes. Allowing you to use lower q values to avoid nasty artifacts like banding when needed. 19 | 20 | It allows you to configure the colorspace of both your input and output, to ensure that your hdr video stays hdr. 21 | 22 | Finally, it supports minimal splitting, the ideal mode for 2 pass vbr encodes. This mode makes as few splits as possible, keeping them all as far apart as possible so that the bitrate stays as variable as possible. 23 | 24 | ### Video queueing 25 | 26 | ![Queue view](/screenshots/queue.png) 27 | 28 | qencoder is the first gui av1 encoder to support proper video queueing. Setup the perfect encode for your video and add it to a queue. Repeat for as many videos as you want to encode. When you are done, save the queue to a file for later, or run it now with the encode button. If any videos are in the queue, qencoder will encode them. 29 | 30 | ### Per Scene Encoding 31 | 32 | ![Target vmaf](/screenshots/vmaf.png) 33 | 34 | Per **SCENE** encoding, analogous to automatic per title encoding, lets you optimize your encodes to save space. Each scene can be encoded to target a specific vmaf (perceptual visual quality). Don't pay a cloud company to optimize your encodes, qencoder lets you do it all in house. 35 | 36 | ### Free codecs 37 | 38 | qencoder supports free codecs that can be encoded into webm. This means your videos can be shared and played on any html5 compliant browser. It also means that you do not need to worry about licensing fees or patent violation using it. Your encodes are yours, and should stay that way. 39 | 40 | ### Using qencoder 41 | 42 | ##### Windows 43 | 44 | Download the latest 7zip in the "releases" section. 45 | 46 | ##### Linux 47 | 48 | ###### Ubuntu: 49 | 50 | Via pip: 51 | 52 | First, install ffmpeg, an up to date version of aomenc, and an up to date version of vpxenc. Then install qencoder. 53 | ``` 54 | sudo apt update 55 | sudo apt install python-pip vpx-tools aom-tools ffmpeg 56 | pip install qencoder 57 | ``` 58 | 59 | ###### Arch: 60 | 61 | It's recommended that you install it from the aur: 62 | 63 | https://aur.archlinux.org/packages/qencoder/ 64 | 65 | ###### Others/Manual installation: 66 | 67 | Git clone this repository: 68 | 69 | ```git clone https://github.com/natis1/qencoder``` 70 | 71 | ```cd qencoder``` 72 | 73 | Then install ffmpeg and an up-to-date version of the aom encoder (for instance aomenc-git, on arch) 74 | 75 | Then install the python requirements: 76 | 77 | ```pip install -r requirements.txt``` 78 | 79 | Then run it with 80 | 81 | ```./qenc.py``` 82 | 83 | ##### Legal note 84 | 85 | app.ico modified from Wikimedia Commons by Videoplasty.com, CC-BY-SA 4.0 86 | 87 | pav1n.py contains code created by Master of Zen among others, originally licensed as [MIT](https://github.com/master-of-zen/Av1an/blob/e46db7ea6cb2c06556e0b8f957d617282cee0e47/LICENSE.md) and relicensed as gplv3 for the version within this project. 88 | -------------------------------------------------------------------------------- /app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/natis1/qencoder/3d693f72756639a9c5751069bda4d29d8bffd35c/app.ico -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.5.{build} 2 | image: Visual Studio 2019 3 | environment: 4 | PYTHON: C:\Python38-x64 5 | install: 6 | - cmd: '"%PYTHON%\python.exe" -m pip install numpy opencv-python tqdm scenedetect[opencv,progress_bar] psutil pypiwin32 PyQt5 ' 7 | - cmd: '"%PYTHON%\python.exe" -m pip install pyinstaller scipy ' 8 | build_script: 9 | - cmd: '"%PYTHON%\Scripts\pyinstaller" --onefile qenc.py --icon=app.ico' 10 | test: off 11 | artifacts: 12 | - path: dist/qenc.exe 13 | -------------------------------------------------------------------------------- /qenc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # This Python file uses the following encoding: utf-8 3 | import qencoder 4 | from qencoder.window import window 5 | from PyQt5 import QtWidgets 6 | from PyQt5.QtWidgets import QApplication 7 | 8 | import sys 9 | import multiprocessing 10 | import os 11 | 12 | #baseUIClass, baseUIWidget = uic.loadUiType("mainwindow.ui") 13 | 14 | def main(): 15 | if not sys.platform.startswith('win'): 16 | os.setpgrp() 17 | global window 18 | if sys.platform.startswith('win'): 19 | multiprocessing.freeze_support() 20 | print("Loading program... please wait!") 21 | app = QtWidgets.QApplication(sys.argv) 22 | window = window() 23 | window.show() 24 | sys.exit(app.exec_()) 25 | 26 | if __name__ == '__main__': 27 | main() 28 | -------------------------------------------------------------------------------- /qencoder/av1anworkarounds.py: -------------------------------------------------------------------------------- 1 | from av1an.manager import Manager 2 | from av1an.project import Project 3 | from av1an.startup.setup import startup_check 4 | import json 5 | 6 | def get_default_args(): 7 | return {'input': None, 'temp': None, 'output_file': None, 'mkvmerge': False, 'logging': None, 8 | 'resume': False, 'keep': False, 'config': None, 'webm': False, 'chunk_method': None, 'scenes': None, 9 | 'split_method': 'pyscene', 'extra_split': None, 'threshold': 35, 'min_scene_len': 60, 10 | 'reuse_first_pass': False, 'passes': None, 'video_params': None, 'encoder': 'aom', 'workers': 0, 11 | 'no_check': False, 'force': False, 'vvc_conf': None, 'ffmpeg': '', 'audio_params': '-c:a copy', 12 | 'pix_format': 'yuv420p10le', 'vmaf': False, 'vmaf_path': None, 'vmaf_res': '1920x1080', 'n_threads': None, 13 | 'target_quality': None, 'target_quality_method': 'per_shot', 'probes': 4, 'min_q': None, 'max_q': None, 14 | 'vmaf_plots': False, 'probing_rate': 4, 'vmaf_filter': None, 'quiet': True} 15 | 16 | 17 | def get_av1an_proj(args): 18 | return Project(args) 19 | 20 | 21 | def get_av1an(proj): 22 | startup_check(proj) 23 | return Manager.Main(proj) 24 | 25 | 26 | def run_av1an(manager): 27 | manager.run() 28 | 29 | 30 | def merge_args(dictargs): 31 | args1 = get_default_args() 32 | for key in dictargs: 33 | args1[key] = dictargs[key] 34 | print(args1) 35 | return args1 36 | 37 | 38 | def done_count(temp, resume): 39 | done_path = temp / 'done.json' 40 | if resume and done_path.exists(): 41 | with open(done_path) as done_file: 42 | data = json.load(done_file) 43 | return sum(data['done'].values()) 44 | else: 45 | return 0 46 | -------------------------------------------------------------------------------- /qencoder/mainwindow.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'mainwindow.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.15.0 6 | # 7 | # WARNING: Any manual changes made to this file will be lost when pyuic5 is 8 | # run again. Do not edit this file unless you know what you are doing. 9 | 10 | 11 | from PyQt5 import QtCore, QtGui, QtWidgets 12 | 13 | 14 | class Ui_qencoder(object): 15 | def setupUi(self, qencoder): 16 | qencoder.setObjectName("qencoder") 17 | qencoder.resize(815, 625) 18 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Preferred) 19 | sizePolicy.setHorizontalStretch(0) 20 | sizePolicy.setVerticalStretch(0) 21 | sizePolicy.setHeightForWidth(qencoder.sizePolicy().hasHeightForWidth()) 22 | qencoder.setSizePolicy(sizePolicy) 23 | self.centralwidget = QtWidgets.QWidget(qencoder) 24 | self.centralwidget.setObjectName("centralwidget") 25 | self.gridLayout_3 = QtWidgets.QGridLayout(self.centralwidget) 26 | self.gridLayout_3.setObjectName("gridLayout_3") 27 | self.label_status = QtWidgets.QLabel(self.centralwidget) 28 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) 29 | sizePolicy.setHorizontalStretch(0) 30 | sizePolicy.setVerticalStretch(0) 31 | sizePolicy.setHeightForWidth(self.label_status.sizePolicy().hasHeightForWidth()) 32 | self.label_status.setSizePolicy(sizePolicy) 33 | self.label_status.setMinimumSize(QtCore.QSize(180, 0)) 34 | self.label_status.setStatusTip("") 35 | self.label_status.setText("") 36 | self.label_status.setObjectName("label_status") 37 | self.gridLayout_3.addWidget(self.label_status, 3, 0, 1, 1) 38 | self.gridLayout_4 = QtWidgets.QGridLayout() 39 | self.gridLayout_4.setObjectName("gridLayout_4") 40 | self.outputPath = QtWidgets.QLabel(self.centralwidget) 41 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred) 42 | sizePolicy.setHorizontalStretch(0) 43 | sizePolicy.setVerticalStretch(0) 44 | sizePolicy.setHeightForWidth(self.outputPath.sizePolicy().hasHeightForWidth()) 45 | self.outputPath.setSizePolicy(sizePolicy) 46 | self.outputPath.setText("") 47 | self.outputPath.setTextFormat(QtCore.Qt.PlainText) 48 | self.outputPath.setWordWrap(True) 49 | self.outputPath.setObjectName("outputPath") 50 | self.gridLayout_4.addWidget(self.outputPath, 1, 1, 1, 1) 51 | self.inputFileChoose = QtWidgets.QPushButton(self.centralwidget) 52 | self.inputFileChoose.setMinimumSize(QtCore.QSize(140, 0)) 53 | self.inputFileChoose.setMaximumSize(QtCore.QSize(140, 16777215)) 54 | self.inputFileChoose.setObjectName("inputFileChoose") 55 | self.gridLayout_4.addWidget(self.inputFileChoose, 0, 2, 1, 1) 56 | self.label = QtWidgets.QLabel(self.centralwidget) 57 | self.label.setObjectName("label") 58 | self.gridLayout_4.addWidget(self.label, 0, 0, 1, 1) 59 | self.outputFileChoose = QtWidgets.QPushButton(self.centralwidget) 60 | self.outputFileChoose.setObjectName("outputFileChoose") 61 | self.gridLayout_4.addWidget(self.outputFileChoose, 1, 2, 1, 1) 62 | self.label_5 = QtWidgets.QLabel(self.centralwidget) 63 | self.label_5.setObjectName("label_5") 64 | self.gridLayout_4.addWidget(self.label_5, 1, 0, 1, 1) 65 | self.inputPath = QtWidgets.QLabel(self.centralwidget) 66 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred) 67 | sizePolicy.setHorizontalStretch(0) 68 | sizePolicy.setVerticalStretch(0) 69 | sizePolicy.setHeightForWidth(self.inputPath.sizePolicy().hasHeightForWidth()) 70 | self.inputPath.setSizePolicy(sizePolicy) 71 | self.inputPath.setText("") 72 | self.inputPath.setTextFormat(QtCore.Qt.PlainText) 73 | self.inputPath.setWordWrap(True) 74 | self.inputPath.setObjectName("inputPath") 75 | self.gridLayout_4.addWidget(self.inputPath, 0, 1, 1, 1) 76 | self.gridLayout_3.addLayout(self.gridLayout_4, 0, 0, 1, 4) 77 | self.progressBar_total = QtWidgets.QProgressBar(self.centralwidget) 78 | self.progressBar_total.setEnabled(False) 79 | self.progressBar_total.setProperty("value", 0) 80 | self.progressBar_total.setObjectName("progressBar_total") 81 | self.gridLayout_3.addWidget(self.progressBar_total, 3, 2, 1, 1) 82 | self.pushButton = QtWidgets.QPushButton(self.centralwidget) 83 | self.pushButton.setEnabled(False) 84 | self.pushButton.setMinimumSize(QtCore.QSize(120, 0)) 85 | self.pushButton.setStatusTip("") 86 | self.pushButton.setObjectName("pushButton") 87 | self.gridLayout_3.addWidget(self.pushButton, 3, 3, 1, 1) 88 | self.tabWidget = QtWidgets.QTabWidget(self.centralwidget) 89 | self.tabWidget.setStatusTip("") 90 | self.tabWidget.setObjectName("tabWidget") 91 | self.tab_simple = QtWidgets.QWidget() 92 | self.tab_simple.setObjectName("tab_simple") 93 | self.gridLayout_6 = QtWidgets.QGridLayout(self.tab_simple) 94 | self.gridLayout_6.setObjectName("gridLayout_6") 95 | self.gridLayout_2 = QtWidgets.QGridLayout() 96 | self.gridLayout_2.setObjectName("gridLayout_2") 97 | self.label_preset = QtWidgets.QLabel(self.tab_simple) 98 | self.label_preset.setToolTip("") 99 | self.label_preset.setObjectName("label_preset") 100 | self.gridLayout_2.addWidget(self.label_preset, 1, 2, 1, 1) 101 | self.label_quality = QtWidgets.QLabel(self.tab_simple) 102 | self.label_quality.setToolTip("") 103 | self.label_quality.setObjectName("label_quality") 104 | self.gridLayout_2.addWidget(self.label_quality, 0, 2, 1, 1) 105 | self.checkBox_audio = QtWidgets.QCheckBox(self.tab_simple) 106 | self.checkBox_audio.setMinimumSize(QtCore.QSize(0, 0)) 107 | self.checkBox_audio.setToolTip("") 108 | self.checkBox_audio.setChecked(False) 109 | self.checkBox_audio.setObjectName("checkBox_audio") 110 | self.gridLayout_2.addWidget(self.checkBox_audio, 2, 0, 1, 1) 111 | self.comboBox_quality = QtWidgets.QComboBox(self.tab_simple) 112 | self.comboBox_quality.setToolTip("") 113 | self.comboBox_quality.setObjectName("comboBox_quality") 114 | self.comboBox_quality.addItem("") 115 | self.comboBox_quality.addItem("") 116 | self.comboBox_quality.addItem("") 117 | self.comboBox_quality.addItem("") 118 | self.comboBox_quality.addItem("") 119 | self.comboBox_quality.addItem("") 120 | self.comboBox_quality.addItem("") 121 | self.comboBox_quality.addItem("") 122 | self.comboBox_quality.addItem("") 123 | self.comboBox_quality.addItem("") 124 | self.gridLayout_2.addWidget(self.comboBox_quality, 0, 3, 1, 1) 125 | self.presetbox = QtWidgets.QComboBox(self.tab_simple) 126 | self.presetbox.setToolTip("") 127 | self.presetbox.setObjectName("presetbox") 128 | self.presetbox.addItem("") 129 | self.presetbox.addItem("") 130 | self.presetbox.addItem("") 131 | self.presetbox.addItem("") 132 | self.presetbox.addItem("") 133 | self.presetbox.addItem("") 134 | self.presetbox.addItem("") 135 | self.presetbox.addItem("") 136 | self.presetbox.addItem("") 137 | self.presetbox.addItem("") 138 | self.gridLayout_2.addWidget(self.presetbox, 1, 3, 1, 1) 139 | self.checkBox_twopass = QtWidgets.QCheckBox(self.tab_simple) 140 | self.checkBox_twopass.setToolTip("") 141 | self.checkBox_twopass.setChecked(True) 142 | self.checkBox_twopass.setObjectName("checkBox_twopass") 143 | self.gridLayout_2.addWidget(self.checkBox_twopass, 1, 0, 1, 1) 144 | spacerItem = QtWidgets.QSpacerItem(250, 20, QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Minimum) 145 | self.gridLayout_2.addItem(spacerItem, 2, 1, 1, 1) 146 | self.comboBox_encoder = QtWidgets.QComboBox(self.tab_simple) 147 | self.comboBox_encoder.setObjectName("comboBox_encoder") 148 | self.comboBox_encoder.addItem("") 149 | self.comboBox_encoder.addItem("") 150 | self.comboBox_encoder.addItem("") 151 | self.gridLayout_2.addWidget(self.comboBox_encoder, 3, 3, 1, 1) 152 | self.label_4 = QtWidgets.QLabel(self.tab_simple) 153 | self.label_4.setObjectName("label_4") 154 | self.gridLayout_2.addWidget(self.label_4, 3, 2, 1, 1) 155 | self.label_audio = QtWidgets.QLabel(self.tab_simple) 156 | self.label_audio.setObjectName("label_audio") 157 | self.gridLayout_2.addWidget(self.label_audio, 2, 2, 1, 1) 158 | self.spinBox_audio = QtWidgets.QSpinBox(self.tab_simple) 159 | self.spinBox_audio.setReadOnly(True) 160 | self.spinBox_audio.setMinimum(8) 161 | self.spinBox_audio.setMaximum(480) 162 | self.spinBox_audio.setSingleStep(8) 163 | self.spinBox_audio.setProperty("value", 96) 164 | self.spinBox_audio.setObjectName("spinBox_audio") 165 | self.gridLayout_2.addWidget(self.spinBox_audio, 2, 3, 1, 1) 166 | self.gridLayout_6.addLayout(self.gridLayout_2, 0, 0, 1, 1) 167 | spacerItem1 = QtWidgets.QSpacerItem(20, 242, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 168 | self.gridLayout_6.addItem(spacerItem1, 1, 0, 1, 1) 169 | self.tabWidget.addTab(self.tab_simple, "") 170 | self.tab_advanced = QtWidgets.QWidget() 171 | self.tab_advanced.setObjectName("tab_advanced") 172 | self.gridLayout_5 = QtWidgets.QGridLayout(self.tab_advanced) 173 | self.gridLayout_5.setObjectName("gridLayout_5") 174 | spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 175 | self.gridLayout_5.addItem(spacerItem2, 2, 0, 1, 1) 176 | self.gridLayout = QtWidgets.QGridLayout() 177 | self.gridLayout.setObjectName("gridLayout") 178 | self.spinBox_threads = QtWidgets.QSpinBox(self.tab_advanced) 179 | self.spinBox_threads.setMinimum(1) 180 | self.spinBox_threads.setMaximum(16) 181 | self.spinBox_threads.setProperty("value", 4) 182 | self.spinBox_threads.setObjectName("spinBox_threads") 183 | self.gridLayout.addWidget(self.spinBox_threads, 3, 4, 1, 1) 184 | self.label_2 = QtWidgets.QLabel(self.tab_advanced) 185 | self.label_2.setObjectName("label_2") 186 | self.gridLayout.addWidget(self.label_2, 5, 0, 1, 1) 187 | self.checkBox_rtenc = QtWidgets.QCheckBox(self.tab_advanced) 188 | self.checkBox_rtenc.setObjectName("checkBox_rtenc") 189 | self.gridLayout.addWidget(self.checkBox_rtenc, 5, 3, 1, 1) 190 | self.checkBox_bitrate = QtWidgets.QCheckBox(self.tab_advanced) 191 | self.checkBox_bitrate.setObjectName("checkBox_bitrate") 192 | self.gridLayout.addWidget(self.checkBox_bitrate, 0, 3, 1, 1) 193 | self.label_threads = QtWidgets.QLabel(self.tab_advanced) 194 | self.label_threads.setObjectName("label_threads") 195 | self.gridLayout.addWidget(self.label_threads, 3, 3, 1, 1) 196 | spacerItem3 = QtWidgets.QSpacerItem(140, 20, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Minimum) 197 | self.gridLayout.addItem(spacerItem3, 4, 2, 1, 1) 198 | self.label_6 = QtWidgets.QLabel(self.tab_advanced) 199 | self.label_6.setObjectName("label_6") 200 | self.gridLayout.addWidget(self.label_6, 3, 0, 1, 1) 201 | self.spinBox_speed = QtWidgets.QSpinBox(self.tab_advanced) 202 | self.spinBox_speed.setMaximum(8) 203 | self.spinBox_speed.setProperty("value", 4) 204 | self.spinBox_speed.setObjectName("spinBox_speed") 205 | self.gridLayout.addWidget(self.spinBox_speed, 3, 1, 1, 1) 206 | self.spinBox_quality = QtWidgets.QSpinBox(self.tab_advanced) 207 | self.spinBox_quality.setMinimum(0) 208 | self.spinBox_quality.setMaximum(63) 209 | self.spinBox_quality.setProperty("value", 28) 210 | self.spinBox_quality.setObjectName("spinBox_quality") 211 | self.gridLayout.addWidget(self.spinBox_quality, 0, 1, 1, 1) 212 | self.lineEdit_colordata = QtWidgets.QLineEdit(self.tab_advanced) 213 | self.lineEdit_colordata.setEnabled(False) 214 | self.lineEdit_colordata.setText("") 215 | self.lineEdit_colordata.setObjectName("lineEdit_colordata") 216 | self.gridLayout.addWidget(self.lineEdit_colordata, 6, 0, 1, 5) 217 | self.label_split = QtWidgets.QLabel(self.tab_advanced) 218 | self.label_split.setObjectName("label_split") 219 | self.gridLayout.addWidget(self.label_split, 1, 0, 1, 1) 220 | self.label_inputformat = QtWidgets.QLabel(self.tab_advanced) 221 | self.label_inputformat.setObjectName("label_inputformat") 222 | self.gridLayout.addWidget(self.label_inputformat, 4, 0, 1, 1) 223 | self.checkBox_resume = QtWidgets.QCheckBox(self.tab_advanced) 224 | self.checkBox_resume.setChecked(True) 225 | self.checkBox_resume.setObjectName("checkBox_resume") 226 | self.gridLayout.addWidget(self.checkBox_resume, 4, 3, 1, 1) 227 | self.checkBox_tempfolder = QtWidgets.QCheckBox(self.tab_advanced) 228 | self.checkBox_tempfolder.setObjectName("checkBox_tempfolder") 229 | self.gridLayout.addWidget(self.checkBox_tempfolder, 5, 4, 1, 1) 230 | self.label_q = QtWidgets.QLabel(self.tab_advanced) 231 | self.label_q.setObjectName("label_q") 232 | self.gridLayout.addWidget(self.label_q, 0, 0, 1, 1) 233 | self.label_jobs = QtWidgets.QLabel(self.tab_advanced) 234 | self.label_jobs.setObjectName("label_jobs") 235 | self.gridLayout.addWidget(self.label_jobs, 2, 0, 1, 1) 236 | self.comboBox_inputFormat = QtWidgets.QComboBox(self.tab_advanced) 237 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) 238 | sizePolicy.setHorizontalStretch(0) 239 | sizePolicy.setVerticalStretch(0) 240 | sizePolicy.setHeightForWidth(self.comboBox_inputFormat.sizePolicy().hasHeightForWidth()) 241 | self.comboBox_inputFormat.setSizePolicy(sizePolicy) 242 | self.comboBox_inputFormat.setMinimumSize(QtCore.QSize(150, 0)) 243 | self.comboBox_inputFormat.setObjectName("comboBox_inputFormat") 244 | self.comboBox_inputFormat.addItem("") 245 | self.comboBox_inputFormat.addItem("") 246 | self.comboBox_inputFormat.addItem("") 247 | self.comboBox_inputFormat.addItem("") 248 | self.comboBox_inputFormat.addItem("") 249 | self.comboBox_inputFormat.addItem("") 250 | self.comboBox_inputFormat.addItem("") 251 | self.comboBox_inputFormat.addItem("") 252 | self.comboBox_inputFormat.addItem("") 253 | self.gridLayout.addWidget(self.comboBox_inputFormat, 4, 1, 1, 1) 254 | self.checkBox_hdr = QtWidgets.QCheckBox(self.tab_advanced) 255 | self.checkBox_hdr.setObjectName("checkBox_hdr") 256 | self.gridLayout.addWidget(self.checkBox_hdr, 4, 4, 1, 1) 257 | self.spinBox_jobs = QtWidgets.QSpinBox(self.tab_advanced) 258 | self.spinBox_jobs.setMinimum(0) 259 | self.spinBox_jobs.setMaximum(128) 260 | self.spinBox_jobs.setSingleStep(1) 261 | self.spinBox_jobs.setProperty("value", 0) 262 | self.spinBox_jobs.setObjectName("spinBox_jobs") 263 | self.gridLayout.addWidget(self.spinBox_jobs, 2, 1, 1, 1) 264 | self.comboBox_colorspace = QtWidgets.QComboBox(self.tab_advanced) 265 | self.comboBox_colorspace.setObjectName("comboBox_colorspace") 266 | self.comboBox_colorspace.addItem("") 267 | self.comboBox_colorspace.addItem("") 268 | self.comboBox_colorspace.addItem("") 269 | self.comboBox_colorspace.addItem("") 270 | self.comboBox_colorspace.addItem("") 271 | self.gridLayout.addWidget(self.comboBox_colorspace, 5, 1, 1, 1) 272 | self.label_maxkfdist = QtWidgets.QLabel(self.tab_advanced) 273 | self.label_maxkfdist.setObjectName("label_maxkfdist") 274 | self.gridLayout.addWidget(self.label_maxkfdist, 1, 3, 1, 1) 275 | self.spinBox_maxkfdist = QtWidgets.QSpinBox(self.tab_advanced) 276 | self.spinBox_maxkfdist.setMaximum(9998) 277 | self.spinBox_maxkfdist.setSingleStep(10) 278 | self.spinBox_maxkfdist.setProperty("value", 240) 279 | self.spinBox_maxkfdist.setObjectName("spinBox_maxkfdist") 280 | self.gridLayout.addWidget(self.spinBox_maxkfdist, 1, 4, 1, 1) 281 | self.label_splitmode = QtWidgets.QLabel(self.tab_advanced) 282 | self.label_splitmode.setObjectName("label_splitmode") 283 | self.gridLayout.addWidget(self.label_splitmode, 2, 3, 1, 1) 284 | self.comboBox_splitmode = QtWidgets.QComboBox(self.tab_advanced) 285 | self.comboBox_splitmode.setObjectName("comboBox_splitmode") 286 | self.comboBox_splitmode.addItem("") 287 | self.comboBox_splitmode.addItem("") 288 | self.comboBox_splitmode.addItem("") 289 | self.gridLayout.addWidget(self.comboBox_splitmode, 2, 4, 1, 1) 290 | self.doubleSpinBox_split = QtWidgets.QDoubleSpinBox(self.tab_advanced) 291 | self.doubleSpinBox_split.setDecimals(3) 292 | self.doubleSpinBox_split.setMaximum(1.0) 293 | self.doubleSpinBox_split.setSingleStep(0.01) 294 | self.doubleSpinBox_split.setProperty("value", 0.3) 295 | self.doubleSpinBox_split.setObjectName("doubleSpinBox_split") 296 | self.gridLayout.addWidget(self.doubleSpinBox_split, 1, 1, 1, 1) 297 | self.gridLayout_5.addLayout(self.gridLayout, 1, 0, 1, 1) 298 | self.tabWidget.addTab(self.tab_advanced, "") 299 | self.tab_dimensions = QtWidgets.QWidget() 300 | self.tab_dimensions.setObjectName("tab_dimensions") 301 | self.gridLayout_10 = QtWidgets.QGridLayout(self.tab_dimensions) 302 | self.gridLayout_10.setObjectName("gridLayout_10") 303 | spacerItem4 = QtWidgets.QSpacerItem(10, 20, QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Minimum) 304 | self.gridLayout_10.addItem(spacerItem4, 1, 2, 1, 1) 305 | spacerItem5 = QtWidgets.QSpacerItem(10, 20, QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Minimum) 306 | self.gridLayout_10.addItem(spacerItem5, 1, 0, 1, 1) 307 | self.gridLayout_9 = QtWidgets.QGridLayout() 308 | self.gridLayout_9.setObjectName("gridLayout_9") 309 | self.spinBox_xres = QtWidgets.QSpinBox(self.tab_dimensions) 310 | self.spinBox_xres.setMinimum(1) 311 | self.spinBox_xres.setMaximum(9999) 312 | self.spinBox_xres.setSingleStep(2) 313 | self.spinBox_xres.setProperty("value", 1920) 314 | self.spinBox_xres.setObjectName("spinBox_xres") 315 | self.gridLayout_9.addWidget(self.spinBox_xres, 1, 5, 1, 1) 316 | self.label_yres = QtWidgets.QLabel(self.tab_dimensions) 317 | self.label_yres.setObjectName("label_yres") 318 | self.gridLayout_9.addWidget(self.label_yres, 2, 4, 1, 1) 319 | self.spinBox_cropdown = QtWidgets.QSpinBox(self.tab_dimensions) 320 | self.spinBox_cropdown.setMaximum(9999) 321 | self.spinBox_cropdown.setSingleStep(2) 322 | self.spinBox_cropdown.setObjectName("spinBox_cropdown") 323 | self.gridLayout_9.addWidget(self.spinBox_cropdown, 3, 1, 1, 1) 324 | self.checkBox_rescale = QtWidgets.QCheckBox(self.tab_dimensions) 325 | self.checkBox_rescale.setObjectName("checkBox_rescale") 326 | self.gridLayout_9.addWidget(self.checkBox_rescale, 0, 5, 1, 1) 327 | spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 328 | self.gridLayout_9.addItem(spacerItem6, 1, 3, 1, 1) 329 | self.spinBox_cropright = QtWidgets.QSpinBox(self.tab_dimensions) 330 | self.spinBox_cropright.setMaximum(9999) 331 | self.spinBox_cropright.setSingleStep(2) 332 | self.spinBox_cropright.setObjectName("spinBox_cropright") 333 | self.gridLayout_9.addWidget(self.spinBox_cropright, 2, 2, 1, 1) 334 | self.checkBox_cropping = QtWidgets.QCheckBox(self.tab_dimensions) 335 | self.checkBox_cropping.setObjectName("checkBox_cropping") 336 | self.gridLayout_9.addWidget(self.checkBox_cropping, 0, 1, 1, 1) 337 | self.spinBox_croptop = QtWidgets.QSpinBox(self.tab_dimensions) 338 | self.spinBox_croptop.setMaximum(9999) 339 | self.spinBox_croptop.setSingleStep(2) 340 | self.spinBox_croptop.setObjectName("spinBox_croptop") 341 | self.gridLayout_9.addWidget(self.spinBox_croptop, 1, 1, 1, 1) 342 | self.spinBox_yres = QtWidgets.QSpinBox(self.tab_dimensions) 343 | self.spinBox_yres.setMinimum(1) 344 | self.spinBox_yres.setMaximum(9999) 345 | self.spinBox_yres.setSingleStep(2) 346 | self.spinBox_yres.setProperty("value", 1080) 347 | self.spinBox_yres.setObjectName("spinBox_yres") 348 | self.gridLayout_9.addWidget(self.spinBox_yres, 2, 5, 1, 1) 349 | self.label_xres = QtWidgets.QLabel(self.tab_dimensions) 350 | self.label_xres.setObjectName("label_xres") 351 | self.gridLayout_9.addWidget(self.label_xres, 1, 4, 1, 1) 352 | self.spinBox_cropleft = QtWidgets.QSpinBox(self.tab_dimensions) 353 | self.spinBox_cropleft.setMaximum(9999) 354 | self.spinBox_cropleft.setSingleStep(2) 355 | self.spinBox_cropleft.setObjectName("spinBox_cropleft") 356 | self.gridLayout_9.addWidget(self.spinBox_cropleft, 2, 0, 1, 1) 357 | self.gridLayout_10.addLayout(self.gridLayout_9, 1, 1, 1, 1) 358 | spacerItem7 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 359 | self.gridLayout_10.addItem(spacerItem7, 2, 1, 1, 1) 360 | spacerItem8 = QtWidgets.QSpacerItem(20, 10, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum) 361 | self.gridLayout_10.addItem(spacerItem8, 0, 1, 1, 1) 362 | self.tabWidget.addTab(self.tab_dimensions, "") 363 | self.tab_experimental = QtWidgets.QWidget() 364 | self.tab_experimental.setObjectName("tab_experimental") 365 | self.gridLayout_11 = QtWidgets.QGridLayout(self.tab_experimental) 366 | self.gridLayout_11.setObjectName("gridLayout_11") 367 | self.label_vmafpath = QtWidgets.QLabel(self.tab_experimental) 368 | self.label_vmafpath.setEnabled(False) 369 | self.label_vmafpath.setText("") 370 | self.label_vmafpath.setObjectName("label_vmafpath") 371 | self.gridLayout_11.addWidget(self.label_vmafpath, 2, 3, 1, 7) 372 | self.spinBox_minq = QtWidgets.QSpinBox(self.tab_experimental) 373 | self.spinBox_minq.setEnabled(False) 374 | self.spinBox_minq.setMaximum(62) 375 | self.spinBox_minq.setProperty("value", 15) 376 | self.spinBox_minq.setObjectName("spinBox_minq") 377 | self.gridLayout_11.addWidget(self.spinBox_minq, 0, 4, 1, 1) 378 | self.checkBox_vmaf = QtWidgets.QCheckBox(self.tab_experimental) 379 | self.checkBox_vmaf.setObjectName("checkBox_vmaf") 380 | self.gridLayout_11.addWidget(self.checkBox_vmaf, 0, 0, 1, 2) 381 | self.label_qmin = QtWidgets.QLabel(self.tab_experimental) 382 | self.label_qmin.setEnabled(False) 383 | self.label_qmin.setObjectName("label_qmin") 384 | self.gridLayout_11.addWidget(self.label_qmin, 0, 3, 1, 1) 385 | self.label_teststeps = QtWidgets.QLabel(self.tab_experimental) 386 | self.label_teststeps.setEnabled(False) 387 | self.label_teststeps.setObjectName("label_teststeps") 388 | self.gridLayout_11.addWidget(self.label_teststeps, 0, 6, 1, 1) 389 | self.spinBox_vmafsteps = QtWidgets.QSpinBox(self.tab_experimental) 390 | self.spinBox_vmafsteps.setEnabled(False) 391 | self.spinBox_vmafsteps.setMinimum(1) 392 | self.spinBox_vmafsteps.setMaximum(63) 393 | self.spinBox_vmafsteps.setProperty("value", 5) 394 | self.spinBox_vmafsteps.setObjectName("spinBox_vmafsteps") 395 | self.gridLayout_11.addWidget(self.spinBox_vmafsteps, 0, 7, 1, 1) 396 | spacerItem9 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 397 | self.gridLayout_11.addItem(spacerItem9, 4, 0, 1, 1) 398 | self.checkBox_shutdown = QtWidgets.QCheckBox(self.tab_experimental) 399 | self.checkBox_shutdown.setObjectName("checkBox_shutdown") 400 | self.gridLayout_11.addWidget(self.checkBox_shutdown, 3, 0, 1, 4) 401 | self.checkBox_lsmash = QtWidgets.QCheckBox(self.tab_experimental) 402 | self.checkBox_lsmash.setObjectName("checkBox_lsmash") 403 | self.gridLayout_11.addWidget(self.checkBox_lsmash, 3, 4, 1, 4) 404 | spacerItem10 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 405 | self.gridLayout_11.addItem(spacerItem10, 0, 5, 1, 1) 406 | self.doubleSpinBox_vmaf = QtWidgets.QDoubleSpinBox(self.tab_experimental) 407 | self.doubleSpinBox_vmaf.setEnabled(False) 408 | self.doubleSpinBox_vmaf.setSingleStep(0.1) 409 | self.doubleSpinBox_vmaf.setProperty("value", 92.0) 410 | self.doubleSpinBox_vmaf.setObjectName("doubleSpinBox_vmaf") 411 | self.gridLayout_11.addWidget(self.doubleSpinBox_vmaf, 0, 10, 1, 1) 412 | spacerItem11 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 413 | self.gridLayout_11.addItem(spacerItem11, 0, 2, 1, 1) 414 | spacerItem12 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 415 | self.gridLayout_11.addItem(spacerItem12, 0, 8, 1, 1) 416 | self.pushButton_vmafmodel = QtWidgets.QPushButton(self.tab_experimental) 417 | self.pushButton_vmafmodel.setEnabled(False) 418 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed) 419 | sizePolicy.setHorizontalStretch(0) 420 | sizePolicy.setVerticalStretch(0) 421 | sizePolicy.setHeightForWidth(self.pushButton_vmafmodel.sizePolicy().hasHeightForWidth()) 422 | self.pushButton_vmafmodel.setSizePolicy(sizePolicy) 423 | self.pushButton_vmafmodel.setMinimumSize(QtCore.QSize(110, 0)) 424 | self.pushButton_vmafmodel.setObjectName("pushButton_vmafmodel") 425 | self.gridLayout_11.addWidget(self.pushButton_vmafmodel, 2, 10, 1, 1) 426 | self.label_target = QtWidgets.QLabel(self.tab_experimental) 427 | self.label_target.setEnabled(False) 428 | self.label_target.setObjectName("label_target") 429 | self.gridLayout_11.addWidget(self.label_target, 0, 9, 1, 1) 430 | self.spinBox_maxq = QtWidgets.QSpinBox(self.tab_experimental) 431 | self.spinBox_maxq.setEnabled(False) 432 | self.spinBox_maxq.setMinimum(1) 433 | self.spinBox_maxq.setMaximum(63) 434 | self.spinBox_maxq.setProperty("value", 60) 435 | self.spinBox_maxq.setObjectName("spinBox_maxq") 436 | self.gridLayout_11.addWidget(self.spinBox_maxq, 1, 4, 1, 1) 437 | self.label_maxq = QtWidgets.QLabel(self.tab_experimental) 438 | self.label_maxq.setEnabled(False) 439 | self.label_maxq.setObjectName("label_maxq") 440 | self.gridLayout_11.addWidget(self.label_maxq, 1, 3, 1, 1) 441 | self.tabWidget.addTab(self.tab_experimental, "") 442 | self.tab_custom = QtWidgets.QWidget() 443 | self.tab_custom.setObjectName("tab_custom") 444 | self.gridLayout_7 = QtWidgets.QGridLayout(self.tab_custom) 445 | self.gridLayout_7.setObjectName("gridLayout_7") 446 | self.label_3 = QtWidgets.QLabel(self.tab_custom) 447 | self.label_3.setObjectName("label_3") 448 | self.gridLayout_7.addWidget(self.label_3, 0, 0, 1, 2) 449 | self.checkBox_videocmd = QtWidgets.QCheckBox(self.tab_custom) 450 | self.checkBox_videocmd.setObjectName("checkBox_videocmd") 451 | self.gridLayout_7.addWidget(self.checkBox_videocmd, 1, 0, 1, 1) 452 | self.textEdit_videocmd = QtWidgets.QTextEdit(self.tab_custom) 453 | self.textEdit_videocmd.setEnabled(False) 454 | self.textEdit_videocmd.setAcceptRichText(False) 455 | self.textEdit_videocmd.setObjectName("textEdit_videocmd") 456 | self.gridLayout_7.addWidget(self.textEdit_videocmd, 1, 1, 1, 1) 457 | self.checkBox_audiocmd = QtWidgets.QCheckBox(self.tab_custom) 458 | self.checkBox_audiocmd.setObjectName("checkBox_audiocmd") 459 | self.gridLayout_7.addWidget(self.checkBox_audiocmd, 2, 0, 1, 1) 460 | self.textEdit_audiocmd = QtWidgets.QTextEdit(self.tab_custom) 461 | self.textEdit_audiocmd.setEnabled(False) 462 | self.textEdit_audiocmd.setAcceptRichText(False) 463 | self.textEdit_audiocmd.setObjectName("textEdit_audiocmd") 464 | self.gridLayout_7.addWidget(self.textEdit_audiocmd, 2, 1, 1, 1) 465 | self.checkBox_ffmpegcmd = QtWidgets.QCheckBox(self.tab_custom) 466 | self.checkBox_ffmpegcmd.setObjectName("checkBox_ffmpegcmd") 467 | self.gridLayout_7.addWidget(self.checkBox_ffmpegcmd, 3, 0, 1, 1) 468 | self.textEdit_ffmpegcmd = QtWidgets.QTextEdit(self.tab_custom) 469 | self.textEdit_ffmpegcmd.setEnabled(False) 470 | self.textEdit_ffmpegcmd.setAcceptRichText(False) 471 | self.textEdit_ffmpegcmd.setObjectName("textEdit_ffmpegcmd") 472 | self.gridLayout_7.addWidget(self.textEdit_ffmpegcmd, 3, 1, 1, 1) 473 | self.tabWidget.addTab(self.tab_custom, "") 474 | self.tab_queue = QtWidgets.QWidget() 475 | self.tab_queue.setObjectName("tab_queue") 476 | self.gridLayout_8 = QtWidgets.QGridLayout(self.tab_queue) 477 | self.gridLayout_8.setObjectName("gridLayout_8") 478 | self.pushButton_save = QtWidgets.QPushButton(self.tab_queue) 479 | self.pushButton_save.setObjectName("pushButton_save") 480 | self.gridLayout_8.addWidget(self.pushButton_save, 0, 0, 1, 1) 481 | self.pushButton_up = QtWidgets.QPushButton(self.tab_queue) 482 | self.pushButton_up.setObjectName("pushButton_up") 483 | self.gridLayout_8.addWidget(self.pushButton_up, 0, 4, 1, 1) 484 | spacerItem13 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) 485 | self.gridLayout_8.addItem(spacerItem13, 0, 6, 1, 1) 486 | self.pushButton_edit = QtWidgets.QPushButton(self.tab_queue) 487 | self.pushButton_edit.setObjectName("pushButton_edit") 488 | self.gridLayout_8.addWidget(self.pushButton_edit, 0, 3, 1, 1) 489 | self.pushButton_down = QtWidgets.QPushButton(self.tab_queue) 490 | self.pushButton_down.setObjectName("pushButton_down") 491 | self.gridLayout_8.addWidget(self.pushButton_down, 0, 5, 1, 1) 492 | spacerItem14 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 493 | self.gridLayout_8.addItem(spacerItem14, 0, 2, 1, 1) 494 | self.pushButton_encQueue = QtWidgets.QPushButton(self.tab_queue) 495 | self.pushButton_encQueue.setObjectName("pushButton_encQueue") 496 | self.gridLayout_8.addWidget(self.pushButton_encQueue, 2, 7, 1, 1) 497 | self.pushButton_del = QtWidgets.QPushButton(self.tab_queue) 498 | self.pushButton_del.setObjectName("pushButton_del") 499 | self.gridLayout_8.addWidget(self.pushButton_del, 0, 7, 1, 1) 500 | self.label_queueprog = QtWidgets.QLabel(self.tab_queue) 501 | self.label_queueprog.setText("") 502 | self.label_queueprog.setObjectName("label_queueprog") 503 | self.gridLayout_8.addWidget(self.label_queueprog, 0, 1, 1, 1) 504 | self.listWidget = QtWidgets.QListWidget(self.tab_queue) 505 | self.listWidget.setObjectName("listWidget") 506 | self.gridLayout_8.addWidget(self.listWidget, 1, 0, 1, 8) 507 | self.spinBox_qjobs = QtWidgets.QSpinBox(self.tab_queue) 508 | self.spinBox_qjobs.setMinimum(1) 509 | self.spinBox_qjobs.setMaximum(128) 510 | self.spinBox_qjobs.setObjectName("spinBox_qjobs") 511 | self.gridLayout_8.addWidget(self.spinBox_qjobs, 2, 2, 1, 1) 512 | self.label_qjobs = QtWidgets.QLabel(self.tab_queue) 513 | self.label_qjobs.setObjectName("label_qjobs") 514 | self.gridLayout_8.addWidget(self.label_qjobs, 2, 0, 1, 1) 515 | self.tabWidget.addTab(self.tab_queue, "") 516 | self.gridLayout_3.addWidget(self.tabWidget, 2, 0, 1, 4) 517 | qencoder.setCentralWidget(self.centralwidget) 518 | self.menubar = QtWidgets.QMenuBar(qencoder) 519 | self.menubar.setGeometry(QtCore.QRect(0, 0, 815, 27)) 520 | self.menubar.setObjectName("menubar") 521 | self.menuFile = QtWidgets.QMenu(self.menubar) 522 | self.menuFile.setObjectName("menuFile") 523 | self.menuPreset = QtWidgets.QMenu(self.menubar) 524 | self.menuPreset.setObjectName("menuPreset") 525 | self.menuQueue = QtWidgets.QMenu(self.menubar) 526 | self.menuQueue.setObjectName("menuQueue") 527 | qencoder.setMenuBar(self.menubar) 528 | self.statusbar = QtWidgets.QStatusBar(qencoder) 529 | self.statusbar.setObjectName("statusbar") 530 | qencoder.setStatusBar(self.statusbar) 531 | self.actionOpen = QtWidgets.QAction(qencoder) 532 | self.actionOpen.setObjectName("actionOpen") 533 | self.actionSave = QtWidgets.QAction(qencoder) 534 | self.actionSave.setObjectName("actionSave") 535 | self.actionExit = QtWidgets.QAction(qencoder) 536 | self.actionExit.setObjectName("actionExit") 537 | self.actionOpen_Preset = QtWidgets.QAction(qencoder) 538 | self.actionOpen_Preset.setObjectName("actionOpen_Preset") 539 | self.actionSave_Preset = QtWidgets.QAction(qencoder) 540 | self.actionSave_Preset.setObjectName("actionSave_Preset") 541 | self.actionOpen_Queue = QtWidgets.QAction(qencoder) 542 | self.actionOpen_Queue.setObjectName("actionOpen_Queue") 543 | self.actionSave_Queue = QtWidgets.QAction(qencoder) 544 | self.actionSave_Queue.setObjectName("actionSave_Queue") 545 | self.actionSave_Queue_As = QtWidgets.QAction(qencoder) 546 | self.actionSave_Queue_As.setObjectName("actionSave_Queue_As") 547 | self.actionReset_All_Settings = QtWidgets.QAction(qencoder) 548 | self.actionReset_All_Settings.setObjectName("actionReset_All_Settings") 549 | self.actionAdd_folder_to_queue = QtWidgets.QAction(qencoder) 550 | self.actionAdd_folder_to_queue.setObjectName("actionAdd_folder_to_queue") 551 | self.menuFile.addAction(self.actionOpen) 552 | self.menuFile.addAction(self.actionSave) 553 | self.menuFile.addSeparator() 554 | self.menuFile.addAction(self.actionExit) 555 | self.menuPreset.addAction(self.actionOpen_Preset) 556 | self.menuPreset.addAction(self.actionSave_Preset) 557 | self.menuPreset.addAction(self.actionReset_All_Settings) 558 | self.menuQueue.addAction(self.actionOpen_Queue) 559 | self.menuQueue.addAction(self.actionSave_Queue) 560 | self.menuQueue.addAction(self.actionSave_Queue_As) 561 | self.menuQueue.addSeparator() 562 | self.menuQueue.addAction(self.actionAdd_folder_to_queue) 563 | self.menubar.addAction(self.menuFile.menuAction()) 564 | self.menubar.addAction(self.menuPreset.menuAction()) 565 | self.menubar.addAction(self.menuQueue.menuAction()) 566 | 567 | self.retranslateUi(qencoder) 568 | self.tabWidget.setCurrentIndex(0) 569 | self.comboBox_quality.setCurrentIndex(3) 570 | self.presetbox.setCurrentIndex(4) 571 | QtCore.QMetaObject.connectSlotsByName(qencoder) 572 | 573 | def retranslateUi(self, qencoder): 574 | _translate = QtCore.QCoreApplication.translate 575 | qencoder.setWindowTitle(_translate("qencoder", "qencoder")) 576 | self.inputFileChoose.setText(_translate("qencoder", "Open...")) 577 | self.label.setText(_translate("qencoder", "Source")) 578 | self.outputFileChoose.setText(_translate("qencoder", "Save to...")) 579 | self.label_5.setText(_translate("qencoder", "Output")) 580 | self.progressBar_total.setStatusTip(_translate("qencoder", "Progress only updates during second pass")) 581 | self.pushButton.setText(_translate("qencoder", "▶ Encode")) 582 | self.label_preset.setStatusTip(_translate("qencoder", "Faster presets take more space at a given quality. \'medium\' is usually best.")) 583 | self.label_preset.setText(_translate("qencoder", "Speed Preset")) 584 | self.label_quality.setStatusTip(_translate("qencoder", "The final quality of your output video. If unsure, use 26.")) 585 | self.label_quality.setText(_translate("qencoder", "Quality Preset")) 586 | self.checkBox_audio.setStatusTip(_translate("qencoder", "Reencode source audio as opus (otherwise will copy existing audio if any is present)")) 587 | self.checkBox_audio.setText(_translate("qencoder", "Reencode Audio")) 588 | self.comboBox_quality.setStatusTip(_translate("qencoder", "The final quality of your output video. If unsure, use 26.")) 589 | self.comboBox_quality.setItemText(0, _translate("qencoder", "Ultra low (crf 40)")) 590 | self.comboBox_quality.setItemText(1, _translate("qencoder", "Very low (crf 36)")) 591 | self.comboBox_quality.setItemText(2, _translate("qencoder", "Low (crf 32)")) 592 | self.comboBox_quality.setItemText(3, _translate("qencoder", "Medium (crf 28)")) 593 | self.comboBox_quality.setItemText(4, _translate("qencoder", "Good (crf 26)")) 594 | self.comboBox_quality.setItemText(5, _translate("qencoder", "Very Good (crf 24)")) 595 | self.comboBox_quality.setItemText(6, _translate("qencoder", "Amazing (crf 20)")) 596 | self.comboBox_quality.setItemText(7, _translate("qencoder", "Effectively Lossless (crf 10)")) 597 | self.comboBox_quality.setItemText(8, _translate("qencoder", "Lossless (crf 0)")) 598 | self.comboBox_quality.setItemText(9, _translate("qencoder", "Custom")) 599 | self.presetbox.setStatusTip(_translate("qencoder", "Faster presets take more space at a given quality. \'medium\' is usually best.")) 600 | self.presetbox.setItemText(0, _translate("qencoder", "Ultra fast")) 601 | self.presetbox.setItemText(1, _translate("qencoder", "Super fast")) 602 | self.presetbox.setItemText(2, _translate("qencoder", "Faster")) 603 | self.presetbox.setItemText(3, _translate("qencoder", "Fast")) 604 | self.presetbox.setItemText(4, _translate("qencoder", "Medium")) 605 | self.presetbox.setItemText(5, _translate("qencoder", "Slow")) 606 | self.presetbox.setItemText(6, _translate("qencoder", "Slower")) 607 | self.presetbox.setItemText(7, _translate("qencoder", "Very slow")) 608 | self.presetbox.setItemText(8, _translate("qencoder", "Placebo")) 609 | self.presetbox.setItemText(9, _translate("qencoder", "Custom")) 610 | self.checkBox_twopass.setStatusTip(_translate("qencoder", "Use twopass encoding. Highly recommended when possible.")) 611 | self.checkBox_twopass.setText(_translate("qencoder", "Two Pass")) 612 | self.comboBox_encoder.setStatusTip(_translate("qencoder", "av1 is the most modern/efficient. vp9/8 have good compatibility/speed.")) 613 | self.comboBox_encoder.setItemText(0, _translate("qencoder", "av1")) 614 | self.comboBox_encoder.setItemText(1, _translate("qencoder", "vp9")) 615 | self.comboBox_encoder.setItemText(2, _translate("qencoder", "vp8")) 616 | self.label_4.setStatusTip(_translate("qencoder", "av1 is the most modern/efficient. vp9/8 have good compatibility/speed.")) 617 | self.label_4.setText(_translate("qencoder", "Video Codec")) 618 | self.label_audio.setStatusTip(_translate("qencoder", "With 2 channel stereo, 96kbps is usually close to transparent for movies.")) 619 | self.label_audio.setText(_translate("qencoder", "Audio Bitrate (kbps)")) 620 | self.spinBox_audio.setStatusTip(_translate("qencoder", "With 2 channel stereo, 96kbps is usually close to transparent for movies.")) 621 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_simple), _translate("qencoder", "Simple Settings")) 622 | self.spinBox_threads.setStatusTip(_translate("qencoder", "Fewer threads per job and more jobs is usually recommended.")) 623 | self.label_2.setStatusTip(_translate("qencoder", "The input colordata for your video. Leave default if unsure.")) 624 | self.label_2.setText(_translate("qencoder", "Input Colordata")) 625 | self.checkBox_rtenc.setStatusTip(_translate("qencoder", "Encode with RT preset. Not recommended for cpu-used <=6.")) 626 | self.checkBox_rtenc.setText(_translate("qencoder", "Realtime Encoding")) 627 | self.checkBox_bitrate.setStatusTip(_translate("qencoder", "Use bitrate instead of q factor. Ideal if aiming for specific filesize. Identical to q in efficiency.")) 628 | self.checkBox_bitrate.setText(_translate("qencoder", "Use Bitrate")) 629 | self.label_threads.setStatusTip(_translate("qencoder", "Fewer threads per job and more jobs is usually recommended.")) 630 | self.label_threads.setText(_translate("qencoder", "Threads Per Job")) 631 | self.label_6.setStatusTip(_translate("qencoder", "Encoder speed preset. Lower means a slower speed. Does not affect actual cpu usage.")) 632 | self.label_6.setText(_translate("qencoder", "cpu-used (speed)")) 633 | self.spinBox_speed.setStatusTip(_translate("qencoder", "Encoder speed preset. Lower means a slower speed. Does not affect actual cpu usage.")) 634 | self.spinBox_quality.setStatusTip(_translate("qencoder", "Q factor: quality of video (lower numbers = more quality). Bitrate: target video kbps to use.")) 635 | self.label_split.setStatusTip(_translate("qencoder", "0-1 for ffmpeg, 0-100 for scenedetect. Lower=more splits made. Suggested value ~30%")) 636 | self.label_split.setText(_translate("qencoder", "Split threshold")) 637 | self.label_inputformat.setStatusTip(_translate("qencoder", "Pixel format of input. Usually yuv420p (8b) or yuv420p10le (10b). If unsure leave default.")) 638 | self.label_inputformat.setText(_translate("qencoder", "Input Format")) 639 | self.checkBox_resume.setStatusTip(_translate("qencoder", "If qencoder closed prematurely, resume previous encode.")) 640 | self.checkBox_resume.setText(_translate("qencoder", "Resume Encode")) 641 | self.checkBox_tempfolder.setStatusTip(_translate("qencoder", "Do not delete temp after running an encode.")) 642 | self.checkBox_tempfolder.setText(_translate("qencoder", "Keep temp folder")) 643 | self.label_q.setStatusTip(_translate("qencoder", "Constant rate factor (Q): quality of video (lower numbers = more quality). Bitrate: target video kbps to use.")) 644 | self.label_q.setText(_translate("qencoder", "CRF")) 645 | self.label_jobs.setStatusTip(_translate("qencoder", "Encode jobs to run. 0=as many as cpu cores. Lower if ram usage too high.")) 646 | self.label_jobs.setText(_translate("qencoder", "Jobs")) 647 | self.comboBox_inputFormat.setStatusTip(_translate("qencoder", "Pixel format of input. Usually yuv420p (8b) or yuv420p10le (10b). If unsure leave default.")) 648 | self.comboBox_inputFormat.setItemText(0, _translate("qencoder", "yuv420p")) 649 | self.comboBox_inputFormat.setItemText(1, _translate("qencoder", "yuv420p10le")) 650 | self.comboBox_inputFormat.setItemText(2, _translate("qencoder", "yuv420p12le")) 651 | self.comboBox_inputFormat.setItemText(3, _translate("qencoder", "yuv422p")) 652 | self.comboBox_inputFormat.setItemText(4, _translate("qencoder", "yuv422p10le")) 653 | self.comboBox_inputFormat.setItemText(5, _translate("qencoder", "yuv422p12le")) 654 | self.comboBox_inputFormat.setItemText(6, _translate("qencoder", "yuv444p")) 655 | self.comboBox_inputFormat.setItemText(7, _translate("qencoder", "yuv444p10le")) 656 | self.comboBox_inputFormat.setItemText(8, _translate("qencoder", "yuv444p12le")) 657 | self.checkBox_hdr.setStatusTip(_translate("qencoder", "Use 10 bit colorspace for output video. Greatly reduces banding and improves efficiency.")) 658 | self.checkBox_hdr.setText(_translate("qencoder", "10 bit output")) 659 | self.spinBox_jobs.setStatusTip(_translate("qencoder", "Encode jobs to run. 0=as many as cpu cores. Lower if ram usage too high.")) 660 | self.comboBox_colorspace.setStatusTip(_translate("qencoder", "The input colordata for your video. Leave default if unsure.")) 661 | self.comboBox_colorspace.setItemText(0, _translate("qencoder", "Auto (recommended)")) 662 | self.comboBox_colorspace.setItemText(1, _translate("qencoder", "HD SDR (bt709)")) 663 | self.comboBox_colorspace.setItemText(2, _translate("qencoder", "Classic SDR (bt601)")) 664 | self.comboBox_colorspace.setItemText(3, _translate("qencoder", "HDR (bt-2020)")) 665 | self.comboBox_colorspace.setItemText(4, _translate("qencoder", "Custom")) 666 | self.label_maxkfdist.setStatusTip(_translate("qencoder", "Distance between keyframes in frames. Lower helps with seeking but increases size. Used by time splitting.")) 667 | self.label_maxkfdist.setText(_translate("qencoder", "Max kf distance")) 668 | self.spinBox_maxkfdist.setStatusTip(_translate("qencoder", "Distance between keyframes in frames. Lower helps with seeking but increases size. Used by time splitting.")) 669 | self.label_splitmode.setStatusTip(_translate("qencoder", "ffmpeg is recommended for most encodes.")) 670 | self.label_splitmode.setText(_translate("qencoder", "Split Mode")) 671 | self.comboBox_splitmode.setStatusTip(_translate("qencoder", "ffmpeg is recommended for most encodes.")) 672 | self.comboBox_splitmode.setItemText(0, _translate("qencoder", "ffmpeg")) 673 | self.comboBox_splitmode.setItemText(1, _translate("qencoder", "time (fastest)")) 674 | self.comboBox_splitmode.setItemText(2, _translate("qencoder", "pyscenedetect")) 675 | self.doubleSpinBox_split.setStatusTip(_translate("qencoder", "0-1 for ffmpeg, 0-100 for scenedetect. Lower=more splits made. Suggested value ~30%")) 676 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_advanced), _translate("qencoder", "Advanced")) 677 | self.tab_dimensions.setStatusTip(_translate("qencoder", "Control the size of your output video")) 678 | self.spinBox_xres.setStatusTip(_translate("qencoder", "Number of pixels in horizontal line")) 679 | self.label_yres.setText(_translate("qencoder", "Y resolution")) 680 | self.spinBox_cropdown.setStatusTip(_translate("qencoder", "Pixels to remove from the bottom")) 681 | self.checkBox_rescale.setStatusTip(_translate("qencoder", "Rescaling happens after cropping if both are enabled")) 682 | self.checkBox_rescale.setText(_translate("qencoder", "Rescale")) 683 | self.spinBox_cropright.setStatusTip(_translate("qencoder", "Pixels to remove from the right")) 684 | self.checkBox_cropping.setStatusTip(_translate("qencoder", "Cropping happens before rescaling if both are enabled")) 685 | self.checkBox_cropping.setText(_translate("qencoder", "Crop")) 686 | self.spinBox_croptop.setStatusTip(_translate("qencoder", "Pixels to remove from the top")) 687 | self.spinBox_yres.setStatusTip(_translate("qencoder", "Number of pixels in vertical line")) 688 | self.label_xres.setText(_translate("qencoder", "X resolution")) 689 | self.spinBox_cropleft.setStatusTip(_translate("qencoder", "Pixels to remove from the left")) 690 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_dimensions), _translate("qencoder", "Dimensions")) 691 | self.tab_experimental.setStatusTip(_translate("qencoder", "Experimental stuff may only work on some platforms.")) 692 | self.spinBox_minq.setStatusTip(_translate("qencoder", "Minimum crf value to test/use at target vmaf.")) 693 | self.checkBox_vmaf.setStatusTip(_translate("qencoder", "Encode for specific visual fidelity. Requires crf enabled and darkboost disabled. Increases encode time.")) 694 | self.checkBox_vmaf.setText(_translate("qencoder", "Target VMAF")) 695 | self.label_qmin.setStatusTip(_translate("qencoder", "Minimum crf value to test/use at target vmaf.")) 696 | self.label_qmin.setText(_translate("qencoder", "min crf")) 697 | self.label_teststeps.setStatusTip(_translate("qencoder", "Number of iterations of test to run for finding optimal crf for a scene.")) 698 | self.label_teststeps.setText(_translate("qencoder", "Test steps")) 699 | self.spinBox_vmafsteps.setStatusTip(_translate("qencoder", "Number of iterations of test to run for finding optimal crf for a scene.")) 700 | self.checkBox_shutdown.setStatusTip(_translate("qencoder", "May not work depending on OS/config, please test first with a short queue/video.")) 701 | self.checkBox_shutdown.setText(_translate("qencoder", "Shutdown after completion")) 702 | self.checkBox_lsmash.setStatusTip(_translate("qencoder", "Recommended if possible. Requires vapoursynth, lsmash. Uses more ram, but otherwise better.")) 703 | self.checkBox_lsmash.setText(_translate("qencoder", "use vs+lsmash for splits")) 704 | self.doubleSpinBox_vmaf.setStatusTip(_translate("qencoder", "Percent visual fidelity compared to source video to target. Recommended range: 80-99")) 705 | self.pushButton_vmafmodel.setStatusTip(_translate("qencoder", "Select model file to use for vmaf analysis.")) 706 | self.pushButton_vmafmodel.setText(_translate("qencoder", "Choose Model")) 707 | self.label_target.setStatusTip(_translate("qencoder", "Percent visual fidelity compared to source video to target. Recommended range: 80-99")) 708 | self.label_target.setText(_translate("qencoder", "Target")) 709 | self.label_maxq.setText(_translate("qencoder", "max crf")) 710 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_experimental), _translate("qencoder", "Experimental")) 711 | self.tab_custom.setStatusTip(_translate("qencoder", "Set custom command options")) 712 | self.label_3.setText(_translate("qencoder", "Warning! Checking these custom boxes can override some simple/advanced settings")) 713 | self.checkBox_videocmd.setText(_translate("qencoder", "Custom Video Cmd")) 714 | self.checkBox_audiocmd.setText(_translate("qencoder", "Custom Audio Cmd")) 715 | self.checkBox_ffmpegcmd.setText(_translate("qencoder", "Custom FFMPEG Cmd")) 716 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_custom), _translate("qencoder", "Custom")) 717 | self.pushButton_save.setText(_translate("qencoder", "+ Save To Queue")) 718 | self.pushButton_up.setText(_translate("qencoder", "↑ up")) 719 | self.pushButton_edit.setText(_translate("qencoder", "Edit")) 720 | self.pushButton_down.setText(_translate("qencoder", "↓ down")) 721 | self.pushButton_encQueue.setText(_translate("qencoder", "▶ Encode Queue")) 722 | self.pushButton_del.setText(_translate("qencoder", "🗑 delete")) 723 | self.spinBox_qjobs.setStatusTip(_translate("qencoder", "Number of items from the queue to encode simultaneously.")) 724 | self.label_qjobs.setStatusTip(_translate("qencoder", "Number of items from the queue to encode simultaneously.")) 725 | self.label_qjobs.setText(_translate("qencoder", "Queue jobs:")) 726 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_queue), _translate("qencoder", "Queue")) 727 | self.menuFile.setTitle(_translate("qencoder", "File")) 728 | self.menuPreset.setTitle(_translate("qencoder", "Preset")) 729 | self.menuQueue.setTitle(_translate("qencoder", "Queue")) 730 | self.actionOpen.setText(_translate("qencoder", "Open Video")) 731 | self.actionOpen.setShortcut(_translate("qencoder", "Ctrl+O")) 732 | self.actionSave.setText(_translate("qencoder", "Save Video")) 733 | self.actionSave.setShortcut(_translate("qencoder", "Ctrl+S")) 734 | self.actionExit.setText(_translate("qencoder", "Quit")) 735 | self.actionExit.setShortcut(_translate("qencoder", "Ctrl+Q")) 736 | self.actionOpen_Preset.setText(_translate("qencoder", "Open Preset")) 737 | self.actionSave_Preset.setText(_translate("qencoder", "Save Preset")) 738 | self.actionOpen_Queue.setText(_translate("qencoder", "Open Queue")) 739 | self.actionSave_Queue.setText(_translate("qencoder", "Save Queue")) 740 | self.actionSave_Queue_As.setText(_translate("qencoder", "Save Queue As")) 741 | self.actionReset_All_Settings.setText(_translate("qencoder", "Reset All Settings")) 742 | self.actionAdd_folder_to_queue.setText(_translate("qencoder", "Add folder to queue")) 743 | -------------------------------------------------------------------------------- /qencoder/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | qencoder 4 | 5 | 6 | 7 | 0 8 | 0 9 | 815 10 | 625 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | qencoder 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 0 29 | 0 30 | 31 | 32 | 33 | 34 | 180 35 | 0 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 0 53 | 0 54 | 55 | 56 | 57 | 58 | 59 | 60 | Qt::PlainText 61 | 62 | 63 | true 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 140 72 | 0 73 | 74 | 75 | 76 | 77 | 140 78 | 16777215 79 | 80 | 81 | 82 | Open... 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 0 91 | 0 92 | 93 | 94 | 95 | 96 | 97 | 98 | Qt::PlainText 99 | 100 | 101 | true 102 | 103 | 104 | 105 | 106 | 107 | 108 | Save to... 109 | 110 | 111 | 112 | 113 | 114 | 115 | Source 116 | 117 | 118 | 119 | 120 | 121 | 122 | Output 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | false 132 | 133 | 134 | Progress only updates during second pass 135 | 136 | 137 | 0 138 | 139 | 140 | 141 | 142 | 143 | 144 | false 145 | 146 | 147 | 148 | 120 149 | 0 150 | 151 | 152 | 153 | 154 | 155 | 156 | ▶ Encode 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 0 167 | 168 | 169 | 170 | Simple Settings 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | Faster presets take more space at a given quality. 'medium' is usually best. 182 | 183 | 184 | Speed Preset 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | The final quality of your output video. If unsure, use 26. 195 | 196 | 197 | Quality Preset 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 0 206 | 0 207 | 208 | 209 | 210 | 211 | 212 | 213 | Reencode source audio as opus (otherwise will copy existing audio if any is present) 214 | 215 | 216 | Reencode Audio 217 | 218 | 219 | false 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | The final quality of your output video. If unsure, use 26. 230 | 231 | 232 | 3 233 | 234 | 235 | 236 | Ultra low (crf 40) 237 | 238 | 239 | 240 | 241 | Very low (crf 36) 242 | 243 | 244 | 245 | 246 | Low (crf 32) 247 | 248 | 249 | 250 | 251 | Medium (crf 28) 252 | 253 | 254 | 255 | 256 | Good (crf 26) 257 | 258 | 259 | 260 | 261 | Very Good (crf 24) 262 | 263 | 264 | 265 | 266 | Amazing (crf 20) 267 | 268 | 269 | 270 | 271 | Effectively Lossless (crf 10) 272 | 273 | 274 | 275 | 276 | Lossless (crf 0) 277 | 278 | 279 | 280 | 281 | Custom 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | Faster presets take more space at a given quality. 'medium' is usually best. 293 | 294 | 295 | 4 296 | 297 | 298 | 299 | Ultra fast 300 | 301 | 302 | 303 | 304 | Super fast 305 | 306 | 307 | 308 | 309 | Faster 310 | 311 | 312 | 313 | 314 | Fast 315 | 316 | 317 | 318 | 319 | Medium 320 | 321 | 322 | 323 | 324 | Slow 325 | 326 | 327 | 328 | 329 | Slower 330 | 331 | 332 | 333 | 334 | Very slow 335 | 336 | 337 | 338 | 339 | Placebo 340 | 341 | 342 | 343 | 344 | Custom 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | Use twopass encoding. Highly recommended when possible. 356 | 357 | 358 | Two Pass 359 | 360 | 361 | true 362 | 363 | 364 | 365 | 366 | 367 | 368 | Qt::Horizontal 369 | 370 | 371 | QSizePolicy::Maximum 372 | 373 | 374 | 375 | 250 376 | 20 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | av1 is the most modern/efficient. vp9/8 have good compatibility/speed. 385 | 386 | 387 | 388 | av1 389 | 390 | 391 | 392 | 393 | vp9 394 | 395 | 396 | 397 | 398 | vp8 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | av1 is the most modern/efficient. vp9/8 have good compatibility/speed. 407 | 408 | 409 | Video Codec 410 | 411 | 412 | 413 | 414 | 415 | 416 | With 2 channel stereo, 96kbps is usually close to transparent for movies. 417 | 418 | 419 | Audio Bitrate (kbps) 420 | 421 | 422 | 423 | 424 | 425 | 426 | With 2 channel stereo, 96kbps is usually close to transparent for movies. 427 | 428 | 429 | true 430 | 431 | 432 | 8 433 | 434 | 435 | 480 436 | 437 | 438 | 8 439 | 440 | 441 | 96 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | Qt::Vertical 451 | 452 | 453 | 454 | 20 455 | 242 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | Advanced 465 | 466 | 467 | 468 | 469 | 470 | Qt::Vertical 471 | 472 | 473 | 474 | 20 475 | 40 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 0-1 for ffmpeg, 0-100 for scenedetect. Lower=more splits made. Suggested value ~30% 486 | 487 | 488 | 3 489 | 490 | 491 | 1.000000000000000 492 | 493 | 494 | 0.010000000000000 495 | 496 | 497 | 0.300000000000000 498 | 499 | 500 | 501 | 502 | 503 | 504 | Encoder speed preset. Lower means a slower speed. Does not affect actual cpu usage. 505 | 506 | 507 | cpu-used (speed) 508 | 509 | 510 | 511 | 512 | 513 | 514 | false 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | Use 10 bit colorspace for output video. Greatly reduces banding and improves efficiency. 525 | 526 | 527 | 10 bit output 528 | 529 | 530 | 531 | 532 | 533 | 534 | Do not delete temp after running an encode. 535 | 536 | 537 | Keep temp folder 538 | 539 | 540 | 541 | 542 | 543 | 544 | 0-1 for ffmpeg, 0-100 for scenedetect. Lower=more splits made. Suggested value ~30% 545 | 546 | 547 | Split threshold 548 | 549 | 550 | 551 | 552 | 553 | 554 | Fewer threads per job and more jobs is usually recommended. 555 | 556 | 557 | 1 558 | 559 | 560 | 16 561 | 562 | 563 | 4 564 | 565 | 566 | 567 | 568 | 569 | 570 | ffmpeg is recommended for most encodes. 571 | 572 | 573 | Split Mode 574 | 575 | 576 | 577 | 578 | 579 | 580 | If qencoder closed prematurely, resume previous encode. 581 | 582 | 583 | Resume Encode 584 | 585 | 586 | true 587 | 588 | 589 | 590 | 591 | 592 | 593 | Qt::Horizontal 594 | 595 | 596 | QSizePolicy::MinimumExpanding 597 | 598 | 599 | 600 | 140 601 | 20 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | Constant rate factor (Q): quality of video (lower numbers = more quality). Bitrate: target video kbps to use. 610 | 611 | 612 | CRF 613 | 614 | 615 | 616 | 617 | 618 | 619 | Encode jobs to run. 0=as many as cpu cores. Lower if ram usage too high. 620 | 621 | 622 | 0 623 | 624 | 625 | 128 626 | 627 | 628 | 1 629 | 630 | 631 | 0 632 | 633 | 634 | 635 | 636 | 637 | 638 | Pixel format of input. Usually yuv420p (8b) or yuv420p10le (10b). If unsure leave default. 639 | 640 | 641 | Input Format 642 | 643 | 644 | 645 | 646 | 647 | 648 | ffmpeg is recommended for most encodes. 649 | 650 | 651 | 652 | ffmpeg 653 | 654 | 655 | 656 | 657 | time (fastest) 658 | 659 | 660 | 661 | 662 | pyscenedetect 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | Encode jobs to run. 0=as many as cpu cores. Lower if ram usage too high. 671 | 672 | 673 | Jobs 674 | 675 | 676 | 677 | 678 | 679 | 680 | The input colordata for your video. Leave default if unsure. 681 | 682 | 683 | 684 | Auto (recommended) 685 | 686 | 687 | 688 | 689 | HD SDR (bt709) 690 | 691 | 692 | 693 | 694 | Classic SDR (bt601) 695 | 696 | 697 | 698 | 699 | HDR (bt-2020) 700 | 701 | 702 | 703 | 704 | Custom 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | Distance between keyframes in frames. Lower helps with seeking but increases size. Used by time splitting. 713 | 714 | 715 | 9998 716 | 717 | 718 | 10 719 | 720 | 721 | 240 722 | 723 | 724 | 725 | 726 | 727 | 728 | Encode with RT preset. Not recommended for cpu-used <=6. 729 | 730 | 731 | Realtime Encoding 732 | 733 | 734 | 735 | 736 | 737 | 738 | Distance between keyframes in frames. Lower helps with seeking but increases size. Used by time splitting. 739 | 740 | 741 | Max kf distance 742 | 743 | 744 | 745 | 746 | 747 | 748 | Q factor: quality of video (lower numbers = more quality). Bitrate: target video kbps to use. 749 | 750 | 751 | 0 752 | 753 | 754 | 63 755 | 756 | 757 | 28 758 | 759 | 760 | 761 | 762 | 763 | 764 | Fewer threads per job and more jobs is usually recommended. 765 | 766 | 767 | Threads Per Job 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 0 776 | 0 777 | 778 | 779 | 780 | 781 | 150 782 | 0 783 | 784 | 785 | 786 | Pixel format of input. Usually yuv420p (8b) or yuv420p10le (10b). If unsure leave default. 787 | 788 | 789 | 790 | yuv420p 791 | 792 | 793 | 794 | 795 | yuv420p10le 796 | 797 | 798 | 799 | 800 | yuv420p12le 801 | 802 | 803 | 804 | 805 | yuv422p 806 | 807 | 808 | 809 | 810 | yuv422p10le 811 | 812 | 813 | 814 | 815 | yuv422p12le 816 | 817 | 818 | 819 | 820 | yuv444p 821 | 822 | 823 | 824 | 825 | yuv444p10le 826 | 827 | 828 | 829 | 830 | yuv444p12le 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | The input colordata for your video. Leave default if unsure. 839 | 840 | 841 | Input Colordata 842 | 843 | 844 | 845 | 846 | 847 | 848 | Encoder speed preset. Lower means a slower speed. Does not affect actual cpu usage. 849 | 850 | 851 | 8 852 | 853 | 854 | 4 855 | 856 | 857 | 858 | 859 | 860 | 861 | Use bitrate instead of q factor. Ideal if aiming for specific filesize. Identical to q in efficiency. 862 | 863 | 864 | Use Bitrate 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | Control the size of your output video 875 | 876 | 877 | Dimensions 878 | 879 | 880 | 881 | 882 | 883 | Qt::Horizontal 884 | 885 | 886 | QSizePolicy::Maximum 887 | 888 | 889 | 890 | 10 891 | 20 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | Qt::Horizontal 900 | 901 | 902 | QSizePolicy::Maximum 903 | 904 | 905 | 906 | 10 907 | 20 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | Number of pixels in horizontal line 918 | 919 | 920 | 1 921 | 922 | 923 | 9999 924 | 925 | 926 | 2 927 | 928 | 929 | 1920 930 | 931 | 932 | 933 | 934 | 935 | 936 | Y resolution 937 | 938 | 939 | 940 | 941 | 942 | 943 | Pixels to remove from the bottom 944 | 945 | 946 | 9999 947 | 948 | 949 | 2 950 | 951 | 952 | 953 | 954 | 955 | 956 | Rescaling happens after cropping if both are enabled 957 | 958 | 959 | Rescale 960 | 961 | 962 | 963 | 964 | 965 | 966 | Qt::Horizontal 967 | 968 | 969 | 970 | 40 971 | 20 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | Pixels to remove from the right 980 | 981 | 982 | 9999 983 | 984 | 985 | 2 986 | 987 | 988 | 989 | 990 | 991 | 992 | Cropping happens before rescaling if both are enabled 993 | 994 | 995 | Crop 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | Pixels to remove from the top 1003 | 1004 | 1005 | 9999 1006 | 1007 | 1008 | 2 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | Number of pixels in vertical line 1016 | 1017 | 1018 | 1 1019 | 1020 | 1021 | 9999 1022 | 1023 | 1024 | 2 1025 | 1026 | 1027 | 1080 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | X resolution 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | Pixels to remove from the left 1042 | 1043 | 1044 | 9999 1045 | 1046 | 1047 | 2 1048 | 1049 | 1050 | 1051 | 1052 | 1053 | 1054 | 1055 | 1056 | Qt::Vertical 1057 | 1058 | 1059 | 1060 | 20 1061 | 40 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 1069 | Qt::Vertical 1070 | 1071 | 1072 | QSizePolicy::Maximum 1073 | 1074 | 1075 | 1076 | 20 1077 | 10 1078 | 1079 | 1080 | 1081 | 1082 | 1083 | 1084 | 1085 | 1086 | Experimental stuff may only work on some platforms. 1087 | 1088 | 1089 | Experimental 1090 | 1091 | 1092 | 1093 | 1094 | 1095 | false 1096 | 1097 | 1098 | 1099 | 1100 | 1101 | 1102 | 1103 | 1104 | 1105 | false 1106 | 1107 | 1108 | Minimum crf value to test/use at target vmaf. 1109 | 1110 | 1111 | 62 1112 | 1113 | 1114 | 15 1115 | 1116 | 1117 | 1118 | 1119 | 1120 | 1121 | Encode for specific visual fidelity. Requires crf enabled and darkboost disabled. Increases encode time. 1122 | 1123 | 1124 | Target VMAF 1125 | 1126 | 1127 | 1128 | 1129 | 1130 | 1131 | false 1132 | 1133 | 1134 | Minimum crf value to test/use at target vmaf. 1135 | 1136 | 1137 | min crf 1138 | 1139 | 1140 | 1141 | 1142 | 1143 | 1144 | false 1145 | 1146 | 1147 | Number of iterations of test to run for finding optimal crf for a scene. 1148 | 1149 | 1150 | Test steps 1151 | 1152 | 1153 | 1154 | 1155 | 1156 | 1157 | false 1158 | 1159 | 1160 | Number of iterations of test to run for finding optimal crf for a scene. 1161 | 1162 | 1163 | 1 1164 | 1165 | 1166 | 63 1167 | 1168 | 1169 | 5 1170 | 1171 | 1172 | 1173 | 1174 | 1175 | 1176 | Qt::Vertical 1177 | 1178 | 1179 | 1180 | 20 1181 | 40 1182 | 1183 | 1184 | 1185 | 1186 | 1187 | 1188 | 1189 | May not work depending on OS/config, please test first with a short queue/video. 1190 | 1191 | 1192 | Shutdown after completion 1193 | 1194 | 1195 | 1196 | 1197 | 1198 | 1199 | Recommended if possible. Requires vapoursynth, lsmash. Uses more ram, but otherwise better. 1200 | 1201 | 1202 | use vs+lsmash for splits 1203 | 1204 | 1205 | 1206 | 1207 | 1208 | 1209 | Qt::Horizontal 1210 | 1211 | 1212 | 1213 | 40 1214 | 20 1215 | 1216 | 1217 | 1218 | 1219 | 1220 | 1221 | 1222 | false 1223 | 1224 | 1225 | Percent visual fidelity compared to source video to target. Recommended range: 80-99 1226 | 1227 | 1228 | 0.100000000000000 1229 | 1230 | 1231 | 92.000000000000000 1232 | 1233 | 1234 | 1235 | 1236 | 1237 | 1238 | Qt::Horizontal 1239 | 1240 | 1241 | 1242 | 40 1243 | 20 1244 | 1245 | 1246 | 1247 | 1248 | 1249 | 1250 | 1251 | Qt::Horizontal 1252 | 1253 | 1254 | 1255 | 40 1256 | 20 1257 | 1258 | 1259 | 1260 | 1261 | 1262 | 1263 | 1264 | false 1265 | 1266 | 1267 | 1268 | 0 1269 | 0 1270 | 1271 | 1272 | 1273 | 1274 | 110 1275 | 0 1276 | 1277 | 1278 | 1279 | Select model file to use for vmaf analysis. 1280 | 1281 | 1282 | Choose Model 1283 | 1284 | 1285 | 1286 | 1287 | 1288 | 1289 | false 1290 | 1291 | 1292 | Percent visual fidelity compared to source video to target. Recommended range: 80-99 1293 | 1294 | 1295 | Target 1296 | 1297 | 1298 | 1299 | 1300 | 1301 | 1302 | false 1303 | 1304 | 1305 | 1 1306 | 1307 | 1308 | 63 1309 | 1310 | 1311 | 60 1312 | 1313 | 1314 | 1315 | 1316 | 1317 | 1318 | false 1319 | 1320 | 1321 | max crf 1322 | 1323 | 1324 | 1325 | 1326 | 1327 | 1328 | 1329 | Set custom command options 1330 | 1331 | 1332 | Custom 1333 | 1334 | 1335 | 1336 | 1337 | 1338 | Warning! Checking these custom boxes can override some simple/advanced settings 1339 | 1340 | 1341 | 1342 | 1343 | 1344 | 1345 | Custom Video Cmd 1346 | 1347 | 1348 | 1349 | 1350 | 1351 | 1352 | false 1353 | 1354 | 1355 | false 1356 | 1357 | 1358 | 1359 | 1360 | 1361 | 1362 | Custom Audio Cmd 1363 | 1364 | 1365 | 1366 | 1367 | 1368 | 1369 | false 1370 | 1371 | 1372 | false 1373 | 1374 | 1375 | 1376 | 1377 | 1378 | 1379 | Custom FFMPEG Cmd 1380 | 1381 | 1382 | 1383 | 1384 | 1385 | 1386 | false 1387 | 1388 | 1389 | false 1390 | 1391 | 1392 | 1393 | 1394 | 1395 | 1396 | 1397 | Queue 1398 | 1399 | 1400 | 1401 | 1402 | 1403 | + Save To Queue 1404 | 1405 | 1406 | 1407 | 1408 | 1409 | 1410 | ↑ up 1411 | 1412 | 1413 | 1414 | 1415 | 1416 | 1417 | Qt::Horizontal 1418 | 1419 | 1420 | QSizePolicy::Fixed 1421 | 1422 | 1423 | 1424 | 40 1425 | 20 1426 | 1427 | 1428 | 1429 | 1430 | 1431 | 1432 | 1433 | Edit 1434 | 1435 | 1436 | 1437 | 1438 | 1439 | 1440 | ↓ down 1441 | 1442 | 1443 | 1444 | 1445 | 1446 | 1447 | Qt::Horizontal 1448 | 1449 | 1450 | 1451 | 40 1452 | 20 1453 | 1454 | 1455 | 1456 | 1457 | 1458 | 1459 | 1460 | ▶ Encode Queue 1461 | 1462 | 1463 | 1464 | 1465 | 1466 | 1467 | 🗑 delete 1468 | 1469 | 1470 | 1471 | 1472 | 1473 | 1474 | 1475 | 1476 | 1477 | 1478 | 1479 | 1480 | 1481 | 1482 | 1483 | 1484 | Number of items from the queue to encode simultaneously. 1485 | 1486 | 1487 | 1 1488 | 1489 | 1490 | 128 1491 | 1492 | 1493 | 1494 | 1495 | 1496 | 1497 | Number of items from the queue to encode simultaneously. 1498 | 1499 | 1500 | Queue jobs: 1501 | 1502 | 1503 | 1504 | 1505 | 1506 | 1507 | 1508 | 1509 | 1510 | 1511 | 1512 | 1513 | 0 1514 | 0 1515 | 815 1516 | 27 1517 | 1518 | 1519 | 1520 | 1521 | File 1522 | 1523 | 1524 | 1525 | 1526 | 1527 | 1528 | 1529 | 1530 | Preset 1531 | 1532 | 1533 | 1534 | 1535 | 1536 | 1537 | 1538 | Queue 1539 | 1540 | 1541 | 1542 | 1543 | 1544 | 1545 | 1546 | 1547 | 1548 | 1549 | 1550 | 1551 | 1552 | 1553 | Open Video 1554 | 1555 | 1556 | Ctrl+O 1557 | 1558 | 1559 | 1560 | 1561 | Save Video 1562 | 1563 | 1564 | Ctrl+S 1565 | 1566 | 1567 | 1568 | 1569 | Quit 1570 | 1571 | 1572 | Ctrl+Q 1573 | 1574 | 1575 | 1576 | 1577 | Open Preset 1578 | 1579 | 1580 | 1581 | 1582 | Save Preset 1583 | 1584 | 1585 | 1586 | 1587 | Open Queue 1588 | 1589 | 1590 | 1591 | 1592 | Save Queue 1593 | 1594 | 1595 | 1596 | 1597 | Save Queue As 1598 | 1599 | 1600 | 1601 | 1602 | Reset All Settings 1603 | 1604 | 1605 | 1606 | 1607 | Add folder to queue 1608 | 1609 | 1610 | 1611 | 1612 | 1613 | 1614 | -------------------------------------------------------------------------------- /qencoder/window.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # This Python file uses the following encoding: utf-8 3 | import glob 4 | import shlex 5 | import concurrent 6 | import concurrent.futures 7 | import threading 8 | 9 | from PyQt5 import QtCore 10 | from PyQt5.QtWidgets import QFileDialog, QMainWindow, QMessageBox 11 | from functools import partial 12 | 13 | import signal 14 | import sys 15 | 16 | from qencoder.av1anworkarounds import run_av1an, get_av1an, get_av1an_proj, merge_args, done_count 17 | from qencoder.mainwindow import Ui_qencoder 18 | from av1an.arg_parse import Args 19 | from av1an.manager import Manager 20 | from av1an.startup.setup import startup_check 21 | 22 | import traceback 23 | 24 | from pathlib import Path 25 | import os 26 | from time import sleep 27 | import psutil 28 | import multiprocessing 29 | from multiprocessing.managers import BaseManager, NamespaceProxy 30 | 31 | import pickle 32 | 33 | canLoadScenedetect = 1 34 | 35 | try: 36 | from scenedetect.video_manager import VideoManager 37 | except ImportError as e: 38 | canLoadScenedetect = 0 39 | print("Error loading pyscenedetect. Either it is missing or not properly installed.") 40 | 41 | hasLsmash = 1 42 | try: 43 | from vapoursynth import core 44 | core.lsmas.get_functions() 45 | except: 46 | hasLsmash = 0 47 | print("Error loading lsmash. Either vapoursynth is missing or lsmash is not installed.") 48 | 49 | # baseUIClass, baseUIWidget = uic.loadUiType("mainwindow.ui") 50 | 51 | 52 | class window(QMainWindow, Ui_qencoder): 53 | twopassState = True 54 | realtimeState = False 55 | qualityState = 3 56 | audioState = 4 57 | runningEncode = False 58 | runningQueueMode = False 59 | currentFrames = 0 60 | totalFrames = 0 61 | encodeStage = 0 62 | encodeList = [] 63 | currentFile = "" 64 | scenedetectFailState = -1 65 | currentlyRunning = 0 66 | killFlag = 0 67 | if 'APPDATA' in os.environ: 68 | confighome = os.environ['APPDATA'] 69 | elif 'XDG_CONFIG_HOME' in os.environ: 70 | confighome = os.environ['XDG_CONFIG_HOME'] 71 | else: 72 | confighome = os.path.join(os.environ['HOME'], '.config') 73 | configpath = os.path.join(confighome, 'qencoder.qec') 74 | 75 | def __init__(self, *args, **kwargs): 76 | global canLoadScenedetect 77 | global hasLsmash 78 | self.canLoadScenedetect = canLoadScenedetect 79 | self.hasLsmash = hasLsmash 80 | QMainWindow.__init__(self, *args, **kwargs) 81 | self.setupUi(self) 82 | self.inputFileChoose.clicked.connect(self.inputFileSelect) 83 | self.outputFileChoose.clicked.connect(self.outputFileSelect) 84 | self.pushButton_vmafmodel.clicked.connect(self.inputVmafSelect) 85 | self.label_audio.setEnabled(0) 86 | enable_slot = partial(self.audioEnableState, self.checkBox_audio) 87 | disable_slot = partial(self.audioDisableState, self.checkBox_audio) 88 | self.checkBox_audio.stateChanged.connect(lambda x: enable_slot() if x else disable_slot()) 89 | 90 | enable_slot2 = partial(self.bitrateEnableState, self.checkBox_bitrate) 91 | disable_slot2 = partial(self.bitrateDisableState, self.checkBox_bitrate) 92 | self.checkBox_bitrate.stateChanged.connect(lambda x: enable_slot2() if x else disable_slot2()) 93 | 94 | self.pushButton.clicked.connect(self.encodeVideo) 95 | self.pushButton_encQueue.clicked.connect(self.encodeVideoQueue) 96 | self.pushButton_encQueue.setEnabled(0) 97 | self.comboBox_quality.activated[int].connect(self.changeQPreset) 98 | self.presetbox.activated[int].connect(self.changePresetSimple) 99 | self.comboBox_colorspace.activated[int].connect(self.changeColorspace) 100 | self.comboBox_splitmode.activated[int].connect(self.changeSplitmode) 101 | 102 | self.comboBox_encoder.activated[int].connect(self.changeEncoder) 103 | 104 | self.spinBox_speed.valueChanged.connect(self.changePresetAdvanced) 105 | self.spinBox_quality.valueChanged.connect(self.customQPreset) 106 | self.checkBox_rtenc.stateChanged.connect(self.changeRTState) 107 | self.checkBox_videocmd.stateChanged.connect(self.customVidCmd) 108 | self.checkBox_audiocmd.stateChanged.connect(self.customAudCmd) 109 | self.checkBox_ffmpegcmd.stateChanged.connect(self.customFFCmd) 110 | self.actionOpen.triggered.connect(self.inputFileSelect) 111 | self.actionSave.triggered.connect(self.outputFileSelect) 112 | self.actionExit.triggered.connect(self.quitProgram) 113 | self.actionSave_Queue.triggered.connect(self.saveQueueAuto) 114 | self.actionSave_Queue_As.triggered.connect(self.saveQueueTo) 115 | self.actionOpen_Queue.triggered.connect(self.openQueueFrom) 116 | self.actionSave_Preset.triggered.connect(self.savePresetAs) 117 | self.actionOpen_Preset.triggered.connect(self.openPresetFrom) 118 | self.actionReset_All_Settings.triggered.connect(self.resetAllSettings) 119 | self.actionAdd_folder_to_queue.triggered.connect(self.addFolderToQueue) 120 | self.pushButton_save.setEnabled(0) 121 | self.pushButton_save.clicked.connect(self.saveToQueue) 122 | self.tabWidget.currentChanged[int].connect(self.setCustomText) 123 | self.pushButton_up.clicked.connect(self.queueMoveUp) 124 | self.pushButton_down.clicked.connect(self.queueMoveDown) 125 | self.pushButton_del.clicked.connect(self.removeFromQueue) 126 | self.pushButton_edit.clicked.connect(self.editCurrentQueue) 127 | self.checkBox_cropping.clicked.connect(self.enableCropping) 128 | self.checkBox_rescale.clicked.connect(self.enableRescale) 129 | self.checkBox_vmaf.clicked.connect(self.enableDisableVmaf) 130 | if (len(sys.argv) > 1): 131 | self.inputPath.setText(sys.argv[1]) 132 | 133 | # this dictionary will be use to map combobox index into a values 134 | self.qualitydict = { 135 | 0: 40, 136 | 1: 36, 137 | 2: 32, 138 | 3: 28, 139 | 4: 26, 140 | 5: 24, 141 | 6: 20, 142 | 7: 10, 143 | 8: 0 144 | } 145 | 146 | self.colorspacedict = { 147 | 0: ["", "--color-space=unknown"], 148 | 1: ["--color-primaries=bt709 --transfer-characteristics=bt709 --matrix-coefficients=bt709", 149 | "--color-space=bt709"], 150 | 2: ["--color-primaries=bt601 --transfer-characteristics=bt601 --matrix-coefficients=bt601", 151 | "--color-space=bt601"], 152 | 3: ["--color-primaries=bt2020 --transfer-characteristics=smpte2084 --matrix-coefficients=bt2020ncl", 153 | "--color-space=bt2020"], 154 | } 155 | 156 | try: 157 | filehandler = open(self.configpath, 'rb') 158 | settings = pickle.load(filehandler) 159 | self.setFromPresetDict(settings, False) 160 | self.enableCropping() 161 | self.enableRescale() 162 | self.enableDisableVmaf() 163 | except: 164 | print("Unable to load existing preset at: " + str(self.configpath) + ".") 165 | print("Possibly the first time you have run this, corrupted, or an older version") 166 | print("Do not report this") 167 | self.enableCropping() 168 | self.enableRescale() 169 | self.enableDisableVmaf() 170 | # self.speedButton.changeEvent.connect(self.setSpeed) 171 | self.checkBox_lsmash.setEnabled(hasLsmash) 172 | if canLoadScenedetect == 0: 173 | if self.comboBox_splitmode.currentIndex() == 2: 174 | self.comboBox_splitmode.setCurrentIndex(0) 175 | self.comboBox_splitmode.model().item(2).setEnabled(False) 176 | self.changeSplitmode(self.comboBox_splitmode.currentIndex(), False) 177 | 178 | def changeSplitmode(self, newPreset, setval=True): 179 | if newPreset == 0: 180 | self.doubleSpinBox_split.setEnabled(True) 181 | self.doubleSpinBox_split.setDecimals(3) 182 | if setval: 183 | self.doubleSpinBox_split.setValue(0.3) 184 | self.doubleSpinBox_split.setMaximum(1.0) 185 | self.doubleSpinBox_split.setMinimum(0.001) 186 | self.doubleSpinBox_split.setSingleStep(0.01) 187 | self.spinBox_maxkfdist.setMinimum(0) 188 | elif newPreset == 1: 189 | self.doubleSpinBox_split.setEnabled(False) 190 | self.spinBox_maxkfdist.setMinimum(2) 191 | else: 192 | self.doubleSpinBox_split.setEnabled(True) 193 | if setval: 194 | self.doubleSpinBox_split.setValue(35) 195 | self.doubleSpinBox_split.setMaximum(100) 196 | self.doubleSpinBox_split.setMinimum(1) 197 | self.doubleSpinBox_split.setSingleStep(1) 198 | self.doubleSpinBox_split.setDecimals(0) 199 | self.spinBox_maxkfdist.setMinimum(0) 200 | 201 | def enableDisableVmaf(self): 202 | state = self.checkBox_vmaf.isChecked() 203 | self.label_vmafpath.setEnabled(state) 204 | self.pushButton_vmafmodel.setEnabled(state) 205 | self.label_qmin.setEnabled(state) 206 | self.label_target.setEnabled(state) 207 | self.label_teststeps.setEnabled(state) 208 | self.spinBox_vmafsteps.setEnabled(state) 209 | self.spinBox_minq.setEnabled(state) 210 | self.doubleSpinBox_vmaf.setEnabled(state) 211 | self.spinBox_maxq.setEnabled(state) 212 | self.label_maxq.setEnabled(state) 213 | 214 | def enableRescale(self): 215 | state = self.checkBox_rescale.isChecked() 216 | self.spinBox_xres.setEnabled(state) 217 | self.spinBox_yres.setEnabled(state) 218 | self.label_xres.setEnabled(state) 219 | self.label_yres.setEnabled(state) 220 | 221 | def enableCropping(self): 222 | state = self.checkBox_cropping.isChecked() 223 | self.spinBox_croptop.setEnabled(state) 224 | self.spinBox_cropdown.setEnabled(state) 225 | self.spinBox_cropleft.setEnabled(state) 226 | self.spinBox_cropright.setEnabled(state) 227 | 228 | def addFolderToQueue(self): 229 | buttonReply = QMessageBox.question(self, 'Add folder to queue?', 230 | "The folder chosen will have all detected video files in it added to the queue using the current settings. Make sure your settings are correct before doing this. Continue?", 231 | QMessageBox.Yes | QMessageBox.No, QMessageBox.No) 232 | if buttonReply != QMessageBox.Yes: 233 | return 234 | else: 235 | foldername = QFileDialog.getExistingDirectory(caption="Input Folder") 236 | newfoldername = QFileDialog.getExistingDirectory(caption="Output Folder") 237 | add_enc = False 238 | if foldername == newfoldername: 239 | add_enc = True 240 | types = ('*.mkv', '*.mp4', '*.webm', '*.y4m', '*.avi') 241 | files_grabbed = [] 242 | for files in types: 243 | files_grabbed.extend(glob.glob(foldername + "/" + files)) 244 | for fil in files_grabbed: 245 | if os.path.isdir(fil): 246 | continue 247 | self.inputPath.setText(fil) 248 | dirn, fname = os.path.split(fil) 249 | if add_enc: 250 | fname = "enc_" + fname 251 | if not fname.endswith(".mkv") and not fname.endswith(".webm"): 252 | fname = fname + ".mkv" 253 | self.outputPath.setText(os.path.join(newfoldername, fname)) 254 | self.saveToQueue() 255 | self.inputPath.setText("") 256 | self.outputPath.setText("") 257 | self.pushButton.setEnabled(False) 258 | self.tabWidget.setCurrentIndex(5) 259 | 260 | def editCurrentQueue(self): 261 | if (self.listWidget.currentRow() <= -1): 262 | return 263 | buttonReply = QMessageBox.question(self, 'Overwrite existing encode settings?', 264 | "Clicking yes will move the queue item into your current encoding settings allowing you to edit it, but it will also override your existing encoding settings.", 265 | QMessageBox.Yes | QMessageBox.No, QMessageBox.No) 266 | if buttonReply != QMessageBox.Yes: 267 | return 268 | else: 269 | self.setFromPresetDict(self.encodeList[self.listWidget.currentRow()][1], True) 270 | self.inputPath.setText(str(self.encodeList[self.listWidget.currentRow()][0]['input'][0])) 271 | self.outputPath.setText(str(self.encodeList[self.listWidget.currentRow()][0]['output_file'])) 272 | self.pushButton.setEnabled(1) 273 | self.pushButton_save.setEnabled(1) 274 | del self.encodeList[self.listWidget.currentRow()] 275 | self.redrawQueueList() 276 | self.enableCropping() 277 | self.enableRescale() 278 | self.enableDisableVmaf() 279 | 280 | def encodeFinished(self, taskname, errorCode): 281 | if (not self.runningQueueMode) or int(taskname) == -1: 282 | self.currentlyRunning = 0 283 | if errorCode == 0: 284 | self.pushButton.setEnabled(1) 285 | self.label_status.setText("Encoding complete!") 286 | self.progressBar_total.setValue(100) 287 | self.finalizeEncode() 288 | else: 289 | self.pushButton.setEnabled(1) 290 | self.pushButton.setStyleSheet("color: red; background-color: white") 291 | self.pushButton.setText("Reset") 292 | self.label_status.setText("ERR. See temp/log.log") 293 | else: 294 | taskNumber = int(taskname) 295 | q = self.getQueueIndexData(taskNumber) 296 | item = self.listWidget.item(taskNumber) 297 | if errorCode == 0: 298 | item.setText("Complete: " + q) 299 | else: 300 | item.setText("Failed: " + q) 301 | 302 | def addFrames(self, taskname, addFrames): 303 | if not self.runningQueueMode: 304 | self.currentFrames += addFrames 305 | self.progressBar_total.setValue(int(90 * self.currentFrames / self.totalFrames) + 10) 306 | self.label_status.setText("Encoding: " + str(self.currentFrames) + "/" + str(self.totalFrames)) 307 | else: 308 | taskNumber = int(taskname) 309 | self.currentFrames[taskNumber] += addFrames 310 | q = self.getQueueIndexData(taskNumber) 311 | item = self.listWidget.item(taskNumber) 312 | item.setText("Encoding: " + str(self.currentFrames[taskNumber]) + "/" + 313 | str(self.totalFrames[taskNumber]) + " progress: " + 314 | str(int(90 * self.currentFrames[taskNumber] / self.totalFrames[taskNumber]) + 10) + "% " + q) 315 | 316 | def startEncode(self, taskname, totalFrames, initFrames): 317 | if not self.runningQueueMode: 318 | self.totalFrames = totalFrames 319 | self.currentFrames = initFrames 320 | self.progressBar_total.setValue(int(90 * initFrames / totalFrames) + 10) 321 | self.label_status.setText("Encoding: " + str(initFrames) + "/" + str(totalFrames)) 322 | else: 323 | taskNumber = int(taskname) 324 | self.currentFrames[taskNumber] = initFrames 325 | self.totalFrames[taskNumber] = totalFrames 326 | q = self.getQueueIndexData(taskNumber) 327 | item = self.listWidget.item(taskNumber) 328 | item.setText("Encoding: " + str(initFrames) + "/" + str(totalFrames) + " progress: " + str(int(90 * initFrames / totalFrames) + 10) + "% " + q) 329 | self.label_status.setText("See queue for progress") 330 | 331 | def newTask(self, taskname, taskDesc: str, taskFrames: int): 332 | if not self.runningQueueMode: 333 | if taskDesc.startswith("Pyscene"): 334 | self.label_status.setText("Pyscenedetect... please wait") 335 | self.progressBar_total.setValue(5) 336 | else: 337 | if taskDesc.startswith("Pyscene"): 338 | taskNumber = int(taskname) 339 | q = self.getQueueIndexData(taskNumber) 340 | item = self.listWidget.item(taskNumber) 341 | item.setText("Pyscenedetect... please wait " + q) 342 | 343 | def resetAllSettings(self): 344 | buttonReply = QMessageBox.question(self, 'Factory reset all settings?', 345 | "Clicking yes will cause the program to close and reset all settings. You may lose any existing encodes.", 346 | QMessageBox.Yes | QMessageBox.No, QMessageBox.No) 347 | if buttonReply != QMessageBox.Yes: 348 | return 349 | else: 350 | os.remove(Path(self.configpath)) 351 | if not sys.platform.startswith('win'): 352 | os.killpg(0, signal.SIGTERM) 353 | sys.exit() 354 | 355 | def openPresetFrom(self): 356 | filename = QFileDialog.getOpenFileName(filter="Qencoder encoder config (*.qec)") 357 | newlist = [] 358 | if (filename[0].endswith(".qec")): 359 | pass 360 | elif (len(filename[0]) > 0): 361 | self.outputPath.setText(filename[0] + ".qec") 362 | else: 363 | return 364 | filehandler = open(filename[0], 'rb') 365 | tempdict = pickle.load(filehandler) 366 | self.setFromPresetDict(tempdict, True) 367 | 368 | def savePresetAs(self): 369 | filename = QFileDialog.getSaveFileName(filter="Qencoder encoder config (*.qec)") 370 | if (filename[0].endswith(".qec")): 371 | pass 372 | elif (len(filename[0]) > 0): 373 | self.outputPath.setText(filename[0] + ".qec") 374 | else: 375 | return 376 | file_pi = open(filename[0], 'wb') 377 | pickle.dump(self.getPresetDict(), file_pi) 378 | 379 | def closeEvent(self, event): 380 | print("Writing current settings to config") 381 | curSettings = self.getPresetDict() 382 | file_pi = open(self.configpath, 'wb') 383 | pickle.dump(curSettings, file_pi) 384 | file_pi.close() 385 | if not sys.platform.startswith('win'): 386 | os.killpg(0, signal.SIGTERM) 387 | event.accept() 388 | 389 | def saveQueueAuto(self): 390 | if (len(self.currentFile) < 1): 391 | self.saveQueueTo() 392 | else: 393 | file_pi = open(self.currentFile, 'wb') 394 | pickle.dump(self.encodeList, file_pi) 395 | 396 | def saveQueueTo(self): 397 | filename = QFileDialog.getSaveFileName(filter="Qencoder encoder queue data (*.eqd)") 398 | if (filename[0].endswith(".eqd")): 399 | pass 400 | elif (len(filename[0]) > 0): 401 | self.outputPath.setText(filename[0] + ".eqd") 402 | else: 403 | return 404 | file_pi = open(filename[0], 'wb') 405 | pickle.dump(self.encodeList, file_pi) 406 | self.currentFile = filename[0] 407 | 408 | def openQueueFrom(self): 409 | filename = QFileDialog.getOpenFileName(filter="Qencoder encoder queue data (*.eqd)") 410 | newlist = [] 411 | if (filename[0].endswith(".eqd")): 412 | pass 413 | elif (len(filename[0]) > 0): 414 | self.outputPath.setText(filename[0] + ".eqd") 415 | else: 416 | return 417 | filehandler = open(filename[0], 'rb') 418 | self.encodeList = pickle.load(filehandler) 419 | self.currentFile = filename[0] 420 | self.redrawQueueList() 421 | self.tabWidget.setCurrentIndex(5) 422 | 423 | def queueMoveUp(self): 424 | if (self.listWidget.currentRow() > 0): 425 | self.encodeList[self.listWidget.currentRow()], self.encodeList[self.listWidget.currentRow() - 1] = \ 426 | self.encodeList[self.listWidget.currentRow() - 1], self.encodeList[self.listWidget.currentRow()] 427 | self.redrawQueueList() 428 | 429 | def queueMoveDown(self): 430 | if (self.listWidget.currentRow() < (self.listWidget.count() - 1)): 431 | self.encodeList[self.listWidget.currentRow()], self.encodeList[self.listWidget.currentRow() + 1] = \ 432 | self.encodeList[self.listWidget.currentRow() + 1], self.encodeList[self.listWidget.currentRow()] 433 | self.redrawQueueList() 434 | 435 | def removeFromQueue(self): 436 | if (len(self.encodeList) > 0): 437 | index = self.listWidget.currentRow() 438 | del self.encodeList[index] 439 | self.redrawQueueList() 440 | 441 | def saveToQueue(self): 442 | self.encodeList.append([self.getArgs(), self.getPresetDict()]) 443 | self.redrawQueueList() 444 | self.outputPath.setText("") 445 | self.pushButton.setEnabled(0) 446 | self.pushButton_encQueue.setEnabled(1) 447 | self.pushButton_save.setEnabled(0) 448 | 449 | def getQueueIndexData(self, index): 450 | q = self.encodeList[index] 451 | return str(q[0]['input'][0].parts[-1]) + " -> " + str(q[0]['output_file'].parts[-1]) 452 | 453 | def redrawQueueList(self): 454 | self.listWidget.clear() 455 | for i in self.encodeList: 456 | inputFile = i[0]['input'][0].parts[-1] 457 | outputFile = i[0]['output_file'].parts[-1] 458 | finalString = inputFile + " -> " + outputFile 459 | if (i[1]['brmode']): 460 | finalString += ", " + str(i[1]['qual']) + "kbps" 461 | else: 462 | finalString += ", crf=" + str(i[1]['qual']) + "" 463 | if (i[1]['rtenc']): 464 | finalString += ", spd=" + str(i[1]['cpuused']) + "r" 465 | else: 466 | finalString += ", spd=" + str(i[1]['cpuused']) 467 | finalString += ", 2p=" + str(int(i[1]['2p'])) 468 | if (i[1]['enc'] == 0): 469 | finalString += ", enc=av1" 470 | elif (i[1]['enc'] == 1): 471 | finalString += ", enc=vp9" 472 | else: 473 | finalString += ", enc=vp8" 474 | if (i[1]['audio']): 475 | finalString += ", aud=" + str(i[1]['audiobr']) + "k" 476 | self.listWidget.addItem(finalString) 477 | if (len(self.encodeList) > 0): 478 | self.pushButton_encQueue.setEnabled(1) 479 | else: 480 | self.pushButton_encQueue.setEnabled(0) 481 | 482 | def quitProgram(self): 483 | sys.exit(0) 484 | 485 | def customVidCmd(self, newState): 486 | self.textEdit_videocmd.setEnabled(newState) 487 | if (not newState): 488 | self.textEdit_videocmd.setPlainText(self.getVideoParams()) 489 | 490 | def customFFCmd(self, newState): 491 | self.textEdit_ffmpegcmd.setEnabled(newState) 492 | if (not newState): 493 | self.textEdit_ffmpegcmd.setPlainText(self.getFFMPEGParams()) 494 | 495 | def customAudCmd(self, newState): 496 | self.textEdit_audiocmd.setEnabled(newState) 497 | if (not newState): 498 | self.textEdit_audiocmd.setPlainText(self.getAudioParams()) 499 | 500 | def setCustomText(self, i): 501 | self.textEdit_ffmpegcmd.setPlainText(self.getFFMPEGParams()) 502 | self.textEdit_videocmd.setPlainText(self.getVideoParams()) 503 | self.textEdit_audiocmd.setPlainText(self.getAudioParams()) 504 | 505 | def getCPUUsed(self): 506 | if (self.presetbox.currentIndex() == 9): 507 | return self.spinBox_speed.value() 508 | if (self.comboBox_encoder.currentIndex() == 0): 509 | return (8 - self.presetbox.currentIndex()) 510 | if (self.comboBox_encoder.currentIndex() == 1): 511 | return int((8 - self.presetbox.currentIndex()) * 1.125) # Maps the presets between 0 and 9 512 | if (self.comboBox_encoder.currentIndex() == 2): 513 | return int((8 - self.presetbox.currentIndex()) * 2.0) # Maps the presets between 0 and 16 514 | return 0 515 | 516 | def getColorData(self): 517 | # Get indexes of current colorspace comboBox 518 | inputSpace = self.comboBox_colorspace.currentIndex() 519 | # if colorspace index is 5 uses a custom value set by the user 520 | if (inputSpace == 4): 521 | return self.lineEdit_colordata.text() 522 | # return empty string if current encoder combobox indexes is 2 523 | if (self.comboBox_encoder.currentIndex() == 2): 524 | return "" 525 | # else map the colorspace index into a list of av1,vp9 color space then return the appropriate string based on the encoder 526 | else: 527 | return self.colorspacedict[inputSpace][self.comboBox_encoder.currentIndex()] 528 | 529 | def changeEncoder(self, newencoder): 530 | spdpreset = self.presetbox.currentIndex() 531 | if (newencoder == 0): 532 | self.spinBox_speed.setMaximum(8) 533 | self.spinBox_speed.setMinimum(0) 534 | elif (newencoder == 1): 535 | self.spinBox_speed.setMaximum(9) 536 | self.spinBox_speed.setMinimum(0) 537 | else: 538 | self.spinBox_speed.setMaximum(16) 539 | self.spinBox_speed.setMinimum(0) 540 | self.spinBox_speed.setValue(self.getCPUUsed()) 541 | self.lineEdit_colordata.setText(self.getColorData()) 542 | self.presetbox.setCurrentIndex(spdpreset) 543 | self.changePresetSimple(spdpreset) 544 | if (newencoder > 1): 545 | self.comboBox_colorspace.setCurrentIndex(0) 546 | self.comboBox_colorspace.setEnabled(0) 547 | self.lineEdit_colordata.setEnabled(0) 548 | self.label_2.setEnabled(0) 549 | else: 550 | self.comboBox_colorspace.setEnabled(1) 551 | if (self.comboBox_colorspace.currentIndex() == 4): 552 | self.lineEdit_colordata.setEnabled(1) 553 | self.label_2.setEnabled(1) 554 | 555 | def changeColorspace(self, newspace): 556 | colorInfo = self.getColorData() 557 | self.lineEdit_colordata.setText(colorInfo) 558 | if (newspace == 4): 559 | self.lineEdit_colordata.setEnabled(1) 560 | else: 561 | self.lineEdit_colordata.setEnabled(0) 562 | 563 | def changeRTState(self, newState): 564 | if (newState): 565 | if (self.checkBox_twopass.isEnabled()): 566 | self.twopassState = self.checkBox_twopass.isChecked() 567 | self.checkBox_twopass.setChecked(0) 568 | self.checkBox_twopass.setEnabled(0) 569 | else: 570 | self.checkBox_twopass.setChecked(self.twopassState) 571 | self.checkBox_twopass.setEnabled(1) 572 | 573 | def customQPreset(self): 574 | self.comboBox_quality.setCurrentIndex(9) # custom 575 | 576 | def changeQPreset(self, i): 577 | trueQuality = self.getQuality(i) 578 | self.spinBox_quality.setValue(trueQuality) 579 | self.qualityState = i 580 | self.comboBox_quality.setCurrentIndex(i) 581 | 582 | def changePresetAdvanced(self): 583 | if (self.spinBox_speed.value() > 6 and self.comboBox_encoder.currentIndex() == 0): 584 | if (self.checkBox_rtenc.isEnabled()): 585 | self.realtimeState = self.checkBox_rtenc.isChecked() 586 | if (self.checkBox_twopass.isEnabled()): 587 | self.twopassState = self.checkBox_twopass.isChecked() 588 | self.checkBox_twopass.setChecked(0) 589 | self.checkBox_twopass.setEnabled(0) 590 | self.checkBox_rtenc.setChecked(1) 591 | self.checkBox_rtenc.setEnabled(0) 592 | else: 593 | if (self.checkBox_rtenc.isEnabled()): 594 | self.realtimeState = self.checkBox_rtenc.isChecked() 595 | if (self.checkBox_twopass.isEnabled()): 596 | self.twopassState = self.checkBox_twopass.isChecked() 597 | self.checkBox_twopass.setChecked(self.twopassState) 598 | self.checkBox_twopass.setEnabled(1) 599 | self.checkBox_rtenc.setEnabled(1) 600 | self.checkBox_rtenc.setChecked(self.realtimeState) 601 | self.presetbox.setCurrentIndex(9) 602 | 603 | def changePresetSimple(self, i): 604 | if (i <= 1 and self.comboBox_encoder.currentIndex() == 0): 605 | if (self.checkBox_rtenc.isEnabled()): 606 | self.realtimeState = self.checkBox_rtenc.isChecked() 607 | if (self.checkBox_twopass.isEnabled()): 608 | self.twopassState = self.checkBox_twopass.isChecked() 609 | self.checkBox_twopass.setChecked(0) 610 | self.checkBox_twopass.setEnabled(0) 611 | self.checkBox_rtenc.setEnabled(0) 612 | self.checkBox_rtenc.setChecked(1) 613 | else: 614 | if (self.checkBox_rtenc.isEnabled()): 615 | self.realtimeState = self.checkBox_rtenc.isChecked() 616 | if (self.checkBox_twopass.isEnabled()): 617 | self.twopassState = self.checkBox_twopass.isChecked() 618 | self.checkBox_twopass.setChecked(self.twopassState) 619 | self.checkBox_twopass.setEnabled(1) 620 | self.checkBox_rtenc.setEnabled(1) 621 | self.checkBox_rtenc.setChecked(self.realtimeState) 622 | self.spinBox_speed.setValue(self.getCPUUsed()) 623 | self.presetbox.setCurrentIndex(i) 624 | 625 | 626 | def getQuality(self, qval): 627 | if (qval < 9): 628 | return self.qualitydict[qval] 629 | else: 630 | return self.spinBox_quality.value() 631 | 632 | def inputVmafSelect(self): 633 | filename = QFileDialog.getOpenFileName(filter="VMAF models(*.pkl *.model);;All(*)") 634 | self.label_vmafpath.setText(filename[0]) 635 | 636 | def inputFileSelect(self): 637 | filename = QFileDialog.getOpenFileName( 638 | filter="Videos(*.mp4 *.mkv *.webm *.flv *.gif *.3gp *.wmv *.avi *.y4m);;All(*)") 639 | self.inputPath.setText(filename[0]) 640 | if (len(self.outputPath.text()) > 1): 641 | self.pushButton.setEnabled(1) 642 | self.pushButton_save.setEnabled(1) 643 | 644 | def outputFileSelect(self): 645 | filename = QFileDialog.getSaveFileName(filter="mkv and webm videos(*.mkv *.webm)") 646 | if (filename[0].endswith(".mkv") or filename[0].endswith(".webm")): 647 | self.outputPath.setText(filename[0]) 648 | elif (len(filename[0]) > 0): 649 | self.outputPath.setText(filename[0] + ".mkv") 650 | if (len(self.inputPath.text()) > 1): 651 | self.pushButton.setEnabled(1) 652 | self.pushButton_save.setEnabled(1) 653 | 654 | def audioEnableState(self, checkbox): 655 | self.label_audio.setEnabled(1) 656 | self.spinBox_audio.setReadOnly(0) 657 | self.spinBox_audio.setEnabled(1) 658 | 659 | def audioDisableState(self, checkbox): 660 | self.label_audio.setEnabled(0) 661 | self.spinBox_audio.setReadOnly(1) 662 | self.spinBox_audio.setEnabled(0) 663 | 664 | def bitrateEnableState(self, checkbox): 665 | self.label_q.setText("Bitrate (kbps)") 666 | self.checkBox_vmaf.setChecked(0) 667 | self.checkBox_vmaf.setEnabled(0) 668 | self.spinBox_quality.setMaximum(99999) 669 | self.spinBox_quality.setMinimum(8) 670 | self.spinBox_quality.setValue(3000) 671 | self.comboBox_quality.setCurrentIndex(9) # custom 672 | self.comboBox_quality.setEnabled(0) 673 | self.label_quality.setEnabled(0) 674 | 675 | def bitrateDisableState(self, checkbox): 676 | self.label_q.setText("CRF") 677 | self.checkBox_vmaf.setEnabled(1) 678 | self.spinBox_quality.setMaximum(63) 679 | self.spinBox_quality.setMinimum(0) 680 | self.spinBox_quality.setValue(30) 681 | self.comboBox_quality.setEnabled(1) 682 | self.label_quality.setEnabled(1) 683 | 684 | def getFFMPEGParams(self): 685 | if (self.checkBox_ffmpegcmd.isChecked()): 686 | return self.textEdit_ffmpegcmd.toPlainText() 687 | astr = " " 688 | addedStuff = False 689 | if (self.checkBox_cropping.isChecked() and ( 690 | self.spinBox_cropdown.value() > 0 or self.spinBox_cropright.value() > 0 or self.spinBox_croptop.value() > 0 or self.spinBox_cropleft.value() > 0)): 691 | widthSub = self.spinBox_cropright.value() + self.spinBox_cropleft.value() 692 | heightSub = self.spinBox_croptop.value() + self.spinBox_cropdown.value() 693 | astr += "-filter:v \"crop=iw-" + str(widthSub) + ":ih-" + str(heightSub) + ":" + str( 694 | self.spinBox_cropleft.value()) + ":" + str(self.spinBox_croptop.value()) 695 | addedStuff = True 696 | if (self.checkBox_rescale.isChecked()): 697 | if (addedStuff): 698 | astr += ",scale=" + str(self.spinBox_xres.value()) + ":" + str(self.spinBox_yres.value()) 699 | else: 700 | astr += "-filter:v \"scale=" + str(self.spinBox_xres.value()) + ":" + str(self.spinBox_yres.value()) 701 | addedStuff = True 702 | if (addedStuff): 703 | astr += "\" " 704 | return astr 705 | 706 | def getVideoParams(self): 707 | if (self.checkBox_videocmd.isChecked()): 708 | return self.textEdit_videocmd.toPlainText() 709 | vparams = " --threads=" + str(self.spinBox_threads.value()) 710 | if (self.spinBox_maxkfdist.value() > 0 and self.comboBox_splitmode.currentIndex() != 1): 711 | vparams += " --kf-max-dist=" + str(self.spinBox_maxkfdist.value()) 712 | if (self.comboBox_encoder.currentIndex() < 2): 713 | vparams += " --tile-columns=1 --tile-rows=0 --cpu-used=" + str(self.spinBox_speed.value()) 714 | else: 715 | vparams += " --codec=vp8 --cpu-used=" + str(self.spinBox_speed.value()) 716 | 717 | if (self.comboBox_encoder.currentIndex() == 1): 718 | vparams += " --codec=vp9" 719 | 720 | if (self.checkBox_rtenc.isChecked()): 721 | vparams += " --rt" 722 | else: 723 | vparams += " --good" 724 | if (self.checkBox_bitrate.isChecked()): 725 | vparams += " --end-usage=vbr --target-bitrate=" + str(self.spinBox_quality.value()) 726 | else: 727 | if (self.spinBox_quality.value() < 4 and self.comboBox_encoder.currentIndex() == 2): 728 | vparams += " --end-usage=q --cq-level=4" 729 | else: 730 | vparams += " --end-usage=q --cq-level=" + str(self.spinBox_quality.value()) 731 | if (self.spinBox_quality.value() == 0 and self.comboBox_encoder.currentIndex() <= 1): 732 | vparams += " --lossless=1" 733 | 734 | if (self.checkBox_hdr.isChecked()): 735 | vparams += " --bit-depth=10 " 736 | else: 737 | vparams += " --bit-depth=8 " 738 | input_depth = 8 + 2 * (self.comboBox_inputFormat.currentIndex() % 3) 739 | vparams += "--input-bit-depth=" + str(input_depth) + " " 740 | vparams += self.lineEdit_colordata.text() 741 | if (self.comboBox_inputFormat.currentIndex() <= 2): 742 | vparams += " --i420" 743 | elif (self.comboBox_inputFormat.currentIndex() <= 5): 744 | vparams += " --i422" 745 | else: 746 | vparams += " --i444 " 747 | return vparams 748 | 749 | def getSplitMethod(self): 750 | if (self.comboBox_splitmode.currentIndex() == 0): 751 | return "ffmpeg" 752 | elif (self.comboBox_splitmode.currentIndex() == 1): 753 | return "none" 754 | else: 755 | return "pyscene" 756 | 757 | def getAudioParams(self): 758 | if (self.checkBox_audiocmd.isChecked()): 759 | return self.textEdit_audiocmd.toPlainText() 760 | if (self.checkBox_audio.isChecked()): 761 | return "-b:a " + str(self.spinBox_audio.value()) + "k -c:a libopus" 762 | else: 763 | return "-c:a copy" 764 | 765 | def getVmafFilter(self): 766 | astr = "" 767 | addedStuff = False 768 | if (self.checkBox_cropping.isChecked() and ( 769 | self.spinBox_cropdown.value() > 0 or self.spinBox_cropright.value() > 0 or self.spinBox_croptop.value() > 0 or self.spinBox_cropleft.value() > 0)): 770 | widthSub = self.spinBox_cropright.value() + self.spinBox_cropleft.value() 771 | heightSub = self.spinBox_croptop.value() + self.spinBox_cropdown.value() 772 | astr += "crop=iw-" + str(widthSub) + ":ih-" + str(heightSub) + ":" + str( 773 | self.spinBox_cropleft.value()) + ":" + str(self.spinBox_croptop.value()) 774 | addedStuff = True 775 | if self.checkBox_rescale.isChecked(): 776 | if addedStuff: 777 | astr += ",scale=" + str(self.spinBox_xres.value()) + ":" + str(self.spinBox_yres.value()) 778 | else: 779 | astr += "scale=" + str(self.spinBox_xres.value()) + ":" + str(self.spinBox_yres.value()) 780 | return astr 781 | 782 | def getVmafRes(self): 783 | if self.checkBox_rescale.isChecked(): 784 | return str(self.spinBox_xres.value()) + "x" + str(self.spinBox_yres.value()) 785 | else: 786 | return "1920x1080" 787 | 788 | def setFromPresetDict(self, dict, restoreCropping): 789 | # 1.1 variables 790 | self.comboBox_encoder.setCurrentIndex(dict['enc']) 791 | self.changeEncoder(dict['enc']) 792 | self.spinBox_speed.setValue(dict['cpuused']) 793 | self.spinBox_jobs.setValue(dict['jobs']) 794 | self.spinBox_audio.setValue(dict['audiobr']) 795 | self.spinBox_threads.setValue(dict['threads']) 796 | self.checkBox_audio.setChecked(dict['audio']) 797 | self.spinBox_quality.setValue(dict['qual']) 798 | self.checkBox_videocmd.setChecked(dict['cusvid']) 799 | self.checkBox_audiocmd.setChecked(dict['cusaud']) 800 | self.checkBox_ffmpegcmd.setChecked(dict['cusffmpeg']) 801 | self.textEdit_videocmd.setPlainText(dict['vidcmd']) 802 | self.textEdit_audiocmd.setPlainText(dict['audcmd']) 803 | self.textEdit_ffmpegcmd.setPlainText(dict['ffmpegcmd']) 804 | self.presetbox.setCurrentIndex(dict['preset']) 805 | self.comboBox_quality.setCurrentIndex(dict['vq']) 806 | self.checkBox_bitrate.setChecked(dict['brmode']) 807 | self.checkBox_hdr.setChecked(dict['10b']) 808 | self.checkBox_resume.setChecked(dict['resume']) 809 | self.checkBox_tempfolder.setChecked(dict['keeptmp']) 810 | self.checkBox_rtenc.setChecked(dict['rtenc']) 811 | self.twopassState = dict['2p'] 812 | self.realtimeState = dict['rtenc'] 813 | self.checkBox_twopass.setChecked(dict['2p']) 814 | if (self.twopassState and self.realtimeState): 815 | self.twopassState = True 816 | self.realtimeState = False 817 | self.checkBox_rtenc.setChecked(False) 818 | self.checkBox_twopass.setChecked(True) 819 | print("Resetting invalid twopass and realtime state combos") 820 | 821 | # 1.2 variables 822 | self.spinBox_maxkfdist.setValue(dict['maxkfdist']) 823 | 824 | # 1.5 variables 825 | self.comboBox_inputFormat.setCurrentIndex(dict['inputFmt']) 826 | self.comboBox_colorspace.setCurrentIndex(dict['colordataCS']) 827 | self.lineEdit_colordata.setText(dict['colordataText']) 828 | self.checkBox_vmaf.setChecked(dict['isTargetVMAF']) 829 | self.spinBox_minq.setValue(dict['TargetVMAFMinQ']) 830 | self.spinBox_maxq.setValue(dict['TargetVMAFMaxQ']) 831 | self.spinBox_vmafsteps.setValue(dict['TargetVMAFSteps']) 832 | self.doubleSpinBox_vmaf.setValue(dict['TargetVMAFValue']) 833 | self.label_vmafpath.setText(dict['TargetVMAFPath']) 834 | self.checkBox_shutdown.setChecked(dict['ShutdownAfter']) 835 | 836 | # 2.0 variables 837 | self.checkBox_lsmash.setChecked(dict['usinglsmas']) 838 | self.comboBox_splitmode.setCurrentIndex(dict['splitmethod']) 839 | self.changeSplitmode(dict['splitmethod']) 840 | self.doubleSpinBox_split.setValue(dict['splittr']) 841 | self.spinBox_qjobs.setValue(dict['qjobs']) 842 | if restoreCropping: 843 | self.checkBox_cropping.setChecked(dict["iscropping"]) 844 | self.checkBox_rescale.setChecked(dict["rescale"]) 845 | self.spinBox_xres.setValue(dict["rescalex"]) 846 | self.spinBox_yres.setValue(dict["rescaley"]) 847 | self.spinBox_croptop.setValue(dict["croptop"]) 848 | self.spinBox_cropdown.setValue(dict["cropdown"]) 849 | self.spinBox_cropright.setValue(dict["cropright"]) 850 | self.spinBox_cropleft.setValue(dict["cropleft"]) 851 | 852 | def getPresetDict(self): 853 | return {'2p': self.checkBox_twopass.isChecked(), 'audio': self.checkBox_audio.isChecked(), 854 | 'enc': self.comboBox_encoder.currentIndex(), 855 | 'preset': self.presetbox.currentIndex(), 856 | 'vq': self.comboBox_quality.currentIndex(), 'brmode': self.checkBox_bitrate.isChecked(), 857 | '10b': self.checkBox_hdr.isChecked(), 'resume': self.checkBox_resume.isChecked(), 858 | 'keeptmp': self.checkBox_tempfolder.isChecked(), 'rtenc': self.checkBox_rtenc.isChecked(), 859 | 'qual': self.spinBox_quality.value(), 860 | 'splittr': self.doubleSpinBox_split.value(), 'cpuused': self.spinBox_speed.value(), 861 | 'jobs': self.spinBox_jobs.value(), 'audiobr': self.spinBox_audio.value(), 862 | 'threads': self.spinBox_threads.value(), 863 | 'cusvid': self.checkBox_videocmd.isChecked(), 'cusaud': self.checkBox_audiocmd.isChecked(), 864 | 'cusffmpeg': self.checkBox_ffmpegcmd.isChecked(), 'vidcmd': self.textEdit_videocmd.toPlainText(), 865 | 'audcmd': self.textEdit_audiocmd.toPlainText(), 'ffmpegcmd': self.textEdit_ffmpegcmd.toPlainText(), 866 | 'maxkfdist': self.spinBox_maxkfdist.value(), 867 | 'inputFmt': self.comboBox_inputFormat.currentIndex(), 868 | 'colordataCS': self.comboBox_colorspace.currentIndex(), 869 | 'colordataText': self.lineEdit_colordata.text(), 'isTargetVMAF': self.checkBox_vmaf.isChecked(), 870 | 'TargetVMAFMinQ': self.spinBox_minq.value(), 'TargetVMAFMaxQ': self.spinBox_maxq.value(), 871 | 'TargetVMAFSteps': self.spinBox_vmafsteps.value(), 'TargetVMAFValue': self.doubleSpinBox_vmaf.value(), 872 | 'TargetVMAFPath': self.label_vmafpath.text(), 'ShutdownAfter': self.checkBox_shutdown.isChecked(), 873 | 'usinglsmas' : self.checkBox_lsmash.isChecked(), 'splitmethod': self.comboBox_splitmode.currentIndex(), 874 | 'qjobs' : self.spinBox_qjobs.value(), 'iscropping' : self.checkBox_cropping.isChecked(), 875 | 'croptop' : self.spinBox_croptop.value(), 'cropright' : self.spinBox_cropright.value(), 876 | 'cropleft' : self.spinBox_cropleft.value(), 'cropdown' : self.spinBox_cropdown.value(), 877 | 'rescale' : self.checkBox_rescale.isChecked(), 'rescalex' : self.spinBox_xres.value(), 878 | 'rescaley' : self.spinBox_yres.value() 879 | } 880 | 881 | def getArgs(self): 882 | args = {'video_params': self.getVideoParams(), 'input': [Path(self.inputPath.text())], 'encoder': 'aom', 883 | 'workers': self.spinBox_jobs.value(), 'audio_params': self.getAudioParams(), 884 | 'threshold': self.doubleSpinBox_split.value(), 885 | 'passes': (2 if self.checkBox_twopass.isChecked() else 1), 'output_file': Path(self.outputPath.text()), 886 | 'scenes': None, 'resume': self.checkBox_resume.isChecked(), 887 | 'keep': self.checkBox_tempfolder.isChecked(), 888 | 'pix_format': self.comboBox_inputFormat.currentText(), 'ffmpeg': self.getFFMPEGParams(), 889 | 'threads': self.spinBox_threads.value(), 890 | 'split_method': self.getSplitMethod(), 891 | 'chunk_method': ("vs_lsmash" if self.checkBox_lsmash.isChecked() and self.checkBox_lsmash.isEnabled() else "segment"), 892 | 'temp': Path( 893 | str(os.path.dirname(self.outputPath.text())) + "/temp_" + str( 894 | os.path.basename(self.outputPath.text()))), 'probes': self.spinBox_vmafsteps.value(), 895 | 'min_q': self.spinBox_minq.value(), 'max_q': self.spinBox_maxq.value(), 896 | 'target_quality': (self.doubleSpinBox_vmaf.value() if self.checkBox_vmaf.isChecked() else None), 897 | 'vmaf_path': self.label_vmafpath.text(), 'vmaf_filter': self.getVmafFilter(), 898 | 'vmaf_res': self.getVmafRes(), 'min_scene_len': 60, 'target_quality_method': 'per_shot', 899 | 'probing_rate' : 2, 'n_threads': self.spinBox_threads.value()} 900 | if self.comboBox_splitmode.currentIndex() == 1: 901 | args["extra_split"] = self.spinBox_maxkfdist.value() 902 | else: 903 | args["extra_split"] = None 904 | 905 | if self.comboBox_encoder.currentIndex() >= 1: 906 | args['encoder'] = 'vpx' 907 | args['temp'] = Path(str((args['temp'])).replace("'", "_")) 908 | return args 909 | 910 | def encodeVideoQueue(self): 911 | if (self.runningEncode): 912 | self.encodeVideo1() 913 | return 914 | self.encodeVideo1() 915 | self.runningEncode = True 916 | self.runningQueueMode = True 917 | self.currentFrames = [0] * len(self.encodeList) 918 | self.totalFrames = [0] * len(self.encodeList) 919 | self.worker = EncodeWorker(self.encodeList, self, self.checkBox_shutdown.isChecked(), self.spinBox_qjobs.value()) 920 | self.workerThread = QtCore.QThread() 921 | self.worker.newFrames.connect(self.addFrames) 922 | self.worker.startEncode.connect(self.startEncode) 923 | self.worker.newTask.connect(self.newTask) 924 | self.worker.encodeFinished.connect(self.encodeFinished) 925 | self.worker.moveToThread(self.workerThread) # Move the Worker object to the Thread object 926 | self.workerThread.started.connect(self.worker.run) # Init worker run() at startup (optional) 927 | self.workerThread.start() 928 | 929 | def encodeVideo(self): 930 | if (self.runningEncode): 931 | self.encodeVideo1() 932 | return 933 | args = [self.getArgs(), self.getPresetDict()] 934 | self.encodeVideo1() 935 | print("Running in non-queued mode with a single video") 936 | self.runningEncode = True 937 | self.runningQueueMode = False 938 | self.worker = EncodeWorker([args], self, self.checkBox_shutdown.isChecked(), 1) 939 | self.workerThread = QtCore.QThread() 940 | self.worker.newFrames.connect(self.addFrames) 941 | self.worker.startEncode.connect(self.startEncode) 942 | self.worker.newTask.connect(self.newTask) 943 | self.worker.encodeFinished.connect(self.encodeFinished) 944 | self.worker.moveToThread(self.workerThread) # Move the Worker object to the Thread object 945 | self.workerThread.started.connect(self.worker.run) # Init worker run() at startup (optional) 946 | self.workerThread.start() 947 | 948 | def encodeVideo1(self): 949 | if (self.runningEncode): 950 | if (self.currentlyRunning): 951 | buttonReply = QMessageBox.question(self, 'Stop encode?', 952 | "Warning: You may lose encoding progress.", 953 | QMessageBox.Yes | QMessageBox.No, QMessageBox.No) 954 | if buttonReply != QMessageBox.Yes: 955 | return 956 | 957 | self.finalizeEncode() 958 | return 959 | print("Writing current settings to config") 960 | curSettings = self.getPresetDict() 961 | file_pi = open(self.configpath, 'wb') 962 | pickle.dump(curSettings, file_pi) 963 | file_pi.close() 964 | self.actionOpen.setEnabled(0) 965 | self.actionSave.setEnabled(0) 966 | self.actionSave_Queue.setEnabled(0) 967 | self.actionSave_Queue_As.setEnabled(0) 968 | self.actionOpen_Queue.setEnabled(0) 969 | self.actionSave_Preset.setEnabled(0) 970 | self.actionOpen_Preset.setEnabled(0) 971 | self.actionReset_All_Settings.setEnabled(0) 972 | self.label_3.setEnabled(0) 973 | self.label_threads.setEnabled(0) 974 | self.spinBox_threads.setEnabled(0) 975 | self.checkBox_videocmd.setEnabled(0) 976 | self.checkBox_audiocmd.setEnabled(0) 977 | self.checkBox_ffmpegcmd.setEnabled(0) 978 | self.textEdit_videocmd.setEnabled(0) 979 | self.textEdit_audiocmd.setEnabled(0) 980 | self.textEdit_ffmpegcmd.setEnabled(0) 981 | self.currentlyRunning = True 982 | self.pushButton.setEnabled(1) 983 | self.pushButton.setText("Cancel") 984 | self.pushButton_encQueue.setEnabled(0) 985 | self.pushButton_save.setEnabled(0) 986 | self.progressBar_total.setEnabled(1) 987 | self.spinBox_audio.setEnabled(0) 988 | self.spinBox_quality.setEnabled(0) 989 | self.spinBox_speed.setEnabled(0) 990 | self.doubleSpinBox_split.setEnabled(0) 991 | self.spinBox_jobs.setEnabled(0) 992 | self.label_jobs.setEnabled(0) 993 | self.inputFileChoose.setEnabled(0) 994 | self.outputFileChoose.setEnabled(0) 995 | self.label_2.setEnabled(0) 996 | self.label_audio.setEnabled(0) 997 | self.label_q.setEnabled(0) 998 | self.label_split.setEnabled(0) 999 | self.label_inputformat.setEnabled(0) 1000 | self.label_6.setEnabled(0) 1001 | self.comboBox_colorspace.setEnabled(0) 1002 | self.comboBox_inputFormat.setEnabled(0) 1003 | self.comboBox_quality.setEnabled(0) 1004 | self.presetbox.setEnabled(0) 1005 | self.checkBox_audio.setEnabled(0) 1006 | self.checkBox_bitrate.setEnabled(0) 1007 | self.checkBox_hdr.setEnabled(0) 1008 | self.checkBox_resume.setEnabled(0) 1009 | self.checkBox_rtenc.setEnabled(0) 1010 | self.checkBox_tempfolder.setEnabled(0) 1011 | self.checkBox_twopass.setEnabled(0) 1012 | self.label_preset.setEnabled(0) 1013 | self.label_quality.setEnabled(0) 1014 | self.label_4.setEnabled(0) 1015 | self.comboBox_encoder.setEnabled(0) 1016 | self.pushButton_up.setEnabled(0) 1017 | self.pushButton_down.setEnabled(0) 1018 | self.pushButton_del.setEnabled(0) 1019 | self.label_status.setEnabled(1) # self.setupUi(self) 1020 | self.label_status.setText("Initializing...") 1021 | self.inputPath.setText("") 1022 | self.outputPath.setText("") 1023 | self.pushButton_del.setEnabled(0) 1024 | self.label_maxkfdist.setEnabled(0) 1025 | self.spinBox_maxkfdist.setEnabled(0) 1026 | self.pushButton_edit.setEnabled(0) 1027 | self.checkBox_cropping.setEnabled(0) 1028 | self.checkBox_rescale.setEnabled(0) 1029 | self.label_xres.setEnabled(0) 1030 | self.label_yres.setEnabled(0) 1031 | self.spinBox_yres.setEnabled(0) 1032 | self.spinBox_xres.setEnabled(0) 1033 | self.spinBox_cropleft.setEnabled(0) 1034 | self.spinBox_cropright.setEnabled(0) 1035 | self.spinBox_croptop.setEnabled(0) 1036 | self.spinBox_cropdown.setEnabled(0) 1037 | self.checkBox_vmaf.setEnabled(0) 1038 | self.label_qmin.setEnabled(0) 1039 | self.label_teststeps.setEnabled(0) 1040 | self.label_target.setEnabled(0) 1041 | self.pushButton_vmafmodel.setEnabled(0) 1042 | self.label_vmafpath.setEnabled(0) 1043 | self.spinBox_minq.setEnabled(0) 1044 | self.spinBox_vmafsteps.setEnabled(0) 1045 | self.doubleSpinBox_vmaf.setEnabled(0) 1046 | self.spinBox_maxq.setEnabled(0) 1047 | self.label_maxq.setEnabled(0) 1048 | self.checkBox_shutdown.setEnabled(0) 1049 | self.checkBox_lsmash.setEnabled(0) 1050 | self.comboBox_splitmode.setEnabled(0) 1051 | self.label_splitmode.setEnabled(0) 1052 | self.label_qjobs.setEnabled(0) 1053 | self.spinBox_qjobs.setEnabled(0) 1054 | 1055 | def finalizeEncode(self): 1056 | self.workerThread.quit() 1057 | self.workerThread.wait(2000) 1058 | self.killFlag = True 1059 | self.workerThread.wait() 1060 | self.killFlag = False 1061 | self.runningEncode = False 1062 | self.currentlyRunning = False 1063 | self.pushButton.setStyleSheet("") 1064 | self.pushButton.setText("▶ Encode") 1065 | self.label_threads.setEnabled(1) 1066 | self.spinBox_threads.setEnabled(1) 1067 | self.checkBox_audio.setEnabled(1) 1068 | self.spinBox_speed.setEnabled(1) 1069 | self.spinBox_speed.setValue(self.spinBox_speed.value()) 1070 | self.spinBox_jobs.setEnabled(1) 1071 | self.label_jobs.setEnabled(1) 1072 | self.inputFileChoose.setEnabled(1) 1073 | self.outputFileChoose.setEnabled(1) 1074 | self.inputPath.setText("") 1075 | self.outputPath.setText("") 1076 | self.label_threads.setEnabled(1) 1077 | self.spinBox_threads.setEnabled(1) 1078 | self.label_2.setEnabled(1) 1079 | self.label_q.setEnabled(1) 1080 | self.checkBox_shutdown.setEnabled(1) 1081 | self.label_split.setEnabled(1) 1082 | self.comboBox_splitmode.setEnabled(1) 1083 | self.label_splitmode.setEnabled(1) 1084 | if self.comboBox_splitmode.currentIndex() != 1: 1085 | self.doubleSpinBox_split.setEnabled(1) 1086 | 1087 | self.label_inputformat.setEnabled(1) 1088 | self.label_6.setEnabled(1) 1089 | self.label_5.setEnabled(1) 1090 | self.comboBox_colorspace.setEnabled(1) 1091 | self.comboBox_inputFormat.setEnabled(1) 1092 | self.comboBox_quality.setEnabled(1) 1093 | self.presetbox.setEnabled(1) 1094 | self.checkBox_hdr.setEnabled(1) 1095 | self.checkBox_resume.setEnabled(1) 1096 | if (self.spinBox_speed.value() < 7 or self.comboBox_encoder.currentIndex() != 0): 1097 | self.checkBox_rtenc.setEnabled(1) 1098 | self.checkBox_tempfolder.setEnabled(1) 1099 | if (self.checkBox_audio.isChecked()): 1100 | self.spinBox_audio.setEnabled(1) 1101 | self.label_audio.setEnabled(1) 1102 | self.spinBox_quality.setEnabled(1) 1103 | self.checkBox_bitrate.setEnabled(1) 1104 | self.label_preset.setEnabled(1) 1105 | self.enableDisableVmaf() 1106 | if (not self.checkBox_bitrate.isChecked()): 1107 | self.checkBox_vmaf.setEnabled(1) 1108 | self.comboBox_quality.setEnabled(1) 1109 | self.label_quality.setEnabled(1) 1110 | if (not self.checkBox_rtenc.isChecked()): 1111 | self.checkBox_twopass.setEnabled(1) 1112 | self.label_status.setEnabled(0) # self.setupUi(self) 1113 | self.label_4.setEnabled(1) 1114 | self.comboBox_encoder.setEnabled(1) 1115 | self.label_3.setEnabled(1) 1116 | self.checkBox_videocmd.setEnabled(1) 1117 | self.checkBox_audiocmd.setEnabled(1) 1118 | self.checkBox_ffmpegcmd.setEnabled(1) 1119 | if (self.checkBox_videocmd.isChecked()): 1120 | self.textEdit_videocmd.setEnabled(1) 1121 | if (self.checkBox_ffmpegcmd.isChecked()): 1122 | self.textEdit_ffmpegcmd.setEnabled(1) 1123 | if (self.checkBox_audiocmd.isChecked()): 1124 | self.textEdit_audiocmd.setEnabled(1) 1125 | self.encodeList = [] 1126 | self.redrawQueueList() 1127 | self.pushButton_up.setEnabled(1) 1128 | self.pushButton_down.setEnabled(1) 1129 | self.pushButton_del.setEnabled(1) 1130 | self.pushButton_edit.setEnabled(1) 1131 | self.pushButton_save.setEnabled(0) 1132 | self.progressBar_total.setValue(0) 1133 | self.pushButton.setEnabled(0) 1134 | self.pushButton_encQueue.setEnabled(0) 1135 | self.label_maxkfdist.setEnabled(1) 1136 | self.spinBox_maxkfdist.setEnabled(1) 1137 | self.actionOpen.setEnabled(1) 1138 | self.actionSave.setEnabled(1) 1139 | self.actionSave_Queue.setEnabled(1) 1140 | self.actionSave_Queue_As.setEnabled(1) 1141 | self.actionOpen_Queue.setEnabled(1) 1142 | self.actionSave_Preset.setEnabled(1) 1143 | self.actionOpen_Preset.setEnabled(1) 1144 | self.actionReset_All_Settings.setEnabled(1) 1145 | self.checkBox_cropping.setEnabled(1) 1146 | self.checkBox_rescale.setEnabled(1) 1147 | self.label_qjobs.setEnabled(1) 1148 | self.spinBox_qjobs.setEnabled(1) 1149 | self.checkBox_lsmash.setEnabled(self.hasLsmash) 1150 | self.enableCropping() 1151 | self.enableRescale() 1152 | self.enableDisableVmaf() 1153 | print("Enabled all buttons, returning program to normal") 1154 | 1155 | 1156 | class EncodeWorker(QtCore.QObject): 1157 | newTask = QtCore.pyqtSignal(str, str, int) 1158 | startEncode = QtCore.pyqtSignal(str, int, int) 1159 | encodeFinished = QtCore.pyqtSignal(str, int) 1160 | newFrames = QtCore.pyqtSignal(str, int) 1161 | runningPav1n = False 1162 | 1163 | def __init__(self, argdata, window, shutdown, numcores): 1164 | super().__init__() 1165 | self.argdat = argdata 1166 | self.window = window 1167 | self.shutdown = shutdown 1168 | self.numcores = numcores 1169 | self.istty = sys.stdin.isatty() 1170 | 1171 | def runProcessing(self, dictargs, index): 1172 | if self.window.killFlag: 1173 | return 1174 | self.window.scenedetectFailState = -1 1175 | if os.path.isfile(dictargs['output_file']): 1176 | print("Already completed file: " + str(dictargs['output_file']) + " . Please delete this file first") 1177 | self.encodeFinished.emit(str(index), 0) 1178 | return 1179 | av1an = get_av1an(get_av1an_proj(merge_args(dictargs))) 1180 | proj = av1an.projects[0] 1181 | state = [0, 0, 0] 1182 | t = threading.Thread(target=run_av1an, args=[av1an]) 1183 | t.start() 1184 | initFrames = 0 1185 | while t.is_alive(): 1186 | if state[2] == 0: 1187 | state[2] = proj.frames 1188 | if state[2] != 0: 1189 | state[0] = 1 1190 | self.startEncode.emit(str(index), state[2], 0) 1191 | if proj.counter is not None and state[0] == 1: 1192 | prev = state[1] 1193 | initFrames = done_count(dictargs['temp'], dictargs['resume']) 1194 | state[1] = proj.counter.get_frames() + initFrames 1195 | state[2] = proj.frames 1196 | if prev != state[1]: 1197 | self.newFrames.emit(str(index), state[1] - prev) 1198 | state[0] = 2 1199 | if state[0] == 2: 1200 | prev = state[1] 1201 | state[1] = proj.counter.get_frames() + initFrames 1202 | state[2] = proj.frames 1203 | if prev != state[1]: 1204 | self.newFrames.emit(str(index), state[1] - prev) 1205 | sleep(0.5) 1206 | if self.window.killFlag: 1207 | self.encodeFinished.emit(str(index), 1) 1208 | me = psutil.Process(os.getpid()) 1209 | for child in me.children(recursive=True): 1210 | child.kill() 1211 | os.execl(sys.executable, sys.executable, *sys.argv) 1212 | return 1213 | self.encodeFinished.emit(str(index), 0) 1214 | print("\n\nEncode completed for " + str(dictargs['input']) + " -> " + str(dictargs['output_file'])) 1215 | 1216 | def run(self): 1217 | 1218 | print("Running") 1219 | self.runningPav1n = True 1220 | with concurrent.futures.ThreadPoolExecutor(max_workers=self.numcores) as executor: 1221 | future_cmd = {executor.submit(self.runProcessing, self.argdat[i][0], i): i for i in range(len(self.argdat))} 1222 | for future in concurrent.futures.as_completed(future_cmd): 1223 | try: 1224 | future.result() 1225 | except Exception as e: 1226 | print(e) 1227 | traceback.print_exc() 1228 | if len(self.argdat) > 1: 1229 | self.encodeFinished.emit("-1", 0) 1230 | if self.shutdown: 1231 | if sys.platform.startswith('win'): 1232 | os.system('shutdown -s') 1233 | else: 1234 | try: 1235 | os.system('systemctl poweroff') 1236 | except Exception as e: 1237 | # If that doesn't work we can try shutting down the "other" way 1238 | os.system("shutdown now -h") 1239 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | psutil~=5.7.3 2 | PyQt5~=5.15.2 3 | Av1an-minimal 4 | scenedetect~=0.5.4.1 5 | setuptools~=51.0.0 6 | -------------------------------------------------------------------------------- /screenshots/complex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/natis1/qencoder/3d693f72756639a9c5751069bda4d29d8bffd35c/screenshots/complex.png -------------------------------------------------------------------------------- /screenshots/cores.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/natis1/qencoder/3d693f72756639a9c5751069bda4d29d8bffd35c/screenshots/cores.png -------------------------------------------------------------------------------- /screenshots/queue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/natis1/qencoder/3d693f72756639a9c5751069bda4d29d8bffd35c/screenshots/queue.png -------------------------------------------------------------------------------- /screenshots/simple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/natis1/qencoder/3d693f72756639a9c5751069bda4d29d8bffd35c/screenshots/simple.png -------------------------------------------------------------------------------- /screenshots/vmaf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/natis1/qencoder/3d693f72756639a9c5751069bda4d29d8bffd35c/screenshots/vmaf.png -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | REQUIRES = [ 4 | 'PyQt5', 5 | 'psutil', 6 | 'Av1an', 7 | ] 8 | 9 | with open("README.md", "r") as f: 10 | long_description = f.read() 11 | 12 | setuptools.setup( 13 | name="qencoder", 14 | version="2.1.4", 15 | author="Eli Stone", 16 | author_email="eli.stonium@gmail.com", 17 | description="Qt graphical interface for encoding", 18 | long_description=long_description, 19 | long_description_content_type="text/markdown", 20 | url="https://github.com/natis1/qencoder", 21 | packages=setuptools.find_packages('.', exclude='tests'), 22 | install_requires=REQUIRES, 23 | py_modules=['qenc', 'qencoder/mainwindow', 'qencoder/window', 'qencoder/av1anworkarounds'], 24 | entry_points={"console_scripts": ["qencoder=qenc:main"]}, 25 | classifiers=[ 26 | "Programming Language :: Python :: 3", 27 | "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", 28 | "Operating System :: OS Independent", 29 | ], 30 | python_requires='>=3.7', 31 | ) 32 | -------------------------------------------------------------------------------- /window.pyproject: -------------------------------------------------------------------------------- 1 | { 2 | "files": ["qencoder/pav1n.py","qencoder/mainwindow.py","qencoder/mainwindow.ui","qencoder/window.py","qenc.py"] 3 | } 4 | --------------------------------------------------------------------------------