-1

I am trying to join several .wmv files with C#.....Below is my coding.....The coding is working fine, It's reading and writing all the .wmv files into a stream.....But, when I am playing the joined video with my windows media player, the first video is playing only.....Suppose there are 5 video files of 20 mb.....after i join them the file size becomes 100 mb....But,when i play it the first video is playing only.....But, i need to play the whole video....what can I do?

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

 }    
kmatyaszek
  • 19,016
  • 9
  • 60
  • 65

1 Answers1

1

Maybe try using ffmpeg to "convert" the series to one video.

LaPingvino
  • 2,803
  • 2
  • 18
  • 17