How to convert video from H.264 to H.265

为君一笑 提交于 2019-12-13 23:06:14

问题


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.



来源:https://stackoverflow.com/questions/43960515/how-to-convert-video-from-h-264-to-h-265

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!