[英]DirectShow.Net play MP4 video stream from http responce using C#
[英]Encoding in MP4 using C# / DirectShow.Net / 3ivx
我希望在MP4中編碼.wmv視頻。
我使用這里提供的這個小軟件: http : //www.codeproject.com/Articles/11120/Media-files-conversion-using-C
我用DirectShow.Net: http://sourceforge.net/projects/directshownet/和3ivx的編解碼器。
我該如何更改代碼:
//
// This method convert the input file to an wmv file
//
void Convert2Wmv(string fileName)
{
try
{
label1.Text = "Encodage";
button1.Enabled = false;
hr = me.SetNotifyWindow(this.Handle, WM_GRAPHNOTIFY, IntPtr.Zero);
DsError.ThrowExceptionForHR(hr);
// here we use the asf writer to create wmv files
WMAsfWriter asf_filter = new WMAsfWriter();
IFileSinkFilter fs = (IFileSinkFilter)asf_filter;
hr = fs.SetFileName(fileName + ".wmv", null);
DsError.ThrowExceptionForHR(hr);
hr = gb.AddFilter((IBaseFilter)asf_filter, "WM Asf Writer");
DsError.ThrowExceptionForHR(hr);
hr = gb.RenderFile(fileName + fExt, null);
DsError.ThrowExceptionForHR(hr);
hr = mc.Run();
DsError.ThrowExceptionForHR(hr);
}
catch (Exception ex)
{
MessageBox.Show("Error converting to wmv: " + ex.Message);
}
}
要進行MP4編碼? 我是C#/ .Net的初學者... = $
先感謝您。 :3
您可以使用FFmpeg (適用於Mac,Linux和Windows的免費命令行工具)將WMV編碼為MP4。 這是一個示例語法:
ffmpeg -i input.wmv -c:v libx264 -crf 23 -c:a libfaac -q:a 100 output.mp4
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.