2012-08-05 29 views
-2

我想加入几个.wmv文件与C#.....以下是我的编码.....编码工作正常,它的读取和写入所有的.wmv文件成流.....但是,当我用我的Windows媒体播放器播放加入的视频时,第一个视频只播放.....假设有5个20 MB的视频文件.....加入他们的文件大小变成100 MB ....但是,当我播放它的第一个视频只播放.....但是,我需要播放整个视频....我能做什么?加入多个.wmv文件与C#

private void JoinFiles(string FolderInputPath, string FileOutputPath) 

{ 

// Needed to get all files in that directory 

      DirectoryInfo diSource = new DirectoryInfo(FolderInputPath); 

      // Filestream to reconstruct the file 

      FileStream fsSource = new FileStream(FileOutputPath, FileMode.Append); 

      // Loop through all the files with the *.part extension in the folder 

      foreach (FileInfo fiPart in diSource.GetFiles(@"*.wmv")) 
      { 



        // Create a byte array of the content of the current file 
       Byte[] bytePart = System.IO.File.ReadAllBytes(fiPart.FullName); 
       // Write the bytes to the reconstructed file 
       fsSource.Write(bytePart, 0, bytePart.Length); 

       } 

      fsSource.Close();  

      // Close the file stream 

}  
+4

所以,WMV是一个容器,你不能在二进制级别加入它们...... – leppie 2012-08-05 15:23:45

回答

1

也许尝试使用ffmpeg将该系列“转换”为一个视频。