Hi,

On Sat, Dec 20, 2008 at 6:24 AM, AliReza Khoshgoftar
<[email protected]> wrote:
> Hi,
> I had a question about "AVPacket" structure in Libavcodec.
> If I have an MPEG-2 video elementary stream, and read its "AVPackets", with
> the correct "stream_index" , are these objects  the same as the MPEG2Video
> packets, which are 188Bytes of data, and is zeroing out the "packet.data",
> the same as zeroing the payload of an MPEG2 packet in this case?

yes

> I hope the answer is "Yes", but If not, is there a easy way to packetize an
> MPEG2video Elementary Stream?

An AVPacket can have a different size than a TS Packet.

It's like a TS Packet with a certain ID comes in with a Packet start
identifier, and following
packets with the same ID have to be concatenated till the next packet
with a Packet start identifier comes in.
MPEG- SI/PSI Sections usually have the length defined including a
crc32 number at the end.
As for the mpeg2 elementary stream the stream needs to conform the
specs of the corresponding codec.
For example the mp2 audio header themself also define the length of
the packet, the packets which are returned
for an mp2 stream is 8 times as big as a valid mp2 audio frame with my examples.
Zeroing out packet data will zero out the ES packet, ffmpeg strips off
the TS header when concatenating
the TS packets.

regards,
Markus
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to