Video Merging using the Splicer Lib

Kasun Lee 0 Reputation points
2024-03-06T04:33:14.61+00:00

Hi.

I tried to two videos into one using Splicer library. When I ran the code (below), the code got non-responsive, so after awhile I stopped the code from executing. The resulting file (which was created by the code while it has became non-responsive) was over 11GB. I'm not sure how to fix that. Could anyone guide me please? Thanks.

...
//Create a string array to store file paths
string[] filepaths = new string[10];
filepaths.SetValue(textBox_Source1.Text, 0);
filepaths.SetValue(textBox_Source2.Text, 1);
//Call the video merging function
MergeVideos(filepaths, filepaths[0] + "_merged");
....
using (ITimeline timeline = new DefaultTimeline())
{
    IGroup group = timeline.AddVideoGroup(32, 720, 576); // Set bitrate, width, height
    var firstClip = group.AddTrack().AddVideo(videoPaths[0]);
    var secondClip = group.AddTrack().AddVideo(videoPaths[1], firstClip.Duration /* offset */);
    using (AviFileRenderer renderer = new AviFileRenderer(timeline, outputFilePath))
    {
        renderer.Render();
    }
}

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,857 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.