[go: up one dir, main page]

CN105657457A - TS (transport stream) file adjusting method and TS file adjusting system - Google Patents

TS (transport stream) file adjusting method and TS file adjusting system Download PDF

Info

Publication number
CN105657457A
CN105657457A CN201610204525.6A CN201610204525A CN105657457A CN 105657457 A CN105657457 A CN 105657457A CN 201610204525 A CN201610204525 A CN 201610204525A CN 105657457 A CN105657457 A CN 105657457A
Authority
CN
China
Prior art keywords
data
adjusted
packet
file
stream file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610204525.6A
Other languages
Chinese (zh)
Inventor
高志平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZHEJIANG CHUANGJIA DIGITAL TECHNOLOGY Co Ltd
Original Assignee
ZHEJIANG CHUANGJIA DIGITAL TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZHEJIANG CHUANGJIA DIGITAL TECHNOLOGY Co Ltd filed Critical ZHEJIANG CHUANGJIA DIGITAL TECHNOLOGY Co Ltd
Priority to CN201610204525.6A priority Critical patent/CN105657457A/en
Publication of CN105657457A publication Critical patent/CN105657457A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/236Assembling of a multiplex stream, e.g. transport stream, by combining a video stream with other content or additional data, e.g. inserting a URL [Uniform Resource Locator] into a video stream, multiplexing software data into a video stream; Remultiplexing of multiplex streams; Insertion of stuffing bits into the multiplex stream, e.g. to obtain a constant bit-rate; Assembling of a packetised elementary stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/235Processing of additional data, e.g. scrambling of additional data or processing content descriptors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/235Processing of additional data, e.g. scrambling of additional data or processing content descriptors
    • H04N21/2353Processing of additional data, e.g. scrambling of additional data or processing content descriptors specifically adapted to content descriptors, e.g. coding, compressing or processing of metadata
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Library & Information Science (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The invention discloses a TS (transport stream) file adjusting method and a TS file adjusting system. The TS file adjusting method includes the steps of acquiring packet length of a TS file; positioning and adjusting a to-be-adjusted data packet in the TS file according to the packet length of the TS file, a preset identifier of the to-be-adjusted data packet and a preset adjustment instruction; updating the TS file according to the adjusted data packet and storing the updated TS file. The TS file adjusting method directly achieves TS adjustment without excessive hardware equipment and is simple and convenient to operate.

Description

A kind of method and system adjusting TS stream file
Technical field
The present invention relates to digital TV field, particularly to a kind of method and system adjusting TS stream file.
Background technology
In DTV STB R&D process, have various test request. Due to the standard difference to some extent of each department operation, the front-end configuration of different regions is also different, so it is frequently necessary to test site TS (TransportStream) situation about flowing. In prior art, it is usually and utilizes computer to carry out stream-recording at the scene, preserve into file, utilize code stream to play instrument and become signal bit stream with modulators modulate, be transferred to the research staff of Set Top Box again through Coaxial Network, research staff carries out this simulation in its location again. Fig. 1 is the data flow schematic diagram of test site TS stream in prior art, and its data flow is: computer modulator signal allotter set-top box television.
For doing variation test, it is necessary to the information in code stream is adjusted, such as revises channel name, encryption, change audio frequency and video identification information, increase and decrease or amendment and control descriptor etc., it is necessary to adjust TS data stream. Referring to Fig. 2, in the prior art, the method adjusting TS data stream: pass through code flow broadcast card, source code flow file being play into TS stream, then is input in demultiplexer, operator carry out the amendment of relevant information in demultiplexer, after amendment, again to data again multiplexing and modulate, forming final test stream, its data flow is: computer demultiplexer multiplexer modulator signal allotter set-top box television.
Prior art at least needs to use a professional demultiplexer and multiplexer to adjust code source, so prior art has the disadvantages that specialty demultiplexer and multiplexer volume are relatively big, hardware is many, it has not been convenient to mobile, TS can only be flowed back to and pass to this locality and be adjusted, and it is also very complicated to adjust flow process; And no matter be multiplexer or demultiplexer, all need to safeguard, the maintenance cost of hardware is significantly high, and have oneself life cycle, improve use cost.
Summary of the invention
In view of above-mentioned the deficiencies in the prior art, it is an object of the invention to provide a kind of method and system adjusting TS stream file, comprise the following steps:
The bag obtaining described TS stream file is long;
The identifier of the packet to be adjusted that the bag according to described TS stream file is long, preset and default adjustment instruction, position packet to be adjusted in described TS stream file and adjust;
Update described TS stream file according to the packet after adjusting, and preserve.
Optionally, according to the identifier wrapping long, default packet to be adjusted of described TS stream file and default adjustment instruction, packet to be adjusted in described TS stream file is positioned and adjusts, comprises the following steps;
Identifier according to described packet to be adjusted, captures described packet to be adjusted from described TS stream file;
Described packet to be adjusted is processed, obtains all data to be adjusted in described TS stream file;
According to described adjustment instruction, described data to be adjusted are adjusted;
Data after adjusting are processed and pack, forms the packet after described adjustment.
Optionally, described packet to be adjusted is processed, obtains all data to be adjusted in described TS stream file, comprise the following steps:
Described packet to be adjusted is split, obtains data segment;
Finish message duplicate removal to described data segment, obtains all data to be adjusted in described TS stream file.
Optionally, when described adjustment instruction for replace new data file, described according to adjust instruction described data to be adjusted are adjusted, comprise the following steps:
Read described new data file to be replaced;
Judge the type of described new data file;
If the type of described new data file is table data, then directly utilizes described new data file and replace described data to be adjusted;
If the type of described new data file is non-table data, then described new data file is utilized to replace all correlation tables of described data to be adjusted and the identifier of packet.
Optionally, when described adjustment instruction for increase new data file, described according to adjust instruction described data to be adjusted are adjusted, comprise the following steps:
Read described new data file to be increased;
Judge the type of described new data file;
If the type of described new data file is table data, then according to occurrence frequency, described new data file increased to described data place to be adjusted;
If the type of described new data file is non-table data, then described new data file is increased to described data place to be adjusted, and adds all correlation tables of described new data file and the identifier of packet.
Optionally, when described adjustment instruction is Continuity Analysis and reparation, described according to adjust instruction described data to be adjusted are adjusted, comprise the following steps:
Described data to be adjusted are scanned, and record discontinuity point;
From the complete package data of the described continuous position of extracting data to be adjusted as complete packet;
Front and back data according to described discontinuity point, extract incomplete packet;
Whether judge can incomplete packet described in completion according to described complete packet;
If so, completion is then carried out;
If it is not, then delete described incomplete packet.
Optionally, the table data after adjusting are processed and pack, forms the packet after described adjustment, comprise the following steps:
Check the legitimacy of the table data after described adjustment;
If legal, then calculate 32 cyclic redundancy check codes according to the table data after described adjustment, and described effect code is attached to the table tail of the table data after described adjustment;
Afterwards, according to digital television standard, the table data after described adjustment are packed, form the packet after described adjustment.
Present invention also offers a kind of system adjusting TS stream file, including acquisition module, adjusting module and more new module;
Described acquisition module, the bag for obtaining described TS stream file is long;
Described adjusting module, for identifier and the default adjustment instruction of to be adjusted packet long, that preset according to wrapping of described TS stream file, positions packet to be adjusted in described TS stream file and adjusts;
Described more new module, for updating described TS stream file according to the packet after adjusting, and preserves.
Optionally, described adjusting module includes placement unit, processing unit, adjustment unit and packaged unit;
Described placement unit, for the identifier according to described packet to be adjusted, captures described packet to be adjusted from described TS stream file;
Described processing unit, for described packet to be adjusted is processed, obtains all data to be adjusted in described TS stream file;
Described adjustment unit, for being adjusted described data to be adjusted according to described adjustment instruction;
Described packaged unit, for the data after adjusting are processed and packed, forms the packet after described adjustment.
Optionally, described processing unit includes splitting subelement and arranging subelement;
Described fractionation subelement, for described packet to be adjusted is split, obtains data segment;
Described arrangement subelement, for the finish message duplicate removal to described data segment, obtains all data to be adjusted in described TS stream file.
Compared with prior art, the technical program has the advantage that
The method adjusting TS stream of the present invention includes: the bag obtaining described TS stream file is long; The identifier of the packet to be adjusted that the bag according to described TS stream file is long, preset and default adjustment instruction, position packet to be adjusted in described TS stream file and adjust; Update described TS stream file according to the packet after adjusting, and preserve; This method need not too much hardware device, be directly realized by the adjustment to TS stream, it is not necessary to demultiplexer and multiplexer, not only easy to operate simply, and save cost.
The system adjusting TS stream file of the present invention, including acquisition module, adjusting module and more new module. Acquisition module, the bag for obtaining described TS stream file is long; Adjusting module, for identifier and the default adjustment instruction of to be adjusted packet long, that preset according to wrapping of described TS stream file, positions packet to be adjusted in described TS stream file and adjusts; More new module, for updating described TS stream file according to the packet after adjusting, and preserves. Realize adjustment to TS stream file with native system, it is not necessary to demultiplexer and multiplexer, easy to operate simply, cost is low.
Accompanying drawing explanation
Fig. 1 is the data flow schematic diagram of test site TS stream in prior art;
Fig. 2 is the data flow schematic diagram adjusting TS stream in prior art;
Fig. 3 is the schematic flow sheet of the method adjusting TS stream of the embodiment of the present invention;
Fig. 4 is the schematic flow sheet that the embodiment of the present invention obtains that bag is long;
Fig. 5 is the schematic flow sheet of first embodiment of the invention single channel table data modification;
Fig. 6 is the schematic flow sheet that second embodiment of the invention single channel specifies that pid data stream is replaced;
Fig. 7 is the schematic flow sheet of the specific pid data Continuity Analysis of third embodiment of the invention and reparation.
Detailed description of the invention
In DTV, all videos, audio frequency, word, picture etc. all become data after being digitized into process, and pack according to the standard of MPEG-2, define the transmission bag of regular length (188 bytes), then these packets are carried out multiplexing, forms transport stream (TS stream). In order to check DTV at some in particular cases to the TS broadcasting situation flowed, it is possible to send DTV to then through Set Top Box after being modified TS stream and play. But, prior art amendment TS flow to and needs demultiplexer and multiplexer less, and the invention provides a kind of method adjusting TS stream, it is not necessary to additional instruments, it is only necessary to computer.No matter it is which kind of operating system computer installs, all can use the mode of the present invention, ASCII stream file ASCII is adjusted, be possible not only to save the cost of hardware, and convenient and simple.
The adjustment of code stream (TS stream) is included herein below:
1) ASCII stream file ASCII that dissimilar bag is long, Intelligent Recognition compatible processing. Realize that 204 bag length are converted to 188 standard bags long.
2) data of unique identifier in ASCII stream file ASCII (PID) are analyzed, it is judged that whether data have disappearance, as found there is discrete date, then discrete date are processed, may select and delete or according to homogeneous data polishing.
3) carrying out the particular data in ASCII stream file ASCII printing analyzing, such as total how many circuit-switched data, which table data have, particular table data particular content etc.
4) certain road pid information is deleted, it is possible to be audio frequency and video or control data, delete and process correlation table data simultaneously, make code stream specification perfect.
5) data message of one group of PID is inserted from other file, it is possible to be audio frequency and video or control data, insert and process correlation table data simultaneously, make code stream specification perfect.
6) capture the control information on specific PID and TID in certain road (table identifier), after it is adjusted, preserve into new file. If table data, the then optional one of PID and TID; If audio, video data, then select PID.
Any Suitable content, all comprises the following steps, referring specifically to accompanying drawing 3;
Step S1: the bag obtaining described TS stream file is long.
Step S2: according to the identifier wrapping long, default packet to be adjusted of described TS stream file and default adjustment instruction, packet to be adjusted in described TS stream file is positioned and adjusts.
Adjust instruction: include amendment, deletion, replacement and Continuity Analysis etc.; Optionally, adjust instruction and also include import file name, export file name. Input file is called the filename of the file needing the data adjusted to constitute, according to import file name, it is possible to simply get the data needing to adjust; Output file is called the filename of the file that the data after adjustment are constituted, according to export file name, it is possible to gives the data creation file after adjusting and gives filename.
The identifier of packet to be adjusted can be PID (unique identifier), and when data to be adjusted are table data, identifier can also is that TID (table identifier).
Step S3: update described TS stream file according to the packet after adjusting, and preserve.
Wherein, the bag length of TS stream file described in step S1 is for having two kinds: 188 bytes and 204 bytes, and the transmission report of 188 bytes being packed into according to the standard of MPEG-2 is more common. Wherein, step S1 obtains the bag length of TS stream file referring to accompanying drawing 4, specifically includes following steps:
Step S21: read in TS stream file, search first synchronous head byte of described TS stream file; In DTV, described first synchronous head byte is generally 0X47.
Step S22: read in 188 bytes; In DTV, the data handbag length in general TS stream file is 188 bytes, it is preferred, therefore, that whether the packet in checking TS stream file is 188 bytes.
Step S23: judging that whether last byte of described 188 bytes is identical with first synchronous head byte, such as whether last byte is 0x47.
Step S24: if the judged result of step S23 is true, namely last byte of described 188 bytes is identical with first synchronous head byte, then judge Bao Changwei 188 byte of described TS stream file, starts success counter, makes success count value add 1.
Step S25: judge that whether success count value is be more than or equal to 3.
Step S26: when the judged result of step S25 is true, namely during success count value >=3, confirms 188 bytes of Bao Changwei; Subsequent step S2 and step S3 performs according to 188 bytes of Bao Changwei.
When the judged result of step S25 is false, namely success count value < when 3, comes back to step S22 and again reads in 188 bytes.
Step S27: if the judged result of step S23 is false, namely last byte of described 188 bytes is different from first synchronous head byte, then start fail counter, and fail count value adds 1.
Step S28: judge that whether fail count value is more than 10;
If fail count value��10, then come back to S21 and again read in TS stream file.
If fail count value > 10, enter step S29.
Step S29: with 204 bytes for wrapping the long judgement step repeating 188 bytes, namely step S21 is jumped to, and in step S22, read in 204 bytes, when last byte of 204 bytes wants the number of times listened be more than or equal to 3 with first synchronous head byte, confirm 204 bytes of Bao Changwei.
Subsequent step S2 and step S3 performs according to 188 bytes of Bao Changwei.
Referring to accompanying drawing 5, one embodiment of the present of invention is the amendment to single channel table data, and in the present embodiment, the identifier adjusting instruction and packet to be adjusted was preset before obtaining bag length. The concrete modification step of the present embodiment is as follows:
Step S101: input data. Input data include the identifier adjusting instruction and packet to be adjusted; Wherein adjust instruction and include notice amendment table, import file name, export file name. It is adjusted it addition, the present embodiment is his-and-hers watches data, so the identifier of packet to be adjusted can be PID (unique identifier), it is also possible to be TID (table identifier).
Step S102: obtain bag long: obtain the long process of bag as shown in Figure 4.
Step S103: read file: search satisfactory packet according to the identifier of bag length and packet to be adjusted;
Step S104: packet is combined into data segment by specification analysis.
Step S105: relative analysis data segment, searches and repeats tables of data.
Step S106: judge whether the tables of data of multiple repetition: if there is the tables of data of multiple repetition, then perform step S107; Otherwise directly perform step S108.
Step S107: select to judge whether to the tables of data of amendment according to user: concrete, user inputs the identifier of tables of data to be modified, PID or TID of such as tables of data, from all tables of data read, find the tables of data needing amendment subsequently according to described tables of data PID or TID, then it is modified.
Step S108: select according to user, print data section is to file. The tables of data needing amendment that user is selected prints, and is stored to file; Concrete optional text mode or binary mode carry out output and modify for user.
Step S109: remind user modify, and etc. result to be modified; Specifically, user checks data that step S108 prints, that need amendment, and the described data needing amendment are modified. When amendment data on a small scale, user according to prompting, can revise table data file, preserve voluntarily after amendment; If whole table is replaced, then can not modify in original, but the table data file that directly offer is new, new table data file is replaced the original data file needing amendment.
Step S110: read in amendment result.
Step S111: judge that whether amendment result is legal; If legal, then enter step S112; Otherwise return to step S109.
Step S112: calculate 32 CRCs (CRC32) according to amended data, and redundancy function is attached to data tail; Table data are packaged into the packet meeting digital television standard again.
Step S113: new data segment is packaged into packet.
Step S114: read original document, more new data packets: be specifically as follows and again read off raw data file, deletes raw data packets, inserts new packet. Insert principle for keeping table transmission frequency constant.
Step S115: preserve file.
Referring to accompanying drawing 6, an alternative embodiment of the invention is that single channel is specified the replacement of pid data stream, and in the present embodiment, the identifier adjusting instruction and packet to be adjusted was preset before obtaining bag length. The concrete modification step of the present embodiment is as follows:
Step S201: input data. Input data include the identifier adjusting instruction and packet to be adjusted; Wherein adjust instruction and include action type, import file name, export file name.
When action type is for inserting, also to input the TS stream file of insertion; When action type is for replacing, also to input the TS stream file of replacement.
When action type is for deleting and replacing, step S201 also includes scanning original document, confirms data type; If manipulation of data stream is table data stream, then scans original document, perform operation by frequency. If being audio and video data streams, then step S201 also includes analyzing relevant each table, including Program Association Table (PAT), Program Map Table (PMT), CAT Conditional Access Table (CAT), BAT bouquet association table (BAT), Event Information Table (EIT), network information table (NIT), SDT Service Description Table (SDT), table performs data analysis one by one, and relevant information carries out the amendment of necessity, insert, and delete.
The identifier of packet to be adjusted includes the PID of packet to be adjusted and the data type of packet to be adjusted.
Step S202: obtain bag long.
Step S203: read the data needing to adjust, it is judged that whether data are table data.
Step S204: analyze correlation table, confirms which needs to adjust.
Step S205: obtain table data one by one, and do corresponding adjustment.
Step S206: confirm all correlation tables to be adjusted and pid data.
Step S207: confirm the PID table data needing to adjust.
All data to be adjusted are adjusted by step S208: again read off file, in the present embodiment, described in be adjusted to replacement.
Step S209: update, preserves file.
Concrete, about step S203: read the data needing amendment, it is judged that whether data are table data; If it is not, then need first to obtain the table data of correspondence, more corresponding table data are modified, namely perform step S204-S206, then arrive step S208; If performing step S207.
Step S208 again reads off file, including analyzing each bag read, according to data prototype, is handled differently. Unrelated with operation, former state writes back; Confirmation before is made an amendment, and writes amended corresponding data. According to demand, insert new data by frequency simultaneously.
Referring to accompanying drawing 7, an alternative embodiment of the invention is the Continuity Analysis to specific pid data stream and reparation, and in the present embodiment, the identifier adjusting instruction and packet to be adjusted was preset before obtaining bag length.The concrete modification step of the present embodiment is as follows:
Step S301: input data, including the identifier (PID) adjusting instruction and packet to be adjusted, adjusts instruction and includes import file name, export file name.
Step S302: obtain bag long.
Step S303: read file, it is judged that the data type that PID is corresponding.
Step S304: scanning file, records continuous counter position (CC) discontinuity point.
Step S305: judge whether the file data read is table data.
Step S306: scanning file, obtains similar table data.
Step S307: with discontinuous table Data Comparison.
Step S308: judge the similar table data of step S306 step acquisition are with whether discontinuous table data in step S307 meet.
Step S309: replace discrete date with partial data.
Step S310: to discontinuity point traversing of probe, obtains relevant discontinuous bag.
Step S311: delete discrete date bag.
Step S312: rescan, is revised as discontinuous CC continuously; It is specially after doing completion or abandoning operation, according to original continuity counter value, revises existing all packets meeting PID, make counting continuous.
Step S313: preserve file.
Concrete, about step S305: judge whether the file data read is table data;
If it is, perform step S306 otherwise, perform step S310;
Concrete, about step S308: judge the step S306 similar table data obtained are with whether discontinuous table data in step S307 meet; If met, then perform step S311, otherwise jump to step S309.
Principle for specific PID Continuity Analysis and reparation is first to attempt completion, if can not completion, then abandon; Particularly as follows: analyze continuous counter position (CC), search discontinuous position, and record discontinuity point and complete package data is extracted in continuous position; According to data before and after discontinuity point contrast, extract incomplete packet, compare with known complete data packet, attempt completion; As can completion, then carry out completion replacement operation. Otherwise discrete date bag is abandoned.
Specifically abandoning principle is: if table data, abandon in units of whole section; If being audio, video data, abandon according to effective audio frequency and video section.
Present invention also offers corresponding with the said method system adjusting TS stream file, this system includes acquisition module, adjusting module and more new module. Acquisition module, the bag for obtaining described TS stream file is long; Adjusting module, for identifier and the default adjustment instruction of to be adjusted packet long, that preset according to wrapping of described TS stream file, positions packet to be adjusted in described TS stream file and adjusts; More new module, for updating described TS stream file according to the packet after adjusting, and preserves.
In one embodiment, adjusting module includes again placement unit, processing unit, adjustment unit and packaged unit. Placement unit, for the identifier according to described packet to be adjusted, captures described packet to be adjusted from described TS stream file; Processing unit, for described packet to be adjusted is processed, obtains all data to be adjusted in described TS stream file; Adjustment unit, for being adjusted described data to be adjusted according to described adjustment instruction; Packaged unit, for the data after adjusting are processed and packed, forms the packet after described adjustment.
In another embodiment, data capture unit includes again splitting subelement and arranging subelement;Split subelement, for described packet to be adjusted is split, obtain data segment; Arrange subelement, for the finish message duplicate removal to described data segment, obtain all data to be adjusted in described TS stream file.
In the present embodiment, when adjusting instruction for replacing new data file, adjustment unit includes the first reading subelement, the first judgment sub-unit, the first replacement subelement and the second replacement subelement;
First reads subelement, for reading described new data file to be replaced;
First judgment sub-unit, for judging the type of described new data file;
First replaces subelement, for when the type of described new data file is table data, directly utilizing described new data file and replace described data to be adjusted;
Second replaces subelement, for being non-table data when the type of described new data file, utilizes described new data file to replace all correlation tables of described data to be adjusted and the identifier of packet.
When adjusting instruction for increasing new data file, adjustment unit includes the second reading subelement, the second judgment sub-unit, the first increase subelement and the second increase subelement;
Second reads subelement, for reading described new data file to be increased;
Second judgment sub-unit, for judging the type of described new data file;
First increases subelement, for when the type of described new data file is table data, according to occurrence frequency, described new data file increases to described data place to be adjusted;
Second increases subelement, for when the type of described new data file is non-table data, described new data file increasing to described data place to be adjusted, and adds all correlation tables of described new data file and the identifier of packet.
Being Continuity Analysis and reparation when adjusting instruction, adjustment unit includes scanning subelement, the first extraction subelement, the second extraction subelement and completion unit;
Scanning subelement, for described data to be adjusted are scanned, and records discontinuity point;
First extracts subelement, is used for from the complete package data of the described continuous position of extracting data to be adjusted as complete packet;
Second extracts subelement, for the front and back data according to described discontinuity point, extracts incomplete packet;
Completion subelement, for whether judge can incomplete packet described in completion according to described complete packet; If so, completion is then carried out; If it is not, then delete described incomplete packet.
First packaged unit includes again checking subelement, computation subunit and the first packing subelement;
Check subelement, be used for the legitimacy of the table data after checking described adjustment;
Computation subunit, for when the table data after described adjustment are legal, calculating 32 cyclic redundancy check codes according to the table data after described adjustment, and described effect code be attached to the table tail of the table data after described adjustment;
First packing subelement, for the table data after described adjustment being packed according to digital television standard, forms the packet after described adjustment.
According to the above it can be seen that the method have the advantages that
1) do not rely on any additional hardware, only can complete all redjustment and modification operation with computer;
2) quickly amendment adjusts ASCII stream file ASCII, efficiently completes complicated test environment simulation;
3) simple to operate, upper quick-moving, simple study and operable;
4) cross-cutting, as long as meet the ASCII stream file ASCII of digital television standard, no matter it is wired, ground, satellite all can realize adjusting.
Although the present invention is with preferred embodiment openly as above; but it is not for limiting the present invention; any those skilled in the art are without departing from the spirit and scope of the present invention; may be by the method for the disclosure above and technology contents and technical solution of the present invention is made possible variation and amendment; therefore; every content without departing from technical solution of the present invention; according to any simple modification, equivalent variations and modification that above example is made by the technical spirit of the present invention, belong to the protection domain of technical solution of the present invention.

