Mailing List archive

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

[linux-dvb] Any tool to correct timestamps in MPEG2 video stream?



=?iso-8859-1?Q?J=FCrgen?= Zimmermann writes:
 > Hello,
 > I wonder if there is a tool which corrects the timestamps in a 
 > MPEG2 video stream (file is kind "m2v").
 > 
 > The playtime is 25 minutes, but mpginfo and other programs
 > say its length is approx. 4 minutes. I found out, that the
 > timestamps on the file "wrap around" to 0 at some point...
 > 
 > Any idea how to put new timestamps on the file without reencodeing?
 > 
 > So long,
 >   Jürgen
 > 

look for 0x00 0x00 0x01 0xB8 in the stream and replace the timecode
that comes after that with the one you would like to have there.
The 25 bits after the 0xB8 contain the timecode in the following way:
bit 0        - drop flag 
bit 1-5      - hours in the range from 0-23
bit 6-11     - minutes in the range from 0-59
bit 12       - marker bit 
bit 13-18    - seconds in the range from 0-59
bit 19-24    - pictures in range from 0-59 (frames into the second)

I guess you would only have to change the hours, minutes and seconds
by a constant offset, so that the file starts at 0.

If I have time, I'll add a tool to the mpegtools, or maybe you would
like to do that.

Marcus

-- 
/--------------------------------------------------------------------\
| Dr. Marcus O.C. Metzler        |                                   |
|--------------------------------|-----------------------------------|
| mocm@metzlerbros.de            | http://www.metzlerbros.de/        |
\--------------------------------------------------------------------/



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



Home | Main Index | Thread Index