Re: joining windows media files created with different profiles
- From: mark48 <mark48@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 13 Nov 2007 11:21:01 -0800
Hmmm... I've tried to do this but I must be missing something. According to
the documentation and what Chris P. said, I've used this as my code:
WMEncoder encoder = new WMEncoder();
WMEncProfile2 Pro = new WMEncProfile2();
Pro.LoadFromMemory(profile2); //My saved profile xml
string
IWMEncSourceGroupCollection SrcGrpColl =
encoder.SourceGroupCollection;
IWMEncSourceGroup2 SrcGrp =
(IWMEncSourceGroup2)SrcGrpColl.Add("SG1");
IWMEncAudioSource SrcAud = null;
IWMEncVideoSource2 SrcVid = null;
SrcAud =
(WMEncoderLib.IWMEncAudioSource)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
SrcAud.SetInput("C:\\someInputfile", "", "");
SrcVid =
(WMEncoderLib.IWMEncVideoSource2)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
SrcVid.SetInput("C:\\someInputFile", "", "");
SrcGrp.set_Profile(Pro);
SrcAud.PreProcessPass = 1;
SrcVid.PreProcessPass = 1;
IWMEncFile2 File = (IWMEncFile2)encoder.File;
File.LocalFileName = "C:\\someOutputFile";
encoder.PrepareToEncode(true);
encoder.Start();
....But the output produced will not append to the orriginal input file.
I get a profile mismatch error.
"Chris P." wrote:
On Sun, 7 Oct 2007 00:55:00 -0700, Andy Shenkler wrote:.
I already know the answer to the subject line, which is of course that you
can't. However here is my problem. I have about 90,000 files which have been
created over the past 2 years with differing profiles as time has gone on. I
need to be able to append a video to either the front or end of another.
So I have thought about this, and I have come up with only one way for how I
could work this out, but I need some assistance in making this a reality. I
am also completely open to other possibilities that don't require
recompressing the current video streams.
For the purposes of this problem, assume that the main video is already
encoded in WMV and the clip that I need to add to the head/tail can be
encoded on the fly because it's so small.
I figure that somehow I need to automatically create a profile by having the
system analyze the existing wmv file. Use that profile to encode the clip
that needs to be joined into a wmv file and then use wmvappend to join the
two without having to re-encode either one.
So the question is, is there a way (or an existing application) that will
allow me to create an encoding profile by running an existing wmv file
through it?
Any information or ideas someone has would be greatly appreciated!
You can "pull" the profile of an existing file using the WMEncBasicEdit
interface of the encoder API. You can use the Profile method to get a
IWMEncProfile or you can get the profile as text with SaveProfile.
Once you have the profile you should be able to apply the profile for
re-encoding the non-conforming file to this profile, and then use wmvappend
to merge the results. I don't know what the quality will be like but this
saves you from having to re-encode everything.
--
http://www.chrisnet.net/code.htm
[MS MVP for DirectShow / MediaFoundation]
- Prev by Date: Re: How can I cross fade between or overlay two sources?
- Next by Date: Re: Maximum Framerate for Windows Media Encoder
- Previous by thread: How can I cross fade between or overlay two sources?
- Next by thread: Re: Maximum Framerate for Windows Media Encoder
- Index(es):
Relevant Pages
|