|
|
|
#1 (permalink) | |||||||||||
|
4.0ghz
![]() |
So... C# lacks a simple system() call. I tried getting it to work using their anal implementation, but can't. ffmpeg starts, but does nothing. If someone can tell me what's wrong, I'll be grateful.
Perl: Code:
system("ffmpeg -i \"".$eachFile."\" -vcodec rawvideo -pix_fmt yuv420p -f rawvideo - 2>NUL | x264-nalhrd --quiet --crf 24 --interlaced --nal-hrd --bff --preset fast -o \"".$dist.$filename.".mp4\" --fps 30000/1001 - 720x486");
Code:
Process ffmpeg = new Process();
ProcessStartInfo ffmpegStartInfo = new ProcessStartInfo();
ffmpegStartInfo.FileName = "ffmpeg.exe";
ffmpegStartInfo.RedirectStandardOutput = true;
ffmpegStartInfo.UseShellExecute = false;
ffmpegStartInfo.Arguments = "-i \"" + file.FullName + "\" -vcodec rawvideo -pix_fmt yuv420p -f rawvideo -";
Process x264 = new Process();
ProcessStartInfo x264StartInfo = new ProcessStartInfo();
x264StartInfo.Arguments = "--quiet --crf 24 --interlaced --nal-hrd --bff --preset fast -o \"" + global.dist + file.Name.Substring(0, file.Name.Length - (global.ext.Length + 1)) + ".mp4\" --fps 30000/1001 - 720x486";
x264StartInfo.RedirectStandardInput = true;
x264StartInfo.UseShellExecute = false;
x264StartInfo.FileName = "x264-nalhrd.exe";
x264.StartInfo = x264StartInfo;
ffmpeg.StartInfo = ffmpegStartInfo;
ffmpeg.Start();
x264.Start();
x264.WaitForExit();
ffmpeg.WaitForExit();
__________________
When asking for help: state the goal, not the step.
|
|||||||||||
|
|
|
|
#2 (permalink) | ||||||||||||||
|
PC Gamer
![]() |
Lol - what a scripting language can do in 1 line, takes C# 18 lines!!
Sorry, I know that didn't help, but it reminds me why so-called scripting languages are awesome
__________________
Quote:
|
||||||||||||||
|
|
|
|
|
#3 (permalink) | |||||||||||
|
4.0ghz
![]() |
It's really only C# which is this retarded. Java, which is sort of regarded as C#'s twin, can do it in a single line, too.
Turns out you can actually starts cmd.exe without a window and feed it commands... talk about ass backwards. Also, when I finally got the pipes working in the implementation above (I hadn't captured them) -- it turned out that C# is doing some processing on the input and output before giving it to the process (why the hell?)... which makes for nasty things like this:
__________________
When asking for help: state the goal, not the step.
|
|||||||||||
|
|
|
|
#4 (permalink) | ||||||||||||||
|
Security Sleuth
![]() |
You are piping it after all. Funny things will happen.
Try it correctly with a CreateProcess or similar.
__________________
Quote:
Proud Member of the Linux Gaming CommunityI am your friend.
|
||||||||||||||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|