locked
Access violation when MediaTranscoder and mft encoding a mp4 file

    Question

  • hello:

    I encoding a video (width720  height1280 capture by my phone lumia820 vertically) by the mediatranscoder and mft to add effects, when i set MediaEncodingProfile

    _Profile->Video->Width = 720;
    _Profile->Video->Height = 1280;

    cause error as ellow:

    0x68CC1043 (QcVidEncmftH2648960.dll) (MediaAssistant.WindowsPhone.exe) at the first chance exceptions: 0xC0000005: 0x115A2000 access violation occurred while writing memory.

    if i set MediaEncodingProfile

    _Profile->Video->Width = 1280;
    _Profile->Video->Height = 720;

    it's ok, but the video frame actual size is shrunken.  if the video (width1280, height720) also can encoding success.

    i try use the sinkWriter to encoding it but error as same as above, then i try MediaEncodingProfile::CreateAVI success, but the file so large.

    Someone can tell me what's wrong? very thank you for helps!

    Wednesday, September 10, 2014 8:31 AM

Answers

  • Hello,

    I guess I'm still a bit confused about what you are trying to do. Can you please provide a small Visual Studio 2013 sample project that reproduces the issue without any extraneous code? Once you have created the project can you please zip it up and then upload it to your OneDrive. Once it is uploaded to your OneDrive please paste a link here and I will take a look at it.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    • Marked as answer by zhangwei_yt Tuesday, November 11, 2014 1:40 AM
    Tuesday, September 16, 2014 9:22 PM
    Moderator

All replies

  • Did you test this on other windows phone?

    Thursday, September 11, 2014 6:36 AM
  • I'll ask our media expert to check this out.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, September 11, 2014 7:22 PM
    Moderator
  • Hello,

    Do the height and width of the source profile match the height and width of the output profile? In other words does the input video have the exact same height and width as the output video? The input profile and output profile sizes should have the same aspect ratio.

    What API call specifically is generating the error?

    -James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Thursday, September 11, 2014 10:38 PM
    Moderator
  • James,

    Yes, i'm sure the source file' width and height match the output file' width and height. and the same media type in the MFT the code as below:

    hr = MFGetAttributeSize(m_pInputType, MF_MT_FRAME_SIZE, &m_imageWidthInPixels, &m_imageHeightInPixels);
            if (FAILED(hr))
            {
                goto done;
            }

     m_cbImageSize = 4 * m_imageWidthInPixels * m_imageHeightInPixels;

     m_imageWidthInPixels is 720 and m_imageHeightInPixels is 1280 and I set the output media type same as the input media type, but can't set the ouput profile width = 720,height = 1280, only can set the ouput profile width = 1280,height = 720
    Friday, September 12, 2014 7:11 AM
  • no, only 820 and 630 , but 630 always report error: out of memory .
    Friday, September 12, 2014 7:14 AM
  • the code is:

     hr = m_dxBase->GetD2DDeviceContext()->CreateBitmap(
       D2D1::SizeU(m_imageWidthInPixels, m_imageHeightInPixels),
       pInputBitmapData,
       pitch,
       D2D1::BitmapProperties(
       // Format = RGB32
       D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE)
       ),
       &pInputBitmap
       );

    when the first invoke is success ,but the second invoke cause error, error infomation as bellow:

    0x68CC1043 (QcVidEncmftH2648960.dll) (MediaAssistant.WindowsPhone.exe) at the first chance exceptions: 0xC0000005: 0x115A2000 access violation occurred while writing position.

    Sunday, September 14, 2014 8:06 AM
  • Hello,

    I guess I'm still a bit confused about what you are trying to do. Can you please provide a small Visual Studio 2013 sample project that reproduces the issue without any extraneous code? Once you have created the project can you please zip it up and then upload it to your OneDrive. Once it is uploaded to your OneDrive please paste a link here and I will take a look at it.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    • Marked as answer by zhangwei_yt Tuesday, November 11, 2014 1:40 AM
    Tuesday, September 16, 2014 9:22 PM
    Moderator