I'm also trying to use the Windows Media Encoder to create a video with a
static image, I'm also trying to make the audio source for the video an mp3
file. I have managed to make a video of no length which is contantly playing
the image, so I got a little further than you rob, I realize we are talk to
each other across many months but maybe you are still working/abandoned
etc..... And you notice this post.
I guess this is some form of code sample ^^.
WMEncoder en = new WMEncoder();
IWMEncSourceGroupCollection SrcGrpColl = en.SourceGroupCollection;
IWMEncSourceGroup SrcGrp = SrcGrpColl.Add("SG_1");
IWMEncVideoSource SrcVid =
(IWMEncVideoSource)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
SrcVid.SetInput(txtbPicLoc.Text, "", ""); //Bitmap file (.bmp, .gif
or .jpg file)
IWMEncAudioSource SrcAud =
(IWMEncAudioSource)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
SrcAud.SetInput(txtbTuneLoc.Text, "", "");
IWMEncProfile2 Pro = new WMEncProfile2();
Pro.LoadFromFile(@"D:\Panel\C#
Programs\AviDemo\AviDemo\AviDemo\uMusic.prx");
SrcGrp.set_Profile((IWMEncProfile)Pro);
IWMEncFile2 File = (IWMEncFile2)en.File;
File.LocalFileName = @"C:\output.wmv";
File.FileDuration = DetermineSongLength(); //Duration of audio file
en.PrepareToEncode(true);
en.Start();