<div dir="ltr">I've been attempting to get MPEG-TS content to play back using the Android mediacodec decoders. I finally got it working and wanted to report my findings and ask a couple questions about how to proceed. My device is a Samsung Galaxy S4, and I'm not sure how commonplace this behavior is. <div>
<br></div><div>When I started the audio decoder failed to start. When buffering the first frame I got the following from the OMX codec:<div><br></div><div><div>E/SEC_AAC_DEC(  208):  This is unsupported profile in SAACD. Profile 31 is not supported</div>
<div>E/SEC_AAC_DEC(  208):  SAACD only supports AAC-LC Profile</div></div><div><br></div><div>So, the decoder's confused about profile. Often this data is passed in via a 'csd-0' element in the MediaFormat, and sure enough it looks like this has helped people in the past. The link below also points out an "is-adts" flag in MediaFormat that should be sent to decode ADTS content, which is what I have.</div>
<div><br></div><div><a href="http://stackoverflow.com/questions/18784781/how-to-initialize-mediaformat-to-configure-a-mediacodec-to-decode-raw-aac-data">http://stackoverflow.com/questions/18784781/how-to-initialize-mediaformat-to-configure-a-mediacodec-to-decode-raw-aac-data</a><br>
</div><div><br></div><div>I added both csd-0 and is-adts to my MediaFormat, and this shifted around the error a bit but ultimately didn't get rid of it. However, if I strip out the 7 byte ADTS headers but leave the csd-0 buffer in place to include the format parameters, then the content plays fine.</div>
</div><div><br></div><div>My question is - how should I best implement this for real? The ADTS format is slightly more complicated than a simple 7 byte header, and I'm not sure converting from adts->raw is really the business of the amc component. It appears that this may be a device-specific foible, and that in general devices should support this as long as is-adts is in the format. But my device is a super common one - adding a workaround seems reasonable and par for the course for the MediaCodec support. In any case the csd-0 element will be needed to properly decode ADTS content, and the tsdemux component isn't producing the codec data. I assume the correct fix here is to have the demuxer create this data as part of its caps.</div>
<div><br></div><div>Thanks, and apologies in advance for any misunderstandings or mistaken terminology. This is my first project in gstreamer.</div><div><br></div><div>Thanks for any advice you can provide.</div><div><br>
</div><div>Dave </div></div>