when I encode h264 stream , mfxBitstream->FrameType has I frame output,but when I encode mpeg2 ,I can not get frame type MFX_FRAMETYPE_I,what is wrong?
I am useing the sample_encode in Media SDK 2013 R2.
can you expand a bit more about the specific use case, such as what command line options you are using with sample_encode?
Is the your issue with first frame or expected I-frame later in the encoded stream?
The first encoded frame will always be an I-frame. It will also be tagged as na IDR and REF frame. See the "FrameType" flags in the API spec for details.
You can control the GOP size (I-frame interval) using the GopPicSize parameter in the API.
Glad to see your reply,I find the reason,I am using line options "mpeg2 -i videoHD.yuv -tff -w 1920 -h 1080 -o 111.mpg -hw -d3d -b 4000 -f 25",
mfxBitstream's FrameType returns 0x42,0x42,0x4,,,,,it has none I frames,when I remove the option "-tff", is returns 0xc1,0x42...,that is right.so I guess,it returns the sencond coded frame type ,i can only analysis coded frame pictype to decied whether is I frame.is it right?
I have the other question.the gopsize of coded frame has a variable gop size.it seems the GopPicSize can not limit it.I attach a pic.
I have a idea,you can output the coded frame in field ,that is a Interleaved fame has two coded frame.pass to WriteNextFrame twice.
Why the attached file is wrong ,attach again.
not sure why picture upload failed, seems to be an intermittent issue.
Thanks for clarifying to me the exact workload you're executing. I do not see any issues with the encoded stream. If you explore the interlaced encoded stream in for instance Elecard Stream Analyzer you should see I-frames indicated at the selected interval.
Regarding frame type reporting in the bitstream container. It looks like this was an issue in older Media SDK HW DLL implementation part of Intel graphics driver. I see similar issue with a quite old driver, but the issue is not seen in recent 15.31.3165 driver available for download at the main Intel driver download site. I also tested, the Media SDK SW path. Unfortunately, I-frames are not reported correctly, we will track this as a bug and fix shortly.
What driver version and processor are you using?
Below is my request:
1.fixed gopsize, cannot be changed during the encoding process.
2.Fixed rate, using in the transmission environment, cannot have buffer overflow
3.Premise quality assurance, the sooner the better
Most headachy thing is GOP is not fixed! my environment: cpu core i7-3537u @2.00GHz
os windows 7
HD graphics 4000 driver version 220.127.116.1175
it works in 1.4 hw and 1.7 sw.
Most headachy thing is GOP is not fixed! Please give me some advice.
attach some pics.
thanks for sharing your feature requests. See comments on your items below:
1. Media SDK currently only supports fixed GOP pic size at initialization. We are exploring more dynamic capabilities for future releases of Media SDK and HW. No timeline commitment at this point.On this topic: You do have the ability to manually control frame type at any time using "mfxEncodeCtrl" as input to EncodeFrameAsync(). Using this method you can for instance insert an I-frame on demand into your encoded stream whenever you want.
2. Can you elaborate what you mean by "fixed rate"? Are you referring to dynamic frame rate control or bitrate control?If bitrate: Dynamic bitrate control is supported and have been for quite awhile.
3. Can you also please provide more details on what you mean by "premise quality assurance"?
Sorry for my poor english,and the late reply.
1. the fixed GOP pic size is need just.I update driver to 10.18.10.3282,it works well.
2.I need constant bitrate during encode,that is CBR.when i set mfx.TargetKbps=4000,the output of encded stream can up to 5000K.I don't know how to calculate the bitrate in reeltime,my calculate it by SizeofOneGop/TimeofOneGop,is right?
3.another question: Those are the settings I'm using:
m_mfxEncParams.mfx.CodecId = mpeg2;
m_mfxEncParams.mfx.FrameInfo.Width = 720;
m_mfxEncParams.mfx.FrameInfo.Height = 480;
m_mfxEncParams.mfx.CodecProfile = MFX_PROFILE_MPEG2_MAIN;
m_mfxEncParams.mfx.CodecLevel = MFX_LEVEL_MPEG2_MAIN;
after executing GetVideoParam(), lmfxVideoParam->CodecLevel = MFX_LEVEL_MPEG2_HIGH1440; CodecLevel is changed to MFX_LEVEL_MPEG2_HIGH1440 from MFX_LEVEL_MPEG2_MAIN,What is wrong?
I attach the log file.
Depending on input resolution and bit rate etc. CodecLevel value may be adjusted to best fit even if other CodecLevel value have been set during Init(). If changes were made to parameters during Init() the call will return MFX_WRN_INCOMPATIBLE_VIDEO_PARAM. You can query the actual set of selected parameters by calling GetVideoParam().