调整依赖exe程序

pull/409/head
leiurayer 2 years ago
parent aaf9775221
commit 47515e32ce

@ -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)
## 免责申明

@ -354,6 +354,20 @@
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Content Include="aria2c.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="aria2_COPYING.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="ffmpeg.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="FFmpeg_LICENSE.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Brotli.NET.2.1.1\build\Brotli.NET.targets" Condition="Exists('..\packages\Brotli.NET.2.1.1\build\Brotli.NET.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

@ -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");
}
}
/// <summary>
/// 合并音频和视频
/// </summary>
@ -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));
}

Binary file not shown.

@ -558,18 +558,6 @@
<Resource Include="Resources\no-data.png" />
</ItemGroup>
<ItemGroup>
<Content Include="aria2c.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="aria2_COPYING.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="ffmpeg.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="FFmpeg_LICENSE.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Resource Include="Resources\checked.png" />
<Resource Include="Resources\nodata02.png" />
<Resource Include="Resources\backgound\9-绿荫秘境.png" />

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save