2017-05-10 2 views
0

は、次の問題に役立つ必要があります。 私はユーチューブから3本のビデオをダウンロードし、フォローコード付きの小片にNReco.VideoConverter.FFMpegConverter.ConvertMediaしていることをカット:FFMPEG NReco.ConcatMedia異なるソースからのファイルをマージする

 ffMpegConverter.ConvertMedia (SourceFile, Format.mp4, tempVideo, Format.mp4, 
     new ConvertSettings() { 
      Seek = StartTime, 
      MaxDuration = (EndTime - StartTime), 
      VideoCodec = "libx264", 
      AudioCodec = "mp3", 
      CustomOutputArgs = string.Format ("-vf \"pad=640:360:x=(640-iw)/2:y=(360-ih)/2:color=black\" -af \"volume = {0}dB\"", volumeMultiplier), 
      VideoFrameRate = 25, 
      AudioSampleRate = 44100, 
      VideoFrameSize = "640x360" 
     }); 

と(ちょうどインラインffmpegのコマンドを使用して)追加透かし:

-i {0} -i {1} -filter_complex \"[1:v]scale={3}:{4},format=argb,colorchannelmixer=aa={5}[wat];[0:v][wat]overlay=main_w-overlay_w-{6}:main_h-overlay_h-{7} [out]\" -map \"[out]\" -map 0:a -y {2} 

そして、#1と#2のソースからビデオをつなぎ合わせるとOKですが、#3ではできません。私は(#1、#2)と(#3)のフォーマットの間に何らかの互換性の問題があると信じますが、それはConvertMediaのステージで修正する必要がありますか?私はいくつかのOutPutパラメータを見逃しているかもしれませんか?ソース#からのファイルのソース#3 https://jpst.it/Zoof

そして1からファイル2 https://jpst.it/ZooC

なぜファイルは参加できないことを、理由を検索するための

サンプルMediaInfoを?

Thanx。

答えて

0

NRecoのdidntは、ファイルという合併なぜ私は理由が見つかりませんでしたが、私は自分のラッパーを書いた

 static void Main (string[] args) { 
     concatMedia (new string[] { 
     args[0], args[1] 
     }, args[2]); 
    } 

    private static string makeTempFile (string fileName) { 
     FFMpegConverter c = new FFMpegConverter(); 
     FileInfo fileInfo = new System.IO.FileInfo (fileName); 
     string tempFile = Path.Combine (fileInfo.DirectoryName, Path.GetFileNameWithoutExtension (fileName) + ".ts"); 
     c.Invoke (string.Format ("-i {0} -c copy -bsf:v h264_mp4toannexb -f mpegts -y {1}", fileName, tempFile)); 
     return tempFile; 
    } 

    private static void concatMedia (string[] files, string output) { 
     FFMpegConverter c = new FFMpegConverter(); 
     List<string> tempFiles = new List<string>(); 
     foreach (var item in files) { 
      tempFiles.Add (makeTempFile (item)); 
     } 
     c.Invoke (string.Format ("-i \"concat:{0}\" -c copy -bsf:a aac_adtstoasc -y {1}", string.Join ("|", tempFiles), output)); 
     foreach (var item in tempFiles) { 
      System.IO.File.Delete (item); 
     } 
    } 
関連する問題