Re: enumerating for available muxers and generic way of encoding video

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



From: "Lonewolf"

using 3rd party encoders, say xvid+mp3 and using WM_ASF
writer, yes, the Windows Format SDK does indeed mention
how to configure it for pre-compressed streams. However,
if using it this way, does it still mux the streams?

The WMASFWriter performes 4 functions in 1 filter: (1)
preprocessing, (2) compression, (3) muxing and (4) writing
to a WM sink (a file sink by default). 1 and 2 are skipped
if you configure the filter to mux pre-compressed streams,
which de fact makes the filter into a muxer. 1 is limited
and is only performed if 2 is enabled and the input formats
do not match the inputs required by the compressors. When
used as a muxer, the filter has some requirements:

- all inputs must be pre-compressed (the internal WMWriter
does not care instead)

- WAVEFORMATEXTENSIBLE is not supported (the internal
WMWriter supports it instead, at least for PCM audio)

- the video format block must be a VIDEOINFOHEADER and the
subtype must be a FOURCCMap matching the format's FOURCC
(this comes from the WMWriter)

- the audio format block must be a WAVEFORMATEX and the
subtype must be a FOURCCMap matching the format's tag (this
comes from the WMWriter)

- the input formats must match exactly the configured
profile (this comes from the WMWriter)

- a few more requirements coming from the WMWriter (and
listed in the latest doc page for IWMWriter::SetProfile())

I have however used xvid+mp3 for AVI mux output
to file writer. I can produce the video file, but it is
out of sync. The video runs slower than the audio.

That can happen if the timestamps of the input samples are
not correct and is due to the way AVI works:

- the samples must have a stop time
- the video frame rate must be constant
- the audio can not have gaps

use of custom profile, is it possible to ?name? the pin?

You can assign a stream and/or connection name to each
stream in the profile. I do not know whether that will be
reflected in the naming of the filter's pins however. But
what would you need that for? The streams in the profile are
identified by their ordered index, which is the same order
the pins are enumerated.

custom profile with ASF writer, is it possible to save
the graph as a grf file? Below is the function I used in
[...]
configured it correctly. It seems that no matter what I
set as the custom profile and in the ASF writer, even if
it is just one stream, it would still show me the asf
writer with 2 streams in default WM 8 settings. Is this
because custom profiles set in ASF writer cannot be saved
this way? I use EnumPin and getting the pin info, I was
able to get the correct number of pins and streams
though. Could you enlighten me on this ?

I already answered this in your other thread on m.p.wm.sdk.
The WMASFWriter does not persist its state. If the
configuration is correct, why do you care?


--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


.



Relevant Pages

  • Re: what are .sdk archives?
    ... primary stream, which may be a standard, commodity format. ... The increased adoption of forks is a good indication that a problem ... attached to the same directory entry to reduce clutter and reinforce the ... And for simple streams like text, or raw audio or pixel data? ...
    (comp.sys.apple2)
  • Re: silent semantic changes with reiser4
    ... Once transporting streams becomes ... > information in a particular format that is common to one ... And any app that wants to search these ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: silent semantic changes with reiser4
    ... Hence why I was suggesting the idea of disposable data in streams. ... > internal format, how to generate the index, and how to use it. ... By using lots of libraries, you end up using lots of memory to ... icon for the file to pull the appropriate icon from somewhere else (and ...
    (Linux-Kernel)
  • Re: Question about wmvappend
    ... WMV files only have one format stored per stream, so you need to use the ... exact same format for the streams or else things won't work properly. ... > verses VBR--do you have to have the exact same profiles for wmvappend, ...
    (microsoft.public.windowsmedia.sdk)
  • Re: How to know when WriteStreamSample has written the sample to d
    ... If the writer is not writing out the data, ... but it writes the data when the buffered streams ... are more or less in sync. ... steadily without too much buffering. ...
    (microsoft.public.windowsmedia.sdk)