Knowledge Base - TS Multiplexers
Support
Software Version

Please check that you have the most recent version of the MPEG-2 Transport Stream Multiplexer.

Product Current Version Operating System Release Notes
MP2TSMEV6.0.0Windows, OS X, Linuxmp2tsme-relnotes-6.0.pdf
MP2TSMMV5.0.0Windows, OS X, Linuxmp2tsmm-relnotes-5.0.pdf
MP2TSMSV5.0.0Windows, OS X, Linuxmp2tsms-relnotes-5.0.pdf

We encourage all users to stay up to date with the current version. For upgrade and maintenance agreement information, please contact sales@manzanitasystems.com.

Frequently Asked Questions

Please check to see if your question about our MPEG-2 Transport Stream Multiplexer products (MP2TSME, MP2TSMM, or MP2TSMS) is answered here. If your question still has not been answered, please contact our tech support department at support@manzanitasystems.com.

Installation

I previously had MP2TSME V5.0 installed on my PC. I've just installed the V6.0 update. I tried running the new version, but the header displayed in the command window says the version is V5.0. What is wrong?
Your PATH variable includes the MP2TSME V5.0 program which is still installed on your PC. The command interpreter is finding the MP2TSME V5.0 executable first and executes it. You need to completely uninstall MP2TSME V5.0.

Execution

When running from the command line, is it possible to direct MP2TSME output messages into a file rather than to the screen? I would like to save a log.
Yes, use the redirect command, ">", as follows:
mp2tsme movie.cfg > movie.log
Does MP2TSME take advantage of multiple processors on my PC?
No, MP2TSME runs as a single process on the PC. Performance is usually more I/O limited.

Configuration Issues

I have two video streams that are the output of the demux tool. They are called snippet_01E1.mpv and snippet_01E2.mpv. When I went to insert them into a different multiplex and tried to use the Auto Increment button in the Multiple Files list, it incremented in a way I wasnt expecting. I first used the Add button to input the filename snippet_01E1.mpv then pressed the Auto Increment button. The filename that showed in the list was snippet_01E02.mpv.
When implementing the Auto Increment, we treated the count as a minimum of 2 digits, mainly because sorted lists of files can get misinterpreted when leading zeros are missing. Auto Increment is also done in decimal. When the files were demuxed, the PID was used to differentiate between the various streams. In this case, the PID included an alpha character (hex) followed by only one numerical character and thus a leading zero was inserted in the Auto Increment.
How do I create a Blu-Ray compatible transport stream using MP2TSME?
The Blu Ray standard supports many options. You can set up MP2TSME to include the descriptors and tables necessary for Blu-Ray support by selecting blu-ray.table as the preferred Table Definition Script (see the section, Preferences Dialog Box). We have also found that the following configuration file will create a Blu-Ray compatible transport stream:
# Blu-Ray configuration
Transport*
File = bluray.ts
VBR = yes
PktSize = 192
PktCountMultiple = 32
PSIPATrep = 11.000
PSIPMTrep = 11.000
PATtsid = 0x0
NITPID = 31
SIT = yes
SITperiod = 900
SITtransDescr1 = 63 08 c1 d4 c0 ff ff ff ff ff
SITserviceID = 1
PktTS = yes
PktTSPre = yes
PktTSBits = 30
PktTSBytes = 4
 
Program1*
ProgramNumber = 0x1
PMTPID = 0x100
Descriptor1 = 05 04 48 44 4d 56
Descriptor2 = 88 04 0f ff fc fc
PCRPID = 0x1001
 
Video1$
File = part1.vid
Descriptor1 = 05 08 48 44 4d 56 ff 02 61 3f
PID = 0x1011
PESalign = yes
 
Audio1$
File = part1.ac3
Descriptor1 = 05 04 41 43 2d 33
Descriptor2 = 81 04 08 3c 0e 00
PID = 0x1100
TransportPriority = yes
PESalign = yes
PESid = 0xfd
PESnau = 1
BDbuf = yes
 

General Transport Issues

Our customer requires 0.3% null packets in the output. How can we set this?
By default, the mux allocates 15 kbps for null packets. You can increase this by specifying a higher output rate or if your output rate is fixed, lowering your elementary stream rates. The latter would have to be done at encode time.



