使用C#加入多个.wmv文件

时间:2012-08-05 15:14:58

标签: c#

我正在尝试使用C#加入几个.wmv文件.....下面是我的编码.....编码工作正常,它正在读取和写入所有.wmv文件到流....但是,当我用我的Windows媒体播放器播放加入的视频时,第一个视频只播放.....假设有5个20 mb的视频文件.....我加入后他们的文件大小变为100 mb ....但是,当我播放时,第一个视频只播放.....但是,我需要播放整个视频......我该怎么办?

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

 }    

1 个答案:

答案 0 :(得分:1)

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