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.

How to write the file header in output h264 file using TI OMX encode component?

Hi,

     I modify the encode example to test using one encoder to encode multiple channels of input videos in turn. I use two channels of input videos which have the same content. The encoder works but one of the output h264 file lacks the h264 header and could not be played. I could not find which part of codes in the encode example incharge of writing the h264 header.

Does anyone know how does the encoder write the h264 header to the output file?

Thanks very much ! 

  • Hi,

    Codec encodes the stream and application just writes the frame as it is.Encoder should produce same o/p for both streams if the input is exactly same. May be second file is corrupted ?

    Regards

    Vimal

  • Hi Vimal,

         Thanks for your reply! Do you mean that the Codec will produce the file header automatically? The input streams are exactly the same, but the output files are different. One of them is smaller than the other. The output file which I write data fisrt has no problem when playing. The later one is smaller and could not be played. If I open an exist  h264 file as the later output file with 'a+' mode. Then, after encoding, the output file could be played with no problem.

        So, I guess the later output file is lack of the file header.

  • Hi Bing,

    I guess problem is resolved ? You were giving the streams in single run of encoding ? It wo't put SPS/PPS in same run.

    Regards

    Vimal