Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to create a wmf video file from a TBitmap sequence

68 views
Skip to first unread message

Lars Blumberg

unread,
May 11, 2006, 4:29:53 PM5/11/06
to
Hello my dear newsgroup,

I have a sequence of bitmaps (TBitmap instances). My aim is to create a wmv
file out of this sequence to have a wmv video. Which framework should I use.
I thougt to use DSPack / DirectShow to create a wmv file. How do I do that?
I did not find any example with google. I also want to decode sound samples
to the wmv video file!

Thanks for any help!

With best regards

Lars Blumberg


Steven Thomson

unread,
May 12, 2006, 3:45:34 AM5/12/06
to
Hi,

We use Tvideograbber from Datastead, it is very simple to yse (you have to
set the "videosource" property = "vs_jpegsorbitmaps", there is a demo
project in the evaluation download).

Rgds

Steven.

"Lars Blumberg" <Lars.B...@aquasoft.de> a écrit dans le message de news:
4463...@newsgroups.borland.com...

David J Taylor

unread,
May 12, 2006, 4:08:23 AM5/12/06
to
Steven Thomson wrote:
> Hi,
>
> We use Tvideograbber from Datastead, it is very simple to yse (you
> have to set the "videosource" property = "vs_jpegsorbitmaps", there
> is a demo project in the evaluation download).
>
> Rgds
>
> Steven.

At USD $2950 (with sources), it might be a somewhat expensive way of
making a WMF file from a sequence of bitmaps, though?

David


Lars Blumberg

unread,
May 12, 2006, 4:32:19 AM5/12/06
to
> At USD $2950 (with sources), it might be a somewhat expensive way of
> making a WMF file from a sequence of bitmaps, though?

Yes, it's too expensive. I really would like to use DSPack for creating wmf
video files from a sequence of TBitmaps. Is there anyone who can give me a
short code snippet or any URL where I can find some hints? I guess, I am not
the first one who creates wmv videos from a TBitmap sequence using DSPack.

Thanks for any idea!

Lars Blumberg


Lars Blumberg

unread,
May 12, 2006, 4:56:54 AM5/12/06
to
> We use Tvideograbber from Datastead, it is very simple to yse (you have to
> set the "videosource" property = "vs_jpegsorbitmaps", there is a demo
> project in the evaluation download).

Hi Steven. Thanks for your hint! How can I add sound samples to the video
file? I have some sound raw data and want to encode it to the wmv file.

Thanks for replying!

Lars Blumberg


Boian Mitov

unread,
May 12, 2006, 5:23:24 AM5/12/06
to
Hi Lars,

You can also try VideoLab at www.mitov.com . It is free for non
commercial purposes, and it included a TVLASFLogger. Specify an WMF
Profile file, and take a look at the RecordBitmapsDemo demo project to
see how you can provide your own bitmaps.
With bets regards,
Boian Mitov

Steven Thomson

unread,
May 12, 2006, 5:49:47 AM5/12/06
to
Hi Lars

Not sure how this can be exactly achieved, I suggest you to contact their
support at sup...@datastead.com

Steven.

"Lars Blumberg" <Lars.B...@aquasoft.de> a écrit dans le message de news:

4464...@newsgroups.borland.com...

Lars Blumberg

unread,
May 12, 2006, 8:23:20 AM5/12/06
to
> You can also try VideoLab at www.mitov.com . It is free for non commercial
> purposes, and it included a TVLASFLogger. Specify an WMF Profile file, and
> take a look at the RecordBitmapsDemo demo project to see how you can
> provide your own bitmaps.

Thank you Boian, I will have a look at your tool and test it. Is the source
code of VideoLab available? I would be glad if I could use DSPack directly.
I suppose you also use DSPack/DirectShow code to create wmv files?

Boian Mitov

unread,
May 12, 2006, 4:08:47 PM5/12/06
to
Hi Larus,

