33753162TSMultiplexer
所属分类:mpeg/mp3
开发工具:Visual C++
文件大小:315KB
下载次数:5
上传日期:2010-04-30 11:00:17
上 传 者:
zhaoninayangsong
说明: 将ES打包为ts,不过程序编的一般,新手可以看看
(The TS packaged as tes, but the general compilation process, novices can see)
文件列表:
TSMultiplexer\define.h (17390, 2004-04-22)
TSMultiplexer\enc.cpp (14176, 2004-08-06)
TSMultiplexer\file_io.cpp (1097, 2003-05-12)
TSMultiplexer\MessageInterface\BaseControInfoClass.h (1569, 2003-10-06)
TSMultiplexer\MessageInterface\BaseControlInfoClass.asp (249, 2003-10-06)
TSMultiplexer\MessageInterface\BaseControlInfoClass.h (2584, 2003-10-07)
TSMultiplexer\MessageInterface\BaseControlnfoClass.cpp (2211, 2003-10-07)
TSMultiplexer\MessageInterface\BaseDescriptor.cpp (1021, 2003-10-06)
TSMultiplexer\MessageInterface\BaseDescriptor.h (1570, 2003-10-06)
TSMultiplexer\MessageInterface\BitField.cpp (11070, 2003-10-09)
TSMultiplexer\MessageInterface\BitField.h (10563, 2003-10-09)
TSMultiplexer\MessageInterface\BitField_bk.cpp (8287, 2003-10-02)
TSMultiplexer\MessageInterface\BitField_bk.h (8278, 2003-09-29)
TSMultiplexer\MessageInterface\ByteArray.cpp (1807, 2003-10-02)
TSMultiplexer\MessageInterface\ByteArray.h (1399, 2003-09-30)
TSMultiplexer\MessageInterface\common.h (1920, 2003-10-10)
TSMultiplexer\MessageInterface\Container.cpp (2748, 2003-09-30)
TSMultiplexer\MessageInterface\Container.h (2746, 2003-10-09)
TSMultiplexer\MessageInterface\control_tag.h (373, 2003-10-07)
TSMultiplexer\MessageInterface\ExpandableBaseClass.cpp (2222, 2003-10-07)
TSMultiplexer\MessageInterface\ExpandableBaseClass.h (3773, 2003-09-29)
TSMultiplexer\MessageInterface\IPMPToolES_DecoderConfig.cpp (0, 2003-09-29)
TSMultiplexer\MessageInterface\IPMPToolES_DecoderConfig.h (2522, 2003-09-29)
TSMultiplexer\MessageInterface\IPMPTool_Info.cpp (6901, 2003-10-07)
TSMultiplexer\MessageInterface\IPMPTool_Info.h (5509, 2003-10-07)
TSMultiplexer\MessageInterface\IPMP_AddToolNotificationListener.cpp (5719, 2003-10-01)
TSMultiplexer\MessageInterface\IPMP_AddToolNotificationListener.h (6229, 2003-10-01)
TSMultiplexer\MessageInterface\IPMP_AudioWatermarkingInit.cpp (8581, 2003-10-03)
TSMultiplexer\MessageInterface\IPMP_AudioWatermarkingInit.h (6312, 2003-10-03)
TSMultiplexer\MessageInterface\IPMP_CanProcess.asp (249, 2003-09-29)
TSMultiplexer\MessageInterface\IPMP_CanProcess.cpp (1075, 2003-10-01)
TSMultiplexer\MessageInterface\IPMP_CanProcess.h (1127, 2003-10-01)
TSMultiplexer\MessageInterface\IPMP_ConnectTool.cpp (781, 2003-10-09)
TSMultiplexer\MessageInterface\IPMP_ConnectTool.h (1106, 2003-10-09)
TSMultiplexer\MessageInterface\IPMP_ContentTransfer.cpp (3215, 2003-09-30)
TSMultiplexer\MessageInterface\IPMP_ContentTransfer.h (2149, 2003-09-30)
TSMultiplexer\MessageInterface\IPMP_Data_BaseClass.cpp (5522, 2003-10-10)
TSMultiplexer\MessageInterface\IPMP_Data_BaseClass.h (5376, 2003-09-29)
TSMultiplexer\MessageInterface\IPMP_Descriptor.cpp (7561, 2003-10-09)
TSMultiplexer\MessageInterface\IPMP_Descriptor.h (6171, 2003-10-08)
... ...
This software is provided by :
Panasonic Singapore Laboratories Pte. Ltd
Author: Liu Jing
contact: j liu@psl.com.sg
===============================================================================
1. What is it
This software is a MPEG-2 IPMP Transport Stream(TS) multiplexer developed by C.
Its basic functionality is to multiplex MPEG-1/2 compatible video|audio and private
streams into TS stream. Its advanced functionality includes generate MPEG-2 TS stream
with IPMP information, e.g., Tool List, Tool Container, Rights Container, IPMP Descriptor.
The produced MPEG-2 TS stream is readable by MPEG-2 compliant terminals.
The produced MPEG-2 IPMP TS stream is readable only by MPEG-2 IPMP compliant terminals.
2.Version
The current version is 1.0
3. Usage
This software has a command-line interface. It requires a parameter file to tell what
kind of work to do
The basic command-line syntax is:
tsmuxer para_file output_file
tsmuxer: executable file name of this multiplexer
para_file: parameter file name which contains parameters required by multiplexer
output_file: file name of output TS stream
Advanced usage:
some options are provided:
-v verbose mode, print some verbose information
-a [VIDEO or AUDIO]: this option is used with our Triple DEL Tool desdll.dll. With this option,the multiplexer will
encrypt the specified stream type with DES algorithm during the multiplex.
e.g., encrypt both audio and video files : -a VIDEO -a AUDIO
-k [Keys] : this option is used together with -a to give the keys to be used in the DES encryption,
for test reason. currently, we only accept 8 chars[0-9] as *** bit keys. However, the provide DES Tool
support ***,128 and 196 bit keys.
-n [interval]: this tricky option is used with -a. It gives the intervals of the previous encrypted packet
and next to-be encrypted packets. We have this option because encrypt every packets
(especially video packets) affects the Terminal side's performance heavily. i.e., the playback
Terminal need to decrypt every packet before decode and render. This could beyond some less powerful
Terminal's capabilities sometimes. So with this option, we can encrypt data selectively.
Examples:
a) encrypt Audio stream's every packet (audio is lightweight compared with video)
tsmuxer -a AUDIO -k 12345678 -n 1 parameter.txt filename
b) encrypt one Video Stream's packet out of every 10 packet
tsmuxer -a VIDEO -l 12345678 -n 10 parameter.txt filename
When using DES tool to encrypt data stream, users should also put necessary inforamtion
in the descriptor data so that the terminal can know where and what key should be used to decrypt
the stream. If selective encryption is used, the related information should also be provided in certain ways.
Next, we introduce the parameter file used for different multiplex purpose
3.1 Produce simple MPEG-2 TS stream (no IPMP information)
a sample profile is given as following:
TRANSPORT_RATE 2 dummy 999
PROGRAM 1 dummy 37
VIDEO 2 video1.m2v 40
AUDIO 1 audio1.mp2 50
PROGRAM 2 dummy 38
VIDEO 2 video2.m2v 60
AUDIO 1 audio2.mp2 70
...
END 1 dummy 300 dummy
take line "VIDEO 2 video1.m2v 40 "for example:
"VIDEO": specify the stream is a VIDEO stream
"2": specify the video stream format, "2" means MPEG-2 stream
"video1.m2v": specify the stream data
"40": specify the stream PID in program stream. It is just a reference, can be changed
to any valid integeral number.
3.2 Produce MPEG-2 IPMP TS stream
a sample profile is given as following:
//IPMP tools information
//syntax: IPMP_TOOL Tool_ID=... isAltgroup=... isParametric=... NumUrls=... Url=...;
IPMP_TOOL Tool_ID=1 isAltgroup=0 isParametric=0 NumUrls=1 Url=REL.dll;
IPMP_TOOL Tool_ID=2 isAltgroup=0 isParametric=0 NumUrls=1 Url=DES.dll;
//IPMP Tool Container
//syntax: TOOL_CONTAINER Tool_ID=... Format_ID=... Package_ID=... Data_File=...;
TOOL_CONTAINER Tool_ID=8 Format_ID=1 Package_ID=10 Data_File=tool_data;
TOOL_CONTAINER Tool_ID=9 Format_ID=1 Package_ID=10 Data_File=too2_data;
/IPMP Rights Container
//syntax: RIGHTS_CONTAINER IsProprietary=... Rights_Tool_ID=... Data_File=...;
RIGHTS_CONTAINER IsProprietary=1 Rights_Tool_ID=3 Data_File=rights_data;
TRANSPORT_RATE 2 dummy 999
PROGRAM 1 dummy 37
VIDEO 2 /path/video.m2v 40
AUDIO 1 /path/audio.mp2 50
//IPMP Descriptor
//syntax: IPMP_DESCRIPTOR Descr_ID=... Elem_ID=... Tool_ID=... CP=... SC=... IsSigned=... Data_File=...;
IPMP_DESCRIPTOR Descr_ID=1 Elem_ID=40 Tool_ID=2 CP=1 SC=10 IsSigned=0 Data_File=descriptor_data;
END 1 dummy 300 dummy
We take the IPMP_Descriptor for further explanation:
"IPMP_DESCRIPTOR Descr_ID=1 Elem_ID=40 Tool_ID=1 CP=1 SC=10 IsSigned=0 Data_File=descriptor_data;"
Parameters given by above statement are:
Descr_ID: this descriptor's ID is "1";
Elem_ID: this descriptor is to protect elementary stream with index "40";
Tool_ID: this descriptor is associated with tool whose id is "1";
CP: specify Control Point of this descriptor. "1" means after demultiplex
valid values are:
0 : No control point
1: after demultiplex
2: before decode
3: before render
SC: specify Sequence Code of this descriptor is
IsSigned: specify whether following descriptor_data is signed or not, "0" means false.
Data_File: path of the proprietary data refered by this descriptor. Since there are no IPMP
tools have been normalized, the data can be proprietary. Thereafter, the terminal
side should be able to read the proprietary data according to its tool id.
example:
a) produce a global scope descriptor
IPMP_DESCRIPTOR Descr_ID=4 Elem_ID=301 Tool_ID=5 CP=0 SC=5 IsSigned=0 Data_File=ipmp_rel.descriptor;
"global" is specified by CP=0, which means the control point is set before demultiplex buffer, in this
situation, the Elem_ID's value is just used as dummy value. All the other values are still valid.
b) produce 2 descriptors apply to same elementary stream
IPMP_DESCRIPTOR Descr_ID=5 Elem_ID=40 Tool_ID=5 CP=1 SC=10 IsSigned=0 Data_File=ipmp_tool5.descriptor;
IPMP_DESCRIPTOR Descr_ID=6 Elem_ID=40 Tool_ID=50 CP=1 SC=20 IsSigned=0 Data_File=ipmp_tool6.descriptor;
Just set the Elem_ID to the stream that this descriptor applies. In above example, there are two IPMP tools
will be applied to video stream(PID 40) after demultiplex. One tool has higher priority(sequence code=20) whil
the other one has lower priority (sequence doe = 10)
3.3 Produce IPMP Stream
This multiplexer also enable user to dynamically generate IPMP stream, which is consisted by multiple IPMP_StreamDataUpdate
packets. In our implementation, we generate one IPMP Stream TS packet immediately after PMT table. There will be multiple
such TS packet in the finally produced TS stream because PMT table is re-muxed into TS stream every a few seconds(this paramaeter
is adjustable). A possible scenario to use IPMP Stream is to carry time variant keys. So user can decide what data to be packed
in the IPMP_StreamDataUpdate packet at the time to mux it into IPMP Stream. The IPMP Stream header specified which descriptor should
receive this message.
At IPMP Terminal side, once IPMP Stream is received, the terminal will extract the message inside and route the message to the
IPMP Tools associated with the descritor in the IPMP Stream header.
example: use following 2 lines to mux a IPMP Stream
1. IPMP 6 ipmpstream.data 70
2. IPMP_DESCRIPTOR Descr_ID=6 Elem_ID=40 Tool_ID=50 CP=1 SC=10 IsSigned=0 Data_File=ipmp_tool5.descriptor;
Line 1 starts with "IPMP", saying this is an IPMP Stream to be muxed.
"6" says the stream is to be received by the Tool given in descriptor 6(ID=6). The tool specified in this descriptor is Tool 50(ID=50).
"ipmpstream.data" can carry data to be included in the IPMP_StreamDataUpdate packet.
"70" is the PID of this IPMP Stream
3.4 Summary
A sample parameter file can be like following:
//start
IPMP_TOOL Tool_ID=1 isAltgroup=0 isParametric=0 NumUrls=1 Url=DESDLL.dll;
IPMP_TOOL Tool_ID=3 isAltgroup=0 isParametric=0 NumUrls=1 Url=RELTOOL.dll;
IPMP_TOOL Tool_ID=5 isAltgroup=0 isParametric=0 NumUrls=1 Url=DUMMYTOOL.dll;
TOOL_CONTAINER Tool_ID=3 Format_ID=1 Package_ID=10 Data_File=tool_data;
RIGHTS_CONTAINER IsProprietary=1 Rights_Tool_ID=3 Data_File=License_longValidInterval.XML;
TRANSPORT_RATE 2 dummy 999
PROGRAM 1 dummy 37
VIDEO 2 home-text_WM.m2v 301
AUDIO 1 HOME65T.mp2 302
IPMP 2 ipmpstream.data 303
IPMP_DESCRIPTOR Descr_ID=4 Elem_ID=301 Tool_ID=5 CP=0 SC=5 IsSigned=0 Data_File=ipmp_dummy.descriptor;
IPMP_DESCRIPTOR Descr_ID=2 Elem_ID=301 Tool_ID=3 CP=0 SC=10 IsSigned=0 Data_File=ipmp_REL.descriptor;
IPMP_DESCRIPTOR Descr_ID=6 Elem_ID=302 Tool_ID=1 CP=1 SC=10 IsSigned=0 Data_File=ipmp_DES.descriptor;
END 1 dummy 300 dummy
//end
Explanation: This parameter file tells the muxer following information:
1) mux 3 streams, one MPEG-2 video(PID=301), one MPEG-1 audio(PID=302) and one IPMP stream(PID=303),
IPMP stream is going to be received by Tool(ID=3).
2) 3 Tools are to be included in the IPMP Tool List
3) One Tool is carried in Tool Container
4) Rights Data is carried in Rights Container
5) 2 descriptors apply before demux(ID=4 and ID=2)
6) 1 descriptor applies on audio stream after demux
4.Known limitations
Current version multiplexer only supports to carry IPMP Tool (with ToolContainer)
and Rights Tool(with Rights Container) whose size is less than 4k. This limitation will
be corrected at next version.
Current version is tested with one program including one video and one audio stream respectlly.
Multiple programs and multiple streams are not fully tested.
Thanks for using PSL's multiplexer. please send your feedback or questions to the author.
近期下载者:
相关文件:
收藏者: