Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to Run ffmpeg commands using .Net

How to Run ffmpeg commands using .Net

Scheduled Pinned Locked Moved C#
csharptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kuricheti
    wrote on last edited by
    #1

    Hi Friends, I have to run ffmpeg commands(userd to Transcode audio and video) from c#. Actually I'm trying to make one dll with one method which does this transcoding of audio and video. ex: c:\\ffmpeg\\bin\\ffmpeg.exe -i c:\\ffmpeg\\bin\\ish.mp4 -y sample.mp4 The above command generates one sample.mp4 video file by taknig ish.mp4 as input. This is not fixed commands will generate at runtime based on the input file. So I want to run this command from .net. I tried by using string path = "C:\\ffmpeg\\bin\\ffmpeg.exe"; string fileargs = "ffmpeg -i ish.mp4 -s cif -vcodec h263 -acodec libamr_nb -ar 8000 -ac 1 -ab 12.2k sampleish12.3gp"; Process p = new Process(); p.StartInfo.FileName = path; p.StartInfo.Arguments = fileargs; p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = false; p.StartInfo.RedirectStandardOutput = false; p.Start(); p.WaitForExit(50000); but it is not giving any output file Thanks HariBabu

    C 1 Reply Last reply
    0
    • K Kuricheti

      Hi Friends, I have to run ffmpeg commands(userd to Transcode audio and video) from c#. Actually I'm trying to make one dll with one method which does this transcoding of audio and video. ex: c:\\ffmpeg\\bin\\ffmpeg.exe -i c:\\ffmpeg\\bin\\ish.mp4 -y sample.mp4 The above command generates one sample.mp4 video file by taknig ish.mp4 as input. This is not fixed commands will generate at runtime based on the input file. So I want to run this command from .net. I tried by using string path = "C:\\ffmpeg\\bin\\ffmpeg.exe"; string fileargs = "ffmpeg -i ish.mp4 -s cif -vcodec h263 -acodec libamr_nb -ar 8000 -ac 1 -ab 12.2k sampleish12.3gp"; Process p = new Process(); p.StartInfo.FileName = path; p.StartInfo.Arguments = fileargs; p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = false; p.StartInfo.RedirectStandardOutput = false; p.Start(); p.WaitForExit(50000); but it is not giving any output file Thanks HariBabu

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      remove ffmpeg from your file args. This is how your command sent in code differs from your example.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups