View Full Version : Adding multiple subtitles to MPEG transport stream
trilko
16th May 2007, 11:14
Hey guys, I need some help.
I want to create a MPEG (MPEG-2 or H.264) transport stream (.ts file) in which I could have one video stream, multiple audio streams (done with XMuxer) and multiple subtitle streams.
Does anybody have any idea how could I do this? Is there any program for these things? Any ideas are more than welcome, since I've tried many many programs already :confused:
Tnx!
MBoufleur
17th May 2007, 18:05
I was also looking for a solution to it.
The only apps I could find that do it were FAB Subtitler MPEG (http://www.fab-online.com/eng/subtitling/broadcast/subtmpg.htm) and Softel (http://www.softel.co.uk/) (not sure about this one though...).
These can insert DVB Bitmap Subtitles (ETSI 300743) from some subtitle text formats.
FAB Subtitler MPEG can accept formats such as EBU STL, Spruce STL files, PAC, RAC, 890, TXT and DOC (but I guess it costs more than 3000 Euros :()
Softel seems to do it as well, as well as other tools like Muxman for DVD purposes (using some sort of .SUP file format).
RedBitz
6th June 2007, 13:18
I came across this post while looking for information regarding the EBU STL file format as I've been developing this exact product that you're mentioning for the past 7 months.
When I started, I began with the goal of making exactly the same product that FAB has just released, but sadly, what I learned is, unless you're using an extremely expensive multiplexer such as realtime (slow time) hardward solutions or you're using the Manzanita enterprise multiplexer, you're screwed. This means that you're looking at a minimum of a $5000 per system (dongle locked) investment for multiplexing and you're looking at who knows how much for FAB, but given that they typically are quite expensive, probably another $5000 for all the features.
The reason you need an expensive multiplexing solution is that most streaming equipment uses trick mode to be able to handle fast forward and rewind. Systems such as Enstream are very particular to how they receive their ingest data. If you're not interested at all in conditional access (meaning you'll never broadcast anything that needs to be encrypted to the set-top box) they will probably work quite well with pretty much any multiplexer. On the other hand, if you're planning on encoding films for streaming over IPTV VOD systems such as I do, then you will need a CableLabs compliant multiplexer.
CableLabs compliant means that all frames are PES aligned. Systems like XMuxer only align the sequence headers on the PES. To align frames to PES requires that the multiplexer has a much deeper understanding of the elementary streams than most multiplexers do. Sadly, as far as I know, there are only two offline multiplexers I know of with this ability. Manzanita and my own which has no user interface yet (I change file names in code).
As for the FAB solution. The real problem with the FAB solution is that unless you're a great fan of trial and error for every film you're processing, you'll be forced to pad your streams by 192Kbits/sec per subtitle stream as per the DVB subtitling spec. This is because subtitles don't have a CBR format, they are purely VBR since each subtitle is of a difference size and have variable in and out points. This means that unless you precalculate the stream bit-rate of the subtitles (haven't seen it in FAB yet), there's no way to predict what additional padding is needed in the stream.
The reason for the padding instead of just growing the file on output is that CableLabs requires every video packet to be PCR timestamped. The PCR time stamp is a number that is typically calculated by applying the bit rate of the stream to the current position in the stream. So if you're 5 seconds into a film that is transmitted at 5mbits per second, then the PCR will be 5 * 5mbits for that packet and accuracy is important as this limits overflows and underflows.
If you simply insert the subtitles into the stream, then the PCR is no longer accurate unless you accurately pad the entire stream to correspond to the DVB subtitle stream bitrate. This is possible and not necessarily hard to do, but for the most part, I haven't seen a clean way to do it.
So what I'm really saying is, that although what I use works, and it meets the transport stream standard at least as well as Manzanita does, there is no publicly available solution at the moment.
If you're looking for just A SOLUTION. I would recommend authoring a DVD with your fixed-bitrate MPEG and all the rest and use the tool floating around on either here Doom9 or Digital Digest that is a DVD to Transport Stream encoder. It's not cable labs compliant and conditional access on the stream is not likely possible for systems that ingest and preprocess for trick mode, but for the moment, it's the only thing I know that works. From what I understand, it does high-def also.
kristos
5th July 2007, 00:25
RedBitz:
you did that development for commercial purpose or we can use the tool you did?
I would be quite interested in the work you have done so far and glad to continue research or develop on the issue.
setarip_old
5th July 2007, 01:25
@trilko
Hi!I want to create a MPEG (MPEG-2 or H.264) transport stream (.ts file) in which I could have one video stream, multiple audio streams (done with XMuxer) and multiple subtitle streams.For MPEG-2, this is called ".VOB", as in DVD format ;>}
Incorrect... .VOB files are Program Streams. Transport Streams are a different beast (http://en.wikipedia.org/wiki/MPEG_transport_stream) altogether.
setarip_old
5th July 2007, 02:19
I believe the difference between concepts can be handled by "PVAStrumento"...
mayuranantwar
12th November 2008, 11:44
Dear All,
At what bitrate should dvb subtitle transport stream be muxed with audio and video?
Regards,
Mayuranantwar
mayuranantwar
16th November 2009, 10:20
RedBitz:
You said that dvb subtitle stream need to pad by 192 kbits/s.
1) Do we need to send Null packets for padding along with subtitle stream?
2) If we encode PCR(embedded in) from video packets into the subtitle stream packet,Does it require to calculate PCR?
Regards,
Mayur
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.