diff --git a/README.md b/README.md index b0975bf..f93d4a8 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,19 @@ ## 开发 +### x68 & x64 + +发布的压缩包中aria2c.exe和ffmpeg.exe均为32位,如果需要请用下面链接中的文件替换。 + +* [aria2-1.36.0-win-32bit](third_party/aria2-1.36.0-win-32bit-build1.zip) +* [aria2-1.36.0-win-64bit](third_party/aria2-1.36.0-win-64bit-build1.zip) +* [FFmpeg](https://github.com/leiurayer/FFmpeg-Builds/releases/tag/latest) + ### 相关项目 * [哔哩哔哩-API收集整理](https://github.com/SocialSisterYi/bilibili-API-collect):B站API归档 * [Prism](https://github.com/PrismLibrary/Prism):MVVM框架 -* [WebPSharp](https://github.com/leiurayer/WebPSharp):WebP格式图片支持 +* [WebPSharp](https://github.com/leiurayer/WebPSharp):WebP格式图片支持,[NuGet程序包](third_party/WebPSharp.0.5.1.nupkg) ## 免责申明 diff --git a/src/DownKyi.Core/DownKyi.Core.csproj b/src/DownKyi.Core/DownKyi.Core.csproj index f050494..5c3361b 100644 --- a/src/DownKyi.Core/DownKyi.Core.csproj +++ b/src/DownKyi.Core/DownKyi.Core.csproj @@ -354,6 +354,20 @@ Designer + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + diff --git a/src/DownKyi.Core/FFmpeg/FFmpegHelper.cs b/src/DownKyi.Core/FFmpeg/FFmpegHelper.cs index 9b87784..1eb34fb 100644 --- a/src/DownKyi.Core/FFmpeg/FFmpegHelper.cs +++ b/src/DownKyi.Core/FFmpeg/FFmpegHelper.cs @@ -9,6 +9,23 @@ namespace DownKyi.Core.FFmpeg { private const string Tag = "FFmpegHelper"; + private static readonly bool is64Bit = false; + private static readonly string exec = ""; + + static FFmpegHelper() + { + is64Bit = IntPtr.Size == 8; + + if (is64Bit) + { + exec = Path.Combine(Environment.CurrentDirectory, "ffmpeg.exe"); + } + else + { + exec = Path.Combine(Environment.CurrentDirectory, "ffmpeg.exe"); + } + } + /// /// 合并音频和视频 /// @@ -37,7 +54,7 @@ namespace DownKyi.Core.FFmpeg return false; } - ExcuteProcess("ffmpeg.exe", param, null, (s, e) => Console.WriteLine(e.Data)); + ExcuteProcess(exec, param, null, (s, e) => Console.WriteLine(e.Data)); try { @@ -92,7 +109,7 @@ namespace DownKyi.Core.FFmpeg // ffmpeg -y -f concat -safe 0 -i filelist.txt -c copy output.mkv // 加上-y,表示如果有同名文件,则默认覆盖 string param = $"-y -f concat -safe 0 -i {concatFileName} -c copy \"{destVideo}\" -y"; - ExcuteProcess("ffmpeg.exe", param, workingDirectory, (s, e) => Console.WriteLine(e.Data)); + ExcuteProcess(exec, param, workingDirectory, (s, e) => Console.WriteLine(e.Data)); // 删除临时文件 try @@ -128,7 +145,7 @@ namespace DownKyi.Core.FFmpeg { // ffmpeg -y -i "video.mp4" -vf delogo=x=1670:y=50:w=180:h=70:show=1 "delogo.mp4" string param = $"-y -i \"{video}\" -vf delogo=x={x}:y={y}:w={width}:h={height}:show=0 \"{destVideo}\" -hide_banner"; - ExcuteProcess("ffmpeg.exe", param, null, (s, e) => + ExcuteProcess(exec, param, null, (s, e) => { Console.WriteLine(e.Data); action.Invoke(e.Data); @@ -147,7 +164,7 @@ namespace DownKyi.Core.FFmpeg // ffmpeg -i 3.mp4 -vn -y -acodec copy 3.aac // ffmpeg -i 3.mp4 -vn -y -acodec copy 3.m4a string param = $"-i \"{video}\" -vn -y -acodec copy \"{audio}\" -hide_banner"; - ExcuteProcess("ffmpeg.exe", param, + ExcuteProcess(exec, param, null, (s, e) => { Console.WriteLine(e.Data); @@ -166,7 +183,7 @@ namespace DownKyi.Core.FFmpeg // 提取视频 (Extract Video) // ffmpeg -i Life.of.Pi.has.subtitles.mkv -vcodec copy –an videoNoAudioSubtitle.mp4 string param = $"-i \"{video}\" -y -vcodec copy -an \"{destVideo}\" -hide_banner"; - ExcuteProcess("ffmpeg.exe", param, + ExcuteProcess(exec, param, null, (s, e) => { Console.WriteLine(e.Data); @@ -185,7 +202,7 @@ namespace DownKyi.Core.FFmpeg // 提取帧 // ffmpeg -i caiyilin.wmv -vframes 1 wm.bmp string param = $"-i \"{video}\" -y -vframes {number} \"{image}\""; - ExcuteProcess("ffmpeg.exe", param, null, (s, e) => Console.WriteLine(e.Data)); + ExcuteProcess(exec, param, null, (s, e) => Console.WriteLine(e.Data)); } diff --git a/src/DownKyi/FFmpeg_LICENSE.txt b/src/DownKyi.Core/FFmpeg_LICENSE.txt similarity index 100% rename from src/DownKyi/FFmpeg_LICENSE.txt rename to src/DownKyi.Core/FFmpeg_LICENSE.txt diff --git a/src/DownKyi/aria2_COPYING.txt b/src/DownKyi.Core/aria2_COPYING.txt similarity index 100% rename from src/DownKyi/aria2_COPYING.txt rename to src/DownKyi.Core/aria2_COPYING.txt diff --git a/src/DownKyi.Core/aria2c.exe b/src/DownKyi.Core/aria2c.exe new file mode 100644 index 0000000..97b2b5c Binary files /dev/null and b/src/DownKyi.Core/aria2c.exe differ diff --git a/src/DownKyi/ffmpeg.exe b/src/DownKyi.Core/ffmpeg.exe similarity index 57% rename from src/DownKyi/ffmpeg.exe rename to src/DownKyi.Core/ffmpeg.exe index 7504db0..06e8a67 100644 Binary files a/src/DownKyi/ffmpeg.exe and b/src/DownKyi.Core/ffmpeg.exe differ diff --git a/src/DownKyi/DownKyi.csproj b/src/DownKyi/DownKyi.csproj index 33eefbb..789105a 100644 --- a/src/DownKyi/DownKyi.csproj +++ b/src/DownKyi/DownKyi.csproj @@ -558,18 +558,6 @@ - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - diff --git a/src/DownKyi/aria2c.exe b/src/DownKyi/aria2c.exe deleted file mode 100644 index 23bee50..0000000 Binary files a/src/DownKyi/aria2c.exe and /dev/null differ diff --git a/third_party/aria2-1.36.0-win-32bit-build1.zip b/third_party/aria2-1.36.0-win-32bit-build1.zip new file mode 100644 index 0000000..99fe5c1 Binary files /dev/null and b/third_party/aria2-1.36.0-win-32bit-build1.zip differ diff --git a/third_party/aria2-1.36.0-win-64bit-build1.zip b/third_party/aria2-1.36.0-win-64bit-build1.zip new file mode 100644 index 0000000..260e3a4 Binary files /dev/null and b/third_party/aria2-1.36.0-win-64bit-build1.zip differ