Log in

View Full Version : PES_packet_length zero


chits007
4th March 2006, 20:42
Hi,

I have some transport stream in which the PES_Packet_length filed is 0 in case of Video data.I want to ask

1) What is the advantage of having 0?
2)How do we figure out frame completion if some packet is lost ?

Guest
5th March 2006, 01:29
I have some transport stream in which the PES_Packet_length filed is 0 in case of Video data.I want to ask

1) What is the advantage of having 0? The value 0 is special in the specification. It means the PES packet length is neither specified nor bounded.

2)How do we figure out frame completion if some packet is lost ? By seeing the start code for the following frame.

chits007
5th March 2006, 07:44
OK so you are saying that till the next start of frame found is TS keep building the current frame?

Another thing I want to ask is if suppose one packet of that frame lost ,then how we will build the whole frame .
______________________________________
|___|_2__|_3___|__4____|_____5____|___|

^ ^
| |
1st SOF 2nd Video SOF
VIDEO

Let me present you the case.
Supoose 1st Video frame comprise of 2,3,4,5 TS Packet and 1st Video Start I dont know the frame size since PES_Packet_length is zero.So what will happen if I lost the 4th TS Packet .

How to build the first frame?

Thanks

Guest
5th March 2006, 08:38
Let me present you the case.
Supoose 1st Video frame comprise of 2,3,4,5 TS Packet and 1st Video Start I dont know the frame size since PES_Packet_length is zero.So what will happen if I lost the 4th TS Packet .

How to build the first frame?
Lost transport packets will show up as errors in the elementary streams, and the decoders will need to recover. In MPEG2, typically, the current slice is discarded and decoding begins again at a new slice.

chits007
5th March 2006, 14:32
Hi,

I am working on ISDB-T system;in which when a Video Frame starts it sets PES_packet_length to zero;so in my demux what I have done is keep looking for next PES_Start_Unit_indicator and dumping all the other data in a Video Buffer;

When I get the second video start frame i.e.
PES_Start_Unit_indicator =1
I have 5 Video frame in my Video Buffer(the buffers builds upto 19K).

Now my question is this the way it is and now is it the job of video decoder to extract 5 frame from this buffer.?

Guest
5th March 2006, 17:31
Now my question is this the way it is and now is it the job of video decoder to extract 5 frame from this buffer? You can reference the 13818-1 transport spec at my web site's Library for the information you need to properly parse the video elementary stream from a transport stream. You can refer to the DGIndex source code for one implementation.

chits007
5th March 2006, 20:04
Hi,
Thanks ,Let me explain how I have done it.

1)When it get PES_Start_unit indicator and PES_Packet_len is zero..I keep on acumlating the payload in a buffer and also keeping an account of total payload length.

2) when the next start unti comes;I mark all the previous data as ONE Video frame;When I analyse that frame ;I figured out that I contains 5 frames in it.
Since I am working on ISDB-T system ;it has AVC video for it the start code is 0x00 00 00 01 09

Even that one VIDEO frame when played back by MPlayer tell that it has 5 video frames.

Now my question is this the way the TS system works?
Can I get the frame lengh by parsing the AVC header?

I want to put individual frame in a queue ;decoder will the encoded frame from this queue and decode it;my decoder doesn't return how many bytes it has decoded from a given buffer.So I have to know the size of each frame.

One way is to parse the buffer for start code but it is not good for real time system.

Thanks

Guest
6th March 2006, 01:35
You'll need a different spec for AVC in MPEG2 transport. I have it but it's at work. I'll try to remember to grab it tomorrow and make it available to you.

chits007
6th March 2006, 07:01
Thank you so much.

chits007
7th March 2006, 15:49
Hi Neuron,

I gte hold of Ammendment 3 for MPEG-2 TS.
The question I want to ask is

1) What is the Advantage of setting PES_Packet_length zero in case of video?

silenceboy
21st March 2006, 04:20
Cause video es packet data may > 65536, and PES_Packet_length is only 16 bits.