This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Streaming to Flash

Hi All,

We are working on a DM368 Module to create a realtime HD RTMP Streamer, We have The h.264 video streaming to the server beautifuly.
and we have started work on the AACLC encoder to to get that bitstreaming  also, however i have found myslef against a bit of a brick wall for the last couple of weeks.

The audio created with the Encoder will play perfectly in VLC or windows media player etc, however when streamed to Flash, or played directly in flash, it will not play, i am lead to believe that there is something going on with the encoding that is causing it to not be decoded correctly by flash.

the following are my encoder settings:

params.s_iaudenc_params.size                 = sizeof(ITTIAM_EAACPLUSENC_Params);
params.s_iaudenc_params.sampleRate           = 44100;
params.s_iaudenc_params.bitRate              = 128000;
params.s_iaudenc_params.channelMode          = IAUDIO_2_0;
params.s_iaudenc_params.dataEndianness       = XDM_LE_16;
params.s_iaudenc_params.encMode              = IAUDIO_CBR;
params.s_iaudenc_params.inputFormat          = IAUDIO_INTERLEAVED;
params.s_iaudenc_params.inputBitsPerSample   = 16;
params.s_iaudenc_params.dualMonoMode         = 0;
params.s_iaudenc_params.maxBitRate           = 128000;
params.s_iaudenc_params.crcFlag              = XDAS_TRUE;
params.s_iaudenc_params.ancFlag              = XDAS_FALSE;
params.s_iaudenc_params.lfeFlag              = XDAS_FALSE;
params.noChannels                            = 2;
params.aacClassic                            = 1;
params.psEnable                              = 0;
params.dualMono                              = 0;
params.downmix                               = 0;
params.useSpeechConfig                       = 0;
params.fNoStereoPreprocessing                = 1;
params.invQuant                              = 2;
params.useTns                                = 1;
params.use_ADTS                              = 1;
params.use_ADIF                              = 1;
params.full_bandwidth                        = 0;
params.i_channels_mask                       = 0;
params.i_num_coupling_chan                   = 0;
params.write_program_config_element          = 0;

dynParams.s_iaudenc_dynamic_params.size               = sizeof(ITTIAM_EAACPLUSENC_DynamicParams);
dynParams.s_iaudenc_dynamic_params.bitRate            = params.s_iaudenc_params.bitRate;
dynParams.s_iaudenc_dynamic_params.sampleRate         = params.s_iaudenc_params.sampleRate;
dynParams.s_iaudenc_dynamic_params.channelMode        = params.s_iaudenc_params.channelMode;
dynParams.s_iaudenc_dynamic_params.lfeFlag            = params.s_iaudenc_params.lfeFlag;
dynParams.s_iaudenc_dynamic_params.dualMonoMode       = params.s_iaudenc_params.dualMonoMode;
dynParams.s_iaudenc_dynamic_params.inputBitsPerSample = params.s_iaudenc_params.inputBitsPerSample;

Can anyone see something that i might be doing wrong here?

As i cant see anything obvious that would stop flash from streaming this bitstream.

Here is a sample aac encoded file from our DM368 encoder:
http://sites.nm1.tv/TI/test.aac

if anyone requires an FLV then id be happy to post one.

Thanks in advace for any thoughts you can provide.

Eliot Stocker

  • I cannot comment on the encoder settings - but can probably help in finding what error is being thrown by Flash player and why.

    Is it possible to provide a SWF file with this FLV embedded ?

     

     

  • Hi Prabindh,

    thanks for your prompt reply, you will find an SWF with an FLV encoded from our board in the following link:

    http://sites.nm1.tv/TI/test.swf

    and this is the flv file that it is reading from:

    http://sites.nm1.tv/TI/this.flv
    as you can see the video works fine, but the audio not play in flash.

    Kind Regards

    Eliot 

  • From an analysis of Flash10 behaviour with this stream - it appears that the stream is detected correctly as AAC, but audio frame length is not coming out properly. Is there a way you can confirm the audio payload size/content is correct ? Also I am seeing (non critical) errors reported on SWF version checks.

  • Im not sure how i could confirm the correct payload size and content, do you have any suggestions for me? as far as i can tell there would appear to be something wrong in the ADTS headers, however I'm not overly familiar with what this is supposed to look like, or how to correct the problem.

  • In the case where the streaming to flash is happening, you could maybe check the ADTS framelength parameter in the ADTS Header. The ADTS header format can be found here http://wiki.multimedia.cx/index.php?title=ADTS.

    The framelength field in the ADTS header should match the size of the frame sent (from the ADTS sync word onwards - 0xFFF).

    You could dump (into a text file - and view that content as hex-data) one frame of the content from flash player. Seek to the ADTS sync word, then seek to the framelength field and finally compare the framelength field with the size of the frame data being sent by flash player.

    As of now we have no support for flv and I am not aware of particulars of .flv in terms of how audio and video is parsed. I will try and get back to asap after I analyze the issue a little more.