Encoded WMV file appears to miss images

Jun 15, 2011 at 12:39 PM

Hi,

I have create an application that takes a number of files from a folder and creates a WMV file with each image lasting 1 second.

When I play back the file, it appears to miss some images, or flash them up very briefly?? Typically this is the first few images, and then random drops throughout...

Any idea what is happenning?

The basic code is:

Dim outputFile As String = "c:\Test\OutputVideo.wmv"
Dim timeline As ITimeline = New DefaultTimeline()
Dim group As IGroup = timeline.AddVideoGroup(32, 160, 100)
Dim videoTrack As ITrack = group.AddTrack()
videoTrack.AddImage("C:\Test\2011061422430401.BMP", 0, 1)
videoTrack.AddImage("C:\Test\2011061422430504.BMP", 0, 1)
videoTrack.AddImage("C:\Test\2011061422430508.BMP", 0, 1)
videoTrack.AddImage("C:\Test\2011061422430512.BMP", 0, 1)
videoTrack.AddImage("C:\Test\2011061422430604.BMP", 0, 1)
videoTrack.AddImage("C:\Test\2011061422430608.BMP", 0, 1)
videoTrack.AddImage("C:\Test\2011061422430612.BMP", 0, 1)
Dim audioTrack As ITrack = timeline.AddAudioGroup().AddTrack()
Dim audio As IClip = audioTrack.AddAudio("c:\background.wma", 0, videoTrack.Duration)
audioTrack.AddEffect(0, audio.Duration, StandardEffects.CreateAudioEnvelope(1.0, 1.0, 1.0, audio.Duration))
Dim renderer As IRenderer = Nothing
participant = New PercentageProgressParticipant(timeline)
renderer = New WindowsMediaRenderer(timeline, outputFile, WindowsMediaProfiles.HighQualityVideo, New ICallbackParticipant() {participant}, Nothing)
renderer.Render()
MessageBox.Show("done")
 

 

Jun 15, 2011 at 2:55 PM

Ummm, interestingly, if I put the following...

   Dim timeline As ITimeline = New DefaultTimeline(10)
   . . .
   videoTrack.AddImage("C:\Test\2011061422430401.BMP", 0, 0.1)
   videoTrack.AddImage("C:\Test\2011061422430401.BMP", 0, 0.1)
   videoTrack.AddImage("C:\Test\2011061422430401.BMP", 0, 0.1)
   videoTrack.AddImage("C:\Test\2011061422430401.BMP", 0, 0.1)
   videoTrack.AddImage("C:\Test\2011061422430401.BMP", 0, 0.1)
   videoTrack.AddImage("C:\Test\2011061422430401.BMP", 0, 0.1)
   videoTrack.AddImage("C:\Test\2011061422430401.BMP", 0, 0.1)
   videoTrack.AddImage("C:\Test\2011061422430401.BMP", 0, 0.1)
   videoTrack.AddImage("C:\Test\2011061422430401.BMP", 0, 0.1)
   videoTrack.AddImage("C:\Test\2011061422430401.BMP", 0, 0.1)

i.e. add an image for every frame, then it works. It does not appear to always 'hold' the image for the specified length of time

Any ideas?

Thanks,

James

Jul 25, 2011 at 11:00 AM

Hi,

Apter passing the participant how we get the % of rendering???? Any idea???

Jul 26, 2011 at 8:41 AM

Thank you all I got it working created an event handler for it