>The distribution of nulls is fairly uniform, but sometimes video can cause null packets to bunch up. If you set StrictVBV to Yes in the video subsection, then the null packets will be more uniformly distributed. This parameter will only work if the video has valid vbv_delay fields. If you try this, but get lots of warning when multiplexing, your encoder probably does not create valid vbv_delay fields. In this case, you can not use the StrictVBV option.
Why am I getting these warnings on output from the muxing tool?
Warning: packet = 208342, pid = 0x01E1, time 83.56s
Picture vbv_delay fields don't match stream rate
This is usually caused by StrictVBV being set to Yes in the video subsection of the config file. This parameter was added for DIVA VOD servers, and they went out of business years ago. The mux is trying to position each picture in the stream according to the vbv_delay value of the picture header. The values in your stream are not correct, so the mux is unable to satisfy this request. As long as this is the only warning you see, then your output file is fine. To eliminate this warning you can delete the StrictVBV parameter or set it to No.
I'm trying to create a stream for a SONY HDV camera but it will not load. How should I configure the mux?
The Sony HDV camera uses HDV mode HD2. The following configuration file will generate a transport stream that is compatible with HDV mode HD2. If you are using the MP2TSME GUI, you can set the the corresponding parameters to the values in this file.
# Sony HDV camera
Transport*
File = movie1.mpg
HDVModeHD2=Yes
AUXApid=0x815
AUXVpid=0x811
 
Program1*
programnumber = 100
PMTPID = 0x81
PCRPID = 0x134
Descriptor1 = 050B54534856FF1000FFFFFFFF
 
Video1$
File = movie1.mpv
PID=0x810
PESalign=Yes
 
Audio1$
File = movie1.mpa
PID=0x814
PESalign=Yes

Transport Rate

We encode our video at 3 Mbps and audio at 192Kbps. When we set the rate to zero, we get an output rate of 3.3 Mbps. If we set the rate to 3.75Mbps, what happens? Can we expect an improvement in the audio or video?
No, MP2TSME will fill the unused bandwidth with null packets. There will be no quality difference in the audio or video in the stream.
We're muxing video at 3 Mbps and audio at 384 kbps. How much overhead is added in using a transport stream?
The overhead can be determined by running MP2TSME with the output rate set to zero. Subtract from the actual output rate the sum of the elementary stream rates and you have the transport overhead.
How do I specify a minimum number (e.g., 10%) of null packets in a transport stream?
The easiest way to do this is to set the output rate in the Transport Parameters to the Minimum option. Run the multiplexer and note the output rate. Then re-run the Multiplexer, but this time, uncheck the Minimum box and specify a Rate value that is 10% above the output rate of the previous run.

Stream Duration

I set the Duration Parameter to 1:00:00:00, but the Multiplexer says the stream that it created is 00:58:30 (hh:mm:ss). Why is the output stream shorter than the duration that was specified?
The Multiplexer can only create a transport stream that is as long as the input elementary stream with the longest duration. So, your output transport stream will be the length that you desire only if all of your input elementary streams are as long as or longer than the specified duration. In addition, the reported duration may vary by +/- 1 second due to rounding in computing this value.
Is there a way to create a clip of a specified duration and starting point? I want to create a 10-minute clip that starts 30 minutes into a movie?
Yes, there are two ways to do this. The first is to use the Start and End timecode parameters to select the ten minute portion of the video. This will also take the corresponding ten-minute section of audio. An alternative approach is to use the Video ES Tool to copy frames from the video elementary stream starting 30 minutes into the stream. Copy over 10 minutes of the stream. Similarly, use the Audio Tool to copy over 10 minutes of the audio elementary stream starting 30 minutes into the stream. Then create your transport stream with the elementary stream copies, setting the Duration Parameter to 10 minutes.
I would like to minimize the number of null packets in the output transport stream. What is the best approach?
If the output Rate Parameter is set to zero, MP2TSME will compute a minimum rate. A rate lower than this value may be used. MP2TSME computes the minimum required rate, then adds 15Kbps margin to this amount. The resulting rate can be reduced by up to 15Kbps in most cases if the number of null packets is to be minimized. The resulting stream should be analyzed to verify that timing requirements are met.
I am creating streams that have in/out points that are exactly 150 minutes apart on my encoder. After concatenating the files, muxing and analysing [with the Manzanita analyzer], the duration of the finished file is 150 minutes 9 seconds. Why the difference?
Are you measuring the time with drop frame time codes or non drop frame? Using 30 fps -vs- 29.97 fps; the difference is 0.1%, or 150 * 0.001 = 0.15 min = 9 seconds.

Remultiplexing

We are trying to remux DVDs to transport streams and need to set the rate to 4Mbps. Can the mux make this conversion?
Maybe. If the video in your VOBs is at a low enough rate then it can be remultiplexed directly by MP2TSME. You will need to specify the SourceStreamID. If the video rate is too high to fit in a 4 Mbit transport stream, then the video will have to be transcoded. We do not offer a rate conversion product at this time. If you are able to take the video elementary stream and recode it at a lower rate, then you can mux the new elementary stream directly.
I need to remux a set of files forming a single new transport stream file. How can I do this?
Here is a sample config file for remultiplexing based on the spec you provided. You may need to change the input PIDs to match your input files. This is specified with the SourceTSPID parameter in both the video and audio subsections. Finally, you will need to specify your input and output files.



