2009-10-22 8 views
2

내가 좋은 튜토리얼 후 오전 또는 방법 SharpFFMpeg을 사용 또는 C#에서는 FFmpeg를 사용하는 쉬운 방법 ...SharpFFMpeg는 FFmpeg 변환 tutoiral

이 있다면 나는 영상. (X 형식)으로 변환하고자하는 video.flv 스크린 샷을 찍고 내가 저장 한대로 저장합니다.

좋은 지침서가 있거나 쉬운 방법을 알고 있다면 여기에 게시하십시오.

감사합니다, 키에 란

답변

1

실행 명령 행 인수 www.codeproject.com/KB/cs/Execute_Command_in_CSharp.aspx

추출 이미지 http://stream0.org/2008/02/howto-extract-images-from-a-vi.html

protected void BTN_convert_Click(object sender, EventArgs e) { 

    String runMe = @"C:\Documents and Settings\Wasabi Digital\My Documents\Visual Studio 2008\Projects\Evo\WEB\Bin\ffmpeg.exe"; 
    String pathToFiles = @"C:\Documents and Settings\Wasabi Digital\My Documents\Visual Studio 2008\Evo\WEB\test\";  
    String convertVideo = " -i \"" + pathToFiles + "out.wmv\" \"" + pathToFiles + "sample3.flv\" "; 
    String makeImages = " -i \"" + pathToFiles + "out.wmv\" -r 1 -ss 00:00:01 -t 00:00:15 -f image2 -s 120x96 \"" + pathToFiles + "images%05d.png\""; 
    this.ExecuteCommandSync(runMe,convertVideo); 
    this.ExecuteCommandSync(runMe, makeImages); 
} 

그리고 이것은 코드 첫 번째 링크에서 가져온 스 니핏. 명령 사용법에 대한 추가 인용 부호는 이름에 공백을 넣어 실행합니다. 예 : ".../내 문서/..."

public void ExecuteCommandSync(String command, String args) { 


try { 
    System.Diagnostics.ProcessStartInfo procStartInfo = 
    new System.Diagnostics.ProcessStartInfo("\""+command+"\"",args); 

    Process.StandardOutput StreamReader. 
    procStartInfo.RedirectStandardOutput = true; 
    procStartInfo.UseShellExecute = false; 

    procStartInfo.CreateNoWindow = true; 

    System.Diagnostics.Process proc = new System.Diagnostics.Process(); 
    proc.StartInfo = procStartInfo; 
    proc.Start(); 

    string result = proc.StandardOutput.ReadToEnd(); 

    Debug.WriteLine(result); 
    } catch (Exception objException) { 
    // Log the exception 
    } 
+0

명령을 약간 수정했습니다. 샘플 속도를 사용하면 특정 비디오에서 오류가 발생하는 경우가 있습니다. /* 찍은 날짜 : http://www.catswhocode.com/blog/19-ffmpeg-commands-all-needs */ ffmpeg -i video_origine.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv video_finale.flv – Kieran

+0

아무도 실제로 SharpFFmpeg API를 사용하지 않습니까? –

3

그게 fffmpeg.exe whith C#은 sharpffmpeg를 사용하지 않는 것을 사용하고 있습니다.

+0

그것은 단지 내가 ffmpeg를 사용하여 모든 일을 할 수있는 것으로 밝혀졌지만 정말 좋은 API 인 것 같습니다. 즉 이미지를 변환하고 만듭니다. 전환을 더 잘 지원하기 위해 스크립트를 조금 변경했습니다. 아래 편집을 참조하십시오. – Kieran