[FFmpeg-devel] [RFC/PATCH] Pass PRIVATE_STREAM_2 MPEG-PS packets to caller

Richard peper03 at yahoo.com
Sun Feb 24 21:37:41 CET 2013

On 24/02/13 21:04, Paul B Mahol wrote:
> On 2/24/13, Richard <peper03 at yahoo.com> wrote:
>> On 18/02/13 07:24, Richard wrote:
>>> Hi,
>>> In order to improve DVD playback, I need the DVD NAV packets in-sync
>>> with the other audio/video/subtitle packets.  The information is stored
>>> in 'PRIVATE_STREAM_2' MPEG-PS packets (startcode 0x1bf), which are
>>> currently filtered out.
>>> The attached patch adds a new codec ID 'AV_CODEC_ID_PRIVATE_STREAM_2' to
>>> identify these packets.
>>> The contents of these packets is clear for DVDs but looking at the
>>> existing code, it appears that Dreamcast videos (Sofdec) also use this
>>> startcode but for other purposes, so I'm not sure it's feasible to
>>> create any sort of decoder for these packets.  As it is, the patch
>>> simply returns the contents of the packet unchanged.  It is up to the
>>> calling application to process the contents.
>>> All comments welcome.
>> Any comments on this?
>> After more testing, I see that the 'new' packets are not quite in sync
>> with the audio and video packets due to the buffering performed on those
>> packets and not on these data packets, but the packets do at least come
>> through, and they come through, at worst, before they are actually
>> needed rather than (potentially) afterwards if trying to read them via
>> other routes.
> Perhaps thay should have pts/dts/duration set?

I can't set anything based on the contents of the packets as the 
contents are not defined, but if you mean setting those values to 
defaults (like AV_NOPTS_VALUE and zero for duration), aren't they 
already set like that?  Certainly pts and dts are set to AV_NOPTS_VALUE 
in mpegps_read_pes_header just before I check that startcode != 

I have to admit, though, that I can't find where the duration field in 
AVPacket is set, although it appears to be coming through as zero.


More information about the ffmpeg-devel mailing list