For both video and audio, the SourceTSPID specifies the PID in an input transport stream that is to be demuxed by the program, and the PID parameter specifies the output PID to use. In the example, there are two input TS files (input1.ts and input2.ts) and one output file.
# The original TS has PIDs: video=0x30, audio=0x31, pcr=0x30
# New TS PIDs: Video=0x30, Audio=0x31, pcr=0x30, pmt=0x3f
#
Transport*
File = output.mpg
 
Program1*
PMTPID = 0x3f
PCRPID = 0x30
 
Video1$
File1 = input1.ts
File2 = input2.ts
PID = 0x30
SourceTSPID = 0x30
 
Audio1$
File1 = input1.ts
PID = 0x31
SourceTSPID = 0x31
I'm trying to remux a stream and am running out of bandwidth. The video is CBR at 3.18 Mb/S and both audio streams are 192 Kb/S. So this all should fit. I'm getting the bitrate too high errors and a video buffer problem. What can I do?
It appears that you are close, but a little short on bandwidth. The mux says you are 83400 bps short. MP2TSME uses a margin of 15 kbps, so you are really at least 64000 bps short. At the 30 second point you have your first underflow which reaches just over 50kB. This works out to ~13Kbps. Not too much. Without knowing what the video looks like, you can try:
  1. Add a delay to the video to allow the video buffer to fill some more before decoding. 50kB would require ~1/8 sec, or ~12000 90kHz cycles, so add the following to the video subsection:
    delay = 12000
  2. If you don't want to disturb the video TS timing, then you can try freeing up some bandwidth. You have PAT & PMTs 8 times/second. Each is 188 bytes. If you decrease their frequency to 3/sec, that gives an additional (5+5) * 188 bytes/sec to video (= 1880 * 8 = 15kbps)
  3. You have PESalign = Yes in both your audio streams. Do you really need this? This feature uses a lot of bandwidth because of the relatively small audio frame sizes, a lot of stuffing is used to fill the packets to achieve alignment. If you eliminate the PESalign parameter, the problem will probably go away.
I am trying to remultiplex a multiprogram transport stream into a single program transport stream. I am able to successfully extract the target video and audio elementary streams into files video.ves and audio.aes. I verified that the extracted video play successfully. I then attempted to remultplex these two streams using the CableLabs configuration file as starting point. When I run the mux, why does it generates the following error.
Fatal Error: packet = 0, PID = 0x01E1, time = 0.00s
Video never acquired.
Most likely your input video does not start with a sequence header and the multiplexer does not see one in the first 250KB of data. You can use the Video Trim Tool to cut off the beginning of the stream:
mp2tsme -t video.ves video2.ves
Then try muxing with the 'trimmed' video file.



Some additional thoughts:
  • If you are remuxing a transport stream that begins in the middle of a GOP, is this a captured stream? If so, it is probable that you will have lip sync issues in the remuxed stream. Audio and video at the beginning of a captured stream do not necessarily correspond to the same presentation time. When you mux two streams, it assumes they begin at the same time.
  • Using the video trim tool may remove some video frames and this can introduce additional lip sync problems.
You can adjust any lip sync problems by shifting the audio. Use StreamDelay in the audio subsection to delay the audio if the audio leads the video. Units are 90 KHz clock tics, so 45000 will result in a 0.5 second delay of audio. Use Skipframes in the audio subsection if the video leads the audio. Skipframes will drop audio frames from the beginning of the audio stream, thereby advancing the audio. The units are audio frames, which are usually 31ms, so a value of 16 will result in 0.5 second shift.



Alternatively you can use the AVsync option to maintain lip sync while remultiplexing.
I'm remuxing two transport stream files and I get an error at the transition that says there is a loss of audio sync. What can I do to fix this?
If the error is on a transition, then you may be able to fix the problem by enabling the TransitionCleanUp Parameter. We have seen some encoders put out garbage at the begin/end of their audio and we added this feature to work around this problem. Just add:
AVsync = Yes
TransitionCleanUp = Yes
Add the following lines to the audio subsection of the config file or enable these two parameters on the Audio Parameters Dialog Box.

PSI and Private Tables

