Discussion:
How to save raw data to MPEG file?
(too old to reply)
Waiman
2005-01-19 18:31:08 UTC
Permalink
Hi, I'm writing a PC application in C++ and I need to be able to save raw
8-bit pixel data in various file formats, i.e. AVI, MPEG. I'm using the VFW
library for the AVI format but I haven't been able to determine what I can
use for MPEG.

I thought the Windows Media Format SDK would do, but the documentation
refers to the Windows Media MPEG-4 Encoder DMO which seems to produce ASF
files with MPEG-4 compression. I would need something that outputs "*.MPG"
files. Could anyone help?

Also, I don't have a requirement for which type of MPEG to use. Any
recommendations/comments on that would be appreciated too.

TIA,
Waiman
Alessandro Angeli [MVP::DigitalMedia]
2005-01-20 11:05:13 UTC
Permalink
Post by Waiman
Hi, I'm writing a PC application in C++ and I need to be
able to save raw 8-bit pixel data in various file
formats, i.e. AVI, MPEG. I'm using the VFW library for
the AVI format but I haven't been able to determine what
I can use for MPEG.
I thought the Windows Media Format SDK would do, but the
documentation refers to the Windows Media MPEG-4 Encoder
DMO which seems to produce ASF files with MPEG-4
compression. I would need something that outputs "*.MPG"
files. Could anyone help?
Also, I don't have a requirement for which type of MPEG
to use. Any recommendations/comments on that would be
appreciated too.
VFW is meant to work with AVI files and WMF with ASF files.
Both include a minimun set of codecs (in the case of WMF,
the WM codecs and the more-or-less MPEG4 ones) but none
supports anything like MPEG. The most general framework is
DirectShow, part of DirectX, which supports any number of
formats and codecs as long as you have the necessary filters
installed. DirectShow comes with built-in support for AVI
(just like VFW) and ASF (based on WMF) and you can add
support for MPEG1/2 by installing third-party filters, like
the ones included in commercial MPEG1/2 encoders/recorders
(MoonLight.com, GoCyberLink.com, InterVideo.com,
Ligos.com... maybe the free ffdshow as well, if you use a
recent alpha version).
--
// Alessandro Angeli
// MVP :: Digital Media
// a dot angeli at psynet dot net
Waiman
2005-01-20 16:03:07 UTC
Permalink
Post by Alessandro Angeli [MVP::DigitalMedia]
VFW is meant to work with AVI files and WMF with ASF files.
Both include a minimun set of codecs (in the case of WMF,
the WM codecs and the more-or-less MPEG4 ones) but none
supports anything like MPEG. The most general framework is
DirectShow, part of DirectX, which supports any number of
formats and codecs as long as you have the necessary filters
installed. DirectShow comes with built-in support for AVI
(just like VFW) and ASF (based on WMF) and you can add
support for MPEG1/2 by installing third-party filters, like
the ones included in commercial MPEG1/2 encoders/recorders
(MoonLight.com, GoCyberLink.com, InterVideo.com,
Ligos.com... maybe the free ffdshow as well, if you use a
recent alpha version).
So are you saying that if I purchased a commercial MPEG1/2 encoder package,
to get the filter, then I would be able to use DirectShow to create MPG
files? Do you know if there is such a thing as commercially available
software that I could interface with directly without going through
DirectShow?

I was looking at an example of using DirectShow to create AVI files and it
seemed so complicated compared to my implementation using VFW. Perhaps
because DirectShow is providing way more capability than I need and it's all
new to me.

And lastly if I have to purchase software I may as well get something that
will simplify the development as much as possible.

Thanks again for your time.
Alessandro Angeli [MVP::DigitalMedia]
2005-01-21 09:34:06 UTC
Permalink
Post by Waiman
So are you saying that if I purchased a commercial
MPEG1/2 encoder package, to get the filter, then I would
be able to use DirectShow to create MPG files? Do you
know if there is such a thing as commercially available
software that I could interface with directly without
going through DirectShow?
Ligos or Moonlight may have an MPEG SDK. For MPEG1 only,
also have a look at bbMPEG, which is open source. For
MPEG1/2, maybe you can find a Windows porting of ffmpeg or
use the VFW wrapper in ffdshow (I don't know if it supports
MPEG encoding). Notice that you need 2 components: an
MPEG1/2 encoder and and MPEG1/2 muxer, juke like with AVIs.
bbMPEG should provide both for MPEG1, ffdshow only the
encoder. There may be other open source projects related to
VCD and SVCD creation.
Post by Waiman
I was looking at an example of using DirectShow to create
AVI files and it seemed so complicated compared to my
implementation using VFW. Perhaps because DirectShow is
providing way more capability than I need and it's all
new to me.
It *is* more complicated
--
// Alessandro Angeli
// MVP :: Digital Media
// a dot angeli at psynet dot net
Waiman
2005-01-21 16:51:09 UTC
Permalink
Post by Alessandro Angeli [MVP::DigitalMedia]
Ligos or Moonlight may have an MPEG SDK. For MPEG1 only,
also have a look at bbMPEG, which is open source. For
MPEG1/2, maybe you can find a Windows porting of ffmpeg or
use the VFW wrapper in ffdshow (I don't know if it supports
MPEG encoding). Notice that you need 2 components: an
MPEG1/2 encoder and and MPEG1/2 muxer, juke like with AVIs.
bbMPEG should provide both for MPEG1, ffdshow only the
encoder. There may be other open source projects related to
VCD and SVCD creation.
Oh this is great! The bbMPEG DLL even came with an example program that
demonstrates how to use the DLL. I should be all set now. Thank you so
much, you've been a great help!
Untergrundprinz
2009-12-18 21:24:01 UTC
Permalink
--
Mein Open Key: )xAGPBF5B4
Post by Alessandro Angeli [MVP::DigitalMedia]
Ligos or Moonlight may have an MPEG SDK. For MPEG1 only,
also have a look at bbMPEG, which is open source. For
MPEG1/2, maybe you can find a Windows porting of ffmpeg or
use the VFW wrapper in ffdshow (I don't know if it supports
MPEG encoding). Notice that you need 2 components: an
MPEG1/2 encoder and and MPEG1/2 muxer, juke like with AVIs.
bbMPEG should provide both for MPEG1, ffdshow only the
encoder. There may be other open source projects related to
VCD and SVCD creation.
Loading...