From ba5df1e3e6aee1300728f9c3abe3d2d73e95b18c Mon Sep 17 00:00:00 2001 From: Subhamoy Biswas Date: Mon, 11 Aug 2025 22:09:13 +0530 Subject: [PATCH] refactor: using ffmpeg as sidecar, bumped up ffmpeg to 7.1.1 and added ffprobe --- .editorconfig | 18 +++++++++++++++++ .gitattributes | 3 +-- makeFilesExecutable.js | 1 - .../binaries/ffmpeg-aarch64-apple-darwin | 3 +++ src-tauri/binaries/ffmpeg-x86_64-apple-darwin | 3 +++ .../ffmpeg-x86_64-pc-windows-msvc.exe | 3 +++ .../binaries/ffmpeg-x86_64-unknown-linux-gnu | 3 +++ .../binaries/ffprobe-aarch64-apple-darwin | 3 +++ .../binaries/ffprobe-x86_64-apple-darwin | 3 +++ .../ffprobe-x86_64-pc-windows-msvc.exe | 3 +++ .../binaries/ffprobe-x86_64-unknown-linux-gnu | 3 +++ src-tauri/capabilities/shell.json | 20 +++++++++++++++++++ .../binaries/ffmpeg-aarch64-apple-darwin | 3 --- .../binaries/ffmpeg-x86_64-apple-darwin | 3 --- .../ffmpeg-x86_64-pc-windows-msvc.exe | 3 --- .../binaries/ffmpeg-x86_64-unknown-linux-gnu | 3 --- src-tauri/tauri.linux.conf.json | 7 +++---- src-tauri/tauri.macos-aarch64.conf.json | 5 +++-- src-tauri/tauri.macos-x86_64.conf.json | 5 +++-- src-tauri/tauri.windows.conf.json | 5 +++-- src/App.tsx | 4 ++-- 21 files changed, 77 insertions(+), 27 deletions(-) create mode 100644 .editorconfig create mode 100644 src-tauri/binaries/ffmpeg-aarch64-apple-darwin create mode 100644 src-tauri/binaries/ffmpeg-x86_64-apple-darwin create mode 100644 src-tauri/binaries/ffmpeg-x86_64-pc-windows-msvc.exe create mode 100644 src-tauri/binaries/ffmpeg-x86_64-unknown-linux-gnu create mode 100644 src-tauri/binaries/ffprobe-aarch64-apple-darwin create mode 100644 src-tauri/binaries/ffprobe-x86_64-apple-darwin create mode 100644 src-tauri/binaries/ffprobe-x86_64-pc-windows-msvc.exe create mode 100644 src-tauri/binaries/ffprobe-x86_64-unknown-linux-gnu delete mode 100644 src-tauri/resources/binaries/ffmpeg-aarch64-apple-darwin delete mode 100644 src-tauri/resources/binaries/ffmpeg-x86_64-apple-darwin delete mode 100644 src-tauri/resources/binaries/ffmpeg-x86_64-pc-windows-msvc.exe delete mode 100644 src-tauri/resources/binaries/ffmpeg-x86_64-unknown-linux-gnu diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1938b93 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 + +[docker-compose.yml] +indent_size = 4 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index e2d2c1a..25909c8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,3 @@ * text=auto eol=lf -src-tauri/binaries/* filter=lfs diff=lfs merge=lfs -text -src-tauri/resources/binaries/* filter=lfs diff=lfs merge=lfs -text \ No newline at end of file +src-tauri/binaries/* filter=lfs diff=lfs merge=lfs -text \ No newline at end of file diff --git a/makeFilesExecutable.js b/makeFilesExecutable.js index 7e8f3eb..6ad4538 100644 --- a/makeFilesExecutable.js +++ b/makeFilesExecutable.js @@ -9,7 +9,6 @@ const __dirname = path.dirname(__filename); // Define array of binary source directories const binSrcDirs = [ path.join(__dirname, 'src-tauri', 'binaries'), - path.join(__dirname, 'src-tauri', 'resources', 'binaries'), ]; function makeFilesExecutable() { diff --git a/src-tauri/binaries/ffmpeg-aarch64-apple-darwin b/src-tauri/binaries/ffmpeg-aarch64-apple-darwin new file mode 100644 index 0000000..726850c --- /dev/null +++ b/src-tauri/binaries/ffmpeg-aarch64-apple-darwin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f908be736c63cfc624ac1e4bce65eb70f167865f7df6e4e66e473043acfe164a +size 80263264 diff --git a/src-tauri/binaries/ffmpeg-x86_64-apple-darwin b/src-tauri/binaries/ffmpeg-x86_64-apple-darwin new file mode 100644 index 0000000..726850c --- /dev/null +++ b/src-tauri/binaries/ffmpeg-x86_64-apple-darwin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f908be736c63cfc624ac1e4bce65eb70f167865f7df6e4e66e473043acfe164a +size 80263264 diff --git a/src-tauri/binaries/ffmpeg-x86_64-pc-windows-msvc.exe b/src-tauri/binaries/ffmpeg-x86_64-pc-windows-msvc.exe new file mode 100644 index 0000000..2837b0c --- /dev/null +++ b/src-tauri/binaries/ffmpeg-x86_64-pc-windows-msvc.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:418ba93234679b06c3a8e2f653422a78dd855b4bc5800c960623374468b85216 +size 140249600 diff --git a/src-tauri/binaries/ffmpeg-x86_64-unknown-linux-gnu b/src-tauri/binaries/ffmpeg-x86_64-unknown-linux-gnu new file mode 100644 index 0000000..6056b0f --- /dev/null +++ b/src-tauri/binaries/ffmpeg-x86_64-unknown-linux-gnu @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a5290ae0ef64702228565b65295ab0a006671c54fdc150f9e5247f5206ea439 +size 141267400 diff --git a/src-tauri/binaries/ffprobe-aarch64-apple-darwin b/src-tauri/binaries/ffprobe-aarch64-apple-darwin new file mode 100644 index 0000000..eebf24d --- /dev/null +++ b/src-tauri/binaries/ffprobe-aarch64-apple-darwin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2890fc88a6b99fb7761dae6acd8ac531083a60d75ac82c09c5fe93d10f67cc81 +size 80089672 diff --git a/src-tauri/binaries/ffprobe-x86_64-apple-darwin b/src-tauri/binaries/ffprobe-x86_64-apple-darwin new file mode 100644 index 0000000..eebf24d --- /dev/null +++ b/src-tauri/binaries/ffprobe-x86_64-apple-darwin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2890fc88a6b99fb7761dae6acd8ac531083a60d75ac82c09c5fe93d10f67cc81 +size 80089672 diff --git a/src-tauri/binaries/ffprobe-x86_64-pc-windows-msvc.exe b/src-tauri/binaries/ffprobe-x86_64-pc-windows-msvc.exe new file mode 100644 index 0000000..82fcc17 --- /dev/null +++ b/src-tauri/binaries/ffprobe-x86_64-pc-windows-msvc.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99cc32fddcde37108bba108993ae5091609d493970583719385099270bd279b7 +size 140052992 diff --git a/src-tauri/binaries/ffprobe-x86_64-unknown-linux-gnu b/src-tauri/binaries/ffprobe-x86_64-unknown-linux-gnu new file mode 100644 index 0000000..f0606bc --- /dev/null +++ b/src-tauri/binaries/ffprobe-x86_64-unknown-linux-gnu @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:165e68e3df3ba78296b6e4d060906abb0e8f235e103180d0f058cb7f5dea3513 +size 141063880 diff --git a/src-tauri/capabilities/shell.json b/src-tauri/capabilities/shell.json index db2c8c6..7de3a26 100644 --- a/src-tauri/capabilities/shell.json +++ b/src-tauri/capabilities/shell.json @@ -15,6 +15,16 @@ "args": true, "sidecar": true }, + { + "name": "binaries/ffmpeg", + "args": true, + "sidecar": true + }, + { + "name": "binaries/ffprobe", + "args": true, + "sidecar": true + }, { "name": "pkexec", "cmd": "pkexec", @@ -29,6 +39,16 @@ "name": "binaries/yt-dlp", "args": true, "sidecar": true + }, + { + "name": "binaries/ffmpeg", + "args": true, + "sidecar": true + }, + { + "name": "binaries/ffprobe", + "args": true, + "sidecar": true } ] } diff --git a/src-tauri/resources/binaries/ffmpeg-aarch64-apple-darwin b/src-tauri/resources/binaries/ffmpeg-aarch64-apple-darwin deleted file mode 100644 index e14acda..0000000 --- a/src-tauri/resources/binaries/ffmpeg-aarch64-apple-darwin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e607b7f079c4eb0dc666ffca152f225020f8022c8c014dd94d91e6072f57228d -size 79945800 diff --git a/src-tauri/resources/binaries/ffmpeg-x86_64-apple-darwin b/src-tauri/resources/binaries/ffmpeg-x86_64-apple-darwin deleted file mode 100644 index e14acda..0000000 --- a/src-tauri/resources/binaries/ffmpeg-x86_64-apple-darwin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e607b7f079c4eb0dc666ffca152f225020f8022c8c014dd94d91e6072f57228d -size 79945800 diff --git a/src-tauri/resources/binaries/ffmpeg-x86_64-pc-windows-msvc.exe b/src-tauri/resources/binaries/ffmpeg-x86_64-pc-windows-msvc.exe deleted file mode 100644 index 003c54f..0000000 --- a/src-tauri/resources/binaries/ffmpeg-x86_64-pc-windows-msvc.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c49b5913c9a107120c86b401af95df7965003f7fc6dbb4436f1f03c8ba391e8b -size 127473664 diff --git a/src-tauri/resources/binaries/ffmpeg-x86_64-unknown-linux-gnu b/src-tauri/resources/binaries/ffmpeg-x86_64-unknown-linux-gnu deleted file mode 100644 index 60ed36b..0000000 --- a/src-tauri/resources/binaries/ffmpeg-x86_64-unknown-linux-gnu +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3ee15e5145c9eb4775c193ab824c592d4ff3744bb7f283f8db29bd3c3c961589 -size 79928672 diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json index 5b8fe48..38060ad 100644 --- a/src-tauri/tauri.linux.conf.json +++ b/src-tauri/tauri.linux.conf.json @@ -36,11 +36,10 @@ "icons/icon.ico" ], "externalBin": [ - "binaries/yt-dlp" + "binaries/yt-dlp", + "binaries/ffmpeg", + "binaries/ffprobe" ], - "resources": { - "resources/binaries/ffmpeg-x86_64-unknown-linux-gnu": "binaries/ffmpeg-x86_64" - }, "linux": { "deb": { "files": { diff --git a/src-tauri/tauri.macos-aarch64.conf.json b/src-tauri/tauri.macos-aarch64.conf.json index e3b3304..7cc0b41 100644 --- a/src-tauri/tauri.macos-aarch64.conf.json +++ b/src-tauri/tauri.macos-aarch64.conf.json @@ -36,11 +36,12 @@ "icons/icon.ico" ], "externalBin": [ - "binaries/yt-dlp" + "binaries/yt-dlp", + "binaries/ffmpeg", + "binaries/ffprobe" ], "resources": { "target/aarch64-apple-darwin/release/neodlp-msghost": "neodlp-msghost", - "resources/binaries/ffmpeg-aarch64-apple-darwin": "binaries/ffmpeg-aarch64", "resources/msghost-manifest/macos/chrome.json": "neodlp-msghost.json", "resources/msghost-manifest/macos/firefox.json": "neodlp-msghost-moz.json", "resources/autostart/macos/autostart.plist": "neodlp-autostart.plist" diff --git a/src-tauri/tauri.macos-x86_64.conf.json b/src-tauri/tauri.macos-x86_64.conf.json index 1e0ea36..fc7819a 100644 --- a/src-tauri/tauri.macos-x86_64.conf.json +++ b/src-tauri/tauri.macos-x86_64.conf.json @@ -36,11 +36,12 @@ "icons/icon.ico" ], "externalBin": [ - "binaries/yt-dlp" + "binaries/yt-dlp", + "binaries/ffmpeg", + "binaries/ffprobe" ], "resources": { "target/x86_64-apple-darwin/release/neodlp-msghost": "neodlp-msghost", - "resources/binaries/ffmpeg-x86_64-apple-darwin": "binaries/ffmpeg-x86_64", "resources/msghost-manifest/macos/chrome.json": "neodlp-msghost.json", "resources/msghost-manifest/macos/firefox.json": "neodlp-msghost-moz.json", "resources/autostart/macos/autostart.plist": "neodlp-autostart.plist" diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json index 3cba0ef..932039a 100644 --- a/src-tauri/tauri.windows.conf.json +++ b/src-tauri/tauri.windows.conf.json @@ -36,10 +36,11 @@ "icons/icon.ico" ], "externalBin": [ - "binaries/yt-dlp" + "binaries/yt-dlp", + "binaries/ffmpeg", + "binaries/ffprobe" ], "resources": { - "resources/binaries/ffmpeg-x86_64-pc-windows-msvc.exe": "binaries/ffmpeg-x86_64.exe", "target/release/neodlp-msghost.exe": "neodlp-msghost.exe", "resources/msghost-manifest/windows/chrome.json": "neodlp-msghost.json", "resources/msghost-manifest/windows/firefox.json": "neodlp-msghost-moz.json" diff --git a/src/App.tsx b/src/App.tsx index 52ddf69..7ac326f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -208,8 +208,8 @@ export default function App({ children }: { children: React.ReactNode }) { 'status:%(progress.status)s,progress:%(progress._percent_str)s,speed:%(progress.speed)f,downloaded:%(progress.downloaded_bytes)d,total:%(progress.total_bytes)d,eta:%(progress.eta)d', '--output', tempDownloadPathForYtdlp, - '--ffmpeg-location', - ffmpegPath, + // '--ffmpeg-location', + // ffmpegPath, '-f', selectedFormat, '--no-mtime',