Our encoding spec requires the PMT to fit in one packet. Our programs have one video and one or two audios with the language descriptor in audio. Are we OK?
The PMT is 16 bytes plus 5 bytes * the number of elementary streams plus any descriptors data bytes. The transport packet carries up to 184 bytes of payload. As long as you do not have a large number of streams or descriptors your PMT will be in a single packet.
I have been trying to understand the NITPID parameter, but I do not quite get it. Can you give an example?
Although the NITPID parameter will add an entry in the PAT for a Network Information Table, you will still have to insert the NIT packets by creating a prepacketized data stream and adding a Data Subsection in your Transport Section. MP2TSME does not create the NIT, we support its use via the NITPID parameter and prepacketized data stream or a Table Data stream.



A typical NIT insertion might look something like:
Transport*
File = test.mpg
NitPid = 0x10
Data1$
file=nitpkt.tp
rate=15040
repeat=yes
fixcc=yes
Program1*
...
Assuming the file, nitpkt.tp contains a single NIT in a transport packet with a PID of 0x10, then this packet would be inserted ten times per second into the stream. The NITPID parameter configures an entry in the PAT for the NIT on PID 0x10. The repeat, fixcc, and rate parameters in the data subsection tell MP2TSME to repeat the data in nitpkt.tp at a rate of 15040 bps and to correct the continuity_counter field in the packets so as to create a legal stream.

Descriptors

