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.

AAC audio encoding sample

koby_s_
Beginner
808 Views

Hi,
I am looking for AAC audio encoding sample for MSS 2016/2015.
I searched on the web site but all I could find is that there was a sample but it was deprecated (and I couldn't find that deprecated sample)

Thank you
koby

0 Kudos
7 Replies
Harshdeep_B_Intel
808 Views

Hi Koby,

Unfortunately, we do not have a sample showcasing audio processing with current samples version. However, if you are really interested in a reference sample, you can take a look at sample_full_transcode (available in deprecated package here). Please note, these are deprecated legacy samples (mean no longer supported) and are still up just as a reference.If you are interested in psuedo code, you might want to take a look at this thread: https://software.intel.com/en-us/forums/intel-media-sdk/topic/603748.  Let us know if you any questions and we will be happy to answer any questions you may have on Audio plugin. 

Thanks, 

0 Kudos
Roman_T_
New Contributor I
808 Views

Hi Harsh!

First versions of Intel Media SDK required Audio plugin as an additional option for basic Media SDK set.
Does latest version of MSDK require additional plugin for audio processing or it has audio processing as internal option?

Best regards,
Roman

0 Kudos
Harshdeep_B_Intel
808 Views

Hi Roman, 

No changes to support model for Audio plugin and MSDK. Current/latest version of MSDK requires additional Audio plugin for Audio processing and which is also part of MSDK package. 

Thanks, 

0 Kudos
koby_s_
Beginner
808 Views

Hi Harsh
Thank you for the quick response. The deprecated sample did help me.

I have another question about the audio timestamps.

When I am pushing 1024 audio samples to the encoder, everything is fine (AAC decode -> AAC encode).

The problem starts when the PCM frame contain more than 1024 samples.

for example:
I decode mpeg1 layer 2 audio and each decoded frame has 1152 samples.
When I pushed those samples to the encoder and called audioSession.SyncOperation(), the time stamps appeared in mfxBitstream::Timestamp was the same as the input.
I was expecting them to match to 1024 samples since the encoder return 'MFX_ERR_MORE_BITSTREAM'

in more details:
PTS units : 90000
sampling rate : 48000

pushing frame 0 (time stamp 0) 1152 samples, EncodeFrameAsync return MFX_ERR_MORE_BITSTREAM
calling SyncOperation - got PTS 0, only 1024 frames were encoded
call EncodeFrameAsync with the same frame (0), new bitstream - EncodeFrameAsync return MFX_ERR_MORE_DATA

pushing frame 1 (PTS 2160) 1152 samples, EncodeFrameAsync return MFX_ERR_MORE_BITSTREAM
calling SyncOperation - got PTS 2160 instead of 1920 ( = 1024 / 48000 * 90000)

when playing the output stream, the player add silence since the timestamps does not match the number of frames.

So my question is - is there any way to tell the audio encoder to manipulate the timestamps?

Thank you
koby    

0 Kudos
Harshdeep_B_Intel
808 Views

Hi Koby,

Glad sample was helpful and thank you for sharing scenario in detail. MediaSDK and Audio plugin handles timestamps transparently, whatever the input timestamp is also delivered as the output for that frame. In regard to question, Audio encoder/MSDK do not provide support to handle that. But, if you want to manipulate/reshuffle timestamps, I would suggest have the splitter/demuxer manipulate/reshuffle the timestamps before passing it to encoder. Hope this information helps. 

Thanks,

 

0 Kudos
koby_s_
Beginner
808 Views

Hi Harsh

Thank you for the clarification.

I manipulate the timestamps by myself now and everything is sync.

Thank you for your support!

Koby

0 Kudos
Harshdeep_B_Intel
808 Views

Hi Koby,

Great, will close this thread. Please start a new thread for any further questions. 

Thanks,

0 Kudos
Reply