[Libav-user] Format in which ES data is stored in (AVPacket*) pkt->data buffers

Arvind Raman arvind_raman at yahoo.com
Fri Jun 14 17:43:06 CEST 2013


> From: Sergey Fedorov <night.rain.whisper at gmail.com>
>By the way, you can find the stream header in AVCodecContext::extradata after avformat_find_stream_info() call.

Thanks that was a life saver tip. I could review the code and see how extradata was being processed. For everyone's benefit I am copying the link to the blog post H.264 extradata (partially) explained for dummies http://aviadr1.blogspot.in/2010/05/h264-extradata-partially-explained-for.html

~ Arvind


>2013/6/14 Sergey Fedorov <night.rain.whisper at gmail.com>
>
>H.264 Video Types: 
>>
>>The MP4 container format stores H.264 data without start codes. Instead, each NALU is prefixed by a length field, which gives the length of the 
NALU in bytes. The size of the length field can vary, but is typically 
1, 2, or 4 bytes.
>>
>>See also: H.264 extradata (partially) explained - for dummies 
>>
>>
>>
>>2013/6/13 Anshul maheshwari <er.anshul.maheshwari at gmail.com>
>>
>>U can try using gdb,  put a brk point on above line u provided,
>>>Print the pkt, 
>>>If trouble using gdb,  reply me I wud do fr u!
>>>It was never required to me!
>>>Anshul
>>>On Jun 13, 2013 10:16 PM, "Arvind Raman" <arvind_raman at yahoo.com> wrote:
>>>
>>>Question - What is the format in which audio / video ES data is stored in (AVPacket*) pkt->data? I am trying to demux and decode AV data from a MP4 file using libavformat and libavcodec.
>>>>
>>>>
>>>>More details
>>>>    1. Using the sample application demuxing.c (http://www.ffmpeg.org/doxygen/trunk/demuxing_8c_source.html) I tried demuxing and decoding a MP4 file containing H.264 video and AAC audio. 
>>>>    2. While the sample application worked fine, I wasn't able to interpret the content in the pkt.data buffer (line #66 in the above file). Since the video was H.264 I was hoping to see familiar "nal_unit_type" but I don't think I saw that for the stream I was trying to decode. If I remember the data correctly the first 4 bytes in the pkt.data buffer were "0x00 0x00 0x02 0x72"
>>>>I haven't spent much time figuring this out yet but searching on the Internet / forum didn't help. I intend to dig deeper tomorrow, but just wanted to check if indeed ES was being passed in the pkt.data buffers in a special way.
>>>>
>>>>
>>>>Appreciate any points that you can provide.
>>>>
>>>>
>>>>Best regards
>>>>Arvind
>>>>
>>>>
>>>>_______________________________________________
>>>>Libav-user mailing list
>>>>Libav-user at ffmpeg.org
>>>>http://ffmpeg.org/mailman/listinfo/libav-user
>>>>
>>>>
>>>_______________________________________________
>>>Libav-user mailing list
>>>Libav-user at ffmpeg.org
>>>http://ffmpeg.org/mailman/listinfo/libav-user
>>>
>>>
>>
>
>_______________________________________________
>Libav-user mailing list
>Libav-user at ffmpeg.org
>http://ffmpeg.org/mailman/listinfo/libav-user
>
>
>


More information about the Libav-user mailing list