-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've got an mpegts file with two PES. One is an H.264 video stream, the
other is a private data stream containing KLV metadata. I need to access
the metadata as well as decoding the video. Looks like the private PES
is dropped in most cases by libavformat. I was able to modify mpegts.c a
bit to add a new PES stream for the private data stream. Packets are
parsed as they are decoded but I can't figure out how to get them to my
app as they are still ignored somewhere in the mpegts parsing code which
is a little difficult to follow. Can someone suggest a way to get this
data? It doesn't matter if I get raw data packets for the stream or if I
have to write a codec to decode the KLV metadata, I just need to get the
stream data somehow as it is parsed. There are many fewer packets in the
metadata stream than in the video stream. I'm currently doing something
similar to this to pull video frames:

while(!streamFinised)
{
  while(bytesRemaining)
  {
    bytesDecoded = avcodec_decode_video(codecCtx, &nextFrame,
&isFrameFinished, rawPacketData, bytesRemaining);
    bytesRemaining -= bytesDecoded;
    rawPacketData += bytesDecoded;
    if (frameFinished) return;
  }
  do
  {
    if(av_read_packet(formatCtx, &packet) < 0)
    {
      streamFinished = true;
      break;
    }
  } while(packet.stream_index != streamId);
  if(!streamFinished)
  {
    bytesRemaining = packet.size;
    rawPacketData = packet.data;
  }
}

Some more details about the private data stream:

PID: 0x01f1
stream_type: 0x06 (H.222.0 | 13818-1 Private PES Packets)

registration_descriptor
tag: 0x05
length: 4
format_identifies: 0x4b4c5641 (KLVA)

metadata_std_descriptor
tag: 0x27
length: 9
metadata_input_leak_rate: 625
metadata_buffer_size: 2
metadata_output_leak_rate: 0
PES stream_id: 0xbd


- ------------------------------
Trevor R.H. Clarke
Ball Aerospace & Technologies Corp
Opticks, Free Your Imagery (http://opticks.ballforge.net
GPG key available on random.sks.keyserver.penguin.de

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)

iD8DBQFJPorW+xUTKUxH/LkRAkvqAJ4gF48Naj/lou6rL4N2nKFHOKdekACfUnxx
zKS4vJLKKLHDjHOjRmuBLg0=
=r+bt
-----END PGP SIGNATURE-----



This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this 
 
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to