Log in

View Full Version : Settig up WMV7/1 encoder DMO problems


Maxsmi
10th December 2010, 10:01
I'm trying to partally reencode a file with WMV1 video and have some difficulties:
after merging reencoded part with the source file part, the second part can't be correctly decoded.
I used 2 following decoders for tests
1) WMVideo 9 Encoder DMO (which is a part of Windows Media Format 9 Runtime, windows XP)
2) WMVideo 7/8 Encoder DMO (wmf12 runtime, Windows 7)

Using ffmpeg I found that the key frame picture header includes the parameter "slice count"(located in 8th to 12th bits from the beginning of the header; msmpeg4.c ), which is the quantity of slices in current gop's frames,
and this parameter is critical for the decoder to play the file.

The first encoder produce the stream with only 1 slice, but the second encoder gives 4 slices.

So the first question:
Is there any ability to set this parameter to the encoder DMO( and also retrieve it somehow from the decoder or demuxer )?

And one more thing is that this parameter is included in every key frame(and should be applied to the current GOP, I think).
However the decoder seems to ignore all the following key-frame picture header values of this parameter except the very first key-frame (the very first value applied to the whole file).

The next question:
are there any encoder parameters that would force the decoding DMO to read and apply "Slice count" value for current GOP?

benwaggoner
29th December 2010, 01:25
Number of slices should correspond to the number of threads used for encoding. That'll be 1, 2, 4, or 8 depending on the number of cores in the encoding system, which version of the DMO is being used (Vista and earlier were limited to 4-way threading), and if it was overridden via registry key or Property Bucket.

The VC-1 Encoder SDK is a static lib that offers number of threads/slices as a parameter.

The source code for WMV9 PowerToy is a good reference for how to set the registry key for this and other parameters:
http://www.citizeninsomniac.com/WMV/

Maxsmi
13th January 2011, 09:30
Number of slices should correspond to the number of threads used for encoding.

Hello Ben, thank you very much for your response.
I've made some tests on 2 machines with 2 and 4 cores and the result is exactly the same as you've described: "number of slices" parameter had been changed to 2 and 4 ( according to the number of cores ) after encoding with WMVideo 7/8 Encoder DMO(wmfr12), but the WMVideo 9 Encoder DMO(wmfr9) gives "number of slices" = 2 in both cases.

I also tried to force only 1 thread with the "Force NumThreads" registry key, however neither one of the encoders seemed to apply this value to the "number of slices" parameter - the resulting parameter was 2 in 2-cored system and 4 in 4-cored system. So I assume, this registry key doesn't affect the parameter of my interest.

There is quite a few info about the WMV DMO components which is useful in my case. If you have any more information about the wmv7 encoding, please let me know.
Thanks again.