Latest post Fri, Feb 27 2015 4:56 PM by andym. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • Wed, Feb 25 2015 5:54 AM

    • macl1012
    • Not Ranked
    • Joined on Wed, Jan 21 2015
    • Posts 18
    • Points 175

    some questions about DHM Transfer

    When we use DHM SDK, we met some questions.

     

    some exceptions exit in the initialization.

     

    [Code] like below:

    ----------------------------------------------------------------------------------------------------

    BOOL CTMOperator::CreateProxyMob(

    LPCTSTR lpszClipName,

    const SDYFileMediaInfo &sFileMediaInfo, 

    LPCTSTR lpszPluginName,

    LPCTSTR lpszOuputMobPath, 

    const std::map<CString, CString>& mapUserAttrib,                          

    LPCTSTR lpszSourceHostname

    )

    {

    if(!Initialize())return FALSE;

     

    Av::Ingest::eError error(Av::Ingest::keNoError);

     

    AG::ProductIdentificationSet clientID;

    clientID.majorVersion = 0;

    clientID.minorVersion = 0;

    clientID.tertiaryVersion = 0;

    clientID.patchLevel = 0;

    clientID.companyName = _T("Avid Technology, Inc.");

    clientID.productName = _T("Transfer Engine NULL PlaybackService");

    clientID.productVersionString = _T("0.0.0");

    AG::InitClientID (clientID);

     

    AG::HelperIF* pHelper(AG::CreateHelper(AG::ContainerIF::TYPE_AAF));

    AG::ContainerBuffer* pNewCB(pHelper->CreateContainerBuffer(50 * 1024));

    AG::ContainerIF* pProxyFile(NULL);

    std::string msErrorMsg;

    std::string strVideoType = AG::kctAvUNKNOWN;

    if(sFileMediaInfo.sMediaInfo.dwVideoStreamCount>0)

    strVideoType = VideoType2AvidMediaType(sFileMediaInfo.sMediaInfo.sVideoMediaInfo.enumVideoType);

     

    std::string strAudioType = AG::kctAvUNKNOWN;

    if(sFileMediaInfo.sMediaInfo.dwAudioStreamCount>0)

    strAudioType = AudioType2AvidMediaType(sFileMediaInfo.sMediaInfo.sAudioMediaInfo.enumAudioType);

     

    OutputDebugFormatString(_T("eVideoMediaType: 0x%X eAudioMediaType: 0x%X"),

    sFileMediaInfo.sMediaInfo.sVideoMediaInfo.enumVideoType, sFileMediaInfo.sMediaInfo.sAudioMediaInfo.enumAudioType);

     

    try

    {

    OutputDebugFormatString(_T("pHelper->CreateContainer"));

    pProxyFile = pHelper->CreateContainer(pNewCB, AG::ContainerIF::koWRITE, AG::ContainerIF::kAafRev1x);

    if(NULL == pProxyFile)

    throw std::string("Unable to create metadata container");

     

    int nFPS(fabs(sFileMediaInfo.sMediaInfo.sVideoMediaInfo.dwStandardRate - 29.97) < 0.0001 ? 30 : 25);

    bool bDrop(nFPS == 30 ? true : false);

    Av::AvString avClipName;

     

    MPCTM::ConvertCString2AvString((CString)lpszClipName, avClipName);

     

    AG::TapeMobIF::TapeVitals tv;

    std::string strClipName(avClipName.ToCString());

     

    if(sFileMediaInfo.dwVideoFrameCount == 0)

    throw std::string("duration error");

     

    tv.sName = strClipName;

    // @note Always set the tape's starting offset to zero.

    // tv.mTimeCode = AG::TimeCode(nFPS, bDrop, 0);

    tv.mTimeCode.hours = 0;

    tv.mTimeCode.minutes = 0;

    tv.mTimeCode.seconds = 0;

    tv.mTimeCode.frames = 0;

    tv.mTimeCode.drop = bDrop;

    tv.mTimeCode.fps = nFPS;

     

     

    AG::TimeCode startTC(tv.mTimeCode);

    AG::veTrack_t vTrackList;

     

    vTrackList.push_back(AG::ktVideo);

    OutputDebugFormatString(_T("vTrackList.push_back(AG::ktVideo)"));

    for(int iTrack = 0; iTrack < sFileMediaInfo.sMediaInfo.sAudioMediaInfo.dwChannels * sFileMediaInfo.sMediaInfo.dwAudioStreamCount; iTrack++)

    {

    vTrackList.push_back(AG::ktAudio1 + iTrack);

    OutputDebugFormatString(_T("vTrackList.push_back(AG::ktAudio%d)"), iTrack+1);

    }

    int nDuration(sFileMediaInfo.dwVideoFrameCount);

    tv.nDuration = nDuration;

    OutputDebugFormatString(_T("AG::Filelist startTC: %s \n strClipName: %s \n strVideoType: %s \n wBitsPerSample: %ld \n nSamplesPerSec: %ld \n strAudioType: %s \n nDuration: %d \n"),

    ns_DYStringUtils::ConvertStringToCString(startTC.Text()),

    ns_DYStringUtils::ConvertStringToCString(strClipName),

    ns_DYStringUtils::ConvertStringToCString(strVideoType),

    sFileMediaInfo.sMediaInfo.sAudioMediaInfo.dwBitsPerSample,

    sFileMediaInfo.sMediaInfo.sAudioMediaInfo.dwSamplesPerSec,

    ns_DYStringUtils::ConvertStringToCString(strAudioType),

    nDuration);

    AG::Filelist fl(

    vTrackList, 

    startTC, 

    strClipName,

    tv,

    // kw_format: changed for uncompressed testing

    strVideoType, 

    sFileMediaInfo.sMediaInfo.sAudioMediaInfo.dwBitsPerSample,

    AG::Rational(sFileMediaInfo.sMediaInfo.sAudioMediaInfo.dwSamplesPerSec, 1),

    strAudioType,

    // kw_temp2: use user-supplied duration for partial restore testing

    //nFPS * nDuration);

    nDuration, NULL);

     

    // set the Ingest Receiver DLL name which the TransferManager will load

    // @note this should neither include "VC7" nor ".dll"

    Av::AvString avPlugin, avHostName;

    USES_CONVERSION;

    MPCTM::ConvertCString2AvString((CString)lpszPluginName, avPlugin);

    MPCTM::ConvertCString2AvString((CString)lpszSourceHostname, avHostName);

     

    fl.SetATTR(AV_INGEST_DLL_ATTRNAME, avPlugin.ToCString());

    fl.SetATTR(AV_INGEST_HOST_ATTRNAME, avHostName.ToCString());

    fl.SetSubATTR(SUBATTR_GROUP, AV_INGEST_TRANSFERTYPE_ATTRNAME, AV_INGEST_TRANSFERTYPE_VALUE);

    for(std::map<CString, CString>::const_iterator it = mapUserAttrib.begin(); it != mapUserAttrib.end(); it++)

    {

    fl.SetSubATTR(SUBATTR_GROUP, T2A(it->first), T2A(it->second));

    }

     

    // set the "don't trim to marks" attribute (when you are setting a markin/markout in the clip)

    // @note otherwise the clip will be reduced to the markin/markout

    //fl.SetSubATTR("_EXPORT", "TRIM_SUBCLIP", "0" /* not trimmed */);

     

    OutputDebugFormatString(_T("Filelist::PutIntoFile"));

    fl.PutIntoFile(pProxyFile);

     

    pHelper->DeleteContainer(pProxyFile);

    pProxyFile = NULL;

     

    EnsureDirectoryExist(lpszOuputMobPath);

     

    Av::AvString avOutput;

    MPCTM::ConvertCString2AvString((CString)lpszOuputMobPath, avOutput);

    OutputDebugFormatString(_T("pNewCB->Dump: %s"), lpszOuputMobPath);

    //pNewCB->Dump(avOutput.ToCString());

    }

    catch (AG::ErrorIF err)

    {

    msErrorMsg = "AG::ErrorIF Error: " + err.GetMsgText();

    error = Av::Ingest::keOMF;

    }

    catch (std::string stError)

    {

    msErrorMsg = "string Error: " + stError;

    error = Av::Ingest::keInternalError;

    }

    catch (...)

    {

    msErrorMsg = "Error: Uncategorized exception";

    error = Av::Ingest::keInternalError;

    }

     

    // cleanup

    if(pProxyFile)

    {

    pHelper->DeleteContainer(pProxyFile);

    pProxyFile = NULL;

    }

    if(pNewCB)

    {

    pHelper->DeleteContainerBuffer(pNewCB);

    pNewCB = NULL;

    }

    if( pHelper)

    {

    AG::DeleteHelper(pHelper);

    pHelper = NULL;

    }

     

    if(error != Av::Ingest::keNoError)

    {

    m_strError.Format(_T("CreateProxyMob %s"), ns_DYStringUtils::ConvertStringToCString(msErrorMsg));

    OutputDebugString(m_strError);

    return FALSE;

    }

    return TRUE;

    }

    ------------------------------------------------------------------------------------------------ 

     

    Output and Error like below:

    ----------------------------------------------------------------------------------------------

    Host::NewHost...

    Host->Initialize...

    Host->Initialize OK

    eVideoMediaType: 0x8000000 eAudioMediaType: 0x1

    pHelper->CreateContainer

    vTrackList.push_back(AG::ktVideo)

    vTrackList.push_back(AG::ktAudio1)

    vTrackList.push_back(AG::ktAudio2)

    AG::Filelist startTC: 00:00:00:00

     strClipName: 1ee0bd15-2a7c-44c4-83dc-1b5c2da86061_VA0

     strVideoType: Avid::HD1080i::DNxHD::145

     wBitsPerSample: 16

     nSamplesPerSec: 48000

     strAudioType: Avid::PCM::Uncompressed

     nDuration: 251

     

    Filelist::PutIntoFile

    [ 26-1-2015 9:0:28,289 ] Postcondition "Valid sequence pointer" violated in rout

    ine "AA::MediaTrack::CreateSequence".

    The violation occurred at line 336 in file "..\..\AA\MediaTrack.cpp".

    The condition "p_sequence != NULL" was false.

    eVideoMediaType: 0x8000000 eAudioMediaType: 0x1

     ----------------------------------------------------------------------------------------------------

     

     

    In the initialization, Transfer Engine has not any output, but when Transfer Engine started, 

    we found some possible error maybe related with DHM Transfer.

     

    [ TCP Optimization Settings: ]

    01/26/2015 16:48:29  C90 --- Tcp1323Opts: Not Found

    01/26/2015 16:48:29  C90 --- TcpWindowSize: Not Found

    01/26/2015 16:48:29  C90 --- DefaultSendWindow: Not Found

    01/26/2015 16:48:29  C90 --- DefaultReceiveWindow: Not Found

     

    01/26/2015 16:48:30  C90 Transfer Engine Software License Enabled

    01/26/2015 16:48:30  C90 Generic FTP License Enabled

     

     

    Firstly, we suspected TM configuration or environment have some problem, so we used 

    AVID FTP Media Browser to test. The Engine of AVID told us that this tool uses DHM SDK 

    to transfer frame data to Transfer Engine. But when we configure FTP Media Browser and 

    click Initiate Transfer, report some error (errorcode=5 means access is denied), transfer 

    is not success. 

    We have excluded the possibility that the machine (hostname is te2) has no DHM authorization, 

    because we saw “Additional Options: FTP DHM Option”in Dongle Manager (Figure 1).

     

    We have some questions list below:

    1. Whether if FTP Media Browser transfer succeed, we can say that the environment configuration 

    of DHM is OK?

    2. Whether like below (Figure 2) the display in the red scope means TM Client could connect Transfer Engine or the Avid Interplay 

    Transfer Engine Configuration is OK?

    Our configuration of Avid Interplay Transfer Engine like Figure 3.

    3. Whether having the dongle authorization before, our development condition using DHM is 

    enough?

    4. Whether the TCP error we met is related with DHM Transfer?

    Filed under:
  • Wed, Feb 25 2015 6:01 AM In reply to

    • macl1012
    • Not Ranked
    • Joined on Wed, Jan 21 2015
    • Posts 18
    • Points 175

    Re: some questions about DHM Transfer

  • Wed, Feb 25 2015 6:03 AM In reply to

    • macl1012
    • Not Ranked
    • Joined on Wed, Jan 21 2015
    • Posts 18
    • Points 175

    Re: some questions about DHM Transfer

  • Wed, Feb 25 2015 6:05 AM In reply to

    • macl1012
    • Not Ranked
    • Joined on Wed, Jan 21 2015
    • Posts 18
    • Points 175

    Re: some questions about DHM Transfer

  • Fri, Feb 27 2015 4:56 PM In reply to

    • andym
    • Not Ranked
    • Joined on Thu, Jan 13 2011
    • Posts 102
    • Points 1,200
    • Avid Developer Moderator

    Re: some questions about DHM Transfer

    Please see my post to your other thread. I suggest you build and run the prototype sample and once successful, you start modifying it step by step so you always have a known good base to start from. Have you been able to run the prototype sample that comes with the SDK successfully? It will create synthetic video and audio without requiring any real input; if that works you can be sure your environment is setup properly.

    Rgds,

    Andy

Page 1 of 1 (5 items)

© Copyright 2011 Avid Technology, Inc.  Terms of Use |  Privacy Policy |  Site Map |  Find a Reseller