Re: joining windows media files created with different profiles

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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]

.



Relevant Pages

  • RE: WMEncoder 9 and MSFT DRM Returning "Content Tampered With" err
    ... certificates, but in DRM profiles: ... A profile created with CreateDRMProfileis automatically added to the ... server, ... IWMEncSourceGroupCollection SrcGrpColl = Encoder.SourceGroupCollection; ...
    (microsoft.public.windowsmedia.encoder)
  • Encoder stops working after 287 files !!!!
    ... same profile, and generate a wma version of them to be archived. ... I'm pretty confident on my Disposeimplementation, where I set the encoder ... private IWMEncSourceGroup _sourceGroup = null; ... foreach (IWMEncProfile p in profiles) ...
    (microsoft.public.windowsmedia.encoder)
  • Re: All my colours are washed out! - qualityprofile.wme (0/1)
    ... mention there being a profile attached to this email which I cannot find. ... The encoder is taking your input and averaging ... > Next, I selected the compression type, and moved to Quality based CBR ... > I then took the original ABI into VirtualDub, ...
    (microsoft.public.windowsmedia)
  • Re: Photo Story 3 : Encoder profile settings for PAL-DVD as end-r
    ... I think that the Sonic encoder (at least with its provided profile) ... I render my slideshow as a 1280x960 pixel size .wmv file which is ... If you want above all *sharpness of the pictures* and you don't mind some occasional PCTV effects then export it as a new profile with a filename you choose yourself. ... the problem is clearly not the number of pixels (my DVD ...
    (microsoft.public.windowsxp.photos)
  • AddDataUnitExtension
    ... I have tested the profile that I'm using in Windows Media Encoder and have ... For both the custom capture resulting wmv file and the Windows Media Encoder ... In the header Extension Object... ... Extended Stream Properties Object is the video stream which has ...
    (microsoft.public.windowsmedia.sdk)