I write a Winform app have 2 function : play video (use vlc videolan active plugin) and convert video to H.265. But I dont know use which library for converting (example code if maybe). Anyone can help me. Thanks and best reagards.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can use FFMpeg with this command:
ffmpeg -i input.mp4 -c:v libx265 output.mp4
回答2:
Yay, I solved it. I put code here for anyone need. First, download https://ffmpeg.zeranoe.com/builds/ (choose Shared), then copy all file in bin folder in this package to your project. Next, code :
string input = "E:\\ii.mp4";
string output = "E:\\oo.mp4";
Process proc = new Process();
proc.StartInfo.FileName = @"E:\\DuyProject\\Format_H264_H265\\ffmpeg\\ffmpeg.exe";
proc.StartInfo.Arguments = "-i " + input + " -c:v libx265 " + output;
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.UseShellExecute = false;
if (!proc.Start())
{
Console.WriteLine("Error starting");
return;
}
StreamReader reader = proc.StandardError;
string line;
while ((line = reader.ReadLine()) != null)
{
Console.WriteLine(line);
}
proc.Close();
回答3:
That's awesome, if anyone feel hard to understand then use Pavtube video converter can convert any video to any format easily. this software is stable and keep updating for users.