Click here to Skip to main content
14,699,428 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The below code i was using video resize using webjobs on my application. I want to configure(use) input and output path on my existing storage image container in Azure to the below code. Please advice. thanks in advance

What I have tried:

public static void ProcessQueueMessage(
       [QueueTrigger("blobcopyqueue")] string filename, TextWriter log,
        [Blob("textblobs/{queueTrigger}", FileAccess.Write)] Stream blobOutput
       )
       {
           //set the input file path
           string inputfile = string.Format(@"D:\home\site\wwwroot\video\{0}", filename);
           //set the input file path
           string outputFile = string.Format(@"D:\home\site\wwwroot\video-compress\{0}", filename);

           using (var engine = new Engine(@"D:\home\site\wwwroot\compress\ffmpeg.exe"))
           {

               string command = string.Format(@"-i {0} -vcodec h264 -b:v 250k -acodec mp2  {1}", inputfile, outputFile);

               //you could change the command value as what you want to use
               engine.CustomCommand(command);
           }

           using (var fileStream = System.IO.File.OpenRead(outputFile))
           {
               fileStream.CopyTo(blobOutput);
           }

       }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900