Click here to Skip to main content
15,563,763 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, I am trying to make a program that copies a specific video until the total length is longer than a specified amount. I need help trying to join them.
Here is my joining code.

C#
// videos is a List<string> containing a list of every single copied video's path.
// dir is the current directory returned by Directory.GetCurrentDirectory()
// outputVideoSelect.FileName is a user specified output file
using Splicer; 
using Splicer.Timeline;
using Splicer.Renderer;

            using (ITimeline timeline = new DefaultTimeline())
            {
                IGroup group = timeline.AddVideoGroup(32, 720, 576);
                
                for (int v = 1; v < videos.ToArray().Length; v++) {
                    group.AddTrack().AddVideo(videos[v]);
                }
                

                using (AviFileRenderer renderer = new AviFileRenderer(timeline, $"{dir}\\output.mp4"))
                {
                    renderer.Render();
                }
            }
            File.Move($"{dir}\\output.mp4", $"{outputVideoSelect.FileName}");



What I have tried:

FFMPEG (no luck)
CMD's copy function (no luck)
Using a for loop to make my list of videos to render using Splicer (program throws
C#
An exception of type 'System.Runtime.InteropServices.COMException' occurred in DirectShowLib-2005.dll but was not handled in user code
The filename, directory name, or volume label syntax is incorrect.
)
Posted
Comments
Richard MacCutchan 1-Mar-22 10:18am    
Which line causes the error and what are the file name details?
j ongamer13 1-Mar-22 10:57am    
group.AddTrack().AddVideo(videos[v]); causes the error. videos[v] should return something like C:/Users/User/AppData/Local/Temp/MovieMakerTempFolder/5.mp4
Richard MacCutchan 1-Mar-22 11:26am    
Fine, but what exactly does it return? You cannot solve code problems by guessing what might be happening, you need to know the complete details.
j ongamer13 1-Mar-22 11:36am    
It returns D:\Temp\/MovieMakerTemp\2.mp4 I think I did some slashes wrong
Edit: For clarification, D:\Temp\ is my temp folder
Richard MacCutchan 1-Mar-22 11:39am    
Yes.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900