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.

mfxStreamParams & mfxTrackInfo - Which values should I use?

Matthew_C_
New Contributor I
389 Views

I'm trying to mux h264 frames into mpg4 frames using the Intel Media SDK. So going from h264 to mpg4.

However, going through mfxStreamParams and mfxTrackInfo makes me unsure of which values to use.

 

So, mfxStreamParams, are the parameters for the mpg4 stream I am outputting? Therefore:

SystemType - that would be MFX_MPEG4_SYSTEM_STREAM ?

Flags - I don't see anything more in the description than simply 'Stream flags.' Do I need to worry about this or is it for internal usage?

NumTracks & NumTracksAllocated - Only 1 since only using video correct?  Why are these numbers different, wouldn't you always want to allocate as many tracks as you use?

 

And I guess mfxTrackInfo is the parameters for the h264 stream being input?

Type - MFX_TRACK_H264

SID - Random number or is this just for internal usage since eventually I may indeed want to have multiple streams going through this system?

Header - the h264 header has many components to it and at least from the looking around I've done, seems complicated. Is there any way to automatically get that out of the h264 packet given that I am generating it using the Media SDK?

AudioParam - Guessing I can just use StreamInfo.NumChannel = 0, fill in the mandatory fields too but it'll basically not worry about this one.

VideoParam - In case anyone else stumbles across this post looking for the same thing, check this out reagrding FrameRateExtD and FrameRateExtN - http://software.intel.com/en-us/forums/topic/311684

 

0 Kudos
1 Solution
Petter_L_Intel
Employee
389 Views

Hi Matthew,

If you want to mux to mp4 container use SystemType = MFX_MPEG4_SYSTEM_STREAM.  You can leave Flags = 0.

NumTracks & NumTracksAllocated should be set to 1 if you only want to mux a single video track into the container.

Type should be  MFX_TRACK_H264  unless you want to mux MPEG2 stream whihc is also supported for mp4 containers.

SID is a unique identifier for the track. You can set this to whatever you want. 0 is also fine.

Header : For muxing you do not have to set the header. The stream header will be parsed automatically during initialization.

AudioParam : Set o NULL since you're not muxing an audio track.

VideoParam : Just use the video parameter structure used by the encoder.

Regards,
Petter

View solution in original post

0 Kudos
4 Replies
Petter_L_Intel
Employee
390 Views

Hi Matthew,

If you want to mux to mp4 container use SystemType = MFX_MPEG4_SYSTEM_STREAM.  You can leave Flags = 0.

NumTracks & NumTracksAllocated should be set to 1 if you only want to mux a single video track into the container.

Type should be  MFX_TRACK_H264  unless you want to mux MPEG2 stream whihc is also supported for mp4 containers.

SID is a unique identifier for the track. You can set this to whatever you want. 0 is also fine.

Header : For muxing you do not have to set the header. The stream header will be parsed automatically during initialization.

AudioParam : Set o NULL since you're not muxing an audio track.

VideoParam : Just use the video parameter structure used by the encoder.

Regards,
Petter

0 Kudos
Matthew_C_
New Contributor I
389 Views

Thank you Petter!

The header had be most worried, so I'm glad to hear I don't have to deal with that!

0 Kudos
Matthew_C_
New Contributor I
389 Views

Actually still have a question regarding this one, what would you use for FrameRateExtN and FrameRateExtD?

I see that FrameRateExtN/FrameRateExtD is the ratio for determining the frame rate but is the only thing important what that ratio is?  Or do the actual numbers matter?  

Here I see they are using FrameRateExtN = 27000000   and FrameRateExtD = 1080000 : http://software.intel.com/en-us/forums/topic/314483  Would using 25 and 1 be equivalent to say 25,000 to 1,000?

 

 

0 Kudos
Petter_L_Intel
Employee
389 Views

Hi Matthew,

The Numerator and Denominator frame rate components are used to be able to represent non Integer rate settings, such as 29.97  (=30000/1001).

If you want 30 fps, just set the values to 30 and 1.

Regards,
Petter

0 Kudos
Reply