Claims (10)

1. the method adjusting TS stream file, it is characterised in that comprise the following steps:
The bag obtaining described TS stream file is long;
The identifier of the packet to be adjusted that the bag according to described TS stream file is long, preset and default adjustment instruction, position packet to be adjusted in described TS stream file and adjust;
Update described TS stream file according to the packet after adjusting, and preserve.
2. the method adjusting TS stream file according to claim 1, it is characterized in that, the identifier of the packet to be adjusted that the bag according to described TS stream file is long, preset and default adjustment instruction, packet to be adjusted in described TS stream file is positioned and adjusts, comprises the following steps;
Identifier according to described packet to be adjusted, captures described packet to be adjusted from described TS stream file;
Described packet to be adjusted is processed, obtains all data to be adjusted in described TS stream file;
According to described adjustment instruction, described data to be adjusted are adjusted;
Data after adjusting are processed and pack, forms the packet after described adjustment.
3. the method adjusting TS stream file according to claim 2, it is characterised in that described packet to be adjusted is processed, obtains all data to be adjusted in described TS stream file, comprise the following steps:
Described packet to be adjusted is split, obtains data segment;
Finish message duplicate removal to described data segment, obtains all data to be adjusted in described TS stream file.
4. according to claim 2 adjust TS stream file method, it is characterised in that described adjustment instruction for replace new data file, described according to adjust instruction described data to be adjusted are adjusted, comprise the following steps:
Read described new data file to be replaced;
Judge the type of described new data file;
If the type of described new data file is table data, then directly utilizes described new data file and replace described data to be adjusted;
If the type of described new data file is non-table data, then described new data file is utilized to replace all correlation tables of described data to be adjusted and the identifier of packet.
5. according to claim 2 adjust TS stream file method, it is characterised in that described adjustment instruction for increase new data file, described according to adjust instruction described data to be adjusted are adjusted, comprise the following steps:
Read described new data file to be increased;
Judge the type of described new data file;
If the type of described new data file is table data, then according to occurrence frequency, described new data file increased to described data place to be adjusted;
If the type of described new data file is non-table data, then described new data file is increased to described data place to be adjusted, and adds all correlation tables of described new data file and the identifier of packet.
6. according to claim 2 adjust TS stream file method, it is characterised in that described adjustment instruction is Continuity Analysis and reparation, described according to adjust instruction described data to be adjusted are adjusted, comprise the following steps:
Described data to be adjusted are scanned, and record discontinuity point;
From the complete package data of the described continuous position of extracting data to be adjusted as complete packet;
Front and back data according to described discontinuity point, extract incomplete packet;
Whether judge can incomplete packet described in completion according to described complete packet;
If so, completion is then carried out;
If it is not, then delete described incomplete packet.
7. the method adjusting TS stream file according to claim 2, it is characterised in that the table data after adjusting are processed and pack, forms the packet after described adjustment, comprise the following steps:
Check the legitimacy of the table data after described adjustment;
If legal, then calculate 32 cyclic redundancy check codes according to the table data after described adjustment, and described effect code is attached to the table tail of the table data after described adjustment;
Afterwards, according to digital television standard, the table data after described adjustment are packed, form the packet after described adjustment.
8. adjust a system for TS stream file, including acquisition module, adjusting module and more new module;
Described acquisition module, the bag for obtaining described TS stream file is long;
Described adjusting module, for identifier and the default adjustment instruction of to be adjusted packet long, that preset according to wrapping of described TS stream file, positions packet to be adjusted in described TS stream file and adjusts;
Described more new module, for updating described TS stream file according to the packet after adjusting, and preserves.
9. the system adjusting TS stream file according to claim 8, it is characterised in that described adjusting module includes placement unit, processing unit, adjustment unit and packaged unit;
Described placement unit, for the identifier according to described packet to be adjusted, captures described packet to be adjusted from described TS stream file;
Described processing unit, for described packet to be adjusted is processed, obtains all data to be adjusted in described TS stream file;
Described adjustment unit, for being adjusted described data to be adjusted according to described adjustment instruction;
Described packaged unit, for the data after adjusting are processed and packed, forms the packet after described adjustment.
10. the system adjusting TS stream file according to claim 9, it is characterised in that described processing unit includes splitting subelement and arranging subelement;
Described fractionation subelement, for described packet to be adjusted is split, obtains data segment;
Described arrangement subelement, for the finish message duplicate removal to described data segment, obtains all data to be adjusted in described TS stream file.
CN201610204525.6A 2016-04-01 2016-04-01 TS (transport stream) file adjusting method and TS file adjusting system Pending CN105657457A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610204525.6A CN105657457A (en) 2016-04-01 2016-04-01 TS (transport stream) file adjusting method and TS file adjusting system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610204525.6A CN105657457A (en) 2016-04-01 2016-04-01 TS (transport stream) file adjusting method and TS file adjusting system