The source code of VideoLab is available but for a price. DSPack the
last time I worked with it, is a direct Delphi translation of some the
DirectShow SDK VC++ foundation clases provided by Microsoft. It did not
include all of them, and the original SDK lacks some necesary clases.
There ware also a lot of bugs in the DSPack version at the time. I ended
up using parts of the DSPack translation, and translating some of the
original C++ clases my self. VideoLab has now its own translation, very
similar to DSPack.
You can't use the DSPack directly unless they have added a pusher
filter. The last time I checked it was not there. I had to write my own
push filter, as one was not even available in the M$ C++ foundation
classes :-( .
With best regards,
Boian Mitov

KimB

unread,
May 15, 2006, 12:16:00 PM5/15/06
to

Compile and register the pushsource demo in DSPack. then test using graphedit. That will take a
bitmap source file and render it to video. You will however need to do some coding to get it running
the way you want, basically the pushsource demo filter only renders from a bmp file on disk, this is
slow.

If you want to do this in memory you need to add a com interface to the filter to pass the image
data and also add some way to start and stop the playback until each frame's image buffer is full.

I'd check the DSPack forum for more info on this.

kimB

Lars Blumberg

unread,
May 18, 2006, 7:48:51 AM5/18/06
to
> The source code of VideoLab is available but for a price. DSPack the last
> time I worked with it, is a direct Delphi translation of some the
> DirectShow SDK VC++ foundation clases provided by Microsoft. It did not
> include all of them, and the original SDK lacks some necesary clases.
> There ware also a lot of bugs in the DSPack version at the time. I ended
> up using parts of the DSPack translation, and translating some of the
> original C++ clases my self. VideoLab has now its own translation, very
> similar to DSPack.
> You can't use the DSPack directly unless they have added a pusher filter.
> The last time I checked it was not there. I had to write my own push
> filter, as one was not even available in the M$ C++ foundation classes
> :-( .
> With best regards,
> Boian Mitov

Hello Boian,

First I installed the trial version before byuing the full version. After
the installation Delphi could not find the SignalLab*.bpl files, because
they were installed to the wrong directory. I use a german version of
Delphi. My bpl files are located in

C:\Dokumente und Einstellungen\Lars Blumberg\Eigene Dateien\Borland
Studio-Projekte\Bpl

but your bpl files are installed to

C:\Dokumente und Einstellungen\Lars Blumberg\Eigene Dateien\Borland Studio
Projects\Bpl

When starting Delphi it is looking for your bpl files in the first one, but
they are located in the second one. When I copy the files to the first
directory, everything works fine.

With best regards

Lars


Lars Blumberg

unread,
May 18, 2006, 8:48:57 AM5/18/06
to
> The source code of VideoLab is available but for a price. DSPack the last
> time I worked with it, is a direct Delphi translation of some the
> DirectShow SDK VC++ foundation clases provided by Microsoft. It did not
> include all of them, and the original SDK lacks some necesary clases.
> There ware also a lot of bugs in the DSPack version at the time. I ended
> up using parts of the DSPack translation, and translating some of the
> original C++ clases my self. VideoLab has now its own translation, very
> similar to DSPack.
> You can't use the DSPack directly unless they have added a pusher filter.
> The last time I checked it was not there. I had to write my own push
> filter, as one was not even available in the M$ C++ foundation classes
> :-( .
> With best regards,
> Boian Mitov

I tried the demo project "RecordBitmapsDemo". It works fine for creating avi
video files. I am also able to use WMV3 video compression. But I cannot
change the file extension of the TVLAVILogger from .avi to .wmv, because it
creates avi files.

Now my question is, Boian, how can I create a wmv video file? I suppose I
cannot use the TVLAVILogger component for this. How do I do that?

Thanks for help!

Lars


Boian Mitov

unread,
May 18, 2006, 9:14:20 AM5/18/06
to
Hi Lars,

To write into WMV you need to use the dedicated TVLASFLogger component.
You will have to create compression profile first. Please check the
online help for that.


With best regards,
Boian Mitov

Jonathan Benedicto

unread,
May 18, 2006, 9:14:58 AM5/18/06
to
Lars Blumberg wrote:
> Now my question is, Boian, how can I create a wmv video file? I suppose I
> cannot use the TVLAVILogger component for this. How do I do that?

Use the TVLASFLogger.

HTH

Jonathan


Boian Mitov

unread,
May 18, 2006, 9:15:23 AM5/18/06
to
Hi Lars,

Thank you! I will test with German version of BDS 2006 .

With best regards,
Boian Mitov

Lars Blumberg

unread,
May 18, 2006, 9:46:26 AM5/18/06
to
> To write into WMV you need to use the dedicated TVLASFLogger component.
> You will have to create compression profile first. Please check the online
> help for that.
> With best regards,
> Boian Mitov

Thank you for your answers, Boian and Jonathan. Now I also installed the
"WMV Encoder SDK" in order to create wmv files. After placing the
TVLASFLogger component on the form I had to specify a profile file (*.prx).
In the VideoLab help file I only found the follow help for the "profile"
property:

"Allows setting of the Windows Media <Format> profile. Set the profile in
order to create the Windows Media <Format> file. The profile specifies the
compression, and digital right management (DRM) settings."

When clicking on <Format> link I receive the error message "no more
information available". So how can I create such a profile file? When I was
using "DSPack" it was possible to select a predefined profile (e.g.
"wmp_V80_255VideoPDA") in the property editor of "TASFWriter". Why do I have
to use a profile file when using TVLASFLogger?

Lars


Boian Mitov

unread,
May 18, 2006, 12:48:58 PM5/18/06
to
Hi Lars,

Creating WMV files or any other ASF file requires a profile. You can
create profile in WMF(Windows Media Format) two ways. You can create a
profile file, or you can manually specify all the compression properties
in your code. The TVLASFLogger currently supports profile file. There
is a way to also manually set the profile options, but it is not very
easy in the current version. If there is enough interest, we will work
to simplify the process in the future versions of the component.
Currently you can obtain the profile interface and do it the same way as
you would with DSPack as example. In the future, if there is enough
interest in manually creating profiles, we can make properties for that.


With best regards,
Boian Mitov

Lars Blumberg

unread,
May 19, 2006, 5:51:42 AM5/19/06
to
Thank for your answer, Boian. Unfortunately you didn't tell me how to create
such a profile file (*.prx). I did not find any hint in your VideoLab help
file.

Can you give me short code snippet please for how to create a profile file
or how to use the followong *existing* profiles?

In the WMF9.pas of DSPack are several predefined profiles, for example:

WMProfile_V80_255VideoPDA : TGUID =
'{FEEDBCDF-3FAC-4c93-AC0D-47941EC72C0B}';
{$EXTERNALSYM WMProfile_V80_255VideoPDA}
WMProfile_V80_150VideoPDA : TGUID =
'{AEE16DFA-2C14-4a2f-AD3F-A3034031784F}';
{$EXTERNALSYM WMProfile_V80_150VideoPDA}
WMProfile_V80_28856VideoMBR : TGUID =
'{D66920C4-C21F-4ec8-A0B4-95CF2BD57FC4}';
{$EXTERNALSYM WMProfile_V80_28856VideoMBR}
WMProfile_V80_100768VideoMBR : TGUID =
'{5BDB5A0E-979E-47d3-9596-73B386392A55}';
{$EXTERNALSYM WMProfile_V80_100768VideoMBR}
WMProfile_V80_288100VideoMBR : TGUID =
'{D8722C69-2419-4b36-B4E0-6E17B60564E5}';
{$EXTERNALSYM WMProfile_V80_288100VideoMBR}
WMProfile_V80_288Video : TGUID =
'{3DF678D9-1352-4186-BBF8-74F0C19B6AE2}';
{$EXTERNALSYM WMProfile_V80_288Video}

Can I also use these profiles with TVLASFLogger? You told me that I can
obtain the profile interface and do it the same way as DSPack does. I only
need these predefined files for creating WMV files. So if I could use these
profiles than I only need a short code snippet for using them and it's not
important how to create a prx file. Thank you a lot for your help!

Lars

"Boian Mitov" <mi...@mitov.com> schrieb im Newsbeitrag
news:446ca585$1...@newsgroups.borland.com...

Lars Blumberg

unread,
May 19, 2006, 5:56:16 AM5/19/06
to

"Lars Blumberg" <Lars.B...@aquasoft.de> schrieb im Newsbeitrag
news:446d952f$1...@newsgroups.borland.com...

I found the following function in "WMF9.pas" of DSPack

function LoadProfileByID(const guidProfile: TGUID; out ppProfile:
IWMProfile): HRESULT; stdcall;

Can I use this function with VideoLab or is there another translation of
this function in VideoLab included?

I suppose that this is the right function for me to load an existing profile
by id.

Lars


Lars Blumberg

unread,
May 19, 2006, 6:09:48 AM5/19/06
to

"Lars Blumberg" <Lars.B...@aquasoft.de> schrieb im Newsbeitrag
news:446d9641$1...@newsgroups.borland.com...

I need an instance of IWMProfileManager to use this function. To create an
object of IWMProfileManager I need to call

WMCreateProfileManager, like described in

http://www.progdigy.com/modules.php?name=Forums&file=viewtopic&t=650

This function is also included in WMF9.pas of DSPack. How can I call this
method using VideoLab? Is there an implementation?

Lars


Lars Blumberg

unread,
May 19, 2006, 6:27:48 AM5/19/06
to
> Compile and register the pushsource demo in DSPack. then test using
> graphedit. That will take a bitmap source file and render it to video. You
> will however need to do some coding to get it running the way you want,
> basically the pushsource demo filter only renders from a bmp file on disk,
> this is slow.
>
> If you want to do this in memory you need to add a com interface to the
> filter to pass the image data and also add some way to start and stop the
> playback until each frame's image buffer is full.
>
> I'd check the DSPack forum for more info on this.
>
> kimB

Hello kimB,

thank you for your detailed answer, but I will use Mitov's VideoLab in
future. It seems to make a lot of things easier.

With best regards

Lars


Boian Mitov

unread,
May 20, 2006, 1:39:21 AM5/20/06
to
Hi Lars,

Here is one way you can create profile manager:

//-----------------------------------------------------------------
_WMCreateProfileManager : function( out ppProfileManager :
IWMProfileManager ): HResult; stdcall;
//-----------------------------------------------------------------
function WMCreateProfileManager( out ppProfileManager :
IWMProfileManager ) : HResult; stdcall;
begin
if( not Assigned( _WMCreateProfileManager )) then
begin
wmvcoreLib := LoadLibrary( 'wmvcore.dll' );
_WMCreateProfileManager := GetProcAddress(wmvcoreLib,
'WMCreateProfileManager');
end;

if( Assigned( _WMCreateProfileManager )) then
Result := _WMCreateProfileManager( ppProfileManager )

else
Result := E_NOTIMPL;

end;

You will also need to get access to the IConfigAsfWriter2 . You can do
that by querying the VLASFLogger1.Graph.Graph . VLASFLogger1.Graph.Graph
is of type IGraphBuilder .

We can also work to expand the TVLASFLogger with the necessary
functionality for you. So far we have not had any requests for direct
control of the profile, and this is the reason the functionality is not
there.

Please contact me directly at mi...@mitov.com with further detail how
you can query the IGraphBuilder and if you would like to have us add the
profile management to the component for you. I think we are starting to
move away from the scope of this newsgroup.

With best regards,
Boian Mitov

Lars Blumberg

unread,
May 26, 2006, 12:24:55 PM5/26/06
to
Hello Boian,

using your sample code I now can go trough each system profile using
GetSystemProfileCount/LoadSystemProfile. Thank you!

But the following code works using DSPack and does not work when using
VideoLab:

const
WMProfile_V70_225VideoPDA: TGUID =
'{F55EA573-4C02-42b5-9026-A8260C438A9F}';
var
x: IWMProfileManager;
begin
if WMCreateProfileManager(x) = S_OK then
x.LoadProfileByID(WMProfile_V70_225VideoPDA, profile);
end;

With VideoLab I receive an access violation when LoadProfileByID oocurs.

I then created a profile file using DSPack and IWMProfile.SaveProfile to get
the xml source code of the profile. I wrote this code into a file (which is
an attachment of this post).

I opened your VLRecordBitmapsDemo, placed a TVLASFLogger component on the
form and set its properties as following:

Filename = "c:\test.asf"
InputPin = VLGenericFilter1.OutputPin
Profile.FileName = "pda_profile.prx" (in attachment)

There is no asf file created and no error message appears. The avi file is
created, because VLAVILogger creates a video file.

Why does TASFLogger not create a asf/wmv video file? I hope you can repeat
my steps and tell why it does not work.

Thank you very much!

Lars

Here is the content of pda_profile.prx:

<profile version="458752"
storageformat="1"
name="Video für PDA-Farbgeräte (225 Kbit/s)"
description="Verwendung zum Erstellen von Videodateien für die
Wiedergabe auf schnellen Pocket PCs mit Farbdisplay.">
<streamconfig
majortype="{73647561-0000-0010-8000-00AA00389B71}"
streamnumber="1"
streamname="Audio Stream"
inputname="Audio"
bitrate="32048"
bufferwindow="-1"
reliabletransport="0"
decodercomplexity=""
rfc1766langid="de">
<wmmediatype subtype="{00000161-0000-0010-8000-00AA00389B71}"
bfixedsizesamples="1"
btemporalcompression="0"
lsamplesize="744">
<waveformatex wFormatTag="353"
nChannels="2"
nSamplesPerSec="22050"
nAvgBytesPerSec="4006"
nBlockAlign="744"
wBitsPerSample="16"
codecdata="00440000170041170000"/>
</wmmediatype>
</streamconfig>
<streamconfig
majortype="{73646976-0000-0010-8000-00AA00389B71}"
streamnumber="2"
streamname="Video Stream"
inputname="Video"
bitrate="186152"
bufferwindow="5000"
reliabletransport="0"
decodercomplexity=""
rfc1766langid="de">
<videomediaprops maxkeyframespacing="20000000"
quality="0"/>
<wmmediatype subtype="{31564D57-0000-0010-8000-00AA00389B71}"
bfixedsizesamples="0"
btemporalcompression="1"
lsamplesize="0">
<videoinfoheader dwbitrate="186152"
dwbiterrorrate="0"
avgtimeperframe="500000">
<rcsource left="0"
top="0"
right="208"
bottom="160"/>
<rctarget left="0"
top="0"
right="208"
bottom="160"/>
<bitmapinfoheader biwidth="208"
biheight="160"
biplanes="1"
bibitcount="24"
bicompression="WMV1"
bisizeimage="0"
bixpelspermeter="0"
biypelspermeter="0"
biclrused="0"
biclrimportant="0"/>
</videoinfoheader>
</wmmediatype>
</streamconfig>
</profile>

"Boian Mitov" <mi...@mitov.com> schrieb im Newsbeitrag

news:446eab96$1...@newsgroups.borland.com...

Whome

unread,
Jun 3, 2006, 5:29:16 AM6/3/06
to
> using your sample code I now can go trough each system profile using
> GetSystemProfileCount/LoadSystemProfile. Thank you!
>
> But the following code works using DSPack and does not work when using
> VideoLab:
>
> const
> WMProfile_V70_225VideoPDA: TGUID =
> '{F55EA573-4C02-42b5-9026-A8260C438A9F}';
> var
> x: IWMProfileManager;
> begin
> if WMCreateProfileManager(x) = S_OK then
> x.LoadProfileByID(WMProfile_V70_225VideoPDA, profile);
> end;

This is how I get a xml string from internal profiles by profile
constant. Download ASFCapture.zip file and uProfile form. Its not really
my code but I compiled and merged few things together to have
ready-to-run examples for everyone(sources + exe). See comments at the
end of uProfile.pas.

http://koti.mbnet.fi/akini/delphi/dspack/
file: ASFCapture.zip


Boian Mitov

unread,
Jun 3, 2006, 9:07:58 PM6/3/06
to
Hi Lars,

I have sent you e-mail with that. I have added an event handler that
allows you to load custom profile. Please contact me to get updated
version. I have done a new build and i am testing it at the moment.

Cheers,
Boian

0 new messages