Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    5

    How to use CMMFDevVideoRecord to record video from camera?

    I want to record video from camera using CMMFDevVideoRecord in mmfdevvideo lib(S60 5th SDK), I modify my test app according to Nokia's DevvideoEx example, to change SetSourceMemoryL() to SetSourceCameraL(), but when I run it in phone, I got "Signal Exception 0 received: A data abort exception has occurred" in after CMMFDevVideoRecord::Start() called, I have debuged many times but I got nothing, can anybody help me to solve the problem? thanks!

    part of source shows below:
    void CDevvideoExAppUi:oTestL() {


    LFPRINT((_L("DoTestL...")));

    iFile.Replace(CEikonEnv::Static()->FsSession(), KFile, EFileWrite);
    delete iCall;
    iCall = NULL;
    iCall = CAsyncCall::NewL(this);

    LFPRINT((_L("NewL()")));
    delete iDvr;
    iDvr = NULL;
    iDvr = CMMFDevVideoRecord::NewL(*this);

    // Find an accelerated encoder if possible, non-accelerated if not
    LFPRINT((_L("FindEncodersL()")));
    RArray<TUid> encs;
    iDvr->FindEncodersL(KMime, 0, encs, EFalse);
    LFPRINT((_L("Got %d encoders"), encs.Count()));
    TUid enc = TUid::Uid(0);
    TBool foundAccel = EFalse;
    for ( TInt i = 0; i < encs.Count(); i++ ) {
    LFPRINT((_L("Get info for encoder 0x%08x"), encs[i].iUid));
    CVideoEncoderInfo *info = iDvr->VideoEncoderInfoLC(encs[i]);
    if ( info->Accelerated() ) {
    LFPRINT((_L("Is accelerated, using this")));
    enc = encs[i];
    foundAccel = ETrue;
    } else if ( !foundAccel ) {
    LFPRINT((_L("Not accelerated, but haven't seen one so far -- using this")));
    enc = encs[i];
    } else {
    LFPRINT((_L("Not accelerated and already have one -- skipping")));
    }
    CleanupStack::PopAndDestroy(); //info
    }

    if ( enc.iUid == 0 ) {
    LFPRINT((_L("Didn't find an encoder")));
    User::Leave(KErrNotSupported);
    }

    // Select encoder
    LFPRINT((_L("Selecting encoder 0x%08x"), enc.iUid));
    iEnc = iDvr->SelectEncoderL(enc);

    // Input format
    LFPRINT((_L("Setting input format")));
    TSize size(176, 144);
    TUncompressedVideoFormat fmt;
    fmt.iDataFormat = EYuvRawData;
    fmt.iYuvFormat.iCoefficients = EYuvBt601Range1; // BT.601 coeffs, full rane
    fmt.iYuvFormat.iPattern = EYuv420Chroma2;
    fmt.iYuvFormat.iDataLayout = EYuvDataPlanar;
    fmt.iYuvFormat.iYuv2RgbMatrix = NULL;
    fmt.iYuvFormat.iRgb2YuvMatrix = NULL;
    fmt.iYuvFormat.iAspectRatioNum = 1;
    fmt.iYuvFormat.iAspectRatioDenom = 1;
    iDvr->SetInputFormatL(iEnc, fmt, size);

    // Output format
    LFPRINT((_L("Setting output format")));
    CCompressedVideoFormat *cfmt = CCompressedVideoFormat::NewL(KMime);
    CleanupStack::PushL(cfmt);
    iDvr->SetOutputFormatL(iEnc, *cfmt, EDuCodedPicture, EDuElementaryStream, EFalse);
    CleanupStack::PopAndDestroy(); //cfmt

    // Buffer options
    LFPRINT((_L("Setting buffer options")));
    TEncoderBufferOptions bopt;
    bopt.iMaxPreEncoderBufferPictures = 1;
    bopt.iHrdVbvSpec = EHrdVbvNone;
    bopt.iHrdVbvParams.Set(NULL, 0);
    bopt.iMaxOutputBufferSize = 10240;
    //bopt.iMaxCodedPictureSize = 20000;//10240;
    bopt.iMaxCodedPictureSize = 10240;
    bopt.iMaxCodedSegmentSize = 10240; // ignored in non-segmented mode
    bopt.iMinNumOutputBuffers = 2;
    iDvr->SetBufferOptionsL(bopt);

    // Source is memory
    //LFPRINT((_L("SetSourceMemoryL")));
    //iDvr->SetSourceMemoryL(15.0, EFalse, EFalse); // not real-time

    //Set souce from camera
    TRAPD(lError,iDvr->SetSourceCameraL(iCameraHandle->Handle(),15));

    // Initialize
    LFPRINT((_L("Initialize")));
    iDvr->Initialize();
    }

    void CDevvideoExAppUi::MdvroInitializeComplete(TInt aError) {

    LFPRINT((_L("MdvroInitializeComplete(%d)"), aError));
    if ( aError != KErrNone ) {
    TestComplete(aError);
    }

    // Start encoding
    LFPRINT((_L("Start")));
    iDvr->Start();

    // Write first input picture
    //iPicNum = 0;
    //WritePic();
    } //------------------------- received "Signal Exception 0 received: A data abort exception has occurred" here!!!!!!!!

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,807

    Re: How to use CMMFDevVideoRecord to record video from camera?

    Have you tried what happens with the original Nokia example? It may worth a check.
    Otherwise Signal Exception 0, data abort are generic slang, you should consider getting the Symbian error message: http://wiki.forum.nokia.com/index.ph...ded_panic_code

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    5

    Re: How to use CMMFDevVideoRecord to record video from camera?

    Hi, thank you wizard_hu_!

    I test my same app in 3rd SDK, now it is fine(no Signal Exception 0 error), but a new problem is coming, the MdvroNewBuffers() is never being called, how to do now?

    BTW, the Nokia original DevvidexEx sample is OK.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,807

    Re: How to use CMMFDevVideoRecord to record video from camera?

    If everything seems to be similar in your code and the example, you should check the capabilities it use (in the .mmp file). For camera or microphone stuff you will certainly need UserEnvironment as a minimum.

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    5

    Re: How to use CMMFDevVideoRecord to record video from camera?

    Quote Originally Posted by wizard_hu_ View Post
    If everything seems to be similar in your code and the example, you should check the capabilities it use (in the .mmp file). For camera or microphone stuff you will certainly need UserEnvironment as a minimum.
    Hi, wizard_hu_:

    I check the capabilities it use, there are "MultimediaDD UserEnvironment WriteDeviceData ReadDeviceData ReadUserData WriteUserData", I think it is enough, but I still do not know what missing? the MdvroNewBuffers() is never being called still, I doubt the Devvideo API is really usable? Nokia has really opened the API?

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,807

    Re: How to use CMMFDevVideoRecord to record video from camera?

    Unfortunately I do not know - neither the API, nor the policy. However you said that the example worked.
    Does your own code use a radically different part of the API?
    Do you get KErrNone-s everywhere?

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    5

    Re: How to use CMMFDevVideoRecord to record video from camera?

    Quote Originally Posted by wizard_hu_ View Post
    Unfortunately I do not know - neither the API, nor the policy. However you said that the example worked.
    Does your own code use a radically different part of the API?
    Do you get KErrNone-s everywhere?
    Dear wizard_hu_:
    I have modified SetSourceMemoryL() to SetSourceCameraL(), I want to capture video from camera directly, after I debuged it again and again, I also search whole internet, I could not find any other sample and reference for MDFDevvideo record API. I believe the MDFDevvideo Record API is not available actually. so I have to give up MDFDevvideo Record API and find a new solution...

  8. #8
    Registered User
    Join Date
    Jan 2010
    Posts
    9

    Re: How to use CMMFDevVideoRecord to record video from camera?

    Quote Originally Posted by Romeo1978 View Post
    Hi, thank you wizard_hu_!

    I test my same app in 3rd SDK, now it is fine(no Signal Exception 0 error), but a new problem is coming, the MdvroNewBuffers() is never being called, how to do now?

    BTW, the Nokia original DevvidexEx sample is OK.
    Hi Romeo,
    How do you run the DevvideoEx example? I can not install it on my N97 phone. When I install I got "Request application access not granted" error. I used the same capability as yours, which is "MultimediaDD UserEnvironment WriteDeviceData ReadDeviceData ReadUserData WriteUserData". And I use a developer certification to sign the example. But I still cannot install it.

    Do you know why?

    Thank you very much!
    ty

  9. #9
    Registered User
    Join Date
    Jan 2010
    Posts
    1

    Re: How to use CMMFDevVideoRecord to record video from camera?

    Quote Originally Posted by tianyu.wang View Post
    Hi Romeo,
    How do you run the DevvideoEx example? I can not install it on my N97 phone. When I install I got "Request application access not granted" error. I used the same capability as yours, which is "MultimediaDD UserEnvironment WriteDeviceData ReadDeviceData ReadUserData WriteUserData". And I use a developer certification to sign the example. But I still cannot install it.

    Do you know why?

    Thank you very much!
    ty
    I was able to run the example, when I disabled MultimediaDD capability -- I simply don't have any keys, that would allow me to use it (just developer key won't do, you need to do capabilities-shopping of some sort from Nokia). It seems the only really needed capability here is UserEnvironment, as the MultimediaDD still left problems fot Romeo.

    Also, the example ran but didn't do aynthing userful on my 5th edidition device. Except failing (aError < 0) when called MdvroInitializeComplete (errors varied while I played with it).

    With my own code that was supposed to get stream from camera I get aError==0 in MdvroInitializeComplete, but afterwards I get the same behaviour as Romeo -- signal exception 0 after a call to iDvr->Start().
    I tried:
    • not reserving and not powering up camera by hand (gives errors on initialization)
    • setting input format and all other data according to CCamera enumerations for video
    • setting rgb input format that looks reasonable
    • preparing the camera for video capture
    • even running ccamera video capture by hand
    • trying both MCameraObserver and MCameraObserver2 (I have no idea whether duplicated camera is obliged to use the same interface as the "original")

    I think that it could be feasible to play with preprocessors and see what they can do, but for now I have my own software encoder from ffmpeg, that actually does work. It is slow, but it works.
    Also, there's http://wiki.forum.nokia.com/index.ph...a_Recorder_API I'll see what it can do.

Similar Threads

  1. Video recording in camera wrapper
    By glbrighenti in forum Symbian Media (Closed)
    Replies: 6
    Last Post: 2009-11-10, 23:33
  2. Video Record Streaming
    By somnathbanik in forum Symbian
    Replies: 16
    Last Post: 2009-09-09, 15:16
  3. record video in mpg format for mobile phone
    By D|3-H4rD in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2006-11-24, 01:25
  4. CMdaAudioRecorderUtility and Video Record cause phone to restart!!
    By ronald29 in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2006-10-31, 03:32
  5. draw into video stream from camera
    By Davidyes in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-07-28, 22:19

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×