[Ffmpeg-devel] mpeg transport streams

Marcus Hunger marcus.hunger
Fri Jun 3 09:50:28 CEST 2005


Am 1 Jun 2005 um 18:10 hat M?ns Rullg?rd geschrieben:

> Could you explain the what theory of operation you have used?  What
> are the changes you made to the demuxer?

The main idea I wanted to implement was that the difference of two pcrs and the 
amount of data written between the accurrence of them define the actual bitrate. 
Assuming a constant bitrate is needed, this leads to two requirements:

- there must be pcrs.
- the value of these pcrs must be calculated using a defined bitrate and the amount of 
data written since the previous pcr.

Furthermore, pts/dts of the frame-data shouldn't be too much in front of the pcr to 
reduce caching demands on the player. So I orientated the pcrs written at the pts of 
actual frame. To still keep a constant bitrate, null-packets are inserted until the pcr 
equals about the pts.

- null-packets

Pts-values being in the past of pcrs don't make much sense, so every pts as increased 
by a constant offset (say 50000).

- pts += 50000

To meet mpegts/dvb requirements of a maximum pcr-interval, a ts-packet with a pcr is 
written after a certain interval.

- pcr-interval

Frames do not get interleaved which should be no problem at high bitrates.

All bitrate/pcr algorithms are only done for video-frames, which should be changed to 
using the frames of the pcr-pid.

The base of all timing is the amount of data written and the pts-values. The rtc of the pc 
is not used.

I introduced setting a discontinuity indicator for the first pcr so concatenating ts-files 
should be possible. Doing this still causes cc-discontinuity-errors and I have no easy 
idea how to avoid them.



About the changes in the demuxer: I made these to tune into a certain dvb-service 
specified by it's name. The changes shouldn't break ffmpeg's current behaviour but I 
would agree in excluding it from this patch (if anyone complains).

regards,
Marcus HungerMUGLER AG
Entwicklung
E-mail: marcus.hunger at mugler.de
Tel. +49-3723-747-183
Fax: +49-3723-747-198

Bitte nutzen Sie die E-Mail-Verbindung mit uns aus-
schliesslich zum Informationsaustausch. Wir koennen
auf diesem Wege keine rechtsgeschaeftlichen Erklaer-
ungen (Auftraege etc.) entgegennehmen. Der Inhalt 
dieser Nachricht ist vertraulich und nur fuer den an-
gegebenen Empfaenger bestimmt. Jede Form der Kennt-
nisnahme und Weitergabe durch Dritte ist unzulaessig.
Sollte diese Nachricht nicht fuer Sie bestimmt sein, 
so bitten wir Sie, sich mit uns per E-Mail oder 
telefonisch in Verbindung zu setzen.

Please use your E-mail connection with us exclusively
for the exchange of information. We do not accept 
legally binding declarations (orders, etc) by this means
of communication. The content of this message is 
confidential and intended only for the recipient 
indicated. Taking notice of this message or disclosure 
by third parties is not permitted. In the event 
that this message is not intended for you, 
please contact us via E-mail or phone.





More information about the ffmpeg-devel mailing list