string[] files = { }; foreach (string f in files) { Debug.Print(f); } WMEncoder encoder = new WMEncoder(); try { files = System.IO.Directory.GetFiles(@"C:\Users\gaurav.STRINGNET\Desktop\New folder\video capture\video capture\bin\Debug\img\"); } catch (Exception ex) { MessageBox.Show(ex.Message); } foreach (string f in files) { Debug.Print(f); } //profile for each frame IWMEncProfile2 pro = new WMEncProfile2(); try { pro.LoadFromFile(@"C:\Users\gaurav.STRINGNET\test.prx"); } catch (Exception ex) { MessageBox.Show(ex.Message, "error1"); } //build up the collection of frames IWMEncSourceGroup2 frameSourceGroup; try { foreach (string filename in files) { frameSourceGroup = ( IWMEncSourceGroup2)encoder.SourceGroupCollection.Add(filename); frameSourceGroup.set_Profile(pro); //odd to have to do it this way instead of via property IWMEncVideoSource2 sourceVideo = (IWMEncVideoSource2)frameSourceGroup.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO); sourceVideo.SetInput(filename," ", " "); } } catch (Exception ex) { MessageBox.Show(ex.Message, "error 2"); } try { encoder.File.LocalFileName= @"C:\Users\gaurav.STRINGNET\output.wmv"; encoder.PrepareToEncode(true); } catch (Exception ex) { MessageBox.Show(ex.Message, "error 3"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)