Video Merging using Splicer Lib
-
Hi. I tried to merge 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, heightvar 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(); }
}
-
Hi. I tried to merge 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, heightvar 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(); }
}
The only person who's going to be able to "guide you" on this is the person(s) who wrote the Splicer library. As far as I can tell, there is no documentation on it that survives anywhere and the project on GitHub hasn't been touched in the last 6 years. It appears to be abandoned.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak
-
Hi. I tried to merge 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, heightvar 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(); }
}
To add to what Dave has said, if you are recoding videos in order to join them together (and unless they have the same resolution, same frame rate, same codecs, and a very similar bit rate that is exactly what you have to do to get a working file) then it's going to take some significant time - we are talking hours here for 4K videos, even on a powerful machine, using well optimised software. The partial file size of 11GB isn;t that surprising in the context of the bitrate you appear to be requesting: is that "32" generating a 32K bitrate? If so, then the file size is going to be pretty huge and will take a long time to process. Grab a free copy of XMedia Recode[^] (it's one of the tools I use for such jobs) and see how long it takes and the resulting video file size.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
To add to what Dave has said, if you are recoding videos in order to join them together (and unless they have the same resolution, same frame rate, same codecs, and a very similar bit rate that is exactly what you have to do to get a working file) then it's going to take some significant time - we are talking hours here for 4K videos, even on a powerful machine, using well optimised software. The partial file size of 11GB isn;t that surprising in the context of the bitrate you appear to be requesting: is that "32" generating a 32K bitrate? If so, then the file size is going to be pretty huge and will take a long time to process. Grab a free copy of XMedia Recode[^] (it's one of the tools I use for such jobs) and see how long it takes and the resulting video file size.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
Thanks. The two files I'm trying to merge are around 30MB each. I'm actually not that familiar with working videos in C#, just playing around and testing here. Anyways, a video merger like Wondershare would take less than 5 mins to do it, and the resulting video would be less than 100MB. I'm not sure how to properly do that.
-
Thanks. The two files I'm trying to merge are around 30MB each. I'm actually not that familiar with working videos in C#, just playing around and testing here. Anyways, a video merger like Wondershare would take less than 5 mins to do it, and the resulting video would be less than 100MB. I'm not sure how to properly do that.
Check the bitrate on the result file from wondershare (windows explorer will show you that) and use VLC to check the codecs the result file contains - H265 for example is a lot more compact than H264 for example, but not everything can read it. But as Dave said, that one would appear to be abandoned - and that may be because it was never finished, or had bugs, or ... you never know. You know you can splice files directly using FFMPEG as an external process? Concatenate – FFmpeg[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!