[libdvbpsi-devel] Fwd: [vlc-devel] TS files that has PCR hickups

Morgan Tørvolt morgan.torvolt at gmail.com
Wed Mar 5 08:44:53 CET 2008


Hi. I managed to forget that the reply address from this mailinglist
is wrong (vlc-devel instead), so I forward this message here again so
that I might have a chance of an answer =)

> 1. Do you see anything suspicious in the vlc messages window which might
 > point to something?


Good question! Did not check that before. Yes, there pops up these messages:
 mux_ts debug: adjusting rate at -5400000/200000 (19/1072)
 mux_ts debug: adjusting rate at -5600000/200000 (11/1105)
 mux_ts debug: adjusting rate at -4600000/200000 (123/1152)
 mux_ts debug: adjusting rate at -3600000/200000 (63/870)
 mux_ts debug: adjusting rate at -3800000/200000 (17/996)

 They pop up in the same way as there appears PCR problems in the
 stream, and the exact same number of times as well. This seems to be
 related to my problems.
 All further tests confirms that this message occurs whenever I get a
 wrong PCR timing in the TS stream.


 > 2. Do you also see a similar thing happen if you read a regular normal (ts?)
 > file and rewrite it to a ts-file?


I took the same TS file and used it as input and that seems to have
 removed one occurrence of the issue, the resulting file has four
 problems:

 mux_ts debug: adjusting rate at -5200000/200000 (19/862)
 mux_ts debug: adjusting rate at -5600000/200000 (11/1105)
 mux_ts debug: adjusting rate at -4600000/200000 (123/1152)
 mux_ts debug: adjusting rate at -3600000/200000 (78/871)

 This got me thinking, so I ran this command:

vlc dvd:///dev/scd0@1:2

"--sout=#duplicate{dst=std{access=file,mux=ps,dst="test.ps"}}"
 --sout-all
 Followed by this command:
 vlc test.ps "--sout=#duplicate{dst=std{access=file,mux=ts,dst="test3.ts"}}"
 --sout-all

 This resulted in a perfect ts file when I look at the PCR. The
 language information for the audio tracks is gone though, but that is
 not a huge issue. Why reading the vob from the DVD is different from
 reading the same file from the disk I cannot really say I understand.


 > I would recommend using broadcast-level shaping and DTS delay, such as
 >  --sout-ts-shaping=1000 --sout-ts-use-key-frames --sout-ts-dts-delay=500


Adding those parameters really helped alot. The PCR now seems to be
 constand between I frames. We did get one occurence of the rate
 adjustment like earlier, and it seems to be more severe than before.
 As a result, the entire following GOP has very long duration per
 packet, since it now uses the rest of the time until the following I
 frame to compensate.

 Output from my test program on this new TS file:
 http://paste.videolan.org/3447


 Thanks a lot for your help guys. I am mighty impressed that the two
 people who answers actually both comes up with good replies.


 -Morgan-


More information about the libdvbpsi-devel mailing list