c# Process Arguments and Missing Output -
i'm using ffmpeg process
gather information on file:
private void gatherframes() { process process = new process(); process.startinfo.filename = "ffmpeg"; process.startinfo.arguments = "-i \"" + filepath + "\""; process.startinfo.redirectstandarderror = true; process.startinfo.useshellexecute = false; if (!process.start()) { console.writeline("error starting"); return; } streamreader reader = process.standarderror; string line; while ((line = reader.readline()) != null) { outputrichtextbox.appendtext(line + "\n"); } process.close(); }
this seems works fine. want framerate
, , thanks other posts, i've found ffprobe
can used that:
public void getframerate() { process process = new process(); process.startinfo.filename = "ffprobe"; process.startinfo.arguments = "-v 0 -of compact=p=0 -select_streams 0 -show_entries stream = r_frame_rate \"" + filepath + "\""; console.writeline(process.startinfo.arguments); process.startinfo.redirectstandarderror = true; process.startinfo.redirectstandardoutput = true; process.startinfo.useshellexecute = false; process.startinfo.createnowindow = false; console.writeline(process.startinfo); if (!process.start()) { console.writeline("error starting"); return; } streamreader reader = process.standarderror; string line; while ((line = reader.readline()) != null) { console.writeline(line); } process.close(); }
this not seem work @ all. process starts, not return expect returned.
if run command manually, following in cmd.exe
:
> e: > cd "file_path" > ffprobe -v 0 -of compact=p=0 -select_streams 0 -show_entries stream=r_frame_rate "file_name.mp4" r_frame_rate=60/1
note: -show_entries stream = r_frame_rate
not work, -show_entries stream=r_frame_rate
without spaces.
i'm not sure how go doing process
.
Comments
Post a Comment