From: anand m. <kvm...@gm...> - 2008-08-22 21:51:17
|
Hi Keith, I have a doubt with PES packetization. According to what i learnt PES packets carry elementary stream data , either video or audio but not both. I also read that if the PES packet carries video elementary stream then it carries the contiguous bits from the elementary stream. I want to clarify one point, will a PES packet carry only one coded picture, say an I or a B or a P? or a particular PES packet can have last slice of a picture ending and then followed immediately by the next picutre header?? I am working on a small project where I wrote a small wrapper over the libmpeg2 mpeg2dec.c to *get the whole bytes * of a coded picture(included with the PES headers and transport stream headers),The video packets are from a transport stream. i wanted to clarify the way i do it, i do it as follows..... i modify the prototype of decode_mpeg2 of mpeg2dec.c as follows *decode_mpeg2 (uint8_t *start , unit8_t *end, uint8_t *buffer) * where the buffer refers to the 188 byte packet(video packet) of a transport stream which is passed explicitly by me. The buffer should contain all the headers of the transport stream and then followed by the PES headers. Now in decide_mpeg2 function in case STATE_PICTURE : when the picture header and picture coding extension are recognized, i assume that a new picture has been identified and then i start pushing the buffers (the 188 byte packets )into a data structure till i again hit STATE_SLICE state. so when i encounter STATE_SLICE , my logic assumes that the data structure has all the data of that particular picture along with the PES headers and transport stream headers. I know the logic will work only if a new picture definition will not start in middle of a PES packet that is right after the last picture has been identified. It would be really helpful if you can let me know if i am doing something wrong. I can explain if some point was not clear. thanks & regards Anand Meher |