Publications (1)

Publication Number Publication Date
CN105657457A true CN105657457A (en) 2016-06-08

Family

ID=56496811

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610204525.6A Pending CN105657457A (en) 2016-04-01 2016-04-01 TS (transport stream) file adjusting method and TS file adjusting system

Country Status (1)

Country Link
CN (1) CN105657457A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534981A (en) * 2016-11-28 2017-03-22 湖南国科微电子股份有限公司 Method and device for generating code stream file for set-top box testing

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040004560A1 (en) * 2000-09-11 2004-01-08 Satoshi Okamoto Stream decoder
CN101904168A (en) * 2007-08-08 2010-12-01 迈凌有限公司 TS package trimming
CN202587238U (en) * 2012-05-17 2012-12-05 安徽天虹数码技术有限公司 Transport stream (TS) subtitle insertion system
CN103686443A (en) * 2013-12-02 2014-03-26 浙江宇视科技有限公司 A method and device for improving TS stream sorting ability

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040004560A1 (en) * 2000-09-11 2004-01-08 Satoshi Okamoto Stream decoder
CN101904168A (en) * 2007-08-08 2010-12-01 迈凌有限公司 TS package trimming
CN202587238U (en) * 2012-05-17 2012-12-05 安徽天虹数码技术有限公司 Transport stream (TS) subtitle insertion system
CN103686443A (en) * 2013-12-02 2014-03-26 浙江宇视科技有限公司 A method and device for improving TS stream sorting ability

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
夏刊: "TS流复用的软件实现", 《2005国际有线电视技术研讨会》 *
沈智鹏等: "DVB系统中TS流的软件复用关键技术与实现", 《电视技术》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534981A (en) * 2016-11-28 2017-03-22 湖南国科微电子股份有限公司 Method and device for generating code stream file for set-top box testing
CN106534981B (en) * 2016-11-28 2019-07-16 湖南国科微电子股份有限公司 A kind of generation method and generating means of the ASCII stream file ASCII of set top box testing