How do I create a language descriptor for [some language]?
The basic format for the 6-byte language descriptor is:
0A = ISO 639 language descriptor tag
04 = length of descriptor
XX = 1st character
YY = 2nd character
ZZ = 3rd character
00 = audio type (00 = undefined, 01=clean effects, 02 = hearing impaired, 03 = visual impaired commentary, 04-FF = reserved
The 3 characters make up a language code. The valid language codes are defined in ISO 639. This information can be found by searching on the web.
I have configured the following descriptor, but the set-top does not see it. What's wrong?
Descriptor1 = 0x676E651001000100
The Descriptor data that you specified does not use a valid format. The data should not start with a "0x", but should just consist of the hex data. In addition, the Descriptor format is a one byte tag followed by a one byte length field. This data indicates the tag is 0x67 and the length is 0x6e = 110, but this does not match the data provided. Keep in mind that the Multiplexer does not verify the accuracy of descriptors.
I am attempting to build some content using your software that has a CA descriptor in it that points to an ECM stream. However I do not know what the descriptor is or how to do this with your software. Can you help me?
MPEG defines the basic CA descriptor syntax and gives some information on the use of ECMs and EMMs. This information is in section 2.6.16 of the MPEG Systems spec (ISO/IEC 13818-1). The CA descriptor definition includes the CA_PID field that specifies the PID for packets that carry access control information, e.g., ECMs. However, the CA descriptor can include private data bytes. Furthermore, the MPEG spec does not address the contents of ECM messages, as they are are privately defined.



The contents of the CA descriptor will be specific to the vendor making your access control hardware. Once you determine what the descriptors look like, you can insert it into the stream with the DescriptorN parameter.
We are required to use an AC-3 descriptor. What is it?
The AC-3 descriptor is defined on page 120 of the ATSC A/52a document. You can download it from: You can use the MP2TSME Descriptor Generator to build an AC-3 descriptor and then include it in a PMT.

PCR Issues

The mux has a default InitDI = no for video, but CableLabs requires the DI to be set in the PCR PID. Are the CableLabs settings in the mux broken?
No. MP2TSME will always set the discontinuity_indicator in the PCR PID at the beginning of the stream even if the InitDI parameter is set to No for that stream. The InitDI option is only effective for non-PCRPID streams.

Adaptation Field Issues

The mux has a default InitDI = no for video, but CableLabs requires the DI to be set in the PCR PID. Are the CableLabs settings in the mux broken?
No. MP2TSME will always set the discontinuity_indicator in the PCR PID at the beginning of the stream even if the InitDI parameter is set to No for that stream. The InitDI option is only effective for non-PCRPID streams.

PES Issues

I'm trying to create a stream with a PES header on every picture. The PESnau Parameter and video access unit terminology confuse me. What should I do?
Because MPEG supports field pictures, where each frame is encoded as two separate pictures, the MPEG 'picture' may not be the picture you intend. Hence the notion of access units was created. MP2TSME offers control over how many access units are in each PES packet. For normal NTSC video (i.e., frame pictures) the default value of PESnau = 1 will give you a PES header with every picture.

General Video Issues

My content is film and switches in and out of 3:2 pulldown mode. Will MP2TSME handle this OK?
Yes, MP2TSME can handle any legal sequence of pictures. Film transitions are not a problem.
Can Manzanita TS multiplexers multiplex files if any part of the video elementary stream is encrypted? For example, will MP2TSME multiplex a VES if it is encrypted such that the video picture headers are in the clear and the payload is encrypted?
The upper layers of the video would need to be in the clear. We would need to see all the way down to the first slice header, beneath that the data could be scrambled.
I want to send still pictures. How do I use this feature?
Typically, the still picture stream is a sequence of only I frames. However, some decoders require one or two empty P frames after each I frame. If you use empty P frames, you should set the PESNAU parameter to indicate the total group size. For example, if you have two P frames, the PESNAU would be set to three. This is necessary to keep the P frames in the same PES packet as the I frames for timing purposes.



The other parameter that you will need to set is the StillPicOffset parameter. This should be set to the max time it will take to transfer the IPP group of pictures. Time is measured in picture times. For example, if your I frames are nominally 50 KB and you are sending the video at 100 kbps, then it will take 50000 * 8 / 100000 = 4 seconds to send each I frame. The StillPicOffset should be set slightly larger than this value. For 30 fps video, this means the StillPicOffset should be at least 120. Using a value that is too small will result in an underflow in the decoder as the larger pictures will not arrive in time. Using a value that is too large will result in an overflow as the decoder waits for the decode time. Note that actual decoder behavior varies with make and model.
Why doesn't the Manzanita Mux work with the H.264 stream I just downloaded from the MAC HD Video Gallery?
H.264 encoding does not require some of the parameters, e.g., bit rate and frame rate, that MPEG specifies are necessary for creating transport streams. Your H.264 stream probably does not contain bit rate or frame rate information. To multiplex the stream, you can explicitly configure the bit rate and/or frame rate if you know the values.
Why did the Multiplexer create such a huge output file when my input file is H.264 video and only 1 MB in size?
Bit rate information is sometimes not encoded in H.264 streams. If no bit rate is found in the input stream and the video bit rate parameter is not explicitly configured, the Multiplexer will use the maximum rate for the profile and level, which will often result in files larger than expected

Video Rate and Buffering

I get underflows when I try to multiplex a video stream, what can I do to fix it?
The input stream probably does not have accurate timing information in it. There are several things to try. If the underflow happens right away, i.e., within the first second or so, then use the Delay Parameter to increase the amount of data in the buffer. If the underflow starts later in the stream and gets progressively worse, i.e., the number of bytes that the buffer underflows by keeps increasing, then the rate at which the stream is multiplexed is too low. Use the Rate Parameter to increase the rate until the underflows stop. If the underflow is brief, then the stream may not be correctly encoded for the specified bit rate or decoder buffer size. Either re-encode the stream or try using a higher rate or a larger buffer size with the DBsize Parameter. Note that using a larger decoder size will result in a transport stream that is not MPEG compliant. Depending on your decoder, it may solve your problem.
I'm muxing an MPEG-1 variable bitrate video stream and the output file is huge, in fact my hard drive fills! What is wrong?
MPEG-1 variable bit rate (VBR) video streams have the bit rate field set to the max allowable. For MPEG-1 VBR video the Rate Parameter must be specified for the video stream. The value used should be the actual maximum rate that will be encountered in the stream.
I am getting lots of video underflow errors halfway through a full movie I'm multiplexing. I've read the help files and tried everything but still the same problem. Creating new elementary streams with a more moderate bitrate doesn't help either. What do I do?
Usually this is caused by the video stream using more bits than it should. There are a couple of things you can try.



First, if your video elementary stream is CBR, then you can do a simple math check of the file size. This is not exact, but will tell if there is an obvious problem. Assuming you know the duration of the stream, compare this to what you would compute the duration to be based on the video rate and the file size. You can use our MPEGID utility to report the video rate and duration. If the file is CBR, the computed duration should be very close to the expected value (within one second). If the computed duration is longer, then there are more bits than expected which means the actual rate is higher.



You can also try a simple test to see if the rate is off by setting a higher rate in the Video Subsection and running the mux again. For example, if your rate is 3.18Mbps, you might try 3.3Mbps. If this works, the problem isn't fixed, but it verifies that the encoder is generating too many bits.
I get the following warning: "Picture vbv_delay fields don't match stream rate". What do I do?
Unless you need it, disable the StrictVBV parameter. Your input video stream probably does not have accurate vbv_delay field values and this is causing these warnings. The StrictVBV parameter is supported for a VOD Server that is no longer made.

General Audio Issues

Does MP2TSME support MP3 audio?
Yes, MP2TSME supports Layer III MPEG audio, as well as Layer I and Layer II. However, few decoders currently support MP3 audio in a transport stream. Although a particular decoder may play an MP3 file by itself, it may not play it when it is multiplexed in a transport stream.
I am trying to multiplex a Dolby 5.1 AC3 stream. Is there a setting for stereo AC3 vs. 5.1 AC3?
The audio internal format (stereo, 5.1, etc.) are at coding layer lower than the transport stream, so is entirely controlled by your audio encoder. The format does not matter to MP2TSME.
I used the value of 16.9 for the audio SkipFrames parameter in my config file. The manual says it is an integer, but I need a fractional adjustment. Will this work?
Parameters that expect an integer value will ignore all extra data after the integer. If you enter 16.9, it will use the value 16 and ignore the 0.9. You can verify this by looking for this parameter in the summary output that is displayed as the Multiplexer begins to run from the command line. The command line program will give the actual value used. If you need finer control you can add additional delay to the stream with the StreamDelay parameter.
I'm hoping that you could help me with a problem that I'm having muxing PCM audio. All I hear is static when it is played back. What I'm trying to do is mux a 422 mpeg video stream with 2 pairs (4 channels) of .wav PCM audio. The two stereo .wav files were captured and the .wav headers were removed using a program called 'riffstrip'. After muxing the file, and attempting to play back on a decoder, all I could hear is static. Is there something I should add to the my config settings?
The problem most likely is caused by a difference between what the multiplexer expects and the actual format of the input data. Your config file has no settings specified, so the default values are:
ByteReversed = No
BytesPerWord = 3
MSjustified = No
WordSize = 24
This is probably not valid for your input data. Usually .wav files are byte reversed. Did your utility reverse the byte order of the samples? What is the word size? Most PC .wav files are 16 bit. The MS justified is probably fine, but the others may need changing.

Audio Rate and Buffering

I get underflows when I try to multiplex an audio stream, what can I do to fix it?
If the underflow happens early in the stream, say within the first second or so, then try using the Delay Parameter to increase the initial delay and thereby increase the amount of data in the decoder buffer before the first access unit is decoded. If the underflow is regular throughout the stream and you are using AC-3 audio, then it may be caused by the potentially larger frame sizes in the higher rate AC-3 streams. Try using the ATSCbuf Parameter to enable the ATSC buffer model. Alternatively, you can use the DBsize Parameter to specify a larger decoder buffer. This last option will result in a stream that is not MPEG compliant, however it may solve your problem if your decoder can handle the stream.
We need to create a single program transport stream containing some of the official Dolby AC-3 test material. While trying to multiplex many of the test clips MP2TSME reports many warnings, and the audio content often stops and starts when played back. How can we fix this?
We have multiplexed the Dolby AC-3 test suite and some of the streams contain bit rate changes and other changes that can cause underflows. The solution to this problem is to make sure the transport rate is high enough and set a higher audio bit rate if necessary. For example, if you are multiplexing the audio by itself and do not specify the transport rate, then MP2TSME will compute the transport rate based on the initial audio bit rate. If the audio bit rate changes to a higher bit rate, underflows will happen.
Here is the software encoded audio elementary stream file that we are having problems with when trying to multiplex with the Manzanita tool. We are having no problems with the files we have created with our hardware encoder. Please let me know what you find.
In your config file you have the rate specified as:
Rate = 128014
but our analyzer says the audio input stream is encoded as:
MC audio: layer 2, 44.1Ksps 256 Kbps
If you omit the Rate parameter from your config file, it should multiplex with no errors.

Data Issues

I'm creating a transport stream with a single data subsection. The packets all use PID 0x10 and there are 10 packets in the file. I have included the Repeat Parameter. Despite asking for a 1:00 duration file, I get only 0:08. Why?
The multiplexer will only continue to repeat the input data stream if there are other input streams that have not completed. It will stop multiplexing when all of the input streams have been processed, or the requested duration has been reached. In this case, since you do not have other input streams, you will have to lengthen your data stream. You can do this by specifying the data file repeatedly using the FileN Parameter. Repeating the file 8 times, for example, may allow MP2TSME to run for 1 minute.
How do I make a data stream part of a program in the transport stream? I need the data to be carried in a User private Data PID? I create a packetized stream file using PID = 0x1EB, but when I configure PID = 0x1EB in data section of the config file the resulting stream shows up as an undetermined stream.
The PID and StreamType parameters are required in the Data Subsection if you want the data stream to be entered in the program's PMT. In this case, the CreatePMTEntry Parameter must be set to Yes. If you have specified both the PID and StreamType, then the PMT will list that PID as part of the program. If you use a stream_type value that indicates private stream (5 or 6), or user private (0x80-0xff), the decoder will know to look for this data. Unless you include other information or the decoder has a-priori information (i.e., it looks for AC-3 audio in stream_type 0x81) the data is just undefined user private data.
We need to insert metadata in our streams. How can we do this?
This is a question we often hear, and usually there is a lack of information as to how the metadata is to be inserted into the transport stream. First, you need to answer these questions:
  1. Will the data be in private sections (tables)?
  2. If so, are they section syntax, or non-section syntax?
  3. If not private sections, then private stream? (PES'd stream)
  4. If private stream, private_stream_1 or private_stream_2?


We support some of these formats and expect to support more as time goes on. We also have more tools in our MP2TSME product. Once you figure out what format you need, we can help you find the necessary tools.

Lipsync

When I mux an audio and video stream, the resulting transport has lip sync problems. Why?
Lip Sync errors can be caused by different problems. If the offset is variable, then the problem is in the encoded elementary streams and can not be fixed when multiplexing. If the offset is fixed, then the elementary streams were created starting at different times. This can be fixed by using either the Audio Skipframes Parameter to advance the audio or the Audio StreamDelay Parameter to retard the audio relative to the video.
Our HD-VOD customer tells us the audio and video are 'out of sync'. What must we do to correct this?
MP2TSME assumes that the input elementary stream files all begin at the exact same time. It sounds like your inputs do not begin at the same time. You can adjust the AV sync at the time of multiplexing to compensate for the different beginning times.



If the audio is ahead of the video, that is sounds happen before the action, then the audio can be delayed with the Audio StreamDelay Parameter. The units of StreamDelay are 90KHz cycles, so to introduce a 1/2 second delay would require a value of 45000.



If the audio lags the video, or sounds happen after the action, then you need to advance the audio. This is done with the Audio SkipFrames Parameter. SkipFrames tells the multiplexer to drop some number of audio frames off the beginning of the stream, this effectively advances the audio by that number of frames. The duration of an audio frame is a function of the type of audio, but they are usually around 31ms. To advance the audio by 1/2 second would typically require a SkipFrames value of 15.



We recommend only the audio be adjusted (as opposed to using the StreamDelay parameter with video) because the PCR is carried on the video PID and delaying the presence of PCRs can cause other problems.



If you are lucky, the AV shift will be a fixed amount for your encoder, so you can figure out what compensation you need and always use the same value. Otherwise you will need to determine the adjustment each time. Usually the encoders start in a predetermined fashion, so any compensation is fixed.
We are using MP2TSME to generate a one hour mp2ts file. While playing the file we notice some audio drift about 5 minutes before the end of the file. I was wondering if you could tell me if a) that would be "normal behaviour" given the length of the file and b) if I could set up some parameters to prevent this problem ?
This is caused by the audio & video elementary streams being created asynchronously. The multiplexer can not alter the timing within either the video or audio streams, so it can not cause or correct AV drift during the stream. If you have drift, then it was either in the original material or (most likely) was introduced when the audio & video were encoded. This is not normal & should be fixed at the time the elementary streams are encoded.

