Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] PES parsing



  Hi,

I'm trying to parse PES packets, but I seem to be missed
something (or totally confused).


Here is fragment of my code (stolen from driver's distro
apps/test/test_pes.c):

  fd_demux2=open("/dev/ost/demux", O_RDWR|O_NONBLOCK);

  pesFilterParams.pid = argc > 1 ? atoi(argv[1]) : 96; 
  pesFilterParams.input = DMX_IN_FRONTEND; 
  pesFilterParams.output = DMX_OUT_TAP; 
  pesFilterParams.pesType = DMX_PES_OTHER; 
  pesFilterParams.flags = DMX_IMMEDIATE_START;
  if (ioctl(fd_demux2, DMX_SET_PES_FILTER, &pesFilterParams) < 0){
          perror("audio");
          return(1); 
  }
  printf("Audio filter OK\n");
  
  while (1) {
    len=read(fd_demux2, buf, 4096);
    if (len>0) { 
      write (aout, buf, len);
      break;
    }
  }
  close(aout);


After one successfull reading I got some data. But I can not
find out what are the data represented. I thought it might
be a PES packet or packets(?). But if the following chart
is right then every PES packet starts with 0x00 0x00 0x01
tripplet bytes:

http://members.aol.com/mpucoder/DVD/pes-hdr.html

Am I wrong?

I simply want to be able to parse such data and retrieve
payload from them.

I know only about mpegtools library to do it, but there
are many unwanted code for me, so I would like to find
a simpler solution.

Thanx.

/Honza






-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index