Similar Documents

Publication Publication Date Title
CN105657457A (en) TS (transport stream) file adjusting method and TS file adjusting system
JP3932123B2 (en) Structured data receiving program, structured data receiving apparatus, and structured data receiving method
JP3932131B2 (en) Structured data transmission apparatus and structured data transmission method
JP3932122B2 (en) Structured data receiving program, structured data receiving apparatus, and structured data receiving method
US8418213B2 (en) Method for providing contents referencing information for personal data broadcasting service and receiving apparatus and processing method
JP3932129B2 (en) Structured data transmission apparatus and structured data transmission method
JP3932128B2 (en) Structured data transmission apparatus and structured data transmission method
JP2004180258A (en) Transmitting device of structured data
JP3932120B2 (en) Structured data receiving program, structured data receiving apparatus, and structured data receiving method
JP3932137B2 (en) Structured data transmission apparatus and structured data transmission method
JP3932130B2 (en) Structured data transmission apparatus and structured data transmission method
JP3932135B2 (en) Structured data transmission apparatus and structured data transmission method
JP2005063453A (en) Transmission device for structured data
JP2007095082A (en) Reception program for structured data
JP2005011374A (en) Device for transmitting structured data
KR20170096884A (en) Method and apparatus for transmitting and receiving multimedia services
JP2005063452A (en) Transmission device for structured data
JP2004320685A (en) Receiver for structured data
JP2004318771A (en) Receiver of structured data
JP2004318772A (en) Receiver of structured data
JP2004320689A (en) Receiver for structured data
JP2004320684A (en) Receiver for structured data
JP2004320686A (en) Receiver for structured data
JP2004320688A (en) Receiver for structured data
JP2004318775A (en) Receiver of structured data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160608