Set-top and Decoder Playback

I created a transport stream using MP2TSME, but it will not play on a Zephyr-2000 decoder. What is wrong?
Some decoders, including the Zephyr-2000, rely on fixed PID assignments. If you have used the MP2TSME default PID assignments, or configured PID values that do not comply with the decoder's requirements, the transport stream will not be decoded. Ask the decoder manufacturer for the required PID values.
I create a transport stream using MP2TSME but it will not play on my PC. What is wrong?
Most PC-based software decoders will not play a transport stream reliably, if at all. There are some hardware MPEG decoders that support transport, and even Dolby AC-3 audio, however we have not found any PC decoders that will support all the different types of audio and video in a transport stream. In addition, a software player will often work at lower rates, but at higher rates or with HD content the decoder starts to have problems. The most reliable way to play transport streams is with a set-top box.
I am trying to solve a problem that relates to trick plays. I am encoding/multiplexing using the Manzanita tool for a VOD application. They are using an OVS and PACE set-top boxes. The content seems to play back fine, but there is an issue with the FF and RW functions. At certain points of the stream, the STB will crash during the FF function. This problem does not occur with the content created by the network carrier using an Optibase real time encoder.
Looking at your spec two requirements are not met by the config file:
  1. PCR every 40ms - You can add the following line to the Program section to meet this requirement:
    PCRper = 40
  2. Random access indicators set every I frame - You can add the following line to the Video subsection:
    RAI = Yes
