TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kiran Chitari
NA
50
2.4k
Passing input to an exe file using C# console application
Aug 1 2018 2:12 AM
I want to convert my video file from mp4 to webm, using ffmpeg.exe got from ffmpeg.org.
I need to pass the input through a C# console application to ffmpeg.exe. so that it converts that file. Following is the code that I have tried:
using System;
using System.Diagnostics;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
string input = @"C:\Users\bkiran\Downloads\Compressed\ffmpeg-4.0.2-win64-static\bin\mymp4.mp4";
string output = @"C:\Users\bkiran\Downloads\Compressed\ffmpeg-4.0.2-win64-static\bin\testwebmFromc.webm";
ProcessStartInfo processStartInfo = new ProcessStartInfo();
processStartInfo.FileName = @"C:\Users\bkiran\Downloads\Compressed\ffmpeg-4.0.2-win64-static\bin\ffmpeg.exe";
processStartInfo.Arguments = "\"ffmpeg -i " + input + " " + output + "\"";
Process.Start(processStartInfo);
}
}
}
I tried this code but it is not working. I think the reason is ffmpeg is created using C and I am accessing this through C# console application. Is this is due to the compatibility issue?
Reply
Answers (
1
)
Asp.Net Core 2.0 & Angular 4
Video Playing Doubt