1

私の英語のすみません

AVIDコーデックを使用して.movファイルをインポートする必要があります。インポート設定のAVIDComposerプログラムでは、オプションRGB(0-255)または601(16-235)をインストールすることにより、カラーレベルをカスタマイズできます。

このオプション(601)をコードで設定するにはどうすればよいですか?

セッションを設定するときに彼女を設定しようとしました:

    long lwidth;
    CHECK_FAILED( m_pMt->get_Pixels(&lwidth) );
    SInt32 width = lwidth;
    number = CFNumberCreate( NULL, kCFNumberSInt32Type, &width );
    CFDictionaryAddValue( pixelBufferAttributes, kCVPixelBufferWidthKey, number );
    CFRelease( number );

    long lheight;
    CHECK_FAILED( m_pMt->get_Lines(&lheight) );
    SInt32 height = lheight;
    number = CFNumberCreate( NULL, kCFNumberSInt32Type, &height );
    CFDictionaryAddValue( pixelBufferAttributes, kCVPixelBufferHeightKey, number );
    CFRelease( number );

    double gamma = 2.199997;
    // Always seems to equal 2.5 for RGB colorspaces and 2.199997 for YUV
    number = CFNumberCreate( NULL, kCFNumberDoubleType, &gamma );
    CFDictionaryAddValue( pixelBufferAttributes, kCVImageBufferGammaLevelKey, number );
    CFRelease( number );

    CFDictionaryAddValue(pixelBufferAttributes, kCVImageBufferYCbCrMatrixKey, kCVImageBufferYCbCrMatrix_ITU_R_601_4);

    CHECK_OSSTATUS( ICMDecompressionSessionCreate(NULL, imageDesc, NULL, pixelBufferAttributes, &trackingCallbackRecord, &m_decompressionSession) );

しかし、それはうまくいきませんでした。

4

1 に答える 1

1

申し訳ありませんが、これらの設定は AVID コーデック固有であるため、プログラムで構成する方法はありません (少なくとも私はそれを行う方法が見つかりませんでした)。

ただし、AVID Media Composer で使用されるのと同じインポート設定ダイアログを呼び出すことができる場合があります。

MovieImportDoUserDialog()

API 関数。

編集

これは明白すぎるかもしれませんが、ソース フレーム記述ディクショナリのピクセル フォーマット タイプ キーを YUV ピクセル フォーマットに設定することで、解凍セッションから YUV データを単純に要求しようとしたことがありますか?

これを行うには、コードに次のブロックを追加します。

// request YUV 8 Bit 4:2:2 output from the decompression session
SInt32 pixel_format = k2vuyPixelFormat; // this should be '601 (16-235)' by definition
number = CFNumberCreate( NULL, kCFNumberSInt32Type, & pixel_format );
CFDictionaryAddValue( pixelBufferAttributes, kCVPixelBufferPixelFormatTypeKey, number );
CFRelease( number );
于 2009-07-31T11:49:09.007 に答える