Compare commits
12 commits
Author | SHA1 | Date | |
---|---|---|---|
c8538f5d03 | |||
2c2f469cc5 | |||
7973a02603 | |||
a6fe54fd9c | |||
20052ed7d6 | |||
877021ee0d | |||
fce9bce308 | |||
0ed6407315 | |||
af921925af | |||
cb9de1b856 | |||
1d1c0f78bc | |||
6fffd19278 |
7 changed files with 85 additions and 147 deletions
|
@ -25,3 +25,4 @@ jobs:
|
|||
with:
|
||||
token: ${{ secrets.TOKEN }}
|
||||
files: out/make/zip/win32/x64/dsr-win32-x64-${{ github.ref_name }}.zip
|
||||
draft: true
|
||||
|
|
18
README.md
18
README.md
|
@ -4,7 +4,7 @@ Tool for sharing video to Discord.
|
|||
|
||||
> This tool was primarily made for video captured by NVidia Shadowplay.
|
||||
|
||||
## Download/Install
|
||||
## Download/Install/Update
|
||||
|
||||
2 choices :
|
||||
|
||||
|
@ -16,21 +16,23 @@ Tool for sharing video to Discord.
|
|||
```
|
||||
|
||||
> - If you have Discord Nitro: add `/nitro` flag when running DSR.
|
||||
> - If you have Discord Nitro Basic: add `/nitrobasic` flag when running DSR.
|
||||
> - If you have an NVidia GPU with NVenc: add `/nvenc` flag when running DSR.
|
||||
|
||||
## More info
|
||||
|
||||
- [x] KISS interface
|
||||
- [x] Support drag&drop into the icon
|
||||
- [x] Keep the video under 25mb (discord limitation)
|
||||
- [x] NVenc support
|
||||
- [x] Keep the video under discord limitation
|
||||
- [x] If already under the limit, the file won't be compressed
|
||||
- [x] Nitro suppport via `/nitro` flag
|
||||
- [x] Merge audio files into one track when recorded with system audio and microphone
|
||||
split up, while keeping the original ones (with conveninant metadata)
|
||||
- [x] Works also with file with only one audio track
|
||||
- [x] Basic NVenc support
|
||||
- [x] Nitro suppport via flags
|
||||
- [x] Merge 2 audio files into one track when recorded with system audio and microphone
|
||||
split up, while keeping the original ones (with conveniant metadata)
|
||||
- [x] Works also with file with only one or more than 2 audio track, by doing
|
||||
nothing
|
||||
- [x] Support multiples files at once
|
||||
- [x] Optimize for video streaming
|
||||
- [x] Always optimize for video streaming
|
||||
|
||||
## Package the app for Windows
|
||||
|
||||
|
|
176
package-lock.json
generated
176
package-lock.json
generated
|
@ -1,19 +1,18 @@
|
|||
{
|
||||
"name": "dsr",
|
||||
"version": "1.9.1",
|
||||
"version": "1.9.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "dsr",
|
||||
"version": "1.9.1",
|
||||
"version": "1.9.3",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@electron-forge/maker-zip": "^7.4",
|
||||
"ffmpeg-static": "^5.2",
|
||||
"ffprobe-static": "^3.1",
|
||||
"terminate": "^2.8",
|
||||
"typescript": "^5.5"
|
||||
"typescript": "^5.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-forge/cli": "^7.4",
|
||||
|
@ -312,11 +311,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@electron/asar": {
|
||||
"version": "3.2.10",
|
||||
"resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.2.10.tgz",
|
||||
"integrity": "sha512-mvBSwIBUeiRscrCeJE1LwctAriBj65eUDm0Pc11iE5gRwzkmsdbS7FnZ1XUWjpSeQWL1L5g12Fc/SchPM9DUOw==",
|
||||
"version": "3.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.2.11.tgz",
|
||||
"integrity": "sha512-L373+owaTGjko13wS/KlbxC4cyqwTmWg740nb3pwQSmV0kcoS1oP/JE5WfyRkNbhw3GFzJXk0y3pBawgXNc5oA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/glob": "^7.1.0",
|
||||
"commander": "^5.0.0",
|
||||
"glob": "^7.1.6",
|
||||
"minimatch": "^3.0.4"
|
||||
|
@ -761,6 +761,16 @@
|
|||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/glob": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/minimatch": "*",
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/http-cache-semantics": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz",
|
||||
|
@ -776,10 +786,16 @@
|
|||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/minimatch": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz",
|
||||
"integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "20.16.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.2.tgz",
|
||||
"integrity": "sha512-91s/n4qUPV/wg8eE9KHYW1kouTfDk2FPGjXbBMfRWP/2vg1rCXNQL1OCabwGs0XSdukuK+MwCDXE30QpSeMUhQ==",
|
||||
"version": "22.5.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz",
|
||||
"integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~6.19.2"
|
||||
|
@ -872,9 +888,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/ansi-regex": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
|
||||
"integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
|
||||
"integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
|
@ -1462,12 +1478,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.6",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz",
|
||||
"integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==",
|
||||
"version": "4.3.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
|
||||
"integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "2.1.2"
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
|
@ -1594,12 +1610,6 @@
|
|||
"p-limit": "^3.1.0 "
|
||||
}
|
||||
},
|
||||
"node_modules/duplexer": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",
|
||||
"integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/eastasianwidth": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
|
||||
|
@ -1607,9 +1617,9 @@
|
|||
"license": "MIT"
|
||||
},
|
||||
"node_modules/electron": {
|
||||
"version": "32.0.1",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-32.0.1.tgz",
|
||||
"integrity": "sha512-5Hd5Jaf9niYVR2hZxoRd3gOrcxPOxQV1XPV5WaoSfT9jLJHFadhlKtuSDIk3U6rQZke+aC7GqPPAv55nWFCMsA==",
|
||||
"version": "32.0.2",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-32.0.2.tgz",
|
||||
"integrity": "sha512-nmZblq8wW3HZ17MAyaUuiMI9Mb0Cgc7UR3To85h/rVopbfyF5s34NxtK4gvyRfYPxpDGP4k+HoQIPniPPrdE3w==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
|
@ -1647,6 +1657,16 @@
|
|||
"global-agent": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron/node_modules/@types/node": {
|
||||
"version": "20.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.5.tgz",
|
||||
"integrity": "sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~6.19.2"
|
||||
}
|
||||
},
|
||||
"node_modules/electron/node_modules/fs-extra": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
|
||||
|
@ -1793,21 +1813,6 @@
|
|||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/event-stream": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",
|
||||
"integrity": "sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"duplexer": "~0.1.1",
|
||||
"from": "~0",
|
||||
"map-stream": "~0.1.0",
|
||||
"pause-stream": "0.0.11",
|
||||
"split": "0.3",
|
||||
"stream-combiner": "~0.0.4",
|
||||
"through": "~2.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/eventemitter3": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
|
||||
|
@ -2085,12 +2090,6 @@
|
|||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/from": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz",
|
||||
"integrity": "sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fs-extra": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
|
||||
|
@ -3051,11 +3050,6 @@
|
|||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/map-stream": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz",
|
||||
"integrity": "sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g=="
|
||||
},
|
||||
"node_modules/matcher": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz",
|
||||
|
@ -3250,9 +3244,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/negotiator": {
|
||||
|
@ -3708,18 +3702,6 @@
|
|||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/pause-stream": {
|
||||
"version": "0.0.11",
|
||||
"resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz",
|
||||
"integrity": "sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==",
|
||||
"license": [
|
||||
"MIT",
|
||||
"Apache2"
|
||||
],
|
||||
"dependencies": {
|
||||
"through": "~2.3"
|
||||
}
|
||||
},
|
||||
"node_modules/pe-library": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pe-library/-/pe-library-1.0.1.tgz",
|
||||
|
@ -3897,21 +3879,6 @@
|
|||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/ps-tree": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz",
|
||||
"integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"event-stream": "=3.3.4"
|
||||
},
|
||||
"bin": {
|
||||
"ps-tree": "bin/ps-tree.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/pump": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
|
||||
|
@ -4504,18 +4471,6 @@
|
|||
"integrity": "sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==",
|
||||
"license": "CC0-1.0"
|
||||
},
|
||||
"node_modules/split": {
|
||||
"version": "0.3.3",
|
||||
"resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz",
|
||||
"integrity": "sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"through": "2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/sprintf-js": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz",
|
||||
|
@ -4534,15 +4489,6 @@
|
|||
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/stream-combiner": {
|
||||
"version": "0.0.4",
|
||||
"resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz",
|
||||
"integrity": "sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"duplexer": "~0.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/string_decoder": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
|
@ -4693,24 +4639,6 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/terminate": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/terminate/-/terminate-2.8.0.tgz",
|
||||
"integrity": "sha512-bcbjJEg0wY5nuJXvGxxHfmoEPkyHLCctUKO6suwtxy7jVSgGcgPeGwpbLDLELFhIaxCGRr3dPvyNg1yuz2V0eg==",
|
||||
"license": "GPL-2.0",
|
||||
"dependencies": {
|
||||
"ps-tree": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/through": {
|
||||
"version": "2.3.8",
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
|
@ -4771,9 +4699,9 @@
|
|||
"license": "MIT"
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.5.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz",
|
||||
"integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==",
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz",
|
||||
"integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
|
|
10
package.json
10
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "dsr",
|
||||
"version": "1.9.1",
|
||||
"version": "1.9.3",
|
||||
"description": "Discord Video Sharing",
|
||||
"main": "./dist/main.js",
|
||||
"scripts": {
|
||||
|
@ -21,8 +21,7 @@
|
|||
"@electron-forge/maker-zip": "^7.4",
|
||||
"ffmpeg-static": "^5.2",
|
||||
"ffprobe-static": "^3.1",
|
||||
"terminate": "^2.8",
|
||||
"typescript": "^5.5"
|
||||
"typescript": "^5.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-forge/cli": "^7.4",
|
||||
|
@ -32,7 +31,10 @@
|
|||
"config": {
|
||||
"forge": {
|
||||
"packagerConfig": {
|
||||
"icon": "./image/icon.ico"
|
||||
"icon": "./image/icon.ico",
|
||||
"asarOptions": {
|
||||
"unpack": "**/node_modules/*-static/**"
|
||||
}
|
||||
},
|
||||
"makers": [
|
||||
{
|
||||
|
|
|
@ -11,9 +11,9 @@ import {
|
|||
processes,
|
||||
} from "./utils/misc";
|
||||
import path = require("path");
|
||||
import ffmpegPath = require("ffmpeg-static");
|
||||
|
||||
const kill = require("terminate");
|
||||
import ffmpeg = require("ffmpeg-static");
|
||||
const ffmpegPath = `${ffmpeg}`.replace("app.asar", "app.asar.unpacked");
|
||||
|
||||
let error = false;
|
||||
|
||||
|
@ -147,7 +147,7 @@ app.whenReady().then(() => {
|
|||
bitrate: number,
|
||||
nbTracks: number
|
||||
) => {
|
||||
const audioBitrate = 400; // keep some room
|
||||
const audioBitrate = 500; // keep some room
|
||||
let videoBitrate = bitrate - audioBitrate;
|
||||
|
||||
const finalFile = getNewFilename(file, "Compressed - ");
|
||||
|
@ -239,7 +239,7 @@ app.whenReady().then(() => {
|
|||
|
||||
app.on("window-all-closed", () => {
|
||||
processes.forEach((process) => {
|
||||
kill(process.pid);
|
||||
process.stdin.write("q");
|
||||
});
|
||||
|
||||
app.quit();
|
||||
|
|
|
@ -56,13 +56,16 @@ const getFiles = async () => {
|
|||
/** Returns maximum allowed size for files in MB */
|
||||
const fetchMaxSize = async () => {
|
||||
const argv = await internals.argv();
|
||||
if (argv.includes("/nitro")) {
|
||||
if (argv.includes("/nitrobasic")) {
|
||||
// Nitro Basic user
|
||||
return 50;
|
||||
} else if (argv.includes("/nitro")) {
|
||||
// Nitro user
|
||||
return 500;
|
||||
} else {
|
||||
// Free user
|
||||
return 25;
|
||||
}
|
||||
|
||||
// Free user
|
||||
return 25;
|
||||
};
|
||||
|
||||
/** Either replace the message, or add some info */
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import ffprobe = require("ffprobe-static");
|
||||
import child_process = require("child_process");
|
||||
import path = require("path");
|
||||
import { BrowserWindow } from "electron";
|
||||
import { existsSync, unlink } from "fs";
|
||||
|
||||
import ffprobe = require("ffprobe-static");
|
||||
const ffprobePath = ffprobe.path.replace("app.asar", "app.asar.unpacked");
|
||||
|
||||
export const processes: child_process.ChildProcess[] = [];
|
||||
|
||||
/** Create a new filename from the OG one */
|
||||
|
@ -14,14 +16,14 @@ export const getNewFilename = (ogFile: string, part: string) => {
|
|||
|
||||
/** Return the duration of a video in second */
|
||||
export const getVideoDuration = (file: string) => {
|
||||
const command = `"${ffprobe.path}" -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "${file}"`;
|
||||
const command = `"${ffprobePath}" -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "${file}"`;
|
||||
const durationString = child_process.execSync(command).toString().trim();
|
||||
return parseFloat(durationString);
|
||||
};
|
||||
|
||||
/** Return the number of audio tracks */
|
||||
export const getNumberOfAudioTracks = (file: string) => {
|
||||
const command = `"${ffprobe.path}" -v error -show_entries stream=index -select_streams a -of json "${file}"`;
|
||||
const command = `"${ffprobePath}" -v error -show_entries stream=index -select_streams a -of json "${file}"`;
|
||||
const result = child_process.execSync(command, { encoding: "utf8" });
|
||||
return JSON.parse(result).streams.length;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue