My guess is that you'd have to decompress the jpgs into RGB bitmaps (pretty
easy using C#, if I recall correctly) and then hand those samples to an
instance of the WMWriter that is configured to take the RGB format you
specify.
There are no code samples to do what you want to do that I know of. I'd
recommend looking through the writer samples that ship with the WMFSDK and
possibly modifying one of those. Additionally, I think most of the WMFSDK
isn't available in C# (all the samples are in C++), but I could be mistaken.
You may have to write some sort of wrapper class to bridge the managed and
unmanaged code.
You might also look at the "Writing Image Streams" section of the WMFSDK.
--
Where am I going?
And why am I in this handbasket?
Somebody knows how can i consolidate some jpg's into a wmv file?
Could you paste a source code example?
I prefer a VB .NET but in C# also is ok.
Thank you very much!!!
Lord Rick
To use a image, it's the same as AVI/WMV source to the encoder, just set it
using IWMEncSource::SetInput
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jeremy Noring" <some...@thenet.com> wrote in message
news:OmILbGwL...@tk2msftngp13.phx.gbl...
Therefore how can we make a video from jpg's with the WME 9 SDK ???
Using the software itself I succeeded creating a video inserting various
sources put it did not rollover automatically between images... I had to
click on the different sources manually to make transitions in the video. My
assumption would be that the rollover method does not apply to images...
therefore it would not be possible to make videos from still images with this
SDK...
Please have you got any ideas ????? Thank you very much!
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Olivier" <Oli...@discussions.microsoft.com> wrote in message
news:1C336AD6-F0B5-4359...@microsoft.com...
I realize this thread has been dead for a couple of years, but I am
experiencing a very similar problem to Oliver.
Any time I try to programatically encode a .jpg to a file using the WME SDK,
the file comes up with a blank screen. I have noticed that the image will
flash for an instant in the middle of the video file, but the rest of the
video file is a blank screen.
Using the windows media encoder UI, i have been able to encode the image to
a file with no problems, but the SDK doesn't appear to work the same way.
I am not worrying about setting the Rollover or MarkIn/MarkOut as mentioned
in the replies to this thread. I am manually switching between my source
groups using a dropdown on my UI, so these solutions do not apply to my
situation.
Is there something I need to set on my encoder / profile in order for a jpg
to create a proper output file?
Thanks,
Rob
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();
> I had a stupid way to do this and implemented it.
> Fisrt, I put Bitmap into a video stream and convert it to
> AVI by DirectShow. Next, I convert AVI to WMV by WMV SDK.
> But I don't know how to SetInput with video stream in WMV
> DMO by DirectShow.
You are replying to a post about Windows Media Encoder 9,
which has nothing to do with DirectShow or the WMF SDK (I am
assuming that you meant WMF SDK, since there is no "WMV
SDK").
If you know how to push bitmaps into a DirectShow graph, why
do you need the intermediate file at all? The WMASFWriter
filter will create the WMV directly. Why do you even need
the WMV DMO encoder? The WMASFWriter and the WMF SDK will
use it for you.
Read the docs in the WMF SDK to learn how to create a
profile and for the WMWriter (WMF) or WMASFWriter
(DirectShow).
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
"Alessandro Angeli" wrote:
> .
>
> I'm new in Media encoder/decoder.
> My case is that Bitmaps are put into video stream, and is
> encoded a VC-1 compliant video files, such as WMV9/VC-1.
> Can WMASFWriter encode VC-1 compliant video files, such
> as WVC1 codec?
The WM[ASF]Writer doesn't care, it simply uses whatever WM
codecs are on your system.
Since version 9.5 (or 11?) of the WMF runtime, the standard
WMV3 (aka WMV9) codec produces VC-1 simple and main profile
streams and the advanced WVC1 codec produces VC-1 advanced
profile.
The VC-1 SDK has more optimized codecs, but it is provided
as a static link library and it is not integrated with
DirectShow or WMF (but you can encode the video and then use
the WM[ASF]Writer to mux the pre-compressed stream into a
WMV file).