Mailing List archive

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

[linux-dvb] Re: Data returned by read() when doing PES filtering



James Green wrote:
Hi there. I've got a couple of questions on the data returned by read() when doing PES filtering, but I'm not 100% sure how it all works, so please excuse any mistakes.

I am reading from the /dev/../demux0 device not the /dev/../dvr0 device. I
read in the documentation that the data returned in these situations is in
different formats; demux0 returns section data and dvr0 returns PES data.
no, the DVR device delivers TS data, the demux device delivers PES or section data, depending on what type of filter was configured.

PES if the filter was started using DMX_SET_PES_FILTER, section data if it was started using DMX_SET_FILTER.

I'm actually wanting PES data (so I can play it in mplayer) but I'm
reading from demux0, so I need to convert the data after reading it. This
is where I start to get a bit hazy.

I think all I need to do is read blocks of data from demux0, prepend each
block with a PES header, and write it to my output file. I tried doing
this by hand, and also using the mpegtools library.
The data you get is just the PES payload including the header. Unfortunally PES packets can get arbitrary long, thus you have to search manually in your application for the start bytes.

Does anybody know what I am doing wrong, or have suggestions of how best to do this? I have a suggestion for the DVB drivers: is it possible to add an ioctl option so that demux0 can return PES data or section data? Does this make sense, as I said I'm 100% sure about all this?
It's implemented: start a section filter using DMX_SET_FILTER, a PES filter using DMX_SET_PES_FILTER. Set output = DMX_OUT_TAP and pes_type = DMX_PES_OTHER, thenafter you can read your PES data from the demux fd.

Holger



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



Home | Main Index | Thread Index