The lack of the RAI option for video is probably causing the problems you are encountering. The PESalign parameter should also be set to Yes. The RAI is used for trick modes to allow the decoder to quickly find the I frames.



You may also set the RAI parameter to Yes in your audio subsection, but this is not a requirement. You may want to omit this as it uses a fair amount of bandwidth. The same is true of PESalign in audio.

Demultiplexer

I often have to demultiplex 10-20 transport streams to elementary streams. Is there any batch function I can use?
You can use the command line version of the MP2TSME Demultiplexer. For example, if you have to demultiplex the video elementary streams carried in PID 0x21 from four different transport stream files, your batch file would look something like:
mp2tsme -d infile1.mpg outfile1.mpv 0x21
mp2tsme -d infile2.mpg outfile2.mpv 0x21
mp2tsme -d infile3.mpg outfile3.mpv 0x21
mp2tsme -d infile4.mpg outfile4.mpv 0x21
When I use the Demultiplexer tool and click on the "Select All" button, I don't see that any files have been selected, but the "Demux" button does become active. What is going on?
For Win XP, change Display -> Properties -> theme scheme to "Windows XP (modified)" and for Win Vista change Personalization -> Window Color and Appearance to "Windows Standard". This sets up the frame and window background colors to be different enough so that the select all always has enough contrast to show up.

