public void Create(VideoSpec spec) { using (ITimeline timeline = new DefaultTimeline()) { logger.Log("Creating video file " + spec.Name); var video = timeline.AddVideoGroup("video", FRAME_RATE, 32, spec.Width, spec.Height); var audio = timeline.AddAudioGroup("audio", FRAME_RATE); // the length of the movie is governed by the audio, so start with that var voiceTrack = AddVoiceTrack(audio, spec.Text); var duration = voiceTrack.Duration; var musicTrack = AddBackgroundMusic(audio, spec.SoundFiles, duration); // now add the video CreateVideo(video, spec.ImageFiles, duration, spec.Width, spec.Height); AddWatermark(video, spec.WatermarkFile, duration, spec.Width, spec.Height); // combine everything and write out the result RenderVideo(timeline, spec.Name); } }
private void ProcessRecords(IEnumerable<string[]> data, VideoSpec spec, VideoMaker maker) { foreach (var record in data) { spec.Name = Path.Combine(txtOutputFolder.Text, record[0] + ".wmv"); spec.Text = record[1]; SetStatus(spec.Name); pbStatus.Increment(1); maker.Create(spec); pbStatus.Increment(1); } }