|
Hi,
I struggled with a specific problem/bug(?) of the ISO target format: I tried to do a simple video conversion to H264 in approx. these steps:
- CoCreateInstance of the ltmmConvert object
- use put_SourceFile() and put_TargetFile() to set source and destination
- use put_TargetFormat( ltmmConvert_TargetFormat_ISO ) and put_AllowedStream() to set ISO format
- use get_AudioCompressors() & Find() & put_Selection() to select the correct audio compressor (AAC)
- use get_VideoCompressors() & Find() & put_Selection() to select the correct video compressor (H264)
- use StartConvert() to start the conversion
At step 6 I was always getting an error 0x80040227 (VFW_E_WRONG_STATE, "The operation could not be performed because the filter is in the wrong state")
I encountered this problem only when using the ISO container format - OGG for example was working fine.
After closely following the convert.exe example, and after trying out some different combinations, I finally succeeded by changing the sequence as follows:
- CoCreateInstance of the ltmmConvert object
- use put_SourceFile() and put_TargetFile() to set source and destination
- use put_TargetFormat( ltmmConvert_TargetFormat_Avi ) and put_AllowedStream() to set AVI format
- use get_AudioCompressors() & Find() & put_Selection() to select the correct audio compressor (AAC)
- use get_VideoCompressors() & Find() & put_Selection() to select the correct video compressor (H264)
- use put_TargetFormat( ltmmConvert_TargetFormat_ISO ) and put_AllowedStream() to set ISO format
- use StartConvert() to start the conversion
So it is absolutely necessary to set AVI as dummy-target format BEFORE selection of the compressors, and to select ISO in a last step? Even if I set the ISO format twice in both steps 3 & 6, it did not work - it needs to be AVI at the first step.
Is there any reasonable explanation for this behaviour? Or is it a machine specific behaviour (e.g. depending on the codecs I have installed?).
thanks
Wolfgang
|