Packetize Data Tool

Is there a trick to packetizing more than 1.5 MB using the Packetized Data Tool? We are doing some tests with data, but I get "Error packetizing data" if I try with a file larger than 1.5 MB. At 3881000 bps, even if I repeat the file 20 times, it only lasts 8 seconds. I would like to packetize a very large file so that at 3881000 bps it will run for a few minutes at least.
The MPEG spec limits the length of a section syntax format table to 1 MB. Tables are broken into sections. There may be up to 256 sections with each section carrying up to 4096 bytes. Because of a small amount overhead in each section, so you actually get a little less than 1 MB of payload in a table. The only way to send more data is to use multiple tables.
Why am I getting an error when using the Packetize Data Tool on files over 2MB?
MPEG limits the size of tables to 256 sections of 4 Kbytes each, or a total of 1 MB. You will need to split the data into multiple tables.

DVB Subtitles Tool

I am trying to generate subtitles with Spruce STL and I get this error: "Subtitle Rendering Error: 6 lines were seen in a subtitle, max is 5 (line 1071)". How do I get rid of this error?
Using a text editor that displays line numbers, you can directly edit the .stl file. Line Breaks are denoted by "|". You can edit out one or more of those characters taking note that the size and length of each line will also be limited.
When I "Make" my VOBSUB subtitle file, I get a popup "Subtitle rending warning: using 106995 bytes, more than the DVB pixel buffer of 80000 bytes", what does this mean?
This means that the .idx file is not DVB compliant and "may" not play on the STB. If this is the case, you may want to use a different format such as Spruce STL to render the subtitles. You can also choose to ignore the warning, generate the subtitle file and see if it works for your application.

Audio ES Tool

When using the Audio ES Information Tool, why does the rate not always agree with what my encoder says for HE-AAC streams?
Depending upon whether the SBR and PS signalling are implicit or explicit, the streams may or may not be backwards compatible with AAC only decoders. The rate that the Audio ES Tool displays for implicit signaling is the AAC core sample rate. The rate displayed for explicit streams includes the SBR sampling rate. Your encoder may specify only the SBR rate for an HE-AAC stream.

Video ES Tool

I am using the Video Tool to compute the min and max rate on an H.264 stream. When I set the max rate from the tool in the mux, I still get underflows. Why?
The Plot Rate Tool does not compute the maximum multiplexed rate, but computes an average of the picture sizes over a user specified window. The tool shows how the picture sizes fluctuate over time and is related to the actual bit rate. Usually the actual rate is close to that shown in the plot, but often some adjustment will need to be made. If you are still seeing underflows, then you will need to increase the rate above that provided by the tool.

Terminator and Splicing

When we terminate our transport streams we note a slight drift in the PCR. The stream is legal, but is this expected?
Yes, the Terminator will adjust the system clock frequency slightly to eliminate timing discontinuities at stream transitions. As you noted the transport stream is still perfectly legal.
I'm trying to splice together two streams. I am using the File1 and File2 parameters to input the video and audio elementary streams. The video muxes fine, but I get an error that Audio lost sync. What is wrong?
Most likely the first audio file does not end with a complete audio access unit. We have seen this problem with some MPEG encoders that put extra (garbage) data at the end of the stream. There are two approaches to solving this problem. The first is to use the Audio ES Tool to copy the audio frames from the original file to a new file. Copy beginning at frame 1 and do not specify an ending frame. This will copy all the complete frames to the new file. This process may also need to be repeated with the second audio file. After both audio files have been copied, the new files will work in the multiplexer. Alternatively, the files can be multiplexed to create two transport streams using the Terminator process, then these streams can be concatenated together.