2016-06-16 19 views
0

에서 비디오를 확인하십시오.Nreco 비디오 컨버터 내가 Nreco.videoconverter의는 FFmpeg 래퍼를 사용하여 .JPG 파일의 시퀀스에서 비디오를 만들기 위해 노력하고있어 이미지 시퀀스

NReco.VideoConverter.FFMpegConverter c = new FFMpegConverter(); 

       ConcatSettings set = new ConcatSettings(); 
       set.VideoFrameRate = 5; 
       set.VideoFrameCount = 10; 
       set.ConcatVideoStream = true; 
       set.ConcatAudioStream = false; 
       set.SetVideoFrameSize(704, 576); 

       string[] _fileNames = new string[25]; 
       _fileNames[0] = "g:\\Storage\\001.jpg"; 
       _fileNames[1] = "g:\\Storage\\002.jpg"; 
       _fileNames[2] = "g:\\Storage\\003.jpg"; 
       _fileNames[3] = "g:\\Storage\\004.jpg"; 
       _fileNames[4] = "g:\\Storage\\005.jpg"; 
       _fileNames[5] = "g:\\Storage\\006.jpg"; 
       _fileNames[6] = "g:\\Storage\\007.jpg"; 
       _fileNames[7] = "g:\\Storage\\008.jpg"; 
       _fileNames[8] = "g:\\Storage\\009.jpg"; 
       _fileNames[9] = "g:\\Storage\\010.jpg"; 

      c.ConcatMedia(_fileNames, "g:\\Storage\\test2.mp4", Format.mp4, set); 
: 나는 나를 거의 도움이 포럼 및 주제에 대한 대답을 검색하는 것은

http://stackoverflow.com/questions/15280199/how-to-make-a-video-file-from-images 

If you already have image files the best way is using special "image2" format (FFMpeg demuxer) and FFMPeg will read files directly for producing video Video can be produced in real-time with live stream conversion supported by VideoConverter. In this case "rawvideo" should be specified as input format and C# application should pass RAW bitmap bytes (as mentioned in the question) as input for live stream converter.

나는이 코드를 시도하지만 난 항상 1 프레임 (배열에서 첫 번째)와 함께 비디오를 얻을 수있다

또한 ConcatMedia 대신 ConvertMedia() 메서드를 사용하려고하지만 동일한 결과를 얻으려고합니다.

이 일련의 이미지는 컨버터를 알 수있는 방법이 있습니까?

이 작업을 수행하려면 다른 FFMPEG의 wrraper 또는 방법이 있나요?

나는 좋은 그러나 .NET 3.5

TNX 만 작업입니다 AForge 클래스를 발견!

답변

0

FFMpegConverter.ConcatMedia 여러 비디오 파일을 병합 CONCAT 필터를 사용하여 이미지의 비디오 부호화에 사용되어서는 안된다. 는 FFmpeg 이미지 디멀티플렉서와 ​​ConvertMedia 방법을 사용

올바른 방법 :이 지난 몇 초 그래서 내가 볼 수있는 이미지로 비디오를 변환을 위해 내가 기간을 설정하는 방법

var videoConv = new FFMpegConverter(); 
videoConv.ConvertMedia( 
    @"g:\Storage\%03d.jpg", null, 
    "test.mp4", null, 
    new ConvertSettings() { 
     CustomInputArgs = " -framerate 5 ", 

     // specify any additional ffmpeg parameters for output here 
     CustomOutputArgs = " -profile:v high " 
}); 
+0

당신이 말해 줄 수. 현재 두 번째 길지 않습니다. 비디오의 이미지도보기 어렵습니다. – Kanishka

+0

나는 이것이 작동하는 것처럼 보이지 않는다. 이것은 유효한 대답인가? –

+0

@MarkRedman 네, 작동합니다; 어쩌면 이미지 파일이 % 03d.jpg 패턴과 일치하지 않을 수도 있습니다. 커맨드 라인에서 먼저 (ffmpeg.exe로) 변환을 시도하여 어떤 일이 일어나고 있는지 알아보십시오. –