| Author |
Message |
Naroin
Guest
|
Posted:
Fri Oct 01, 2004 11:39 am Post subject:
BMP format for image stream |
|
|
hi
what is the exact format to pass to the writer for an image stream ?
someone already said me in this forum that i need to put a
BITMAPINFOHEADER before the raw data, but how? and what else?
BITMAPINFOHREADER + raw dont work
thx!
|
|
| Back to top |
|
 |
Chris P. [MVP]
Guest
|
Posted:
Fri Oct 01, 2004 5:39 pm Post subject:
Re: BMP format for image stream |
|
|
Naroin wrote:
| Quote: | hi
what is the exact format to pass to the writer for an image stream ?
someone already said me in this forum that i need to put a
BITMAPINFOHEADER before the raw data, but how? and what else?
BITMAPINFOHREADER + raw dont work
|
A stream to what? What SDK are you using? WMF SDK? DirectShow? |
|
| Back to top |
|
 |
Naroin
Guest
|
Posted:
Fri Oct 01, 2004 5:50 pm Post subject:
Re: BMP format for image stream |
|
|
a WMF stream
pProfile->CreateNewStream(WMMEDIATYPE_Image, &pConfigJpeg);
| Quote: | Naroin wrote:
hi
what is the exact format to pass to the writer for an image stream ?
someone already said me in this forum that i need to put a
BITMAPINFOHEADER before the raw data, but how? and what else?
BITMAPINFOHREADER + raw dont work
A stream to what? What SDK are you using? WMF SDK? DirectShow?
|
|
|
| Back to top |
|
 |
Chris P. [MVP]
Guest
|
Posted:
Fri Oct 01, 2004 6:43 pm Post subject:
Re: BMP format for image stream |
|
|
Naroin wrote:
| Quote: | a WMF stream
pProfile->CreateNewStream(WMMEDIATYPE_Image, &pConfigJpeg);
|
I've never tried an Image stream before, but with a video stream you need to
first configure the interface.
This includes SetStreamNumber(), SetStreamName(), SetConnectionName(),
SetBitrate() (0?), SetQuality(), and query for IID_IWMMediaProps so you can
set the media type.
The media type WM_MEDIA_TYPE that you set through the IWMMediaProps
interface has a pointer pbFormat which you usually set to point to a
WMVIDEOINFOHEADER or WMVIDEOINFOHEADER2 struct. Inside that struct is a
BITMAPINFOHEADER. Don't forget to set the cbFormat size accordingly.
Once you've done all that you can call AddStream(). |
|
| Back to top |
|
 |
Naroin
Guest
|
Posted:
Mon Oct 04, 2004 12:33 pm Post subject:
Re: BMP format for image stream |
|
|
all of that is done and works well
someone in another post said me:
Assuming you're doing this, though, the input for image streams is
somewhat
picky. It requires that the input sample be an RGB bitmap, starting
with a
BITMAPINFOHEADER (note that this is different from plain old input
video
frames, which don't start with the BITMAPINFOHEADER).
because for the moment, when i try to pass a image, it return
NS_INVALID_DATA
so i need the exact format of data to pass to the writer
thx :)
| Quote: | I've never tried an Image stream before, but with a video stream you need to
first configure the interface.
This includes SetStreamNumber(), SetStreamName(), SetConnectionName(),
SetBitrate() (0?), SetQuality(), and query for IID_IWMMediaProps so you can
set the media type.
The media type WM_MEDIA_TYPE that you set through the IWMMediaProps
interface has a pointer pbFormat which you usually set to point to a
WMVIDEOINFOHEADER or WMVIDEOINFOHEADER2 struct. Inside that struct is a
BITMAPINFOHEADER. Don't forget to set the cbFormat size accordingly.
Once you've done all that you can call AddStream().
|
|
|
| Back to top |
|
 |
Chris P. [MVP]
Guest
|
Posted:
Tue Oct 05, 2004 1:43 am Post subject:
Re: BMP format for image stream |
|
|
Naroin wrote:
| Quote: | all of that is done and works well
someone in another post said me:
Assuming you're doing this, though, the input for image streams is
somewhat
picky. It requires that the input sample be an RGB bitmap, starting
with a
BITMAPINFOHEADER (note that this is different from plain old input
video
frames, which don't start with the BITMAPINFOHEADER).
because for the moment, when i try to pass a image, it return
NS_INVALID_DATA
so i need the exact format of data to pass to the writer
|
Unfortunately I do not know the answer to that part, but I would imagine
that it has mostly to do with the setup phase, perhaps make sure you're
using WMVIDEOINFOHEADER2.
The documentation is rather lacking in this area. |
|
| Back to top |
|
 |
|
|
|
|