मेरा सुझाव है कि आप अपने वेब्रोल के लिए Local Storage Resource का उपयोग करें जहां आप ब्लॉब स्टोरेज से एएसी फाइल डाउनलोड कर सकते हैं, और उन्हें एमपी 3 में परिवर्तित कर सकते हैं। फिर ब्लॉब स्टोरेज पर वापस अपलोड करें।
साइड नोट यह है कि आप अपने एएसी/एमपी 3 फ़ाइलों के लिए अस्थायी फ़ाइल नाम प्राप्त करने के लिए Path.GetTempFileName() का भी उपयोग कर सकते हैं, लेकिन मैं ऐसा करने के लिए प्रोत्साहित नहीं करता हूं (भले ही मैंने इसे पहले किया हो)।
actuall ffmpeg चलने के लिए, आप AzureVideoConv के लिए कोड ब्राउज़ करना चाहते हैं, जिसे मैंने कुछ समय पहले बनाया है। आपको वहां बहुत उपयोगी कोड मिलेगा।
यहाँ वास्तविक ffmpeg कॉल (ध्यान दें कि मैं एक ब्लॉब भंडारण से exe डाउनलोड, बाहरी exe फ़ाइलों के साथ मेरी नीला पैकेज सूजन से बचने के लिए, और आसानी से ffmpeg.exe अद्यतन करने के लिए जब आवश्यक) का एक नमूना है:
internal void ConvertFile(string inputFileName, Guid taskID)
{
string tmpName = string.Format(
"{0}\\{1}.flv",
Path.GetTempPath(), inputFileName.Substring(inputFileName.LastIndexOf("\\")+1));
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = this._processorExecutable;
psi.Arguments = string.Format(@"-i ""{0}"" -y ""{1}""", inputFileName, tmpName);
psi.CreateNoWindow = true;
psi.ErrorDialog = false;
psi.UseShellExecute = false;
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.RedirectStandardOutput = true;
psi.RedirectStandardInput = false;
psi.RedirectStandardError = true;
try
{
// Start the process with the info we specified.
// Call WaitForExit and then the using statement will close.
using (Process exeProcess = Process.Start(psi))
{
exeProcess.PriorityClass = ProcessPriorityClass.High;
string outString = string.Empty;
// use ansynchronous reading for at least one of the streams
// to avoid deadlock
exeProcess.OutputDataReceived += (s, e) => {
outString += e.Data;
};
exeProcess.BeginOutputReadLine();
// now read the StandardError stream to the end
// this will cause our main thread to wait for the
// stream to close (which is when ffmpeg quits)
string errString = exeProcess.StandardError.ReadToEnd();
Trace.WriteLine(outString);
Trace.TraceError(errString);
byte[] fileBytes = File.ReadAllBytes(tmpName);
if (fileBytes.Length > 0)
{
this._sSystem.SaveOutputFile(
fileBytes,
tmpName.Substring(tmpName.LastIndexOf("\\")+1),
taskID
);
}
}
}
catch (Exception e)
{
Trace.TraceError(e.Message);
}
}
नोट परियोजना के अंतिम चेक इन विंडोज Azure SDK का उपयोग कर रहा है 1.3
मैंने इसे 1 घंटे पहले पढ़ा है, आपके महान काम के लिए धन्यवाद! लेकिन मैं सी # में अच्छा नहीं हूं इसलिए मुझे नहीं पता कि मेरे संदर्भ में इसका उपयोग कैसे किया जाए। मैंने अपनी वेब भूमिका (कार्यकर्ता भूमिका नहीं) के स्थानीय संग्रहण संसाधन को कॉन्फ़िगर किया है, फिर ब्लॉब से .exe और .aac को कैसे डाउनलोड करें? इसे कैसे चलाएं? एमपी 3 वापस कैसे अपलोड करें? – Skyler
कृपया मेरे कोड पर एक नज़र डालें: http://azurevideoconv.codeplex.com/SourceControl/changeset/view/5501 becasue अब बहुत सारे प्रश्न हैं और उन सभी को मेरे कोड में उत्तर दिया गया है :) आप इसका उपयोग कर सकते हैं अतिरिक्त प्रश्न पूछने के लिए कोडप्लेक्स की परियोजना साइट पर चर्चाएं। – astaykov
ठीक है। तीन संस्करण हैं। मुझे किसका उपयोग करना चाहिए? – Skyler