[mpeg2] Doubts with SCR and Timing MPEG-2

Alexandre Vazquez alexandre.vazquez at gmail.com
Sun Mar 2 21:19:07 CET 2008


I'm writing to you, because I have a doubt with some fields in the 13138 - 1 
MPEG-2 ISO . The doubt it's related with some piece of code, but that 
envolves concept problems  about MPEG, because of this, the mail is in the 

Ok, the code I'll talk about is the dvb-mpegtools (used to many programs) and 
now inside the libdvb.

I need to calculate the SCR from the parameters I have in the Transport 
Stream, and in the PES packages ,I can see in the code.. something like this 
(line 1512 of transform.c ) :

SCR = trans_pts_dts(p->pts)-3600; 

I would know the relation between SCR and PTS/DTS and the meaning of that 

the code of the function trans_pts_dts is the following:

uint32_t trans_pts_dts(uint8_t *pts)
        uint32_t wts;
        wts = (((pts[0] & 0x06) << 4) | 
               ((pts[1] & 0xFC) >> 2)) << 24; 
        wts |= (((pts[1] & 0x03) << 6) |
                ((pts[2] & 0xFC) >> 2)) << 16; 
        wts |= (((pts[2] & 0x02) << 6) |
                ((pts[3] & 0xFE) >> 1)) << 8;
        wts |= (((pts[3] & 0x01) << 7) |
                ((pts[4] & 0xFE) >> 1));
        return wts;

I can't know the reference of that hexadecimal numbers.. in the ISO .. If 
anyone know the meaning of that numbers , please tell me.

That's all for now.. I send you the code  of mpegtools .

Thanks for all .

P.S. For problems with the attachments, I only send you the transform.c/.h 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transform.h
Type: text/x-chdr
Size: 6128 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/mpeg2/attachments/20080302/c9695ec7/attachment-0001.h 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transform.c
Type: text/x-csrc
Size: 45190 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/mpeg2/attachments/20080302/c9695ec7/attachment-0001.c 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://www.linuxtv.org/pipermail/mpeg2/attachments/20080302/c9695ec7/attachment-0001.pgp 

More information about the mpeg2 mailing list