Too big size of output file

Topics: Developer Forum
Oct 21, 2010 at 8:12 AM

Hi, 

I was playing with splicer lib and faced with the following problem: output file using AVI renderer is very big (about 50 Mb from 4 images with total size about 1Mb). I was trying to create video from the set of jpg images. Here is my code:

using (ITimeline timeline = new DefaultTimeline())
			{
				var group = timeline.AddVideoGroup(32, 300, 200);

				var videoTrack = group.AddTrack();

				IClip previousClip = null;
				const double halfDuration = 0.5;
				const double clipEnd = 2;
				foreach (var image in images)
				{
					var fileInfo = new FileInfo(image);
					if (!fileInfo.Exists)
					{
						throw new InvalidOperationException(
							string.Format("File {0} does not exist", fileInfo.FullName));
					}

					var currentClip = videoTrack.AddImage(fileInfo.FullName, 0, clipEnd);

					if (previousClip != null && previousClip.Offset > 0)
					{
						group.AddTransition(
							previousClip.Offset - halfDuration,
							halfDuration,
							StandardTransitions.CreateFade(),
							true);
						group.AddTransition(
							previousClip.Offset,
							halfDuration,
							StandardTransitions.CreateFade(),
							false);
					}

					previousClip = currentClip;
				}

				if (previousClip != null && previousClip.Offset > 0)
				{
					group.AddTransition(
						previousClip.Offset - halfDuration,
						halfDuration,
						StandardTransitions.CreateFade(),
						true);
					group.AddTransition(
						previousClip.Offset,
						halfDuration,
						StandardTransitions.CreateFade(),
						false);
				}

				// Using renderer for .avi files.
				using (var renderer =
						new AviFileRenderer(
							timeline,
							outputFile))
				{
					renderer.Render();
				}
			}

 

What am I doing wrong? Any help will be very appreciated.

Thanks!

Nov 23, 2010 at 1:33 PM

This may be late in coming, but AVI files are large by nature. I do not believe that splicer applies any compression to the rendered AVI file. So depending on the length of your video and the image format that splicer uses for the frames, your output file would probably wind up that large.