Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

Media SDK and DirectShow Editing Services

Don_Winters
Beginner
2,351 Views
I'm tasked with developing a video editing application, similar to Microsoft MovieMaker, i.e mutliple source images/movies, transitions, trimming, background music, etc. The only API that I know of to do this is DirectShow Editing Services (DES), a DirectShow API that handles most of the editing details. I also need h264 support, hence my interest in the Intel Media SDK.

My understanding is that DES will only take RGB input and it's output is RGB so in order to use it with the Intel codecs I need to convert from NV12 to RGB. I wrote a NV12 to RGB converter to go from the Intel decoder to DES and I am able to preview my "timeline" images OK. But if I want to encode, I need to write an RGB to NV12 converter and then connect to the Intel h264 encoder. I'm having a lot of trouble with that. I can connect my NV12 to RGB filter to the Intel h264 encoder, but that's as far as I go. I can't run it.

First of all, is there any reason why, in principle, what I am trying to do will not work?

Some specifics, I get an error in CEncVideoFilter::DecideBufferSize where the call to

sts = pEnc->GetVideoParam(&par);

returns MFX_ERR_NOT_INITIALIZED. At the moment I can't figure out why it wouldn't be initialized and I'm not sure this is critical because DecideBufferSize does return successfully ( but the sample code does not get this error).

Ultimately I fail altogether in the CEncVideoFilter::Receive call with the same sort of problem

sts = m_pEncoder->Init(&m_mfxParamsVideo, &m_mfxParamsVPP, this);

this return MFX_ERR_INVALID_VIDEO_PARAM.

I'm digging through the sample code trying to figure out the difference, but I can't seem to pinpoint it.

I'm really more concerned with whether I am wasting my time even trying this than the details above. Although if anyone has any ideas on the details, that would be great.

Thanks,
0 Kudos
1 Solution
maxim-sharabayko
New Contributor I
2,351 Views
Hi Eric,

I have this problem solved in another thread: http://software.intel.com/en-us/forums/showthread.php?t=79907

Thanks for your response.

View solution in original post

0 Kudos
9 Replies
Eric_S_Intel
Employee
2,351 Views

Hi

That function also requires a valid mfxsession. Have verified that the session has been init'ed?
You can also make sure the implementation dll's are in your system path. Are these the only SDK functions that are failing? I dont see any reason - in principle - why what your trying to do would not work. If you can't get it, post the input params.

Eric

0 Kudos
Don_Winters
Beginner
2,351 Views
Eric,

Ok, I think the session is the problem, but what do I need to do? Isn't the session created when the filter gets instanciated? I'm using the dshowplayer sample as a guide, how does it insure a valid session? Is there some sort of init call I need?

The implementation dlls are there (libmfxhw32.dll and libmfxsw32.dll) so I don't think that is the problem.

One other thing I have noticed is that the CEncVideoFilter::CompleteConnect call fails for both the dshowplayer sample and my app. The line

CComQIPtr mfxalloc(alloc);

returns a NULL pointer. The call still succeeds but this doesn't seem right to me.

In any case, thanks for the info.

Don
0 Kudos
Eric_S_Intel
Employee
2,351 Views

The session is created in the CBaseEncoder::SetAcceleration call which is invoked during the initialization of the filter.

The DShowPlayer application is just a higher level application thats just building a filter graph with the encoder filter being instantiated if you choose to do a transcode.

Try this:

Go to the Samples\PlugIns\DShow Samples (the filters) and build the h264_enc_Filter project.

Register the output: Regsvr32 h264_enc_filter.dll (it will be in the _build dir use admin rights).

Launch The DShowPlayer,

Go back to Visual Studio, set a break point on the constructor CH264EncVideoFilter::CH264EncVideoFilter(). Then goto Debug->Attach to Process. Select the Dshow Process. The debugger should attach.

Go back to the DirectShow Player, start a transcode when the Encoder is instantiated your breakpoint should trigger. At that point you can step into the base class constructor and see whats failing.

It sounds like the m_pmfxENC pointer is invalid, which could cause all kinds of downstream errors to happen.

0 Kudos
Don_Winters
Beginner
2,350 Views
Eric,

I am able to step through the code with the debugger.

The dshowfilter example works fine for me but my sample fails in the CBaseEncoder::InternalReset call around line 301.

sts = m_pmfxENC->Init(&InitParams); ///this is where I get -15, MFX_ERR_INVALID_VIDEO_PARAM

There seems to be something wrong with my input parameters, but this is a large structure and I haven't been able to pinpoint the problem. Even with being able to compare to the dshowsample debugger as a guide.

I'm trying to connect my RGB to NV12 converter filter up to the encoder. I can connect it, but when I try to run it, I get this error.

This strucure is pretty large. Do you know of any part of it that would be the likely problem spot so I could narrow it down a little.

Thanks,
Don Winters
0 Kudos
Eric_S_Intel
Employee
2,351 Views

These are required for Encoder Initialization:

mfxVideoParam:

  • IOPattern

mfxInfoMFX:

  • CodecID
  • TargetKBS
  • EncodedOrder

MfxInfoMFX.mfxFrameInfo:

  • FourCC
  • Width
  • Height
  • CropX
  • CropY
  • CropW
  • CropH
  • FrameRateExtN
  • FrameRateExtD
  • ChromaFormat

I zero'ed out a few of them in the debugger and constantly received -15 back from the call.
Hope this helps

-Eric

0 Kudos
Don_Winters
Beginner
2,351 Views
Ok, thanks. I guess I have some work to do. I have several of these coming up empty.

TargetKBS, FrameRateExtN, FrameRateExtD, EncodedOrder are all zero.

I notice that some values are getting set initially from the registry and then get wiped out somewhere. I'll keep digging.

Don
0 Kudos
maxim-sharabayko
New Contributor I
2,351 Views
Hi!

I have quite the same problem. The AVC Encoder cannot connect because
m_mfxVideoSession.Init(impl, &version);
returns '-3'

I got down to
return MFXInit(impl, ver, &m_session); (mfxvideo++.h line 25), but MFXInit seems to be in dll (?) and I can only see the return value is -3.

Don, if you found your problem please give some advices!

P.S. I use initial Media SDK 2.0 Gold sample, build it, copy libmfxsw32.dll to the filter's folder, but it seems I don't have libmfxhw32.dll. So I don't know where the problem may be!
Please help!

P.S.2 Ok, the return value is -3 which is MFX_ERR_UNSUPPORTED
impl is set to MFX_IMPL_AUTO, version is 1.1.65537 (major, minor,version)
What may be wrong here?
0 Kudos
Eric_S_Intel
Employee
2,351 Views

Hi,

What platform is this occurring on?

MFXInit with version = 1.1 means to load the Sandy Bridge library. Are you using a Sandy Bridge platform? The HW lib is installed via the graphics driver install. If you are not using a Sandy Bridge platform, change the version to 1.0. If that still doesnt work, try updating your graphics driver.

0 Kudos
maxim-sharabayko
New Contributor I
2,352 Views
Hi Eric,

I have this problem solved in another thread: http://software.intel.com/en-us/forums/showthread.php?t=79907

Thanks for your response.
0 Kudos
Reply