WO2019219056A1 - Ts processing method and device - Google Patents
Ts processing method and device Download PDFInfo
- Publication number
- WO2019219056A1 WO2019219056A1 PCT/CN2019/087205 CN2019087205W WO2019219056A1 WO 2019219056 A1 WO2019219056 A1 WO 2019219056A1 CN 2019087205 W CN2019087205 W CN 2019087205W WO 2019219056 A1 WO2019219056 A1 WO 2019219056A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- stream
- identifier
- packets
- packet
- streams
- 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.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/438—Interfacing the downstream path of the transmission network originating from a server, e.g. retrieving encoded video stream packets from an IP network
- H04N21/4385—Multiplex stream processing, e.g. multiplex stream decrypting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/41—Structure of client; Structure of client peripherals
- H04N21/426—Internal components of the client ; Characteristics thereof
Definitions
- the present application relates to the field of digital multimedia technologies, and in particular, to a method and an apparatus for processing a TS stream.
- MPEG-2 (based on digital storage media moving image and voice compression standards) is an image compression standard developed by ISO/IEC/JTC1/SC29/WG11, which is adapted to the generation, editing, storage, transmission and display of digital television programs. Developed for comprehensive requirements, it is widely used in digital TV broadcasting and DVD. At present, multimedia programs such as television programs are basically compressed and packaged by the MPEG-2 standard to form a TS stream (Transport Stream). The TS stream is channel-coded and modulated and transmitted to the channel for transmission.
- the digital multimedia receiving device When the user views the multimedia program, the digital multimedia receiving device extracts the TS stream corresponding to the multimedia program selected by the user from the plurality of TS streams according to the PID (Package Identification) of the TS stream corresponding to the multimedia program selected by the user. And decrypting the program content in the TS stream, and the decrypted program content can be played for the user to watch.
- PID Package Identification
- the digital multimedia receiving device needs to extract the TS stream of the multi-channel multimedia program and decrypt the program content in the multi-channel TS stream.
- the purpose of the present application is to provide a TS stream processing method and apparatus for decrypting multiple TS streams to realize playback or recording of multimedia programs corresponding to multiple TS streams.
- the present application provides a TS stream processing method, which includes separately distinguishing TS packets in the acquired multiple TS streams to form a plurality of TS packets and a first identifier.
- the second distinguishing identifier is a plurality of TS data packets, the first distinguishing identifier is used to identify the first road TS stream, and the second distinguishing identifier is used to identify the second road TS stream;
- the plurality of TS packets that are identified by the two are decrypted; and the plurality of decrypted TS packets are classified and packaged according to the distinguishing identifier to form a multi-channel program.
- FIG. 1 is a schematic diagram of a TS stream data format description
- FIG. 2 is a schematic diagram of a broadcast receiving apparatus according to an embodiment of the present application.
- 3a is a schematic diagram of a transmission of a TS packet in a two-way TS stream according to an embodiment of the present application
- FIG. 3b is a schematic diagram of another transmission of a TS packet in a two-way TS stream according to an embodiment of the present application.
- 3c is a schematic diagram of combined transmission of TS data packets in two TS streams according to an embodiment of the present application
- FIG. 4 is another schematic diagram of a broadcast receiving apparatus according to an embodiment of the present application.
- FIG. 5 is a third schematic diagram of a broadcast receiving apparatus according to an embodiment of the present application.
- FIG. 5b is a fourth schematic diagram of a broadcast receiving apparatus according to an embodiment of the present disclosure.
- FIG. 6 is a schematic diagram of steps of a TS stream processing method according to an embodiment of the present application.
- 6b is a schematic diagram of steps of performing TS stream processing on two TS streams in the embodiment of the present application.
- FIG. 7 is a schematic diagram of a step of determining a transmission rate of a TS packet that distinguishes an identifier according to an embodiment of the present application
- FIG. 8 is a schematic diagram of determining a first transmission rate of a TS packet that distinguishes an identifier according to an embodiment of the present application
- FIG. 9 is a schematic diagram of determining a second transmission rate of a TS packet that distinguishes an identifier according to an embodiment of the present application.
- FIG. 10 is a schematic diagram of a CI mode determination process in an embodiment of the present application.
- FIG. 11 is a fifth schematic diagram of a broadcast receiving apparatus according to an embodiment of the present disclosure.
- FIG. 12 is a schematic flowchart diagram of a TS stream processing method provided by an embodiment of the present application.
- the two-way TS stream is used as an example for description, and the situation of the multi-channel TS stream is similar to that of the two paths, and no redundant description is made.
- the TS stream digital TV set-top box receives a segment of code stream, and each TS stream carries some information, such as Video, Audio, and PAT (Program Association Table), PMT (Program Map Table, which we need to learn). Program map table and other information.
- the TS stream is constructed as shown in FIG. 1.
- the TS stream is a packet-based bit stream format, and each packet is 188 bytes or 204 bytes. For 204 bytes, a 16-byte CRC (Cyclic Redundancy Check) check data is added after 188 bytes, and the other formats are the same.
- CRC Cyclic Redundancy Check
- the synchronization identifier is a transmission identifier under the MPEG-2 TS transmission standard, which is usually a fixed value of 0x47;
- the PID information is a unique identifier in the TS stream, and the content of the data packet in the TS stream is determined by it. For example, if the PID of the packet header information of a packet in a TS stream is 0x0000, the data of this packet is the PAT table in DVB (Digital Video Broadcasting).
- DVB Digital Video Broadcasting
- the apparatus includes at least an identification unit 30, a TS stream reconstruction unit 40, and a decryption unit 50.
- the identifier unit 30 is configured to separately distinguish and identify the TS data packets in the acquired multiple TS streams, and form a plurality of TS data packets having the first differentiated identifier and the plurality of TS data packets of the second differentiated identifier, where the first The distinguishing identifier is used to identify the first TS stream, and the second distinguishing identifier is used to identify the second TS stream.
- the multipath is greater than or equal to two.
- the decryption unit 50 decrypts the plurality of TS packets having the first distinguishing identifier and the second distinguishing identifier in a time division manner.
- the TS stream reconstruction unit 40 is configured to classify and encapsulate the decrypted plurality of TS packets according to the distinguishing identifier.
- the apparatus may further include a plurality of demodulator 10, a storage unit 20, and a decoder 60.
- Each demodulator 10 is used to demodulate its received broadcast television signal to form a multiplexed TS stream.
- the storage unit 20 stores the multiplex TS streams output from the plurality of demodulator 10.
- the decoder 60 is operative to decode the repackaged multiplexed TS streams to form a multiplexed program.
- the multiplexed TS stream is input to the storage unit 20.
- the identification unit 30 distinguishes the TS packets of the multiple TS streams stored in the storage unit 20 to determine which TS streams each of the TS packets in the multiple TS streams originate from, and further differentiates the identified TS packets. And sent to the decryption unit 50 according to the chronological order of the first in first out, and based on a certain transmission rate.
- the decryption unit 50 decrypts the differentiated TS stream according to its preset decryption rule, and transmits the decrypted TS packet to the TS stream reconstruction unit 40 after decryption.
- the TS stream reconstruction unit 40 distinguishes the decrypted TS packets according to the distinguishing identifier, and repackages the TS packets belonging to the same TS stream into one TS stream.
- the final decoder 60 decodes the repackaged TS packets to form a multiplexed program.
- one decryption unit can only decrypt one TS packet at a time, as shown in FIG. 3a, at time t, one TS packet of Packet TS1 and one TS packet of TS2, Packet2-
- the decryption unit cannot decrypt the received data packets Packet1-1 and Packet2-1 at the same time.
- the decryption unit receives the packet Packet1-1, and if at time t2, the decryption unit further receives the TS packet Packet2-1 of TS2, at this time, the decryption unit is working on the TS packet.
- Packet1-1 performs processing, and the decryption unit cannot receive and process the packet Packet2-1, which inevitably causes processing conflicts between the data packets, causing partial data packets to be lost or unable to be decrypted, thereby affecting the integrity of the TS stream data. , affecting users to watch or record TV shows.
- a storage unit 20 is added between the demodulator 10 and the decryption unit 50, and the storage unit 20 will receive TSs of the multiple TS streams.
- the data packets are stored and sorted in the order of receiving time, and the stored TS data packets are sent to the identification unit 30 in the stored order and differentiated and identified by the TS data packets, thereby avoiding the transmission of TS data packets in different TS streams. Time conflict issues.
- the two TS data packets are two data packets stored adjacent to each other, but the storage is not required.
- Those skilled in the art can also adopt other judgment mechanisms to specify the storage order of the two TS packets in this case.
- the TS packets of the multiple TS streams form a new data stream in the receiving order, and then the data stream is identified and sent to the decryption unit for decryption.
- the decryption unit performs the same data packet of Packet 1-1, Packet 1-2, and Packet 1-3 from the same TS stream in the newly formed data stream according to the distinguishing identifier. Decryption rules are decrypted; Packet 2-1, Packet 2-2, and Packet 2-3 from another TS stream are decrypted according to another decryption rule.
- the TS packet in the multi-channel TS stream reconstructs a new data stream
- the corresponding transmission rate of the new data stream needs to be adjusted and changed accordingly, and the adjustment and change are specifically described in the following contents. And examples, not to describe too much here.
- the identifier unit 30 is specifically configured to: identify the synchronization identifier in the header information of the TS packet in the multiple TS streams by using a differentiated identifier, for example, in the header information of the TS packet in the two TS streams.
- the synchronization identifier is modified to be the first identifier or the second identifier, so that the identifiers of the TS packets belonging to the same TS stream are the same.
- the inherent synchronization identifier is 0x47, and different changes can be made to the synchronization identifiers in the TS packet header information in different TS streams.
- the synchronization identifier in the header information can be changed to 0x48; the synchronization identifier in the TS packet of the other TS stream can be changed to 0x49.
- the TS reconstruction unit 40 is specifically configured to: according to the modified synchronization identifier, identify which TS stream the TS packet is derived from after decryption, and re-encapsulate the TS packet originating from the same TS stream into one TS stream.
- the decoder can only recognize TS packets whose synchronization identifier is eigenvalue 0x47, TS packets that are identified as 0x48 and 0x49 after the change are not recognized. Therefore, the TS reconstruction unit 40 receives the decrypted TS data packet sent by the decryption unit 50, and distinguishes the TS data of the identifier after decryption according to the classification rule of the TS data packet (ie, the changed synchronization identifier: eg, 0x48, 0x49, etc.) The packet is distinguished, and the synchronization identifier (e.g., 0x48, 0x49, etc.) of the TS packet is changed to the original synchronization identifier (0x47) so that it can satisfy the inherent protocol standard and output to the decoder 60 to form a multi-channel program.
- the synchronization identifier e.g., 0x48, 0x49, etc.
- the TS reconstruction unit 40 is specifically configured to: determine, according to the first distinguishing identifier, a path of the multiple TS streams to which the decrypted plurality of TS data packets originally belong, and encapsulate the TS data packet of the first differentiated identifier into A TS stream, and modifying the synchronization identifier of the encapsulated TS stream to a pre-change TS stream synchronization identifier.
- the synchronization identifiers of the plurality of decrypted TS packets are modified as the pre-change TS stream synchronization identifier as an example for detailed description.
- the identification unit 30 and the TS stream reconstruction unit 40 have a channel for transmitting data information to each other, so that the TS stream reconstruction unit 40 can acquire the distinguishing rule of the TS packet from the identifier unit 30, and according to the distinguishing rule. And identifying which TS stream each of the decrypted TS packets originates from, and re-packaging the TS packets that are derived from the same TS stream after decryption into one TS stream.
- the identification unit 30 changes the synchronization identifier of the TS1 packet from 0x47 to 0x48, the synchronization identifier of the TS2 packet is changed from 0x47 to 0x49; and the TS stream reconstruction unit passes the information channel from the identification unit.
- the identification rule is obtained in 30, and the packet with the synchronization identifier 0x48 in the decrypted TS packet is changed to 0x47 and re-encapsulated as TS1, and the packet whose synchronization identifier is 0x49 is changed to 0x47 and re-encapsulated as TS2.
- the functions of the storage unit 20, the identification unit 30, and the TS stream reconstruction unit 40 can be implemented by an integrated chip (i.e., the TS data processing chip 70).
- the multiple TS streams are all encrypted TS streams.
- the multimedia receiving apparatus provided by the solution can decrypt the multiplexed TS stream based on a decryption unit.
- the solution of the present application will still use multiple TSs.
- the TS packets in the stream are differentiated, and the TS packets that distinguish the identifiers are sent to the decryption unit in chronological order.
- the decryption unit selectively decrypts the TS packets that need to be decrypted according to the distinguishing identifier, and decrypts the identifiers after decryption.
- the TS packet then changes its synchronization identifier to the synchronization identifier inherent in the existing standard protocol to form a multi-channel program.
- the judging module may be added before the identifier is distinguished, and then the received TS stream is determined to be an encrypted stream. If it is an encrypted stream, the distinguishing identifier is performed. Otherwise, the non-encrypted TS stream is directly output to the decoder. This is not too restrictive.
- IIC Inter-Integrated Circuit
- the system chip controls the demodulator 10 through the IIC, sets the data format of the output TS stream and the channel to be demodulated, and the demodulator 10 controls the channel through the IIC control Tuner, and the Tuner takes the frequency of the demodulator 10
- the IF/IQ signal is transmitted to the demodulator 10 for demodulation; the demodulator 10 transmits the demodulated encrypted TS stream (such as TS1 and TS2 in FIG. 2) to the storage unit 20; and the system chip passes the IIC control flag.
- the unit 30 is configured to enable the identification unit 30 to distinguish the TS packets in the TS1 and the TS2 received by the storage unit 20, and the TS packets having different distinguishing identifiers form a new data stream (ie, the MS stream in FIG. 2 and FIG. 4).
- the new data stream is sent to the decryption unit 50, which in turn decrypts the new data stream formed by the TS packets having different distinguishing identities. .
- the decryption unit 50 may be a CI card, which is also called a CAM (Conditional Access Module) card, and refers to a module for decrypting a digital multimedia program signal.
- the TV operator authorizes the CAM demodulator manufacturer to enable the CAM manufacturer to add descrambling in a certain way, and the encryption and decryption mode descrambles and scrambles the encrypted payment signal issued by the operator. Decrypt encryption. Therefore, users can watch different payment signals issued by different operators by replacing different CAM cards.
- the CI card is dedicated to digital TV cards or high-end set-top boxes and can be used for cable digital TV cards and satellite digital TV cards. It can also be used for set-top boxes with separated machine cards, digital TV integrated machines, and so on.
- the TS stream reconstruction unit 40 classifies and encapsulates the decrypted plurality of TS packets according to the distinguishing identifier.
- the decoder 60 is configured to decode the plurality of TS data packets of the classification package to form video data, audio data, and other data.
- the decoder 60 decodes and splits the TS stream into video data, audio data, and other data according to the PID information in the header information of the TS packet.
- the decoder splits the decrypted TS stream into video data and audio data for display and playback, respectively.
- IF Intermediate Frequency
- IQ In-phase Quadrature
- DVB-S2 DVD-Satellite-Second Generation, a second generation satellite digital video broadcasting
- DVB-T2 DVD-Second Terrestrial, second generation terrestrial digital video broadcasting
- DVB-C DVD-Cable, cable digital video broadcasting
- a tuner is used to receive the above DVB-S2, DVB-T2
- the /C signal is sent to the demodulator 10 for demodulation.
- the tuner receives the signal (DVB-S2, DVB-T2/C), and sends the signal to the demodulator 10 in the form of IQ and IF signals, and the demodulator 10 acquires the corresponding signal according to the received signal.
- the TS stream is simultaneously determined according to the PID of the TS stream corresponding to the multimedia program information selected by the user, and the TS packet to be decrypted to be sent to the decryption unit 50;
- the storage unit 20 connected to the output of the demodulator 10 receives the TS a data packet, and the identification unit 30 separately distinguishes the TS data packets in the acquired multiple TS streams;
- the decryption unit 50 receives the TS data packets of the differentiated identifiers sent by the storage unit, and separately distinguishes the data packets in the different time periods.
- the identified TS packet is decrypted. Further, the decryption unit 50 sends the decrypted differentiated identifier TS packet to the TS stream reconstruction unit 40 through the output end, and the TS stream reconstruction unit 40 decrypts the identifier according to the differentiated identification rule.
- the differentiated identified TS packets are differentiated and form a decrypted multiplexed TS stream that is sent to decoder 60 to form a multiplexed program for playback or/and recording.
- the storage unit, the identification unit, the TS stream reconstruction unit, and the decoder are integrated into a system on chip SOC (System on Chip) 80.
- the system chip SOC 80 includes the functions and functions of the above units. Specifically, when the multiplexed TS stream is demodulated by the demodulator 10, the multiplexed TS stream is input and stored in the system chip SOC 80.
- the system chip SOC 80 performs differential identification on the TS packets of the multiple TS streams to determine which TS streams each of the TS packets in the multiple TS streams originate from, and further differentiates the identified TS packets according to the advanced first. The chronological order is sent to the decryption unit 50 based on a certain transmission rate.
- the decryption unit 50 decrypts the differentiated TS stream according to its preset decryption rule, and transmits the decrypted TS packet back to the system chip SOC 80.
- the system chip SOC 80 distinguishes the decrypted TS data packets according to the distinguishing identifier, and repackages the TS data packets belonging to the same TS stream into one TS stream to form a packaged multiple TS stream, and finally repackages the multiple channels.
- the TS stream is decoded to form a multi-channel program.
- the identification unit, the TS stream reconstruction unit, and the decoder are integrated into a system on chip SOC (System on Chip) 80.
- the memory unit is located outside of the system chip SOC.
- the storage unit includes a first end, a second end, and a third end.
- the first end of the storage unit includes at least one input that is respectively coupled to at least one output of the demodulator.
- the second end of the storage unit includes at least one output end, the at least one output end being respectively connected to at least one input end of the SOC chip.
- the third end of the storage unit is connected to the decryption unit.
- the decryption unit is also connected to the SOC chip through the CMD interface.
- the TS packets in the two TS streams are separately marked in the storage unit, and the marked TS packets are further distinguished. It may be sent to the decryption unit according to the chronological order of the first in first out, and based on a certain transmission rate, and the decryption unit decrypts the sent TS data packet according to its preset decryption rule, and decrypts the decrypted TS data after decryption.
- the packet is sent back to the storage unit, and the TS packets from the two TS streams are re- distinguished according to the rule of distinguishing the mark in the storage unit, that is, the original two-way data is restored, and then the subsequent processing is performed to form two program outputs. .
- the method for decrypting multiple TS streams includes the following steps S1-S3.
- Step S1 Perform differential identification on the TS packets in the obtained multiple TS streams to form a plurality of TS data packets having the first distinguishing identifier and a plurality of TS data packets of the second distinguishing identifier, where the first distinguishing identifier It is used to identify the first TS stream, and the second distinguishing identifier is used to identify the second TS stream.
- each radio frequency signal corresponds to one TS stream
- each TS stream further includes a single program TS stream corresponding to at least one television program
- each single program TS stream corresponding to each television program has a corresponding PID.
- each program signal corresponds to one TS stream.
- the user may have the need to simultaneously watch the program and record another program, which requires a decryption unit for two or more channels.
- the TS stream is decrypted.
- each TS packet in the received TS stream is identified to determine which TS stream each TS packet belongs to, and the decrypted TS packet can be re-encapsulated according to the TS stream to which the identification identifier belongs.
- the synchronization identifier in the header information of the TS packet can be changed.
- the inherent synchronization identifier is 0x47, and different changes can be made to the synchronization identifiers in the TS packet header information in different TS streams. Taking two paths as an example, in the TS packet in the first TS stream, the synchronization identifier in the header information can be changed to 0x48; the synchronization identifier of the TS packet in the second TS stream can be changed to 0x49.
- the SOC chip After the decryption unit decrypts the differentiated TS packet, the SOC chip repackages the TS packet with the synchronization identifier 0x48 into the first TS stream according to the synchronization identifier, and identifies the TS packet with the synchronization identifier as 0x49. Repackaged into a second TS stream.
- Step S2 Demultiplexing a plurality of TS data packets having a first distinguishing identifier and a second distinguishing identifier in a time division manner.
- TVs are digital cable TVs that support cable digital TV reception.
- current digital cable TVs have encryption protection and need to be decrypted using a decryption unit (ie, digital TV smart card) designated by the local radio and television department.
- a decryption unit ie, digital TV smart card
- the decryption unit Transmitting the TS packet with the differentiated identifier to the decryption unit for decrypting the program TS stream, and the decryption unit decrypts the encrypted TS packet separately according to a decryption rule preset by the radio and television department or a related manufacturer, and then The decrypted TS packets are sent to the SOC chip to form a corresponding program.
- Step S3 classifying and packaging the decrypted plurality of TS data packets according to the distinguishing identifier to form a multi-channel program.
- the SOC chip can only receive and identify the TS stream data with the synchronization identifier of 0x47, the TS packets with the modified synchronization identifiers of 0x48 and 0x49 are not recognized, and the SOC chip is difficult to output normally.
- the program is for the user to watch or/and record. Therefore, the SOC chip receives the decrypted TS packet transmitted by the decryption unit, and distinguishes the decrypted TS packet according to the division rule of the TS packet, and changes the distinguishing identifier to the original identifier.
- the SOC chip determines, according to the synchronization identifier change rule, the TS stream to which the TS packet originally belongs, and the TS data originally belonging to the same TS stream.
- the packet is again encapsulated into one TS stream, and the synchronization identifier of the TS stream before the change is restored, that is, the synchronization identifier (such as 0x48, 0x49, etc.) of the TS packet is changed to the inherent synchronization identifier (0x47) of the TS stream before the modification, so that the packet can satisfy
- the inherent protocol standard is output to the SOC chip to form a multi-channel program.
- the intrinsic synchronization identifier refers to the synchronization identifier of the packet header information of the TS stream under the existing standard protocol, which is a fixed value of 0x47.
- the TS packets having the same synchronization identifier are arranged in chronological order into one data stream to form a one-way program.
- the decrypted data stream can be split into two data streams according to different synchronization identifiers.
- one way is the TS packet whose synchronization identifier is changed to 0x48, and then the synchronization identifier in the TS packet is changed to the eigenvalue 0x47 to form the decrypted TS1; the other is the TS data whose synchronization identifier is changed to 0x49.
- the packet changes the synchronization identifier in the TS packet to an eigenvalue of 0x47 to form the decrypted TS2. Further, the decrypted TS1 and TS2 respectively form corresponding programs for playback or recording.
- the TS data packets in the TS streams output by the demodulator are differentiated and identified, and the TS packets that distinguish the identifiers form a new data transmission stream. Sending the new data transmission stream to the decryption unit for decryption, and then, after decrypting the decryption unit, receiving the TS packet of the decrypted differentiated identifier, and according to the differentiated identification rule, the TS packet of the decrypted differentiated identifier Differentiate to form a multi-channel program.
- the TS stream when decrypting the TS packet in the new data transmission stream, the TS stream can be decrypted by setting a decryption unit in the digital multimedia receiving device, thereby simplifying the digital multimedia receiving device.
- the structure reduces the cost of the digital multimedia receiving device.
- the PID of the TS stream corresponding to the required multimedia program can be obtained, and the TS packet required for decryption is obtained according to the PID of the TS stream corresponding to the required multimedia program.
- the PID of the TS stream corresponding to the required multimedia program may correspond to a plurality of programs, such as one TS stream corresponding to CCTV1 and CCTV5; and the user selects to watch the CCTV5 program, according to the PID information from the TS stream and the CCTV5 program. Corresponding TS packets.
- the TS stream processing method provided by the embodiment of the present application is described in detail below by taking two TS streams as an example. As shown in FIG. 7, the TS stream processing method includes the following steps S200-S203.
- Step S200 Acquire a first TS stream and a second TS stream.
- the first TS stream and the second TS stream are obtained from the plurality of TS streams generated by the demodulator.
- Step S201 distinguishing between the first type TS packet from the first TS stream and the second type TS packet from the second TS stream.
- each radio frequency signal corresponds to one TS stream
- each TS stream further includes a single program TS stream corresponding to at least one television program
- each single program TS stream corresponding to each television program has a corresponding PID.
- each program signal corresponds to one TS stream.
- the user may have the need to simultaneously watch the program and record another program, which requires decrypting the two TS streams at the same time.
- the synchronization identifier in the header information of the TS packet can be changed.
- the inherent synchronization identifier is 0x47, and different changes can be made to the synchronization identifiers in the TS packet header information in different TS streams.
- the synchronization identifier in the header information can be changed to 0x48; the other channel can be changed to 0x49.
- TS packets from one of the TS streams as the first type of TS packets
- TS packets from the other TS stream as the second type of TS packets
- Step S202 transmitting the first type TS data packet and the second type TS data packet that have been marked differently to a CI card in a serial manner; the CI card sequentially decrypts the received data packet; The CI card decrypts the first type of TS data packets in some time periods, and decrypts the second type of TS data packets in other time periods;
- a specific case is that the first type of TS packets that have been subjected to the distinguishing flag are placed in the first queue, and the second type of TS packets that have been subjected to the distinguishing flag are placed in the second queue, from the The first queue and the second queue alternately take one TS packet and send it to the one CI card for decryption. It can be simply understood that the CI card is time division multiplexed.
- the temporary TS stream is discontinuous, which may cause the first queue or the second queue to temporarily have no TS packets; for the purpose of synchronization, if the TS packet is taken If the state of the first queue or the second queue is just empty, add an empty packet with a distinguishing mark to the empty first queue or the second queue at this time; There is no content after decryption.
- the first step the CI card starts to work; determine whether the first queue has at least one TS packet; if so, jump to the second step, if not, jump to the third step.
- the second step taking the first TS packet of the first queue to decrypt in the CI card, and then jumping to the third step;
- Step 3 Determine whether the second queue has at least one TS packet; if yes, jump to the fourth step, if not, jump to the fifth step.
- the fourth step taking the first TS packet of the second queue to decrypt in the CI card; then jumping to the sixth step.
- Step 5 Add an empty TS packet to the second queue to decrypt in the CI card; then jump to the sixth step.
- Step 6 Determine whether the first queue has at least one TS packet; if yes, jump to the second step, if not, jump to the seventh step.
- Step 7 Add an empty TS packet to the first queue to decrypt in the CI card; then jump to the third step.
- Step S203 Differentiate the decrypted first type TS data packet and the second type TS data packet according to the rule of distinguishing the mark to form a two-way program output.
- the decrypted first type TS packet and the second type TS packet are distinguished, and the original two TS streams are restored, and subsequent processing is performed to form two program outputs.
- These two programs can be used for live broadcast and program recording.
- the SOC chip receives the decrypted TS data packet sent by the CI card, and distinguishes the decrypted first type TS data packet from the second type TS data packet according to the distinguishing rule of the TS data packet to form two programs. Output.
- the synchronization identifier in the header information is changed, the TS packets of the same synchronization identifier are arranged in chronological order into one data stream to form a program.
- the synchronization identifier of one packet header information is changed to 0x48, and the other path is changed to 0x49, after decryption, the TS packet with the synchronization identifier of 0x48 is re-formed as one data stream output.
- the TS packet whose synchronization is identified as 0x49 is reformed to form another data stream output.
- TS-1 and TS-2 are obtained from the TS stream according to the PID of TS-1 and the PID of TS-2, where TS-1 and TS-2 may be located in the same TS stream, TS-1 And TS-2 may also be located in different TS streams.
- the synchronization identifier of each TS packet header information is changed or redefined to form a TS packet that distinguishes the identifier, and then the TS that distinguishes the identifier is The data packets form a new data stream in chronological order.
- the TS packets that need to be decrypted have two paths, namely TS-1 and TS-2, and after TS-1 and TS-2 are respectively extracted from the multiple TS streams, the synchronization identifier of the TS-1 is changed.
- At least one TS packet TS-1' and at least one TS packet TS-2' having a second distinguishing identifier are combined to form a new data stream. It is worth mentioning that when the synchronization identifier in the header information of the TS stream is changed, the distinguishing rule that can be followed can be performed according to actual needs. For example, the synchronization identifier in the header information of the multiple TS streams generally starts with 0x47.
- the synchronization identifiers of the TS packets with different distinguishing identifiers can be 0x48, 0x49, 0x50. ...and as a starting point, wherein the synchronization identifiers of the TS packets having the respective distinguishing identifiers are different from each other.
- the TS packet includes two types of synchronization identifiers as an example.
- the TS packets are respectively classified into TS-1 and TS-2, and the synchronization identifier of the TS-1 can be changed to 0x48, and the TS-2.
- the synchronization ID can be changed to 0x49. It should be noted that, when the header information of the TS packet is changed, only the synchronization identifier of the header information in the TS packet is changed or redefined, and the PID of the program content in the target TS stream is not changed.
- the TS packet may be distinguished according to the changed synchronization identifier of the different TS packet. And decrypt it.
- the synchronization identifier of a certain TS packet starts with 0x48, indicating that the currently decrypted TS packet is TS-1', according to the encryption manner of the program content in TS-1', in TS-1' The program content is decrypted.
- the TS-2 is based on the encryption method of the program content in the TS-2'.
- the program content in ' is decrypted.
- the data stream is split into multiple data streams to form corresponding multiples.
- Road show For example, two TS streams are taken as an example.
- the two TS streams are TS-1 and TS-2, respectively, and the synchronization identifier in the packet header information of TS-1 and the synchronization identifier of TS-2 are respectively changed to form.
- the synchronization identifier of the identified TS packet TS-1' starts with 0x48, and the synchronization identifier of the identified TS packet TS-2' is distinguished. Start with 0x49.
- the TS packets TS-1' and TS-2' of the differentiated identifier are respectively decrypted.
- the splitting is performed in units of data packets, and the synchronized identifiers of the TS packets TS-1' and TS-2' of the differentiated identifiers are changed again to the inherent synchronization identifier, that is, 0x47, and then sent to the SOC chip to form a corresponding
- the program is then transferred to the corresponding unit according to the user's play or recording. For example, when the user needs to distinguish the identified TS data packets TS-1' and TS-2' from playing, the differentiated TS data packets TS-1' and TS-2' are transmitted to the decoder, after being decoded.
- the acquired multiple TS packets need to be stored in the storage unit in chronological order.
- the decryption unit since a single decryption unit only needs to decrypt one TS stream, it is only necessary to ensure that the decryption unit decrypts the rate and the TS stream transmission rate, that is, the transmitted TS stream does not need to be For storage, real-time TS stream decryption can be realized.
- the transmission rate of each TS stream in the input multiple TS streams is not the same, different time periods may change, and therefore, it is difficult to ensure the distinguishing identifier.
- the rate of the TS packet is a constant value, and the scheme also needs to change the synchronization identifier of the header information in the TS packet; therefore, the data packet in the input multiple TS stream needs to be first stored in a storage unit. Then change the synchronization identifier of the TS packet.
- the "chronological order" can be set according to the actual situation. For example, it can be set according to the chronological order when the user selects each multimedia program, or can be set according to the order of the acquired multiple TS streams. Do too much limit.
- each TS packet is sequentially extracted from the storage unit according to the sequence of each TS packet in the storage unit, The synchronization identifier of each TS packet is changed to form a corresponding TS packet of the differentiated identifier, and the TS packets of the differentiated identifier are sequentially transmitted to the decryption unit. This design prevents confusion when merging TS packets that distinguish between them.
- the transmission rate of the identified TS packet needs to be determined according to the following steps, and according to the transmission rate, the differentiated identified TS packet is transmitted to the decryption unit for decryption.
- Step S110 analyzing the sum of the transmission rates of the multiple TS streams.
- the TS data packet to be decrypted is extracted from the multiple TS streams according to the PID of the TS stream corresponding to each required multimedia program, and the transmission rate of the data packet to be decrypted in each TS stream can be determined.
- the synchronization identifier of the TS packet is changed to form the TS packet of the differentiated identifier, since the TS packet of the differentiated identifier is different from the corresponding TS stream, only the synchronization identifier of the TS packet is different, and the others are the same, and thus the parsing is performed.
- the sum of the transmission rates of the acquired multiple TS streams the sum of the transmission rates of the identified TS packets can be known, so that the transmission rate of the TS packets that distinguish the identifications to the decryption unit is subsequently set.
- Step S120 determining, according to a sum of transmission rates of the multiple TS streams, a serial parallel transmission manner of the multiple TS streams, and/or a serial parallel transmission manner of the plurality of TS packets having the first distinguishing identifier and the second distinguishing identifier, The transmission rate of the plurality of TS packets of the first distinguishing identifier and the second distinguishing identifier.
- the TS packets that distinguish the identifiers are usually transmitted in a serial manner. Therefore, for the setting of the transmission rate in this solution, the transmission mode of the identified TS packets may be disregarded, and of course, it may be considered here. Make a limit.
- the transmission rate of the identified TS packets is numerically the same as the sum of the obtained transmission rates of the TS packets to be decrypted; when the acquired multiple TS streams are used In the parallel transmission mode, the transmission rate of the identified TS packet is numerically the average of the sum of the transmission rates of the acquired TS packets to be decrypted in the total number of parallel lines. For example, it is assumed that two program signals are acquired, which respectively correspond to two TS streams, and the obtained two TS streams are TS1 and TS2, respectively. Referring to FIG.
- TS1 further includes two single program TS streams, and each single program TS stream corresponds to one multimedia program, and two single program TS streams are TS1-1 and TS1-2, respectively, and single program TS stream TS1-1.
- the transmission rate is 12 Mbps
- the transmission rate of the single program TS stream TS1-2 is 28 Mbps
- the transmission rate of the original TS stream TS1 is 40 Mbps
- the TS2 includes three single program TS streams
- each single program TS stream corresponds to one multimedia program
- three The TS streams of the single program are TS2-1, TS2-2 and TS2-3, the transmission rate of the single program TS stream TS2-1 is 10 Mbps, the transmission rate of the single program TS stream TS2-2 is 14 Mbps, and the single program TS stream TS2
- the transmission rate of -3 is 24 Mbps
- the transmission rate of TS2 is 48 Mbps.
- the user When the desired multimedia program selected by the user is the single program TS stream TS1-1 and the single program TS stream TS2-1, respectively, the user correspondingly selects two target TS streams, which are respectively parsed by TS1-1 and TS2-1.
- the sum of the transmission rates of the TS streams is the sum of the transmission rate of TS1-1 and the transmission rate of TS2-1, that is, 22 Mbps.
- the sum of the transmission rates of the differentiated TS packets is also the sum of the transmission rate of TS1-1 and the transmission rate of TS2-1.
- the setting is made according to the sum of the transmission rates of TS1-1 and TS2-1 and the serial-parallel transmission mode of the acquired multiple TS streams.
- the sum of the transmission rates of the target TS streams is 22 Mbps, that is, the sum of the transmission rates of the differentiated TS packets is also 22 Mbps; at this time, the identified TS data is distinguished.
- the new data stream formed by the packet needs to transmit 22 Mbits of data per second. Therefore, the clock frequency of the identified TS packet is set to 22 MHz.
- the sum of the transmission rates of the TS streams is 22 Mbps, that is, the sum of the transmission rates of the differentiated TS packets is also 22 Mbps;
- the TS packets of the differentiated identifiers formed by the combination of the identified TS packets are separated on each parallel line, and the clock frequency of the identified TS packets is 2.75 MHz.
- the manner of setting the clock frequency of the identified TS packets is also performed in the above manner.
- the determination of the transmission rate of the identified TS packet can be divided into the following two ways.
- the transmission rate determining mode 1 the sum of the obtained transmission rates of the multiple TS streams is first parsed, and then according to the transmission rate of the multiple TS streams, the serial parallel transmission mode of the TS streams, and/or the differentiated TS data.
- the serial transmission mode of the packet sets the clock frequency of the TS packet that distinguishes the identification. That is to say, in the transmission rate determining mode 1, the clock frequency of the identified TS packet is set according to the sum of the obtained transmission rates of the multiple TS streams, and the clock frequency of the TS packet distinguished by the identification can be prevented.
- the TS packets that are too small to distinguish the identifiers cannot be transmitted in time and completely, and at the same time, it is possible to prevent waste of resources in the broadcast receiving apparatus due to the setting of the clock frequency of the TS packets that distinguish the identifiers.
- the differentiated identified TS data packet is sent to the decryption unit based on the fixed transmission rate, and the fixed transmission rate is greater than the sum of the transmission rates of the multiple TS streams.
- the clock frequency of the TS packet distinguishing the identifier is set to a relatively fixed value, which is greater than or equal to the sum of the transmission rates of the acquired multiple TS streams, wherein the clock frequency of the identified TS packet is distinguished.
- the clock frequency of the identified TS packet can be set according to the sum of the transmission rates of all the single program TS streams currently present. It is assumed that all the single program TS streams currently present include TS1-1, TS1-2 in the acquired TS stream TS1 and TS2-1, TS2-2, TS2-3 in the TS stream TS2, wherein the single program TS stream TS1
- the transmission rate of -1 is 12 Mbps
- the transmission rate of single program TS stream TS1-2 is 28 Mbps
- the transmission rate of single program TS stream TS2-1 is 10 Mbps
- the transmission rate of single program TS stream TS2-2 is 14 Mbps
- single program TS The transmission rate of the stream TS2-3 is 24 Mbps
- the sum of the transmission rates of all the single program TS streams present at present is 88 Mbps.
- the clock frequency of the identified TS packets is equal in value to the sum of the transmission rates of all the single program TS streams currently present, for example, the distinguishing identifier can be set.
- the TS packet has a clock frequency of 88 MHz.
- the clock frequency of the differentiated TS packets is numerically the average of the sum of the transmission rates of all the single program TS streams currently present and the total number of parallel lines. Assuming that the total number of parallel lines is eight, the clock frequency of the TS packets that distinguish the identification can be set to 11 MHz. In this way, the clock frequency of the TS packets that distinguish the identifiers is set. Regardless of which multimedia programs are selected by the user, the clock frequency of the identified TS packets is always the value.
- the clock frequency of the identified TS packet may also be set according to the maximum capacity of each TS stream specified in the TS stream protocol, for example, assuming each TS stream specified in the current TS stream protocol.
- the maximum capacity is 108Mbps.
- the maximum capacity of each TS stream specified in the TS stream protocol is used as the clock frequency of the differentiated TS packet, for example, the TS packet of the differentiated identifier is set.
- the clock frequency is 108MHz.
- the average value of the maximum capacity of each TS stream specified in the TS stream protocol and the total number of parallel lines are used as the clock frequency of the identified TS packets.
- the clock frequency of the TS packet that sets the discrimination flag is 13.5 MHz. In this way, the clock frequency of the TS packets that distinguish the identifiers is set. Regardless of which multimedia programs are selected by the user, the clock frequency of the identified TS packets is always the value.
- the clock frequency of the differentiated TS packets may also be determined according to the number of multimedia programs selected by the user. Specifically, the maximum value of the sum of the transmission rates of the two single-program TS streams in all the single-program TS streams is determined according to the transmission rate of all the single-program TS streams currently existing, and the maximum value is selected as the user to select two multimedia. A reference to the clock frequency of the identified TS packet is set at the time of the program. When the acquired multiple TS streams adopt the serial transmission mode, the maximum value can be directly used as the clock frequency of the identified TS packets when the user selects two multimedia programs.
- the average value of the maximum value to the total number of parallel lines may be used as the clock frequency of the identified TS packets when the user selects two multimedia programs.
- the clock frequency of the identified TS packet is always the maximum value.
- the maximum value of the sum of the transmission rates of the three single-program TS streams in all the single-program TS streams is determined according to the transmission rate of all the single-program TS streams currently present, and the maximum value is selected as the three multimedia selected by the user.
- a reference is made to set the clock frequency of the TS packet that distinguishes the identification.
- the maximum value can be directly used as the clock frequency of the identified TS packets when the user selects three multimedia programs; when the acquired multiple TS data is in parallel transmission mode
- the average value of the maximum value and the total number of parallel lines may be used as the clock frequency of the TS data packet when the user selects three multimedia programs.
- the identified TS data is distinguished.
- the clock frequency of the packet is always the maximum. In this way, the maximum value of the sum of the transmission rates corresponding to the number of multimedia programs that the user may select is sequentially calculated, thereby setting the clock frequency of the TS packets that distinguish the identification.
- the TS packet of the differentiated identifier formed by the synchronization identifier in the header information of the acquired multiple TS stream is formed into a new data stream and sent to the new data stream.
- the clock frequency of the TS packet of the distinguishing identifier is the clock frequency set in the foregoing step, and the distinguishing identifier in the TS packet of the distinguishing identifier is the changed synchronization identifier in the packet header information.
- the clock frequency of the TS packet distinguishing the identifier is set to a relatively fixed value. Therefore, when the TS packet of the way distinguish identifier is sent to the decryption unit for decryption, the decryption unit does not need to distinguish the identifier of the dynamic change of the rate.
- the clock frequency of the TS packet is judged and adjusted in real time, so that the operational stability and reliability of the broadcast receiving apparatus can be improved.
- the TS packet that distinguishes the identifier in the storage unit is sent to the decryption unit in one transmission period, when the TS packet that distinguishes the identifier in the storage unit is sent, and the storage unit does not receive a new distinction.
- the TS packet distinguishing the identifier is filled in the form of a null packet until the storage unit receives the new data.
- the distinction is directly made.
- the identified TS packets are successively merged into the TS packets of the differentiated identifiers, and there is no gap between the adjacent two identified identifier TS packets; when the adjacent two differentiated identifiers of the TS packets are not present
- consecutive that is, the TS packet of the differentiated identifier buffered in the storage unit has been sent, and the storage unit has not received other new TS packets of the differentiated identifier, it is necessary to make a new data stream formed by distinguishing the identified TS packets.
- the new data stream formed by the differentiated TS packets is filled with empty packets that do not contain useful information, so that the identified TSs are differentiated.
- the clock signal of the packet continues to output data, which is useless data.
- the TS data of the differentiated identifier transmitted is sent.
- the new data stream formed by the packet is filled with a null packet that does not contain a useful signal, and the null packet may be an empty packet that does not contain a useful signal, such as 0x00 or 0xff, so that the clock signal of the identified TS packet continuously outputs data;
- the data outputted by the TS packet of the distinguishing identifier is useless data.
- the output of the clock signal is interrupted, and the data transmission is stopped.
- the TS stream of the latter identifier does not reach the storage unit; at this time, the TS packet that distinguishes the identifier is filled with an empty packet that does not contain the useful signal, so that The clock signal of the identified TS packet stops outputting data, and when the TS packet of the latter identification identifier arrives, the filling of the empty packet is stopped, and the TS data of the latter identifier is distinguished according to the clock frequency of the identified TS packet.
- the packet is sent to the decryption unit.
- the decryption unit when a decryption unit for decryption, such as a CI card, is inserted, the decryption unit transmits information to the SOC chip through CMD (COMMAND, command), and the SOC chip is The information of the decryption unit determines whether or not the function of simultaneously decrypting multiple TS streams is supported. If it is detected that the decryption unit does not support the TS mixed stream function, the SOC chip does not perform the merge action of the TS stream when processing the information stream.
- CMD COMMAND, command
- the input of the CI card is two channels of encrypted information
- only the information stream of the current channel is decrypted, and the other stream of information cannot be decrypted; if it is an encrypted stream, clear stream, the encrypted stream passes through the CI.
- the card is decrypted, and the clear stream does not need to be decrypted by the CI card.
- the decryption unit If it is detected that the decryption unit does not support the TS mixed stream function, when the SOC chip processes the information stream, whether the input information stream is encrypted or not, the TS stream is merged, and the merged TS stream enters the decryption unit.
- the encrypted stream is decrypted, and the non-encrypted stream is sent back to the SOC chip without any processing, and the SOC chip divides the TS stream outputted by the decryption unit according to the previous merge principle.
- the embodiment of the present application further provides a broadcast receiving apparatus.
- the broadcast receiving apparatus includes an original TS stream generating unit 101, a target TS stream selecting unit 102, an identifying unit 103, a decrypting unit 104, and a TS stream reconstructing unit 105.
- the original TS stream generating unit 101 is for receiving a signal and generating a multiplexed original TS stream based on the received signal.
- the target TS stream selecting unit 102 is connected to the original TS stream generating unit 101, and the target TS stream selecting unit 102 is configured to extract at least two target TSs from the multiplexed original TS stream according to the PID of the TS stream corresponding to each required multimedia program. flow.
- the identifier unit 103 is connected to the target TS stream selection unit 102, and the identifier unit 103 is configured to re-define the headers of at least two target TS streams, form corresponding at least two standby TS streams, and generate based on the at least two standby TS streams.
- the decryption unit 104 is coupled to the identification unit 103, which is used to decrypt the new TS stream.
- the TS stream reconstruction unit 105 is connected to the decryption unit 104, and the TS stream reconstruction unit 105 is configured to divide the spare TS stream in the new TS stream into packets according to the header of the at least two standby TS streams.
- the original TS stream generating unit 101 may include a tuner 110 for receiving signals, a demodulator 120 for generating a plurality of original TS streams according to the received signals, and a decryption unit 104. It can be a CICAM card, and the CICAM card includes a CI card and a CAM module.
- the identification unit 40 is also connected to the TS stream reconstruction unit 105. After the identification unit 40 merges the spare TS streams to form a new TS stream, the new TS stream is directly transmitted to the TS stream reconstruction unit 105, and the TS stream is directly transmitted.
- the reconstruction unit 105 classifies and encapsulates the new TS stream, and also splits the standby TS stream in the new TS stream.
- the broadcast receiving apparatus further includes a memory 106.
- the memory 106 is connected to the target TS stream selection unit 102 and the identification unit 103, respectively.
- the memory 106 is for storing the target TS stream extracted by the target TS stream selection unit 102.
- the memory 106 may include a built-in memory or/and a peripheral memory, wherein the built-in memory may be a cache memory, and is disposed inside the broadcast receiving device, and the external memory may also be a cache memory.
- the memory slot can be set on the broadcast receiving device, and when the external memory needs to be used, the external memory can be inserted into the memory slot.
- the original TS stream generating unit 101 may include a tuner 110 and a demodulator 120, wherein the tuner 110 is configured to receive signals, and the demodulator 120 and the tuner are respectively The 110 is connected to the target TS stream selection unit 102, and the demodulator 120 is configured to generate an original TS stream based on the signal received by the tuner 110.
- the number of demodulator 120 and the number of target TS stream selection units 102 can be set according to actual needs.
- the number of demodulator 120 may be one or more, and the number of target TS stream selection units 102 may also be one or more.
- the number of demodulators 120 and the number of target TS stream selection units 100 are both multiple, and the number of demodulators 120 is the same as the number of target TS stream selection units 102, and more.
- the target TS stream selection unit 102 is connected to the plurality of demodulators 120 in one-to-one correspondence.
- the original TS stream formed by demodulation by each demodulator 120 is transmitted to the corresponding target TS stream selection unit 102.
- the target TS stream selection unit 102 determines whether it is necessary to extract the target TS stream from the corresponding original TS stream according to the PID of the TS stream corresponding to each multimedia program selected by the user.
- the embodiment of the present application further provides a TS stream processing method.
- the method includes the following steps S21-S24.
- Step S21 Extract at least two target TS streams from the multiplexed original TS streams generated by the demodulator according to the packet identification code PID of the TS stream corresponding to each required multimedia program.
- the PID of the TS stream corresponding to the required multimedia program can be known, and the target TS stream is extracted from the original TS stream according to the PID of the TS stream corresponding to the required multimedia program.
- the corresponding TS streams are TS-1 and TS-2, respectively, and TS-1 and TS-2 respectively have corresponding PIDs.
- the TS-2 PID extracts TS-1 and TS-2 from the original TS stream, where TS-1 and TS-2 may be located in the same original TS stream, and TS-1 and TS-2 may also be located in different originals. In the TS stream.
- Step S22 redefining the headers of the at least two target TS streams, forming corresponding at least two standby TS streams, and combining the at least two standby TS streams into one new TS stream, where the at least two paths are The headers of the alternate TS streams are different from each other.
- each target TS stream is extracted from the original TS stream
- the header of each target TS stream is redefined to form a corresponding standby TS stream, and then all the spare TS streams are merged into one new TS stream.
- the header of the TS-1 is redefined to form a corresponding standby TS stream TS-1', for the TS.
- the header of -2 is redefined to form a corresponding spare TS stream TS-2', and then the spare TS stream TS-1' and the alternate TS stream TS-2' are combined into one new TS stream.
- the rules to be followed can be performed according to actual needs. For example, at present, the header of a TS stream usually starts with 0x47. Then, when the header of the target TS stream is redefined to form a corresponding spare TS stream, the header of the spare TS stream can start with 0x48, 0x49, 0x50, etc. , wherein the headers of the alternate streams are different from each other.
- the packet header may be set to Starting with 0x48, the header of the formed standby TS stream TS-1' starts with 0x48, and when the header of the target TS stream TS-2 is redefined to form the corresponding standby TS stream TS-2', the header can be set. To start with 0x49, the header of the formed spare TS stream TS-2' starts with 0x49. It should be noted that, in step S22, when the header of the target TS stream is redefined, only the start of the header of the target TS stream is redefined, and the PID of the program content in the target TS stream is not changed.
- Step S23 Decrypt the one new TS stream.
- the new TS stream may be new according to the header of the standby TS stream.
- the program content in the spare TS stream in the TS stream is decrypted. For example, taking the target TS stream TS-1 and TS-2 as two TS-1 and TS-2 as an example, in step S22, the header of the TS-1 and the header of the TS-2 are respectively redefined to form a correspondence.
- the header of the standby TS stream TS-1' is set to start with 0x48
- the header of the standby TS stream TS-2' is set to 0x49.
- step S23 when the header of a certain spare TS stream is found to start with 0x48, indicating that the spare TS stream sought is TS-1', according to the encryption method of the program content in TS-1', Decoding the program content in TS-1'.
- the header of a spare TS stream starts with 0x49, indicating that the spare TS stream sought is TS-2', according to the program in TS-2'
- the content encryption method decrypts the program content in TS-2'.
- step S24 when the program content in the spare TS stream in the new TS stream is decrypted, the header of the spare TS stream may not be searched.
- Step S24 classify the spare TS streams in the new TS stream according to the header of the at least two standby TS streams.
- step S24 the spare TS stream in the new TS stream is classified and encapsulated according to the header redefined in the target TS stream in step S22, that is, according to the header of the spare TS stream.
- the header of TS-1 and the header of TS-2 are respectively redefined to form a corresponding standby TS stream TS- 1' and the standby TS stream TS-2', the header of the standby TS stream TS-1' starts with 0x48, the header of the standby TS stream TS-2' starts with 0x49, and in step S23, the standby TS stream
- the new TS formed by combining the standby TS stream TS-1' and the standby TS stream TS-2' The stream is classified and encapsulated, and the
- the standby TS stream TS-1' and the standby TS stream TS-2' are both transmitted to the decoder, after being decoded.
- the playback can be performed; when the user needs the spare TS stream TS-1' to play and the standby TS stream TS-2' to record, the standby TS stream TS-1' is transmitted to the decoder, and after being decoded, the playback is performed, and the standby TS stream TS -2' is recorded by the OTG (On The Go) interface; when the user needs to record both the standby TS stream TS-1' and the standby TS stream TS-2', the standby TS stream TS-1' and the standby TS stream The TS-2' is recorded via the OTG (On The Go) interface.
- the standby TS stream corresponding to the target TS stream is merged into one new TS stream, and then the standby TS stream in the new TS stream is decrypted.
- the decryption of the multiple standby TS streams by one channel is realized, thereby realizing the playing or recording of the multimedia programs corresponding to the multiple target TS streams respectively.
- the method before the step of extracting at least two target TS streams from the multiplexed original TS stream generated by the demodulator according to the packet identification code PID of the TS stream corresponding to each of the required multimedia programs, the method further includes: S20. Receive a signal, and generate an original TS stream according to the received signal.
- step S20 The received signal is a radio frequency signal, and each video signal corresponds to one TS stream.
- Each TS stream further includes a single program TS stream corresponding to at least one television program, and each single program TS stream corresponding to each television program has a corresponding PID.
- step S21 when the original TS stream is generated according to the received signal, each received radio frequency signal is processed to generate an original TS stream, and the original TS stream includes a single program TS stream corresponding to at least one television program.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
Description
相关申请的交叉引用Cross-reference to related applications
本专利申请要求于2018年5月16日提交的、申请号为201810470234.0,于2018年5月16日提交的、申请号为201810471962.3,于2018年5月16日提交的、申请号为201810470418.7,于2018年5月16日提交的、申请号为201810469837.9,于2018年5月16日提交的、申请号为201810469172.1,于2018年5月16日提交的、申请号为201810469738.0的中国专利申请的优先权,这些申请的全文以引用的方式并入本文中。This patent application claims to be filed on May 16, 2018, the application number is 201810470234.0, filed on May 16, 2018, and the application number is 201810471962.3, which was filed on May 16, 2018, and the application number is 201810470418.7. Priority of Chinese Patent Application No. 201810469738.0, filed on May 16, 2018, with application number 201810469837.9, filed on May 16, 2018, with application number 201810469172.1, filed on May 16, 2018 The entire contents of these applications are hereby incorporated by reference.
本申请涉及数字多媒体技术领域,尤其涉及一种TS流的处理方法及装置。The present application relates to the field of digital multimedia technologies, and in particular, to a method and an apparatus for processing a TS stream.
MPEG-2(基于数字存储媒体运动图像和语音的压缩标准)是ISO/IEC/JTC1/SC29/WG11制定的图像压缩标准,它是为了适应数字电视节目的生成、编辑、存储、传输和显示的综合要求而研发的,广泛用于数字电视广播和DVD。目前,多媒体节目如电视节目基本上都采用MPEG-2标准进行压缩、打包,形成TS流(Transport Stream,传输流),TS流经过信道编码和调制后发送到信道中,进行传输。MPEG-2 (based on digital storage media moving image and voice compression standards) is an image compression standard developed by ISO/IEC/JTC1/SC29/WG11, which is adapted to the generation, editing, storage, transmission and display of digital television programs. Developed for comprehensive requirements, it is widely used in digital TV broadcasting and DVD. At present, multimedia programs such as television programs are basically compressed and packaged by the MPEG-2 standard to form a TS stream (Transport Stream). The TS stream is channel-coded and modulated and transmitted to the channel for transmission.
用户观看多媒体节目时,数字多媒体接收装置根据用户所选择的多媒体节目对应的TS流的PID(Package Identification,包标识码),从众多TS流中提取出对应于用户所选择的多媒体节目的TS流,并对该TS流中的节目内容进行解密,经解密后的节目内容则可以播放,供用户观看。When the user views the multimedia program, the digital multimedia receiving device extracts the TS stream corresponding to the multimedia program selected by the user from the plurality of TS streams according to the PID (Package Identification) of the TS stream corresponding to the multimedia program selected by the user. And decrypting the program content in the TS stream, and the decrypted program content can be played for the user to watch.
随着数字多媒体的发展,用户在观看多媒体节目的同时,对播放录制功能(即在播放一路多媒体节目的同时录制另一路多媒体节目)、画中画功能(即同时播放至少两路多媒体节目)等的需求也逐渐增加,当用户提出播放录制功能或/和画中画功能时,数字多媒体接收装置则需要提取多路多媒体节目的TS流,并对多路TS流中的节目内容进行解密。With the development of digital multimedia, users watch the multimedia program while playing the recording function (that is, recording another multimedia program while playing one multimedia program) and the picture-in-picture function (that is, playing at least two multimedia programs simultaneously). The demand is also gradually increasing. When the user proposes to play the recording function or/and the picture-in-picture function, the digital multimedia receiving device needs to extract the TS stream of the multi-channel multimedia program and decrypt the program content in the multi-channel TS stream.
发明内容Summary of the invention
本申请的目的在于提供一种TS流处理方法及装置,用于对多路TS流进行解密,实现多路TS流分别对应的多媒体节目的播放或录制。The purpose of the present application is to provide a TS stream processing method and apparatus for decrypting multiple TS streams to realize playback or recording of multimedia programs corresponding to multiple TS streams.
为了实现上述目的,本申请提供一种TS流处理方法,该方法包括:对获取的多路TS流中的TS数据包分别进行区分标识,形成具有第一区分标识的多个TS数据包和第二区分标识的多个TS数据包,所述第一区分标识用于标识第一路TS流,第二区分标识用于标识第二路TS流;分时对所述具有第一区分标识和第二区分标识的多个TS数据包进行解密;将所述解密后的多个TS数据包按照区分标识进行分类封装以形成多路节目。In order to achieve the above object, the present application provides a TS stream processing method, which includes separately distinguishing TS packets in the acquired multiple TS streams to form a plurality of TS packets and a first identifier. The second distinguishing identifier is a plurality of TS data packets, the first distinguishing identifier is used to identify the first road TS stream, and the second distinguishing identifier is used to identify the second road TS stream; The plurality of TS packets that are identified by the two are decrypted; and the plurality of decrypted TS packets are classified and packaged according to the distinguishing identifier to form a multi-channel program.
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the present application, and are intended to be a part of this application. In the drawing:
图1为TS流数据格式说明示意图;1 is a schematic diagram of a TS stream data format description;
图2为本申请实施例提供的广播接收装置的一种示意图;2 is a schematic diagram of a broadcast receiving apparatus according to an embodiment of the present application;
图3a为本申请实施例两路TS流中TS数据包一种传输示意图;3a is a schematic diagram of a transmission of a TS packet in a two-way TS stream according to an embodiment of the present application;
图3b为本申请实施例两路TS流中TS数据包另一种传输示意图;FIG. 3b is a schematic diagram of another transmission of a TS packet in a two-way TS stream according to an embodiment of the present application; FIG.
图3c为本申请实施例两路TS流中TS数据包合并传输示意图;3c is a schematic diagram of combined transmission of TS data packets in two TS streams according to an embodiment of the present application;
图4为本申请实施例提供的广播接收装置的另一种示意图;FIG. 4 is another schematic diagram of a broadcast receiving apparatus according to an embodiment of the present application;
图5a为本申请实施例提供的广播接收装置的第三种示意图;FIG. 5 is a third schematic diagram of a broadcast receiving apparatus according to an embodiment of the present application;
图5b为本申请实施例提供的广播接收装置的第四种示意图;FIG. 5b is a fourth schematic diagram of a broadcast receiving apparatus according to an embodiment of the present disclosure;
图6a为本申请实施例提供的TS流处理方法的步骤示意图;FIG. 6 is a schematic diagram of steps of a TS stream processing method according to an embodiment of the present application;
图6b为本申请实施例中两路TS流进行TS流处理的步骤示意图;6b is a schematic diagram of steps of performing TS stream processing on two TS streams in the embodiment of the present application;
图7为本申请实施例中区分标识的TS数据包的传输速率确定步骤示意图;FIG. 7 is a schematic diagram of a step of determining a transmission rate of a TS packet that distinguishes an identifier according to an embodiment of the present application;
图8为本申请实施例中区分标识的TS数据包的第一种传输速率确定示意图;FIG. 8 is a schematic diagram of determining a first transmission rate of a TS packet that distinguishes an identifier according to an embodiment of the present application;
图9为本申请实施例中区分标识的TS数据包的第二种传输速率确定示意图;FIG. 9 is a schematic diagram of determining a second transmission rate of a TS packet that distinguishes an identifier according to an embodiment of the present application;
图10为本申请实施例中CI模式判断流程示意图;10 is a schematic diagram of a CI mode determination process in an embodiment of the present application;
图11为本申请实施例提供的广播接收装置的第五种示意图;FIG. 11 is a fifth schematic diagram of a broadcast receiving apparatus according to an embodiment of the present disclosure;
图12本申请实施例提供的TS流处理方法的流程示意图。FIG. 12 is a schematic flowchart diagram of a TS stream processing method provided by an embodiment of the present application.
为了进一步说明本申请实施例提供的TS流处理方法及广播接收装置,下面结合说明书附图进行详细描述。In order to further describe the TS stream processing method and the broadcast receiving apparatus provided by the embodiments of the present application, a detailed description will be made below with reference to the accompanying drawings.
相关技术中,当多个解调器分别输出加密的多路TS流时,需要设置多个解密单元(例如CI(Common Interface)卡)分别对不同的加密的多路TS流进行解密;而本申请提供的方案可以仅仅使用一个解密单元对加密的多路TS流进行解密,并在解密后将解密后的TS数据进行区分以形成多路节目。In the related art, when multiple demodulators respectively output encrypted multiple TS streams, it is necessary to set a plurality of decryption units (for example, CI (Common Interface) cards) to decrypt different encrypted multiple TS streams respectively; The solution provided by the application can decrypt the encrypted multiple TS streams using only one decryption unit, and after decryption, distinguish the decrypted TS data to form a multi-channel program.
本申请实施例中,以两路TS流进行示例说明,多路TS流的情况与两路类似,不做过多的赘述。In the embodiment of the present application, the two-way TS stream is used as an example for description, and the situation of the multi-channel TS stream is similar to that of the two paths, and no redundant description is made.
首先,对TS流进行一个简单的介绍。TS流数字电视机顶盒接收到的是一段段的码流,每个TS流都携带一些信息,如Video、Audio以及我们需要学习的PAT(Program Association Table,节目关联表)、PMT(Program Map Table,节目映射表)等信息。First, a brief introduction to the TS stream. The TS stream digital TV set-top box receives a segment of code stream, and each TS stream carries some information, such as Video, Audio, and PAT (Program Association Table), PMT (Program Map Table, which we need to learn). Program map table and other information.
TS流的构成如图1所示,TS流是基于数据包的位流格式,每个数据包是188个字节或204个字节。对于204字节,在188个字节后加上了16字节的CRC(Cyclic Redundancy Check,循环冗余校验码)校验数据,其他格式一样。The TS stream is constructed as shown in FIG. 1. The TS stream is a packet-based bit stream format, and each packet is 188 bytes or 204 bytes. For 204 bytes, a 16-byte CRC (Cyclic Redundancy Check) check data is added after 188 bytes, and the other formats are the same.
整体TS流组成形式如图1所示,其中Packet Header(包头)信息说明如表1所示.The overall TS stream composition is shown in Figure 1, where the Packet Header information is shown in Table 1.
表1Table 1
其中,同步标识是MPEG-2TS传输标准下的传送标识符,其通常为固定值0x47;Wherein, the synchronization identifier is a transmission identifier under the MPEG-2 TS transmission standard, which is usually a fixed value of 0x47;
PID信息是TS流中的唯一标识,TS流中数据包的内容由其决定。例如,如果一个TS流中的包的包头信息中PID是0x0000,那么这个包的数据就是DVB(Digital Video Broadcasting,数字视频广播)中的PAT表。The PID information is a unique identifier in the TS stream, and the content of the data packet in the TS stream is determined by it. For example, if the PID of the packet header information of a packet in a TS stream is 0x0000, the data of this packet is the PAT table in DVB (Digital Video Broadcasting).
本申请广播接收装置的硬件框架图如图2所示。该装置至少包括标识单元30、TS流重构单元40和解密单元50。标识单元30用于对获取的多路TS流中的TS数据包分别进行区分标识,形成具有第一区分标识的多个TS数据包和第二区分标识的多个TS数据包,所述第一区分标识用于标识第一路TS流,第二区分标识用于标识第二路TS流。其中,多路为大于或等于2路。需要说明的是,第一区分标识和第二区分标识仅是用于举例说明,对多路TS流中的数据包分别进行标识,一路TS流采用一个区分标识进行标识,在其他实施方式中,可以使用三个或更多个区分标识进行标识。解密单元50分时对所述具有第一区分标识和第二区分标识的多个TS数据包进行解密。TS流重构单元40用于将解密后的多个TS数据包按照区分标识进行分类封装。A hardware frame diagram of the broadcast receiving apparatus of the present application is shown in FIG. 2. The apparatus includes at least an
此外,该装置还可包括多个解调器10、存储单元20和解码器60。各解调器10用于解调制其接收广播电视信号,以形成多路TS流。存储单元20存储来自多个解调器10输出的多路TS流。解码器60用于将重新封装的多路TS流解码以形成多路节目。Further, the apparatus may further include a plurality of
当多路加密的TS流由解调器10解调后,将该多路TS流输入到存储单元20。标识单元30将存储在存储单元20的多路TS流的TS数据包进行区分标识,以确定多路TS流中的TS数据包各源自哪路TS流,进而将区分标识后的TS数据包,按照先进先出的时间顺序,并基于一定的传输速率发送给解密单元50。解密单元50根据其预设的解密规则,对区分标识后的TS流解密,并在解密后将解密后的TS数据包发送至TS流重构单元40。TS流重构单元40根据区分标识对解密后的TS数据包进行区分,并把属于源自同一TS流的TS数据包重新封装为一路TS流。最终解码器60对重新封装的TS数据包进行解码以形成多路节目。When the multiplexed TS stream is demodulated by the
进一步的,本申请中由于一个解密单元同一时刻只能对一个TS数据包进行解密,如图3a所示,在t时刻,TS1的一个TS数据包Packet1-1和TS2的一个TS数据包Packet2-1同时到达解密单元时,解密单元不能同时对接收到的数据包Packet1-1及Packet2-1进行解密。或者如图3b所示,在t1时刻,解密单元接收到数据包Packet1-1,如果在t2时刻,解密单元又接到TS2的TS数据包Packet2-1,此时,解密单元正在对TS数据包Packet1-1进行处理,解密单元无法对数据包Packet2-1进行接收并处理,则必然会造成该数据包之间的处理冲突,导致部分数据包丢失或者无法解密,进而影响TS流数据的 完整性,影响用户观看或录制电视节目。Further, in the present application, since one decryption unit can only decrypt one TS packet at a time, as shown in FIG. 3a, at time t, one TS packet of Packet TS1 and one TS packet of TS2, Packet2- When the decryption unit arrives at the same time, the decryption unit cannot decrypt the received data packets Packet1-1 and Packet2-1 at the same time. Or, as shown in FIG. 3b, at time t1, the decryption unit receives the packet Packet1-1, and if at time t2, the decryption unit further receives the TS packet Packet2-1 of TS2, at this time, the decryption unit is working on the TS packet. Packet1-1 performs processing, and the decryption unit cannot receive and process the packet Packet2-1, which inevitably causes processing conflicts between the data packets, causing partial data packets to be lost or unable to be decrypted, thereby affecting the integrity of the TS stream data. , affecting users to watch or record TV shows.
因此,为避免不同TS流的数据包的冲突,进而避免TS数据包的丢失,在解调器10和解密单元50之间增加存储单元20,存储单元20将接收到的多路TS流的TS数据包按接收时间顺序存储并排序,进而将存储的TS数据包按存储的顺序发送到标识单元30并对该TS数据包进行区分标识,进而避免由于不同路TS流中TS数据包传输中的时间冲突问题。Therefore, in order to avoid collision of data packets of different TS streams and thus avoid loss of TS packets, a
需要说明的是,当两个TS数据包恰好同时到达存储单元20时,则该两个TS数据包为相邻存储的两个数据包,但存储先后不做要求。所属技术领域的技术人员也可采取其他判断机制对该情况下,两个TS数据包的存储顺序作出规定。It should be noted that when two TS data packets arrive at the
进一步的,示例性的如图3c所述,多路TS流的TS数据包按接收顺序构成一路新的数据流,进而将该数据流进行标识后发送至解密单元进行解密。示例性的,如图3c所示,解密单元根据区分标识,对新构成的数据流中,对来自同一路TS流的Packet 1-1、Packet 1-2、Packet 1-3等数据包按同一种解密规则进行解密;对来自另一路TS流的Packet 2-1、Packet 2-2、Packet 2-3按照另一种解密规则进行解密。Further, as exemplarily shown in FIG. 3c, the TS packets of the multiple TS streams form a new data stream in the receiving order, and then the data stream is identified and sent to the decryption unit for decryption. Exemplarily, as shown in FIG. 3c, the decryption unit performs the same data packet of Packet 1-1, Packet 1-2, and Packet 1-3 from the same TS stream in the newly formed data stream according to the distinguishing identifier. Decryption rules are decrypted; Packet 2-1, Packet 2-2, and Packet 2-3 from another TS stream are decrypted according to another decryption rule.
相应的,当多路TS流中的TS数据包重新构成一路新数据流时,该新数据流对应的传输速率需要做相应的调整和变化,该调整和变化在下述内容中会给出具体说明和示例,此处不做过多描述。Correspondingly, when the TS packet in the multi-channel TS stream reconstructs a new data stream, the corresponding transmission rate of the new data stream needs to be adjusted and changed accordingly, and the adjustment and change are specifically described in the following contents. And examples, not to describe too much here.
进一步的,标识单元30具体用于:将多路TS流中的TS数据包的包头信息中的同步标识采用区分标识分别标识,例如,可以将两路TS流中的TS数据包的包头信息中的同步标识修改为第一区分标识或第二区分标识,使属于同一路TS流的TS数据包的区分标识相同。固有的同步标识为0x47,可分别对不同TS流中TS数据包包头信息中的同步标识做不同的更改。以两路为例,一路TS流中的TS数据包,其包头信息中同步标识可以更改为0x48;另一路TS流的TS数据包中的同步标识则可以更改为0x49。Further, the
对应的,TS重构单元40具体用于:根据更改后的同步标识识别出解密后TS数据包源自哪一路TS流,将源自同一路TS流的TS数据包重新封装为一路TS流。Correspondingly, the
考虑到在一些协议下,解码器仅能识别同步标识为固有值0x47的TS数据包,对更改后同步标识为0x48和0x49的TS数据包并不能识别。因此,TS重构单元40接收解密单元50发送的解密后的TS数据包,根据TS数据包的区分规则(即更改后的同步标识:如0x48、0x49等),对解密后区分标识的TS数据包进行区分,并将TS数据包的同步标识(如0x48、0x49等)更改为原有同步标识(0x47),使其能够满足固有协议标准并输出至解码器60中,以形成多路节目。Considering that under some protocols, the decoder can only recognize TS packets whose synchronization identifier is eigenvalue 0x47, TS packets that are identified as 0x48 and 0x49 after the change are not recognized. Therefore, the
因此,TS重构单元40具体用于:根据第一区分标识确定所述解密后的多个TS数据包原所属的所述多路TS流的一路,将第一区分标识的TS数据包封装成一路TS流,以及将所述封装后的TS流的同步标识修改为更改前TS流同步标识。在本申请的下述实施例中,以解密后的多个TS数据包的同步标识修改为更改前TS流同步标识为例进行详细说明。Therefore, the
进一步的,标识单元30与TS流重构单元40之间具有相互传递数据信息的通道,以使TS流重构单元40能够从标识单元30中获取TS数据包的区分规则,并根据该区分规则,识别解密后的TS数据包各源自哪一路TS流,进而将解密后源自同一TS流的TS数据包重新封装为一路TS流。Further, the
示例性的,如上所述,当标识单元30将TS1数据包的同步标识由0x47更改为0x48,将TS2数据包的同步标识由0x47更改为0x49;进而TS流重构单元通过信息通道从标识单元30中获得该标识规则,并将解密后的TS数据包中同步标识为0x48的数据包更改为0x47并重新封装为TS1,将同步标识为0x49的数据包更改为0x47并重新封装为TS2。Exemplarily, as described above, when the
进一步的,如图4所示,存储单元20、标识单元30和TS流重构单元40的功能可由一个集成芯片(即TS数据处理芯片70)实现。Further, as shown in FIG. 4, the functions of the
进一步的,上述多路TS流均为加密的TS流。本方案提供的多媒体接收装置,能够实现基于一个解密单元对多路加密的TS流进行解密。Further, the multiple TS streams are all encrypted TS streams. The multimedia receiving apparatus provided by the solution can decrypt the multiplexed TS stream based on a decryption unit.
值得一提的,当解调器10根据接收到的信号生成的TS流中,且部分TS流为加密TS流,部分TS流为非加密TS流时,本申请的方案依旧会将多路TS流中的TS数据包进行区分标识,进而按时间顺序将区分标识的TS数据包发送给解密单元,解密单元根据区分标识,有选择性地对需要解密的TS数据包进行解密,解密后区分标识的TS数据包再将其同步标识更改为现有标准协议下固有的同步标识,以形成多路节目。显然,也可在区分标识之前增加判断模块,进而判断接收的TS流是否是加密流,如果是加密流,则进行区分标识,否则,直接将非加密TS流输出到解码器中,本方案对此不做过多的限定。It is worth mentioning that when the
进一步的,各个芯片之间通过IIC(Inter-IntegratedCircuit,集成电路总线)控制协议进行信息交互。具体的,系统芯片通过IIC控制解调器10,设置输出TS流的数据格式及需要解调的频道,解调器10通过IIC控制Tuner进行频道的选择,Tuner将解调器10需求的频点通过IF/IQ信号传给解调器10进行解调;解调器10将解调后的加密的TS流(如图2中TS1和TS2)发送至存储单元20;进而系统芯片通过IIC控制标识单 元30,使得标识单元30将存储单元20接收到的TS1和TS2中的TS数据包进行区分标识,具有不同区分标识的TS数据包形成新数据流(即图2和图4中的MS流),该新数据流发送至解密单元50中,解密单元50再对具有不同区分标识的TS数据包形成的新数据流进行解密。。Further, information exchange between the chips is performed by an Inter-Integrated Circuit (IIC) control protocol. Specifically, the system chip controls the
解密单元50可以是CI卡,CI卡也叫CAM(Conditional Access Module,条件接收模块)卡,指的是一个用于对数字多媒体节目信号进行解密的模块。广泛使用的一种方案中,电视运营商通过授权给CAM解调器生产厂家,使CAM生产厂家按照一定的方式加解扰,加解密模式对运营商发行的加密付费信号进行解扰加扰,解密加密。从而实现用户更换不同的CAM卡就可以观看不同运营商发行的付费信号。CI卡为数字电视卡或高档机顶盒专用,可用于有线数字电视卡,卫星数字电视卡。也可用于机卡分离的机顶盒、数字电视一体机等。The
进一步的,TS流重构单元40将解密后的多个TS数据包按照区分标识进行分类封装。解码器60,用于将分类封装的多个TS数据包解码以形成视频数据、音频数据和其他数据。Further, the TS
可选的,解码器60根据TS数据包的包头信息中PID信息,将TS流解码并拆分为视频数据、音频数据和其他数据。示例性的,根据TS流标准协议规定,若某个TS数据包的PID=45,则该TS数据包为视频数据;若某个TS数据包的PID=78,则该TS数据包为音频数据;若某个TS数据包的PID=69,则该段TS数据为填充数据。解码器将解密后的TS流拆分为视频数据和音频数据,以分别用于显示和播放。Optionally, the
进一步的IF(IF:Intermediate Frequency)为中频信号,IQ(In-phase Quadrature)为基带信号,DVB-S2(DVB-Satellite-Second Generation,第二代卫星数字视频广播)为卫星信号,DVB-T2(DVB-Second Terrestrial,第二代地面数字视频广播)为地面广播信号,DVB-C(DVB-Cable,有线数字视频广播)为有线信号,高频头用于接收上述DVB-S2、DVB-T2/C信号,并将接收到的信号发送至解调器10进行解调。Further IF (IF: Intermediate Frequency) is an intermediate frequency signal, IQ (In-phase Quadrature) is a baseband signal, and DVB-S2 (DVB-Satellite-Second Generation, a second generation satellite digital video broadcasting) is a satellite signal, DVB-T2 (DVB-Second Terrestrial, second generation terrestrial digital video broadcasting) is a terrestrial broadcast signal, DVB-C (DVB-Cable, cable digital video broadcasting) is a wired signal, and a tuner is used to receive the above DVB-S2, DVB-T2 The /C signal is sent to the
具体的,高频头接收信号(DVB-S2、DVB-T2/C),并将该信号以IQ、IF信号的方式发送给解调器10,解调器10根据接收到的信号获取对应的TS流,同时根据用户选择的多媒体节目信息所对应的TS流的PID,确定需要发送至解密单元50的待解密的TS数据包;与解调器10的输出端相连的存储单元20接收该TS数据包,并由标识单元30对获取的多路TS流中的TS数据包分别进行区分标识;解密单元50接收该存储单元发送的区分标识的TS数据包,并在不同时间段内分别对区分标识的TS数据包进行解密;进一步的,解密单元50通过输出端将解密后的区分标识的TS数据包发送给TS流 重构单元40,TS流重构单元40根据区分标识规则,对解密后的区分标识的TS数据包进行区分并形成解密后的多路TS流,发送至解码器60以形成多路节目,该多路节目用于播放或/和录制。Specifically, the tuner receives the signal (DVB-S2, DVB-T2/C), and sends the signal to the
在一个示例中,如图5a所示,存储单元、标识单元、TS流重构单元和解码器集成到系统芯片SOC(System on Chip,片上系统)80中。该系统芯片SOC 80包含上述各单元的功能和作用。具体的,当多路加密的TS流由解调器10解调后,将该多路TS流输入并存储到系统芯片SOC 80中。系统芯片SOC 80对该多路TS流的TS数据包进行区分标识,以确定多路TS流中的TS数据包各源自哪路TS流,进而将区分标识后的TS数据包,按照先进先出的时间顺序,并基于一定的传输速率发送给解密单元50。解密单元50根据其预设的解密规则,对区分标识后的TS流解密,并将解密后的TS数据包回传给系统芯片SOC 80。系统芯片SOC 80根据区分标识对解密后的TS数据包进行区分,并把属于源自同一TS流的TS数据包重新封装为一路TS流形成封装的多路TS流,最终对重新封装的多路TS流进行解码以形成多路节目。In one example, as shown in FIG. 5a, the storage unit, the identification unit, the TS stream reconstruction unit, and the decoder are integrated into a system on chip SOC (System on Chip) 80. The
在另一示例中,如图5b所示,标识单元、TS流重构单元和解码器集成到系统芯片SOC(System on Chip,片上系统)80中。存储单元位于系统芯片SOC的外部。存储单元包括第一端,第二端和第三端。存储单元的第一端包括至少一个输入端,该至少一个输入端分别与解调器的至少一个输出端对应连接。存储单元的第二端包括至少一个输出端,该至少一个输出端分别与SOC芯片的至少一个输入端对应连接。存储单元的第三端与解密单元连接。解密单元通过CMD接口还与SOC芯片连接。In another example, as shown in FIG. 5b, the identification unit, the TS stream reconstruction unit, and the decoder are integrated into a system on chip SOC (System on Chip) 80. The memory unit is located outside of the system chip SOC. The storage unit includes a first end, a second end, and a third end. The first end of the storage unit includes at least one input that is respectively coupled to at least one output of the demodulator. The second end of the storage unit includes at least one output end, the at least one output end being respectively connected to at least one input end of the SOC chip. The third end of the storage unit is connected to the decryption unit. The decryption unit is also connected to the SOC chip through the CMD interface.
当两路加密的TS流由解调器解调后输入到存储单元,在该存储单元对来自于两路TS流中的TS数据包分别进行区分标记,进而将区分标记后的TS数据包,可以按照先进先出的时间顺序,并基于一定的传输速率发送给解密单元,解密单元根据其预设的解密规则,对发来的TS数据包进行解密,并在解密后将解密后的TS数据包发送回存储单元,在存储单元中根据区分标记的规则将来自于两路TS流的TS数据包重新区分开,即恢复成原来的两路数据,然后进行后续的处理以形成两路节目输出。When the two encrypted TS streams are demodulated by the demodulator and input to the storage unit, the TS packets in the two TS streams are separately marked in the storage unit, and the marked TS packets are further distinguished. It may be sent to the decryption unit according to the chronological order of the first in first out, and based on a certain transmission rate, and the decryption unit decrypts the sent TS data packet according to its preset decryption rule, and decrypts the decrypted TS data after decryption. The packet is sent back to the storage unit, and the TS packets from the two TS streams are re- distinguished according to the rule of distinguishing the mark in the storage unit, that is, the original two-way data is restored, and then the subsequent processing is performed to form two program outputs. .
请参阅图5a和图6a,本申请实施例提供的多路TS流的解密方法包括以下步骤S1-S3。Referring to FIG. 5a and FIG. 6a, the method for decrypting multiple TS streams provided by the embodiment of the present application includes the following steps S1-S3.
步骤S1、对获取的多路TS流中的TS数据包分别进行区分标识,形成具有第一区分标识的多个TS数据包和第二区分标识的多个TS数据包,所述第一区分标识用于标识第一路TS流,第二区分标识用于标识第二路TS流。Step S1: Perform differential identification on the TS packets in the obtained multiple TS streams to form a plurality of TS data packets having the first distinguishing identifier and a plurality of TS data packets of the second distinguishing identifier, where the first distinguishing identifier It is used to identify the first TS stream, and the second distinguishing identifier is used to identify the second TS stream.
举例来说,以数字电视为例进行说明,目前电视节目经压缩、打包形成的TS流通常经信道编码和调制后,形成射频信号发送到信道中进行传输,此时,接收的信号则为 射频信号,每个射频信号对应一路TS流,每路TS流中又包括至少一路电视节目对应的单节目TS流,每路电视节目对应的单节目TS流均具有对应的PID。现实生活中,当接收到多个节目信号时,每个节目信号对应一路TS流,此时用户可能有同时观看节目和录制另一路节目的需求,这就需要用一个解密单元对两路甚至多路TS流进行解密。为了解密后能将不同的节目对应的TS流中的数据包进行有效地区分,需要在解密之前将不同路TS流中的TS数据包进行区分标识。具体的对接收到的TS流中的每一个TS数据包进行标识,以确定每个TS数据包属于哪一路TS流,进而解密后的TS数据包可以根据区分标识前所属的TS流重新封装。For example, digital television is taken as an example for description. At present, a TS stream formed by compression and packing of a television program is usually channel-coded and modulated, and a radio frequency signal is formed and transmitted to the channel for transmission. At this time, the received signal is a radio frequency. The signal, each radio frequency signal corresponds to one TS stream, and each TS stream further includes a single program TS stream corresponding to at least one television program, and each single program TS stream corresponding to each television program has a corresponding PID. In real life, when receiving a plurality of program signals, each program signal corresponds to one TS stream. At this time, the user may have the need to simultaneously watch the program and record another program, which requires a decryption unit for two or more channels. The TS stream is decrypted. In order to effectively distinguish the data packets in the TS stream corresponding to different programs after decryption, it is necessary to distinguish the TS packets in the different TS streams before decryption. Specifically, each TS packet in the received TS stream is identified to determine which TS stream each TS packet belongs to, and the decrypted TS packet can be re-encapsulated according to the TS stream to which the identification identifier belongs.
示例性的,可更改TS数据包的包头信息中的同步标识。固有的同步标识为0x47,可分别对不同TS流中TS数据包包头信息中的同步标识做不同的更改。以两路为例,第一路TS流中的TS数据包,其包头信息中同步标识可以更改为0x48;第二路TS流中TS数据包的同步标识可以更改为0x49。在解密单元对区分标识后的TS数据包进行解密后,SOC芯片根据同步标识的不同,将同步标识为0x48的TS数据包重新封装为第一路TS流,将同步标识为0x49的TS数据包重新封装为第二路TS流。Illustratively, the synchronization identifier in the header information of the TS packet can be changed. The inherent synchronization identifier is 0x47, and different changes can be made to the synchronization identifiers in the TS packet header information in different TS streams. Taking two paths as an example, in the TS packet in the first TS stream, the synchronization identifier in the header information can be changed to 0x48; the synchronization identifier of the TS packet in the second TS stream can be changed to 0x49. After the decryption unit decrypts the differentiated TS packet, the SOC chip repackages the TS packet with the synchronization identifier 0x48 into the first TS stream according to the synchronization identifier, and identifies the TS packet with the synchronization identifier as 0x49. Repackaged into a second TS stream.
步骤S2:分时对具有第一区分标识和第二区分标识的多个TS数据包进行解密。Step S2: Demultiplexing a plurality of TS data packets having a first distinguishing identifier and a second distinguishing identifier in a time division manner.
目前多数电视为数字有线电视一体机,支持有线数字电视接收,但目前的数字有线电视有加密保护,需要使用当地广电部门指定的解密单元(即数字电视智能卡)解密。At present, most TVs are digital cable TVs that support cable digital TV reception. However, current digital cable TVs have encryption protection and need to be decrypted using a decryption unit (ie, digital TV smart card) designated by the local radio and television department.
将上述区分标识后的TS数据包发送到用于解密节目TS流的解密单元中,该解密单元会根据广电部门或者相关厂商预设的解密规则,对加密的TS数据包分别进行解密,进而将解密后的TS数据包发送到SOC芯片中,以形成对应的节目。Transmitting the TS packet with the differentiated identifier to the decryption unit for decrypting the program TS stream, and the decryption unit decrypts the encrypted TS packet separately according to a decryption rule preset by the radio and television department or a related manufacturer, and then The decrypted TS packets are sent to the SOC chip to form a corresponding program.
步骤S3:将解密后的多个TS数据包按照区分标识进行分类封装以形成多路节目。Step S3: classifying and packaging the decrypted plurality of TS data packets according to the distinguishing identifier to form a multi-channel program.
由于在一些协议下,SOC芯片仅能接收并识别同步标识为固有值0x47的TS流数据,对更改后同步标识为0x48和0x49的TS数据包并不能识别,进而SOC芯片也就难以输出正常的节目以供用户观看或/和录制。因此,SOC芯片接收解密单元发送的解密后的TS数据包,根据TS数据包的区分规则,对解密后的TS数据包加以区分,同时,将该区分标识更改为原有标识。具体的,在解密单元将区分标识的TS数据进行解密并回传到SOC芯片时,SOC芯片根据同步标识更改规则确定TS数据包原来所属的TS流,将原来所属于同一路TS流的TS数据包再次封装为一路TS流,同时恢复更改前TS流的同步标识,即将TS数据包的同步标识(如0x48、0x49等)更改为更改前TS流的固有同步标识(0x47),使其能够满足固有协议标准并输出至SOC芯片中,以形成多路节目。需要指出的是,固有同步标识即是指现有标准协议下,TS流的数据包包头信息的 同步标识,其是一个固定值0x47。Because under some protocols, the SOC chip can only receive and identify the TS stream data with the synchronization identifier of 0x47, the TS packets with the modified synchronization identifiers of 0x48 and 0x49 are not recognized, and the SOC chip is difficult to output normally. The program is for the user to watch or/and record. Therefore, the SOC chip receives the decrypted TS packet transmitted by the decryption unit, and distinguishes the decrypted TS packet according to the division rule of the TS packet, and changes the distinguishing identifier to the original identifier. Specifically, when the decryption unit decrypts and distinguishes the identified TS data to the SOC chip, the SOC chip determines, according to the synchronization identifier change rule, the TS stream to which the TS packet originally belongs, and the TS data originally belonging to the same TS stream. The packet is again encapsulated into one TS stream, and the synchronization identifier of the TS stream before the change is restored, that is, the synchronization identifier (such as 0x48, 0x49, etc.) of the TS packet is changed to the inherent synchronization identifier (0x47) of the TS stream before the modification, so that the packet can satisfy The inherent protocol standard is output to the SOC chip to form a multi-channel program. It should be noted that the intrinsic synchronization identifier refers to the synchronization identifier of the packet header information of the TS stream under the existing standard protocol, which is a fixed value of 0x47.
示例性的,若更改了包头信息中的同步标识,则将具有相同同步标识的TS数据包按时间顺序排列成一路数据流,形成一路节目。例如,若输入两路TS流,则解密后的数据流可根据同步标识的不同,拆分为两路数据流。其中,一路为同步标识更改为0x48的TS数据包,进而将该路TS数据包中的同步标识再更改为固有值0x47,以形成解密后的TS1;另一路为同步标识更改为0x49的TS数据包,进而将该路TS数据包中的同步标识再更改为固有值0x47,以形成解密后的TS2。进而解密后的TS1和TS2分别形成对应的节目以供播放或录制。Exemplarily, if the synchronization identifier in the packet header information is changed, the TS packets having the same synchronization identifier are arranged in chronological order into one data stream to form a one-way program. For example, if two TS streams are input, the decrypted data stream can be split into two data streams according to different synchronization identifiers. Wherein, one way is the TS packet whose synchronization identifier is changed to 0x48, and then the synchronization identifier in the TS packet is changed to the eigenvalue 0x47 to form the decrypted TS1; the other is the TS data whose synchronization identifier is changed to 0x49. The packet, in turn, changes the synchronization identifier in the TS packet to an eigenvalue of 0x47 to form the decrypted TS2. Further, the decrypted TS1 and TS2 respectively form corresponding programs for playback or recording.
在本申请实施例提供的多路TS流处理方法中,由于将解调器输出的各路TS流中的TS数据包进行区分标识,并将区分标识的TS数据包构成一路新的数据传输流,将该新数据传输流发送至用于解密的解密单元,进而在解密单元解密后,接收解密后的区分标识的TS数据包,并根据区分标识规则,对解密后的区分标识的TS数据包进行区分用以形成多路节目。因而在对该路新数据传输流中的TS数据包进行解密时,只需在数字多媒体接收装置中设置一个解密单元就可实现对各路输入的TS流的解密,从而可以简化数字多媒体接收装置的结构,降低数字多媒体接收装置的成本。In the multi-channel TS stream processing method provided by the embodiment of the present application, the TS data packets in the TS streams output by the demodulator are differentiated and identified, and the TS packets that distinguish the identifiers form a new data transmission stream. Sending the new data transmission stream to the decryption unit for decryption, and then, after decrypting the decryption unit, receiving the TS packet of the decrypted differentiated identifier, and according to the differentiated identification rule, the TS packet of the decrypted differentiated identifier Differentiate to form a multi-channel program. Therefore, when decrypting the TS packet in the new data transmission stream, the TS stream can be decrypted by setting a decryption unit in the digital multimedia receiving device, thereby simplifying the digital multimedia receiving device. The structure reduces the cost of the digital multimedia receiving device.
进一步的,用户选取需要的多媒体节目时,则可以得知所需多媒体节目分别对应的TS流的PID,根据所需多媒体节目分别对应的TS流的PID,获取需要用于解密的TS数据包。例如,对于输入的TS流信号,其可能对应于多个节目,如一路TS流对应于CCTV1和CCTV5;而用户选择观看CCTV5的节目,则可根据该PID信息从该路TS流中与CCTV5节目所对应的TS数据包。Further, when the user selects the desired multimedia program, the PID of the TS stream corresponding to the required multimedia program can be obtained, and the TS packet required for decryption is obtained according to the PID of the TS stream corresponding to the required multimedia program. For example, for an input TS stream signal, it may correspond to a plurality of programs, such as one TS stream corresponding to CCTV1 and CCTV5; and the user selects to watch the CCTV5 program, according to the PID information from the TS stream and the CCTV5 program. Corresponding TS packets.
下面以两路TS流为例,对本申请实施例提供的TS流处理方法进行详细说明。如图7所示,该TS流处理方法包括以下步骤S200-S203。The TS stream processing method provided by the embodiment of the present application is described in detail below by taking two TS streams as an example. As shown in FIG. 7, the TS stream processing method includes the following steps S200-S203.
步骤S200、获取第一路TS流和第二路TS流。Step S200: Acquire a first TS stream and a second TS stream.
从解调器生成的多路TS流中获取第一路TS流和第二路TS流。The first TS stream and the second TS stream are obtained from the plurality of TS streams generated by the demodulator.
步骤S201、对来自于第一路TS流的第一类TS数据包和来自于第二路TS流中的第二类TS数据包进行区分标记。Step S201, distinguishing between the first type TS packet from the first TS stream and the second type TS packet from the second TS stream.
举例来说,以数字电视为例进行说明,目前电视节目经压缩、打包形成的TS流通常经信道编码和调制后,形成射频信号发送到信道中进行传输,此时,接收的信号则为射频信号,每个射频信号对应一路TS流,每路TS流中又包括至少一路电视节目对应的单节目TS流,每路电视节目对应的单节目TS流均具有对应的PID。现实中,当接收 到多个节目信号时,每个节目信号对应一路TS流,此时用户可能有同时观看节目和录制另一路节目的需求,这就需要同时对两路TS流进行解密。为了解密后能将来自于不同路的TS流的数据包进行有效地区分,需要在解密之前将不同路TS流中的TS数据包进行区分标记。For example, digital television is taken as an example for description. At present, a TS stream formed by compression and packing of a television program is usually channel-coded and modulated, and a radio frequency signal is formed and transmitted to the channel for transmission. At this time, the received signal is a radio frequency. The signal, each radio frequency signal corresponds to one TS stream, and each TS stream further includes a single program TS stream corresponding to at least one television program, and each single program TS stream corresponding to each television program has a corresponding PID. In reality, when a plurality of program signals are received, each program signal corresponds to one TS stream. At this time, the user may have the need to simultaneously watch the program and record another program, which requires decrypting the two TS streams at the same time. In order to effectively distinguish the data packets from the TS streams of different paths for decryption, it is necessary to distinguish the TS packets in the different TS streams before decryption.
示例性的,可更改TS数据包的包头信息中的同步标识。固有的同步标识为0x47,可分别对不同TS流中TS数据包包头信息中的同步标识做不同的更改。例如,一路TS流中的TS数据包,其包头信息中同步标识可以更改为0x48;另一路则可以更改为0x49。Illustratively, the synchronization identifier in the header information of the TS packet can be changed. The inherent synchronization identifier is 0x47, and different changes can be made to the synchronization identifiers in the TS packet header information in different TS streams. For example, in a TS packet in a TS stream, the synchronization identifier in the header information can be changed to 0x48; the other channel can be changed to 0x49.
方便叙述起见,我们也可以将来自于其中一路TS流的TS数据包称为第一类TS数据包,将来自于另一路TS流的TS数据包称为第二类TS数据包。For convenience of description, we can also refer to TS packets from one of the TS streams as the first type of TS packets, and TS packets from the other TS stream as the second type of TS packets.
步骤S202:将已经进行区分标记的第一类TS数据包和第二类TS数据包,以串行的方式发送至一个CI卡;该CI卡依次对接收到的数据包进行解密;也就是说,该CI卡是在一些时段解密第一类TS数据包,在另一些时段解密第二类TS数据包;Step S202: transmitting the first type TS data packet and the second type TS data packet that have been marked differently to a CI card in a serial manner; the CI card sequentially decrypts the received data packet; The CI card decrypts the first type of TS data packets in some time periods, and decrypts the second type of TS data packets in other time periods;
一种具体的情况为:已经进行区分标记的所述第一类TS数据包被置入第一队列,已经进行区分标记的所述第二类TS数据包被置入第二队列,从所述第一队列和所述第二队列交替取一个TS数据包发送给所述一个CI卡进行解密。可以简单的理解为该CI卡是时分复用。A specific case is that the first type of TS packets that have been subjected to the distinguishing flag are placed in the first queue, and the second type of TS packets that have been subjected to the distinguishing flag are placed in the second queue, from the The first queue and the second queue alternately take one TS packet and send it to the one CI card for decryption. It can be simply understood that the CI card is time division multiplexed.
由于TS流的解调速度等原因,可能会出现暂时的TS流不连续的情况,这就会导致第一队列或第二队列暂时没有TS数据包;为了同步的需要,若取TS数据包时,所述第一队列或所述第二队列当时的状态恰好为空,则向此时这个空的所述第一队列或所述第二队列添加一个带有区分标记的空包;空包在解密后没有内容。Due to the demodulation speed of the TS stream, etc., there may be a case where the temporary TS stream is discontinuous, which may cause the first queue or the second queue to temporarily have no TS packets; for the purpose of synchronization, if the TS packet is taken If the state of the first queue or the second queue is just empty, add an empty packet with a distinguishing mark to the empty first queue or the second queue at this time; There is no content after decryption.
但是,在CI卡开始工作时,第一次对第一队列的判断时,若第一队列没有TS数据包,则不必添加空包;只需要转向对第二队列进行判断即可,因为这只是相当于首先对第二队列进行判断而已,而第一队列、第二队列也只是相对的区分。因此具体执行的是下述实施例的步骤。However, when the CI card starts to work, the first time the first queue is judged, if the first queue does not have a TS packet, then it is not necessary to add an empty packet; only need to turn to the second queue to judge, because this is only It is equivalent to first determining the second queue, and the first queue and the second queue are only relative distinctions. Therefore, the steps of the following embodiments are specifically performed.
第一步:CI卡开始工作;判断第一队列是否有至少一个TS数据包;若有,跳转至第二步,若无,跳转至第三步。The first step: the CI card starts to work; determine whether the first queue has at least one TS packet; if so, jump to the second step, if not, jump to the third step.
第二步:取所述第一队列首个TS数据包在CI卡中进行解密,然后跳转至第三步;The second step: taking the first TS packet of the first queue to decrypt in the CI card, and then jumping to the third step;
第三步:判断第二队列是否有至少一个TS数据包;若有,跳转至第四步,若无,跳转至第五步。Step 3: Determine whether the second queue has at least one TS packet; if yes, jump to the fourth step, if not, jump to the fifth step.
第四步:取所述第二队列首个TS数据包在CI卡中进行解密;然后跳转至第六步。The fourth step: taking the first TS packet of the second queue to decrypt in the CI card; then jumping to the sixth step.
第五步:向所述第二队列添加一个空的TS数据包在CI卡中进行解密;然后跳转至第六步。Step 5: Add an empty TS packet to the second queue to decrypt in the CI card; then jump to the sixth step.
第六步:判断第一队列是否有至少一个TS数据包;若有,跳转至第二步,若无,跳转至第七步。Step 6: Determine whether the first queue has at least one TS packet; if yes, jump to the second step, if not, jump to the seventh step.
第七步:向所述第一队列添加一个空的TS数据包在CI卡中进行解密;然后跳转至第三步。Step 7: Add an empty TS packet to the first queue to decrypt in the CI card; then jump to the third step.
步骤S203:根据所述区分标记的规则,对解密后的第一类TS数据包和第二类TS数据包进行区分以用于形成两路节目输出。Step S203: Differentiate the decrypted first type TS data packet and the second type TS data packet according to the rule of distinguishing the mark to form a two-way program output.
即,根据所述区分标记的规则,对解密后的第一类TS数据包和第二类TS数据包进行区分,恢复成原来的两路TS流,进行后续处理并形成两路节目输出。这两路节目可以分别用于节目直播和节目录制。That is, according to the rule of distinguishing the mark, the decrypted first type TS packet and the second type TS packet are distinguished, and the original two TS streams are restored, and subsequent processing is performed to form two program outputs. These two programs can be used for live broadcast and program recording.
具体地,SOC芯片接收CI卡发送的解密后的TS数据包,根据TS数据包的区分规则,对解密后的第一类TS数据包和第二类TS数据包区分开,以形成两路节目输出。示例性的,若采取更改包头信息中的同步标识,则将相同的同步标识的TS数据包按时间顺序排列成一路数据流,形成一路节目。例如,若之前输入的两路TS流,一路数据包包头信息中同步标识更改为0x48,另一路更改为0x49,则在解密后会将同步标识为0x48的TS数据包重新形成一路数据流输出,而将同步标识为0x49的TS数据包重新形成另一路数据流输出。Specifically, the SOC chip receives the decrypted TS data packet sent by the CI card, and distinguishes the decrypted first type TS data packet from the second type TS data packet according to the distinguishing rule of the TS data packet to form two programs. Output. Exemplarily, if the synchronization identifier in the header information is changed, the TS packets of the same synchronization identifier are arranged in chronological order into one data stream to form a program. For example, if two TS streams are input before, the synchronization identifier of one packet header information is changed to 0x48, and the other path is changed to 0x49, after decryption, the TS packet with the synchronization identifier of 0x48 is re-formed as one data stream output. The TS packet whose synchronization is identified as 0x49 is reformed to form another data stream output.
在另一示例中,假设用户选取两个多媒体节目(如CCTV1和CCTV2),该两个不同的节目分别对应的TS数据包为TS-1和TS-2,TS-1和TS-2分别具有对应的PID,则根据TS-1的PID和TS-2的PID,从TS流中获取TS-1和TS-2,其中,TS-1和TS-2可能位于同一TS流中,TS-1和TS-2也可能位于不同的TS流中。In another example, it is assumed that the user selects two multimedia programs (such as CCTV1 and CCTV2), and the TS packets corresponding to the two different programs are TS-1 and TS-2, respectively, and TS-1 and TS-2 respectively have Corresponding PID, TS-1 and TS-2 are obtained from the TS stream according to the PID of TS-1 and the PID of TS-2, where TS-1 and TS-2 may be located in the same TS stream, TS-1 And TS-2 may also be located in different TS streams.
进一步的,将各个需要解密的TS数据包从TS流中提取出来后,对每个TS数据包包头信息的同步标识进行更改或重新定义,形成区分标识的TS数据包,然后将区分标识的TS数据包按时间顺序形成一路新的数据流。举例来说,需要解密的TS数据包有两路,分别为TS-1和TS-2,将TS-1和TS-2分别从多路TS流提取出来后,更改TS-1的同步标识,形成具有第一区分标识的至少一个TS数据包TS-1’,更改TS-2的同步标识,形成具有第二区分标识的至少一个TS数据包TS-2’,然后将具有第一区分标识的至少一个TS数据包TS-1’和具有第二区分标识的至少一个TS数据包TS-2’合并形成一路新的数据流。值得一提的是,对TS流的包头信息中的同步标识进行更改时,所遵循的区分规则可以根据实际需要进行。例如,所述多路TS流的包头信息中的同步标识通常 以0x47作为开始,那么,更改TS流的同步标识时,可以将具有不同区分标识的TS数据包的同步标识以0x48、0x49、0x50…等作为开始,其中,具有各区分标识的TS数据包的同步标识互不相同。举例来说,以TS数据包包括两种同步标识为例进行说明,TS数据包分别分为TS-1和TS-2两类,则TS-1的同步标识可以更改为0x48,而TS-2的同步标识可以更改为0x49。需要说明的是,对TS数据包的包头信息更改时,仅对TS数据包中包头信息的同步标识进行更改或重新定义,而并不改变目标TS流中的节目内容的PID。Further, after the TS packets that need to be decrypted are extracted from the TS stream, the synchronization identifier of each TS packet header information is changed or redefined to form a TS packet that distinguishes the identifier, and then the TS that distinguishes the identifier is The data packets form a new data stream in chronological order. For example, the TS packets that need to be decrypted have two paths, namely TS-1 and TS-2, and after TS-1 and TS-2 are respectively extracted from the multiple TS streams, the synchronization identifier of the TS-1 is changed. Forming at least one TS packet TS-1' having the first distinguishing identifier, changing the synchronization identifier of the TS-2, forming at least one TS packet TS-2' having the second distinguishing identifier, and then having the first distinguishing identifier At least one TS packet TS-1' and at least one TS packet TS-2' having a second distinguishing identifier are combined to form a new data stream. It is worth mentioning that when the synchronization identifier in the header information of the TS stream is changed, the distinguishing rule that can be followed can be performed according to actual needs. For example, the synchronization identifier in the header information of the multiple TS streams generally starts with 0x47. Then, when the synchronization identifier of the TS stream is changed, the synchronization identifiers of the TS packets with different distinguishing identifiers can be 0x48, 0x49, 0x50. ...and as a starting point, wherein the synchronization identifiers of the TS packets having the respective distinguishing identifiers are different from each other. For example, the TS packet includes two types of synchronization identifiers as an example. The TS packets are respectively classified into TS-1 and TS-2, and the synchronization identifier of the TS-1 can be changed to 0x48, and the TS-2. The synchronization ID can be changed to 0x49. It should be noted that, when the header information of the TS packet is changed, only the synchronization identifier of the header information in the TS packet is changed or redefined, and the PID of the program content in the target TS stream is not changed.
进一步的,将TS数据包的同步标识进行更改以区分标识后,将TS数据包发送至一个解密单元并进行解密时,可以则根据不同TS数据包更改后的同步标识,对TS数据包进行区分并进行解密。当检测到某个TS数据包的同步标识以0x48作为开始时,表明当前解密的TS数据包为TS-1’,则根据TS-1’中的节目内容的加密方式,对TS-1’中的节目内容进行解密。当检测到某区分标识的TS数据包的同步标识以0x49作为开始时,表明当前解密的TS数据包为TS-2’,则根据TS-2’中的节目内容的加密方式,对TS-2’中的节目内容进行解密。Further, after the synchronization identifier of the TS packet is changed to distinguish the identifier, when the TS packet is sent to a decryption unit and decrypted, the TS packet may be distinguished according to the changed synchronization identifier of the different TS packet. And decrypt it. When it is detected that the synchronization identifier of a certain TS packet starts with 0x48, indicating that the currently decrypted TS packet is TS-1', according to the encryption manner of the program content in TS-1', in TS-1' The program content is decrypted. When it is detected that the synchronization identifier of the TS packet of a certain identifier starts with 0x49, indicating that the currently decrypted TS packet is TS-2', the TS-2 is based on the encryption method of the program content in the TS-2'. The program content in ' is decrypted.
当完成对TS数据包对应的节目内容的解密后,根据步骤S2中预设的区分标识规则,即根据区分标识的TS数据包的同步标识,重新拆分为多个数据流以形成对应的多路节目。举例来说,以两路TS流为例进行说明,两路TS流分别为TS-1和TS-2,分别更改TS-1的包头信息中的同步标识和TS-2的同步标识,以形成对应的区分标识的TS数据包TS-1’和TS-2’时,区分标识的TS数据包TS-1’的同步标识以0x48作为开始,区分标识的TS数据包TS-2’的同步标识为以0x49作为开始。对区分标识的TS数据包TS-1’中的节目内容和区分标识的TS数据包TS-2’中的节目内容分别解密后,对区分标识的TS数据包TS-1’和TS-2’进行以数据包为单位进行拆分,拆分后的区分标识的TS数据包TS-1’和TS-2’的同步标识再次更改为固有同步标识即0x47,进而发送至SOC芯片以形成对应的节目,再根据用户的播放或录制需要传输至对应的单元。例如,当用户需要区分标识的TS数据包TS-1’和TS-2’均进行播放时,则区分标识的TS数据包TS-1’和TS-2’均传输至解码器,经解码后即可进行播放;当用户需要区分标识的TS数据包TS-1’播放而TS-2’录制时,则TS-1’传输至解码器,经解码后进行播放,TS-2’则经OTG(On The Go)接口进行录制;当用户需要区分标识的TS数据包TS-1’和TS-2’均进行录制时,则TS-1’和TS-2’均经OTG(On The Go)接口进行录制。After the decryption of the program content corresponding to the TS data packet is completed, according to the differential identification rule preset in step S2, that is, according to the synchronization identifier of the TS data packet of the differentiated identifier, the data stream is split into multiple data streams to form corresponding multiples. Road show. For example, two TS streams are taken as an example. The two TS streams are TS-1 and TS-2, respectively, and the synchronization identifier in the packet header information of TS-1 and the synchronization identifier of TS-2 are respectively changed to form. When the corresponding TS packets TS-1' and TS-2' are distinguished, the synchronization identifier of the identified TS packet TS-1' starts with 0x48, and the synchronization identifier of the identified TS packet TS-2' is distinguished. Start with 0x49. After decrypting the program content in the TS packet TS-1' that distinguishes the identifier from the program content in the TS packet TS-2' of the differentiated identifier, the TS packets TS-1' and TS-2' of the differentiated identifier are respectively decrypted. The splitting is performed in units of data packets, and the synchronized identifiers of the TS packets TS-1' and TS-2' of the differentiated identifiers are changed again to the inherent synchronization identifier, that is, 0x47, and then sent to the SOC chip to form a corresponding The program is then transferred to the corresponding unit according to the user's play or recording. For example, when the user needs to distinguish the identified TS data packets TS-1' and TS-2' from playing, the differentiated TS data packets TS-1' and TS-2' are transmitted to the decoder, after being decoded. It can be played; when the user needs to distinguish the identified TS packet TS-1' from playing and TS-2' is recorded, then TS-1' is transmitted to the decoder, and after decoding, the TS-2' is transmitted through the OTG. (On The Go) interface for recording; when the user needs to distinguish between the identified TS packets TS-1' and TS-2' for recording, both TS-1' and TS-2' are via OTG (On The Go) The interface is recorded.
对多个TS数据包分别进行区分标识时,需要将获取到的多路TS数据包按照时间顺序存储到存储单元中。在相关技术的TS流解密过程中,由于单个解密单元只需要对一路TS流进行解密,此时只需要保证解密单元解密的速率与TS流的传输速率一致即可, 即传输的TS流不需要进行存储,可实现实时TS流解密。但是,对于本申请的多路TS解密方法而言,由于输入的多路TS流中每一路TS流的传输速率并不相同,不同的时间段可能还会发生变化,因此,就难以保证区分标识的TS数据包的速率为一恒定数值,同时本方案还需要对TS数据包中包头信息的同步标识进行更改;因此需要先将输入的多路TS流中的数据包先存储到一个存储单元,进而更改TS数据包的同步标识。When the plurality of TS packets are separately distinguished, the acquired multiple TS packets need to be stored in the storage unit in chronological order. In the TS stream decryption process of the related art, since a single decryption unit only needs to decrypt one TS stream, it is only necessary to ensure that the decryption unit decrypts the rate and the TS stream transmission rate, that is, the transmitted TS stream does not need to be For storage, real-time TS stream decryption can be realized. However, for the multi-channel TS decryption method of the present application, since the transmission rate of each TS stream in the input multiple TS streams is not the same, different time periods may change, and therefore, it is difficult to ensure the distinguishing identifier. The rate of the TS packet is a constant value, and the scheme also needs to change the synchronization identifier of the header information in the TS packet; therefore, the data packet in the input multiple TS stream needs to be first stored in a storage unit. Then change the synchronization identifier of the TS packet.
“时间顺序”可以根据实际进行设定,例如,可以根据用户选择各多媒体节目时的时间先后顺序来设定,或者,也可以根据获取的多路TS流的先后顺序来设定,此处不做过多限定。相应的,将区分标识的TS数据包发送至解密单元时,基于先入先出的原则,按照各TS数据包在存储单元中的先后顺序,依次将各TS数据包从存储单元中提取出来,对各TS数据包的同步标识更改以形成对应的区分标识的TS数据包,并将区分标识的TS数据包依次发送至解密单元。如此设计,可以防止对区分标识的TS数据包进行合并时出现错乱。The "chronological order" can be set according to the actual situation. For example, it can be set according to the chronological order when the user selects each multimedia program, or can be set according to the order of the acquired multiple TS streams. Do too much limit. Correspondingly, when the TS packets of the differentiated identifier are sent to the decryption unit, according to the principle of first in first out, each TS packet is sequentially extracted from the storage unit according to the sequence of each TS packet in the storage unit, The synchronization identifier of each TS packet is changed to form a corresponding TS packet of the differentiated identifier, and the TS packets of the differentiated identifier are sequentially transmitted to the decryption unit. This design prevents confusion when merging TS packets that distinguish between them.
在一些实施例中,如图7所示,需要根据以下步骤确定区分标识的TS数据包的传输速率,进而根据该传输速率,将区分标识的TS数据包传输至解密单元进行解密。In some embodiments, as shown in FIG. 7, the transmission rate of the identified TS packet needs to be determined according to the following steps, and according to the transmission rate, the differentiated identified TS packet is transmitted to the decryption unit for decryption.
步骤S110、解析多路TS流的传输速率之和。Step S110, analyzing the sum of the transmission rates of the multiple TS streams.
具体地,根据各所需多媒体节目分别对应的TS流的PID,从多路TS流中提取待解密的TS数据包,则各路TS流中待解密的数据包的传输速率可以确定,在对该TS数据包的同步标识更改形成区分标识的TS数据包后,由于区分标识的TS数据包与对应与获取的TS流相比,仅TS数据包的同步标识不相同,其它均相同,因而解析获取的多路TS流的传输速率之和后,即可得知区分标识的TS数据包的传输速率之和,以便后续对将区分标识的TS数据包发送至解密单元的传输速率进行设置。Specifically, the TS data packet to be decrypted is extracted from the multiple TS streams according to the PID of the TS stream corresponding to each required multimedia program, and the transmission rate of the data packet to be decrypted in each TS stream can be determined. After the synchronization identifier of the TS packet is changed to form the TS packet of the differentiated identifier, since the TS packet of the differentiated identifier is different from the corresponding TS stream, only the synchronization identifier of the TS packet is different, and the others are the same, and thus the parsing is performed. After the sum of the transmission rates of the acquired multiple TS streams, the sum of the transmission rates of the identified TS packets can be known, so that the transmission rate of the TS packets that distinguish the identifications to the decryption unit is subsequently set.
步骤S120、根据多路TS流的传输速率之和、多路TS流的串并行传输方式和/或具有第一区分标识和第二区分标识的多个TS数据包的串并行传输方式,确定具有第一区分标识和第二区分标识的多个TS数据包的传输速率。Step S120: determining, according to a sum of transmission rates of the multiple TS streams, a serial parallel transmission manner of the multiple TS streams, and/or a serial parallel transmission manner of the plurality of TS packets having the first distinguishing identifier and the second distinguishing identifier, The transmission rate of the plurality of TS packets of the first distinguishing identifier and the second distinguishing identifier.
在相关技术中,区分标识的TS数据包通常以串行方式传输,因此,对于本方案中传输速率的设置,可以不考虑区分标识的TS数据包的传输方式,当然也可以考虑,此处不做限定。In the related art, the TS packets that distinguish the identifiers are usually transmitted in a serial manner. Therefore, for the setting of the transmission rate in this solution, the transmission mode of the identified TS packets may be disregarded, and of course, it may be considered here. Make a limit.
下面以区分标识的TS数据包以串行方式传输为例进行简单示意说明。In the following, a simple schematic description will be given by taking a serial transmission of the identified TS packets in a serial manner.
当获取的多路TS流采用串行传输方式时,区分标识的TS数据包的传输速率在数值上与获取的待解密的TS数据包的传输速率之和相同;当获取的多路TS流采用并 行传输方式时,区分标识的TS数据包的传输速率在数值上为获取的待解密的TS数据包的传输速率之和在并行线总数的平均值。举例来说,假设获取到两路节目信号,其分别对应两路TS流,获取的两路TS流分别为TS1和TS2。请参阅图8,TS1又包括两个单节目TS流,每个单节目TS流对应一路多媒体节目,两个单节目TS流分别为TS1-1和TS1-2,单节目TS流TS1-1的传输速率为12Mbps,单节目TS流TS1-2的传输速率为28Mbps,则原始TS流TS1的传输速率为40Mbps,TS2包括三个单节目TS流,每个单节目TS流对应一路多媒体节目,三个单节目TS流分别为TS2-1、TS2-2和TS2-3,单节目TS流TS2-1的传输速率为10Mbps,单节目TS流TS2-2的传输速率为14Mbps,单节目TS流TS2-3的传输速率为24Mbps,则TS2的传输速率为48Mbps。当用户选择的所需多媒体节目分别为单节目TS流TS1-1和单节目TS流TS2-1时,即用户对应选择了两路目标TS流,分别为TS1-1和TS2-1解析出的各TS流的传输速率之和则为TS1-1的传输速率与TS2-1的传输速率之和,即为22Mbps。此时,区分标识的TS数据包的传输速率之和也为TS1-1的传输速率与TS2-1的传输速率之和。在设定区分标识的TS数据包的传输速率时,根据TS1-1与TS2-1的传输速率之和以及获取的多路TS流的串并行传输方式进行设定。当获取的多路TS流采用串行传输方式时,各目标TS流的传输速率之和为22Mbps,即区分标识的TS数据包的传输速率之和也为22Mbps;此时,区分标识的TS数据包形成的新的数据流需要每秒钟传输22M bit的数据,因此,区分标识的TS数据包的时钟频率则设定为22MHz。当获取的多路TS流采用并行传输方式,且并行线总数为8条时,TS流的传输速率之和为22Mbps,即区分标识的TS数据包的传输速率之和也为22Mbps;此时,区分标识的TS数据包合并形成的区分标识的TS数据包在每条并行线上需区分标识的TS数据包的时钟频率为2.75MHz。相应的,当用户选择其它多种所需多媒体节目时,区分标识的TS数据包的时钟频率的设定方式也采用上述方式进行。When the acquired multiple TS streams adopt the serial transmission mode, the transmission rate of the identified TS packets is numerically the same as the sum of the obtained transmission rates of the TS packets to be decrypted; when the acquired multiple TS streams are used In the parallel transmission mode, the transmission rate of the identified TS packet is numerically the average of the sum of the transmission rates of the acquired TS packets to be decrypted in the total number of parallel lines. For example, it is assumed that two program signals are acquired, which respectively correspond to two TS streams, and the obtained two TS streams are TS1 and TS2, respectively. Referring to FIG. 8, TS1 further includes two single program TS streams, and each single program TS stream corresponds to one multimedia program, and two single program TS streams are TS1-1 and TS1-2, respectively, and single program TS stream TS1-1. The transmission rate is 12 Mbps, the transmission rate of the single program TS stream TS1-2 is 28 Mbps, and the transmission rate of the original TS stream TS1 is 40 Mbps, the TS2 includes three single program TS streams, and each single program TS stream corresponds to one multimedia program, three The TS streams of the single program are TS2-1, TS2-2 and TS2-3, the transmission rate of the single program TS stream TS2-1 is 10 Mbps, the transmission rate of the single program TS stream TS2-2 is 14 Mbps, and the single program TS stream TS2 The transmission rate of -3 is 24 Mbps, and the transmission rate of TS2 is 48 Mbps. When the desired multimedia program selected by the user is the single program TS stream TS1-1 and the single program TS stream TS2-1, respectively, the user correspondingly selects two target TS streams, which are respectively parsed by TS1-1 and TS2-1. The sum of the transmission rates of the TS streams is the sum of the transmission rate of TS1-1 and the transmission rate of TS2-1, that is, 22 Mbps. At this time, the sum of the transmission rates of the differentiated TS packets is also the sum of the transmission rate of TS1-1 and the transmission rate of TS2-1. When the transmission rate of the TS packet distinguishing the identification is set, the setting is made according to the sum of the transmission rates of TS1-1 and TS2-1 and the serial-parallel transmission mode of the acquired multiple TS streams. When the acquired multiple TS streams adopt the serial transmission mode, the sum of the transmission rates of the target TS streams is 22 Mbps, that is, the sum of the transmission rates of the differentiated TS packets is also 22 Mbps; at this time, the identified TS data is distinguished. The new data stream formed by the packet needs to transmit 22 Mbits of data per second. Therefore, the clock frequency of the identified TS packet is set to 22 MHz. When the acquired multiple TS streams adopt parallel transmission mode, and the total number of parallel lines is eight, the sum of the transmission rates of the TS streams is 22 Mbps, that is, the sum of the transmission rates of the differentiated TS packets is also 22 Mbps; The TS packets of the differentiated identifiers formed by the combination of the identified TS packets are separated on each parallel line, and the clock frequency of the identified TS packets is 2.75 MHz. Correspondingly, when the user selects a plurality of other desired multimedia programs, the manner of setting the clock frequency of the identified TS packets is also performed in the above manner.
进一步的,区分标识的TS数据包的传输速率的确定可以分为以下两种方式。Further, the determination of the transmission rate of the identified TS packet can be divided into the following two ways.
在传输速率确定方式一中,先将获取的多路TS流的传输速率之和解析出来,然后根据多路TS流的传输速率之、TS流的串并行传输方式和/或区分标识的TS数据包的串并行传输方式,设定区分标识的TS数据包的时钟频率。也就是说,在传输速率确定方式一中,区分标识的TS数据包的时钟频率根据获取的多路TS流的传输速率之和进行设定,可以防止因区分标识的TS数据包的时钟频率设定太小而造成区分标识的TS数据包不能及时完整地传输,同时可以防止由于区分标识的TS数据包的时钟频率设定太大而造成广播接收装置内的资源浪费。In the transmission rate determining mode 1, the sum of the obtained transmission rates of the multiple TS streams is first parsed, and then according to the transmission rate of the multiple TS streams, the serial parallel transmission mode of the TS streams, and/or the differentiated TS data. The serial transmission mode of the packet sets the clock frequency of the TS packet that distinguishes the identification. That is to say, in the transmission rate determining mode 1, the clock frequency of the identified TS packet is set according to the sum of the obtained transmission rates of the multiple TS streams, and the clock frequency of the TS packet distinguished by the identification can be prevented. The TS packets that are too small to distinguish the identifiers cannot be transmitted in time and completely, and at the same time, it is possible to prevent waste of resources in the broadcast receiving apparatus due to the setting of the clock frequency of the TS packets that distinguish the identifiers.
在传输速率确定方式二中,请参阅图9,基于固定的传输速率将区分标识的TS 数据包发送至解密单元,该固定的传输速率大于多路TS流的传输速率的和值。In the transmission rate determining mode 2, referring to FIG. 9, the differentiated identified TS data packet is sent to the decryption unit based on the fixed transmission rate, and the fixed transmission rate is greater than the sum of the transmission rates of the multiple TS streams.
具体地,将区分标识的TS数据包的时钟频率设定为一个相对固定的值,该值大于或等于获取的多路TS流的传输速率之和,其中,区分标识的TS数据包的时钟频率的设定方式可以有多种,本领域的技术人员可参考相关技术和TS流解密方式进行变化,此处不做过多赘述。Specifically, the clock frequency of the TS packet distinguishing the identifier is set to a relatively fixed value, which is greater than or equal to the sum of the transmission rates of the acquired multiple TS streams, wherein the clock frequency of the identified TS packet is distinguished. There are a plurality of ways of setting, and those skilled in the art can refer to the related art and the TS stream decryption mode to change, and no further description is made here.
例如,可以根据目前所存在的所有单节目TS流的传输速率之和设定区分标识的TS数据包的时钟频率。假设目前所存在的所有单节目TS流包括获取的TS流TS1中的TS1-1、TS1-2以及TS流TS2中的TS2-1、TS2-2、TS2-3,其中,单节目TS流TS1-1的传输速率为12Mbps,单节目TS流TS1-2的传输速率为28Mbps,单节目TS流TS2-1的传输速率为10Mbps,单节目TS流TS2-2的传输速率为14Mbps,单节目TS流TS2-3的传输速率为24Mbps,目前所存在的所有单节目TS流的传输速率之和则为88Mbps。当获取的多路TS流采用串行传输方式时,区分标识的TS数据包的时钟频率在数值上与目前所存在的所有单节目TS流的传输速率之和相等,例如可以设定区分标识的TS数据包的时钟频率为88MHz。当获取的多路TS流采用并行传输方式时,区分标识的TS数据包的时钟频率在数值上为目前所存在所有单节目TS流的传输速率之和对并行线总数的平均值。假设并行线总数为8条时,则可以设定区分标识的TS数据包的时钟频率为11MHz。采用该种方式设定区分标识的TS数据包的时钟频率,无论用户选择哪几种多媒体节目,区分标识的TS数据包的时钟频率始终为该值。For example, the clock frequency of the identified TS packet can be set according to the sum of the transmission rates of all the single program TS streams currently present. It is assumed that all the single program TS streams currently present include TS1-1, TS1-2 in the acquired TS stream TS1 and TS2-1, TS2-2, TS2-3 in the TS stream TS2, wherein the single program TS stream TS1 The transmission rate of -1 is 12 Mbps, the transmission rate of single program TS stream TS1-2 is 28 Mbps, the transmission rate of single program TS stream TS2-1 is 10 Mbps, and the transmission rate of single program TS stream TS2-2 is 14 Mbps, single program TS The transmission rate of the stream TS2-3 is 24 Mbps, and the sum of the transmission rates of all the single program TS streams present at present is 88 Mbps. When the acquired multiple TS streams adopt the serial transmission mode, the clock frequency of the identified TS packets is equal in value to the sum of the transmission rates of all the single program TS streams currently present, for example, the distinguishing identifier can be set. The TS packet has a clock frequency of 88 MHz. When the acquired multiple TS streams adopt the parallel transmission mode, the clock frequency of the differentiated TS packets is numerically the average of the sum of the transmission rates of all the single program TS streams currently present and the total number of parallel lines. Assuming that the total number of parallel lines is eight, the clock frequency of the TS packets that distinguish the identification can be set to 11 MHz. In this way, the clock frequency of the TS packets that distinguish the identifiers is set. Regardless of which multimedia programs are selected by the user, the clock frequency of the identified TS packets is always the value.
在一些实施方式中,还可以根据TS流协议中所规定的每一路TS流的最大容量设定区分标识的TS数据包的时钟频率,例如,假设目前TS流协议中所规定的每一路TS流的最大容量为108Mbps。当获取的多路TS流采用串行传输方式时,则将TS流协议中所规定的每一路TS流的最大容量作为区分标识的TS数据包的时钟频率,例如设定区分标识的TS数据包的时钟频率为108MHz。当获取的多路TS流采用并行传输方式时,将TS流协议中所规定的每一路TS流的最大容量对并行线总数的平均值作为区分标识的TS数据包的时钟频率。例如假设并行线总数为8条,则设定区分标识的TS数据包的时钟频率为13.5MHz。采用该种方式设定区分标识的TS数据包的时钟频率,无论用户选择哪几种多媒体节目,区分标识的TS数据包的时钟频率始终为该值。In some embodiments, the clock frequency of the identified TS packet may also be set according to the maximum capacity of each TS stream specified in the TS stream protocol, for example, assuming each TS stream specified in the current TS stream protocol. The maximum capacity is 108Mbps. When the acquired multiple TS streams adopt the serial transmission mode, the maximum capacity of each TS stream specified in the TS stream protocol is used as the clock frequency of the differentiated TS packet, for example, the TS packet of the differentiated identifier is set. The clock frequency is 108MHz. When the acquired multiple TS streams adopt the parallel transmission mode, the average value of the maximum capacity of each TS stream specified in the TS stream protocol and the total number of parallel lines are used as the clock frequency of the identified TS packets. For example, assuming that the total number of parallel lines is eight, the clock frequency of the TS packet that sets the discrimination flag is 13.5 MHz. In this way, the clock frequency of the TS packets that distinguish the identifiers is set. Regardless of which multimedia programs are selected by the user, the clock frequency of the identified TS packets is always the value.
在一些实施方式中,还可以根据用户所选择的多媒体节目的数量来确定区分标识的TS数据包的时钟频率。具体地,先根据目前所存在的所有单节目TS流的传输速率,确定所有单节目TS流中两个单节目TS流的传输速率之和的最大值,将该最大值作为用户选择两个多媒体节目时设定区分标识的TS数据包的时钟频率的参考。当获取的多路TS流采用串行传输方式时,可以直接将该最大值作为用户选择两个多媒体节目 时、区分标识的TS数据包的时钟频率。当获取的多路TS采用并行传输方式时,可以将该最大值对并行线总数的平均值作为用户选择两个多媒体节目的时、区分标识的TS数据包的时钟频率。此时,当用户选择两个多媒体节目,区分标识的TS数据包的时钟频率始终为该最大值。同理,根据目前所存在的所有单节目TS流的传输速率,确定所有单节目TS流中三个单节目TS流的传输速率之和的最大值,将该最大值作为用户所选择三个多媒体节目时、设定区分标识的TS数据包的时钟频率的参考。当获取的多路TS流采用串行传输方式时,可以直接将该最大值作为用户选择三个多媒体节目时、区分标识的TS数据包的时钟频率;当获取的多路TS数据采用并行传输方式时,可以将该最大值对并行线总数的平均值作为用户选择三个多媒体节目时、区分标识的TS数据包的时钟频率,此时,当用户所选择三个多媒体节目,区分标识的TS数据包的时钟频率始终为该最大值。如此,依次将用户可能选择的多媒体节目的数量所对应的传输速率之和的最大值计算出来,以此来设定区分标识的TS数据包的时钟频率。In some embodiments, the clock frequency of the differentiated TS packets may also be determined according to the number of multimedia programs selected by the user. Specifically, the maximum value of the sum of the transmission rates of the two single-program TS streams in all the single-program TS streams is determined according to the transmission rate of all the single-program TS streams currently existing, and the maximum value is selected as the user to select two multimedia. A reference to the clock frequency of the identified TS packet is set at the time of the program. When the acquired multiple TS streams adopt the serial transmission mode, the maximum value can be directly used as the clock frequency of the identified TS packets when the user selects two multimedia programs. When the acquired multiple TSs adopt the parallel transmission mode, the average value of the maximum value to the total number of parallel lines may be used as the clock frequency of the identified TS packets when the user selects two multimedia programs. At this time, when the user selects two multimedia programs, the clock frequency of the identified TS packet is always the maximum value. Similarly, the maximum value of the sum of the transmission rates of the three single-program TS streams in all the single-program TS streams is determined according to the transmission rate of all the single-program TS streams currently present, and the maximum value is selected as the three multimedia selected by the user. At the time of the program, a reference is made to set the clock frequency of the TS packet that distinguishes the identification. When the acquired multiple TS streams adopt the serial transmission mode, the maximum value can be directly used as the clock frequency of the identified TS packets when the user selects three multimedia programs; when the acquired multiple TS data is in parallel transmission mode The average value of the maximum value and the total number of parallel lines may be used as the clock frequency of the TS data packet when the user selects three multimedia programs. At this time, when the user selects three multimedia programs, the identified TS data is distinguished. The clock frequency of the packet is always the maximum. In this way, the maximum value of the sum of the transmission rates corresponding to the number of multimedia programs that the user may select is sequentially calculated, thereby setting the clock frequency of the TS packets that distinguish the identification.
完成对区分标识的TS数据包的时钟频率的设定后,将对获取到的多路TS流的包头信息中同步标识更改后形成的区分标识的TS数据包形成一路新的数据流并发送至解密单元中,该区分标识的TS数据包的时钟频率即为上述步骤中设定的时钟频率,该区分标识的TS数据包中区分标识即为包头信息中更改后的同步标识。After the setting of the clock frequency of the TS packet of the differentiated identifier is completed, the TS packet of the differentiated identifier formed by the synchronization identifier in the header information of the acquired multiple TS stream is formed into a new data stream and sent to the new data stream. In the decryption unit, the clock frequency of the TS packet of the distinguishing identifier is the clock frequency set in the foregoing step, and the distinguishing identifier in the TS packet of the distinguishing identifier is the changed synchronization identifier in the packet header information.
将区分标识的TS数据包的时钟频率设定为一个相对固定的值,因而,将该路区分标识的TS数据包发送至解密单元中进行解密时,解密单元不需要对速率动态变化的区分标识的TS数据包的时钟频率进行判断并实时调整,从而可以提高广播接收装置的工作稳定性和可靠性。The clock frequency of the TS packet distinguishing the identifier is set to a relatively fixed value. Therefore, when the TS packet of the way distinguish identifier is sent to the decryption unit for decryption, the decryption unit does not need to distinguish the identifier of the dynamic change of the rate. The clock frequency of the TS packet is judged and adjusted in real time, so that the operational stability and reliability of the broadcast receiving apparatus can be improved.
在一些实施例中,在一个传输周期内,将存储单元中区分标识的TS数据包发送至解密单元,当该存储单元中区分标识的TS数据包发送完毕,且存储单元未接收到新的区分标识的TS数据包时,以空包的形式填充区分标识的TS数据包,直至所述存储单元接收到新数据。In some embodiments, the TS packet that distinguishes the identifier in the storage unit is sent to the decryption unit in one transmission period, when the TS packet that distinguishes the identifier in the storage unit is sent, and the storage unit does not receive a new distinction. When the TS packet is identified, the TS packet distinguishing the identifier is filled in the form of a null packet until the storage unit receives the new data.
对于以固定的传输速率发送区分标识的TS数据包,将区分标识的TS数据包合并至一路新的数据流时,当相邻的两个区分标识的TS数据包连续时,则直接将各区分标识的TS数据包依次连续的合并至区分标识的TS数据包中即可,相邻的两个区分标识的TS数据包之间不存在空隙;当相邻的两个区分标识的TS数据包不连续时,即存储单元中缓存的区分标识的TS数据包已经发送完毕,且存储单元尚未接收到其他新的区分标识的TS数据包时,需要对区分标识的TS数据包形成的新数据流做特殊处理,以防止因相邻的两个区分标识的TS数据包之间存在的间隙造成区分标识的TS数据包的传输出现中断或其他影响用户观看节目的情况;例如,可以在存储单元中没有用于传 输的区分标识的TS数据包时,在新数据流中填充空包,空包的填充形式可以有多种。For a TS packet that transmits a differentiated identifier at a fixed transmission rate, when the differentiated TS packet is merged into a new data stream, when the adjacent two differentiated identifier TS packets are consecutive, the distinction is directly made. The identified TS packets are successively merged into the TS packets of the differentiated identifiers, and there is no gap between the adjacent two identified identifier TS packets; when the adjacent two differentiated identifiers of the TS packets are not present When consecutive, that is, the TS packet of the differentiated identifier buffered in the storage unit has been sent, and the storage unit has not received other new TS packets of the differentiated identifier, it is necessary to make a new data stream formed by distinguishing the identified TS packets. Special processing to prevent interruption of the transmission of the differentiated TS packets due to gaps between the adjacent two identified TS packets; or other circumstances affecting the user watching the program; for example, there may be no in the storage unit When the TS packet of the differentiated identifier is used for transmission, the empty packet is filled in the new data stream, and the filling form of the empty packet may be various.
例如,请参阅图9,当相邻的两个区分标识的TS数据包不连续时,在区分标识的TS数据包形成的新数据流中填充不包含有用信息的空包,使区分标识的TS数据包的时钟信号持续输出数据,该数据为无用数据。For example, referring to FIG. 9, when the TS packets of the adjacent two differentiated identifiers are discontinuous, the new data stream formed by the differentiated TS packets is filled with empty packets that do not contain useful information, so that the identified TSs are differentiated. The clock signal of the packet continues to output data, which is useless data.
具体地,将前一路区分标识的TS数据包发送至解密单元后,由于后一路目标TS流未到达存储单元;因而为了区分标识的TS数据包的传输持续性,在发送的区分标识的TS数据包形成的新数据流中填充不包含有用信号的空包,该空包可以为0x00或0xff等不包含有用信号的空包,使区分标识的TS数据包的时钟信号持续输出数据;此时,区分标识的TS数据包输出的数据为无用数据,当后一路区分标识的TS数据包到达时,则停止填充空包,将后一路区分标识的TS数据包发送至解密单元中。Specifically, after the TS packet of the previous path identifier is sent to the decryption unit, since the latter target TS stream does not reach the storage unit; in order to distinguish the transmission continuity of the identified TS packet, the TS data of the differentiated identifier transmitted is sent. The new data stream formed by the packet is filled with a null packet that does not contain a useful signal, and the null packet may be an empty packet that does not contain a useful signal, such as 0x00 or 0xff, so that the clock signal of the identified TS packet continuously outputs data; The data outputted by the TS packet of the distinguishing identifier is useless data. When the TS packet of the latter distinguishing identifier arrives, the filling of the empty packet is stopped, and the TS packet of the latter distinguishing identifier is sent to the decrypting unit.
或者,当相邻的两个区分标识的TS数据包不连续时,中断时钟信号的输出,停止发送数据。Alternatively, when the TS packets of the adjacent two distinguishing identifiers are discontinuous, the output of the clock signal is interrupted, and the data transmission is stopped.
具体地,将前一路区分标识的TS数据包发送至解密单元后,由于后一路目标TS流未到达存储单元;此时,在区分标识的TS数据包中填充不包含有用信号的空包,使区分标识的TS数据包的时钟信号停止输出数据,当后一路区分标识的TS数据包到达后,则停止填充空包,按照区分标识的TS数据包的时钟频率,将后一路区分标识的TS数据包发送至解密单元中。Specifically, after the TS packet of the previous identifier is sent to the decryption unit, the TS stream of the latter identifier does not reach the storage unit; at this time, the TS packet that distinguishes the identifier is filled with an empty packet that does not contain the useful signal, so that The clock signal of the identified TS packet stops outputting data, and when the TS packet of the latter identification identifier arrives, the filling of the empty packet is stopped, and the TS data of the latter identifier is distinguished according to the clock frequency of the identified TS packet. The packet is sent to the decryption unit.
进一步的,如图10所示,在插入用于解密的解密单元例如CI卡时,解密单元通过CMD(COMMAND,命令)(即解密单元控制命令)将信息传给SOC芯片,进而SOC芯片会根据解密单元的信息判断是否支持多路TS流同时解密的功能。如果检测到解密单元不支持TS混流功能,则SOC芯片在处理信息流的时候,就不会进行TS流的合并动作。具体的,当输入CI卡的是两路加密信息流时,仅会对当前频道的信息流进行解密,对另一路信息流则无法解密;如果是一路加密流,一路清流,则加密流通过CI卡进行解密,清流则不需要经过CI卡进行解密。Further, as shown in FIG. 10, when a decryption unit for decryption, such as a CI card, is inserted, the decryption unit transmits information to the SOC chip through CMD (COMMAND, command), and the SOC chip is The information of the decryption unit determines whether or not the function of simultaneously decrypting multiple TS streams is supported. If it is detected that the decryption unit does not support the TS mixed stream function, the SOC chip does not perform the merge action of the TS stream when processing the information stream. Specifically, when the input of the CI card is two channels of encrypted information, only the information stream of the current channel is decrypted, and the other stream of information cannot be decrypted; if it is an encrypted stream, clear stream, the encrypted stream passes through the CI. The card is decrypted, and the clear stream does not need to be decrypted by the CI card.
如果检测到解密单元不支持TS混流功能,则SOC芯片在处理信息流的时候,不论输入的几路信息流是否加密,都对其进行TS流的合并动作,合并后的TS流进入解密单元,加密流进行解密,非加密流则不做任何处理后,回传给SOC芯片,SOC芯片则根据之前的合并原则,将解密单元解密后输出的TS流进行分流。If it is detected that the decryption unit does not support the TS mixed stream function, when the SOC chip processes the information stream, whether the input information stream is encrypted or not, the TS stream is merged, and the merged TS stream enters the decryption unit. The encrypted stream is decrypted, and the non-encrypted stream is sent back to the SOC chip without any processing, and the SOC chip divides the TS stream outputted by the decryption unit according to the previous merge principle.
如图11所示,本申请实施例还提供一种广播接收装置。所述广播接收装置包括:原始TS流生成单元101、目标TS流选择单元102、标识单元103、解密单元104和TS流重构单元105。原始TS流生成单元101用于接收信号并根据接收到的信号生成多路 原始TS流。目标TS流选择单元102与原始TS流生成单元101连接,目标TS流选择单元102用于根据各所需多媒体节目分别对应的TS流的PID,从多路原始TS流中提取至少两路目标TS流。标识单元103与目标TS流选择单元102连接,标识单元103用于重新定义的至少两路目标TS流的包头,形成对应的至少两路备用TS流,并基于所述至少两路备用TS流生成一路新TS流,其中,所述至少两路备用TS流的包头互不相同。解密单元104与标识单元103连接,解密单元104用于对新TS流进行解密。TS流重构单元105与解密单元104连接,TS流重构单元105用于根据所述至少两路备用TS流的包头,将新TS流中的备用TS流分封装。As shown in FIG. 11, the embodiment of the present application further provides a broadcast receiving apparatus. The broadcast receiving apparatus includes an original TS
其中,原始TS流生成单元101可以包括高频头110和解调器120,高频头110用于接收信号,解调器120用于根据接收到的信号生成多路原始TS流;解密单元104可以为CICAM卡,CICAM卡包括CI卡和CAM模块。The original TS
继续参阅图11,当各目标TS流中的节目内容未进行加密时,则与各目标TS流对应的各备用TS流中的节目内容也未进行加密,则无需对备用TS流中的节目内容进行解密。因此,标识单元40还与TS流重构单元105连接,标识单元40将备用TS流进行合并形成一路新TS流后,该路新TS流则直接传输至TS流重构单元105中,TS流重构单元105则对该路新TS流进行分类封装,也即将该路新TS流中备用TS流拆分。With continued reference to FIG. 11, when the program content in each target TS stream is not encrypted, the program content in each spare TS stream corresponding to each target TS stream is not encrypted, and the program content in the standby TS stream is not required. Decrypt. Therefore, the
继续参阅图11,本申请实施例提供的广播接收装置还包括存储器106。存储器106分别与目标TS流选择单元102和标识单元103连接。存储器106用于存储目标TS流选择单元102提取的目标TS流。存储器106可以包括内置存储器或/和外设存储器,其中,内置存储器可以为高速缓冲存储器(Cache Memory),设置在广播接收装置内部,外置存储器也可以为高速缓冲存储器(Cache Memory),此时,可以在广播接收装置上设置存储器插槽,当需要使用外部存储器时,将外部存储器插入存储器插槽中即可。With continued reference to FIG. 11, the broadcast receiving apparatus provided by the embodiment of the present application further includes a
继续参阅图11,在本申请实施例中,原始TS流生成单元101可以包括高频头110和解调器120,其中,高频头110用于接收信号,解调器120分别与高频头110和目标TS流选择单元102连接,解调器120用于根据高频头110接收到的信号生成原始TS流。With continued reference to FIG. 11, in the embodiment of the present application, the original TS
在上述实施例中,解调器120的数量和目标TS流选择单元102的数量可以根据实际需要进行设定。例如,解调器120的数量可以为一个或多个,目标TS流选择单元102的数量也可以为一个或多个。在本申请实施例中,继续参阅图10,解调器120的数量和目标TS流选择单元100的数量均为多个,解调器120的数量与目标TS流选择单元102的数量相同,多个目标TS流选择单元102与多个解调器120一一对应连接。每 个解调器120解调形成的原始TS流传输至对应的目标TS流选择单元102。该目标TS流选择单元102则根据用户选择的各多媒体节目分别对应的TS流的PID,确定是否需要从对应的原始TS流中提取目标TS流。In the above embodiment, the number of
如图12所示,本申请实施例还提供一种TS流处理方法。该方法包括以下步骤S21-S24。As shown in FIG. 12, the embodiment of the present application further provides a TS stream processing method. The method includes the following steps S21-S24.
步骤S21、根据各所需多媒体节目分别对应的TS流的包标识码PID,从解调器生成的多路原始TS流中提取至少两路目标TS流。Step S21: Extract at least two target TS streams from the multiplexed original TS streams generated by the demodulator according to the packet identification code PID of the TS stream corresponding to each required multimedia program.
具体地,用户选取需要的多媒体节目后,则可以得知所需多媒体节目分别对应的TS流的PID,根据所需多媒体节目分别对应的TS流的PID,从原始TS流中提取各目标TS流。例如,假设用户选取两个多媒体节目,分别对应的TS流为TS-1和TS-2,TS-1和TS-2分别具有对应的PID,在步骤S21中,则根据TS-1的PID和TS-2的PID,从原始TS流中提取TS-1和TS-2,其中,TS-1和TS-2可能位于同一原始TS流中,TS-1和TS-2也可能位于不同的原始TS流中。Specifically, after the user selects the required multimedia program, the PID of the TS stream corresponding to the required multimedia program can be known, and the target TS stream is extracted from the original TS stream according to the PID of the TS stream corresponding to the required multimedia program. . For example, suppose the user selects two multimedia programs, and the corresponding TS streams are TS-1 and TS-2, respectively, and TS-1 and TS-2 respectively have corresponding PIDs. In step S21, according to the PID and the TS-1. The TS-2 PID extracts TS-1 and TS-2 from the original TS stream, where TS-1 and TS-2 may be located in the same original TS stream, and TS-1 and TS-2 may also be located in different originals. In the TS stream.
步骤S22、重新定义所述至少两路目标TS流的包头,形成对应的至少两路备用TS流,并将所述至少两路备用TS流合并为一路新TS流,其中,所述至少两路备用TS流的包头互不相同。Step S22, redefining the headers of the at least two target TS streams, forming corresponding at least two standby TS streams, and combining the at least two standby TS streams into one new TS stream, where the at least two paths are The headers of the alternate TS streams are different from each other.
具体地,将各目标TS流从原始TS流中提取出来后,对每个目标TS流的包头重新定义,形成对应的备用TS流,然后将所有的备用TS流合并为一路新TS流。举例来说,在将目标TS流TS-1和目标TS流TS-2从原始TS流中提取出来后,对TS-1的包头重新定义,形成对应的备用TS流TS-1’,对TS-2的包头重新定义,形成对应的备用TS流TS-2’,然后将备用TS流TS-1’和备用TS流TS-2’合并为一路新TS流。值得一提的是,对目标TS流的包头重新定义时,所遵循的规则可以根据实际需要进行。例如,目前,TS流的包头通常以0x47作为开始,那么,重新定义目标TS流的包头,形成对应的备用TS流时,则可以将备用TS流的包头以0x48、0x49、0x50…等作为开始,其中,各备用流的包头互不相同。举例来说,以目标TS流包括两个TS-1和TS-2为例,重新定义目标TS流TS-1的包头以形成对应的备用TS流TS-1’时,可以将包头设定为以0x48作为开始,则形成的备用TS流TS-1’的包头以0x48作为开始,重新定义目标TS流TS-2的包头以形成对应的备用TS流TS-2’时,可以将包头设定为以0x49作为开始,则形成的备用TS流TS-2’的包头以0x49作为开始。需要说明的是,在步骤S22中,对目标TS流的包头重新定义时,仅对目标TS流的包头的开始进行重新定义,而并不改变目标TS流中的节目内容的PID。Specifically, after each target TS stream is extracted from the original TS stream, the header of each target TS stream is redefined to form a corresponding standby TS stream, and then all the spare TS streams are merged into one new TS stream. For example, after the target TS stream TS-1 and the target TS stream TS-2 are extracted from the original TS stream, the header of the TS-1 is redefined to form a corresponding standby TS stream TS-1', for the TS. The header of -2 is redefined to form a corresponding spare TS stream TS-2', and then the spare TS stream TS-1' and the alternate TS stream TS-2' are combined into one new TS stream. It is worth mentioning that when redefining the header of the target TS stream, the rules to be followed can be performed according to actual needs. For example, at present, the header of a TS stream usually starts with 0x47. Then, when the header of the target TS stream is redefined to form a corresponding spare TS stream, the header of the spare TS stream can start with 0x48, 0x49, 0x50, etc. , wherein the headers of the alternate streams are different from each other. For example, when the target TS stream includes two TS-1s and TS-2s as an example, when the header of the target TS stream TS-1 is redefined to form a corresponding standby TS stream TS-1', the packet header may be set to Starting with 0x48, the header of the formed standby TS stream TS-1' starts with 0x48, and when the header of the target TS stream TS-2 is redefined to form the corresponding standby TS stream TS-2', the header can be set. To start with 0x49, the header of the formed spare TS stream TS-2' starts with 0x49. It should be noted that, in step S22, when the header of the target TS stream is redefined, only the start of the header of the target TS stream is redefined, and the PID of the program content in the target TS stream is not changed.
步骤S23、对所述一路新TS流进行解密。Step S23: Decrypt the one new TS stream.
具体地,将所有的备用TS流合并为一路新TS流后,对新TS流中的备用TS流中的节目内容进行解密时,可以则根据新TS流中的备用TS流的包头,对新TS流中的备用TS流中的节目内容进行解密。举例来说,以目标TS流TS-1和TS-2包括两个TS-1和TS-2为例,在步骤S22中,分别重新定义TS-1的包头和TS-2的包头,形成对应的备用TS流TS-1’和备用TS流TS-2’后,备用TS流TS-1’的包头设定为以0x48作为开始,备用TS流TS-2’的包头设定为以0x49作为开始,在步骤S23中,当探寻到某备用TS流的包头以0x48作为开始时,表明探寻到的该备用TS流为TS-1’,则根据TS-1’中的节目内容的加密方式,对TS-1’中的节目内容进行解密,当探寻到某备用TS流的包头以0x49作为开始时,表明探寻到的该备用TS流为TS-2’,则根据TS-2’中的节目内容的加密方式,对TS-2’中的节目内容进行解密。Specifically, after all the spare TS streams are merged into one new TS stream, when the program content in the standby TS stream in the new TS stream is decrypted, the new TS stream may be new according to the header of the standby TS stream. The program content in the spare TS stream in the TS stream is decrypted. For example, taking the target TS stream TS-1 and TS-2 as two TS-1 and TS-2 as an example, in step S22, the header of the TS-1 and the header of the TS-2 are respectively redefined to form a correspondence. After the standby TS stream TS-1' and the standby TS stream TS-2', the header of the standby TS stream TS-1' is set to start with 0x48, and the header of the standby TS stream TS-2' is set to 0x49. Initially, in step S23, when the header of a certain spare TS stream is found to start with 0x48, indicating that the spare TS stream sought is TS-1', according to the encryption method of the program content in TS-1', Decoding the program content in TS-1'. When it is found that the header of a spare TS stream starts with 0x49, indicating that the spare TS stream sought is TS-2', according to the program in TS-2' The content encryption method decrypts the program content in TS-2'.
需要说明的是,当新TS流中的各备用TS流的节目内容的加密方式相同时,则表明对新TS流中的各备用TS流的节目内容进行解密的方式也相同,此时,在步骤S24中,对新TS流中的备用TS流中的节目内容进行解密时,可以不对备用TS流的包头进行探寻。It should be noted that when the encryption content of the program content of each standby TS stream in the new TS stream is the same, it indicates that the program content of each standby TS stream in the new TS stream is decrypted in the same manner. In step S24, when the program content in the spare TS stream in the new TS stream is decrypted, the header of the spare TS stream may not be searched.
步骤S24、根据至少两个备用TS流的包头,将新TS流中的备用TS流分类封装。Step S24: classify the spare TS streams in the new TS stream according to the header of the at least two standby TS streams.
在步骤S24中,根据步骤S22中对目标TS流重新定义的包头,即根据备用TS流的包头,将新TS流中的备用TS流分类封装。举例来说,以目标TS流包括两个TS-1和TS-2为例,在步骤S22中,分别重新定义TS-1的包头和TS-2的包头,以形成对应的备用TS流TS-1’和备用TS流TS-2’时,备用TS流TS-1’的包头以0x48作为开始,备用TS流TS-2’的包头为以0x49作为开始,在步骤S23中,对备用TS流TS-1’中的节目内容和备用TS流TS-2’中的节目内容分别解密后,在步骤S24中,对备用TS流TS-1’和备用TS流TS-2’合并形成的新TS流进行分类封装,封装后的备用TS流TS-1’和备用TS流TS-2’可以根据用户的需要传输至对应的单元。例如,当用户需要备用TS流TS-1’和备用TS流TS-2’均进行播放时,则备用TS流TS-1’和备用TS流TS-2’均传输至解码器,经解码后即可进行播放;当用户需要备用TS流TS-1’播放而备用TS流TS-2’录制时,则备用TS流TS-1’传输至解码器,经解码后进行播放,备用TS流TS-2’则经OTG(On The Go)接口进行录制;当用户需要备用TS流TS-1’和备用TS流TS-2’均进行录制时,则备用TS流TS-1’和备用TS流TS-2’均经OTG(On The Go)接口进行录制。In step S24, the spare TS stream in the new TS stream is classified and encapsulated according to the header redefined in the target TS stream in step S22, that is, according to the header of the spare TS stream. For example, taking the target TS stream as two TS-1 and TS-2 as an example, in step S22, the header of TS-1 and the header of TS-2 are respectively redefined to form a corresponding standby TS stream TS- 1' and the standby TS stream TS-2', the header of the standby TS stream TS-1' starts with 0x48, the header of the standby TS stream TS-2' starts with 0x49, and in step S23, the standby TS stream After the program content in TS-1' and the program content in the alternate TS stream TS-2' are respectively decrypted, in step S24, the new TS formed by combining the standby TS stream TS-1' and the standby TS stream TS-2' The stream is classified and encapsulated, and the encapsulated spare TS stream TS-1' and the spare TS stream TS-2' may be transmitted to the corresponding unit according to the needs of the user. For example, when the user needs to play both the standby TS stream TS-1' and the standby TS stream TS-2', the standby TS stream TS-1' and the standby TS stream TS-2' are both transmitted to the decoder, after being decoded. The playback can be performed; when the user needs the spare TS stream TS-1' to play and the standby TS stream TS-2' to record, the standby TS stream TS-1' is transmitted to the decoder, and after being decoded, the playback is performed, and the standby TS stream TS -2' is recorded by the OTG (On The Go) interface; when the user needs to record both the standby TS stream TS-1' and the standby TS stream TS-2', the standby TS stream TS-1' and the standby TS stream The TS-2' is recorded via the OTG (On The Go) interface.
由上述分析可知,在本申请实施例提供的TS流处理方法中,将目标TS流对应 的备用TS流合并为一路新TS流,然后对该路新TS流中的备用TS流进行解密,这样,实现利用一个通道对多路备用TS流的解密,进而实现多路目标TS流分别对应的多媒体节目的播放或录制。According to the above analysis, in the TS stream processing method provided by the embodiment of the present application, the standby TS stream corresponding to the target TS stream is merged into one new TS stream, and then the standby TS stream in the new TS stream is decrypted. The decryption of the multiple standby TS streams by one channel is realized, thereby realizing the playing or recording of the multimedia programs corresponding to the multiple target TS streams respectively.
在一个示例中,在步骤21根据各所需多媒体节目分别对应的TS流的包标识码PID,从解调器生成的多路原始TS流中提取至少两路目标TS流之前,还包括:步骤S20、接收信号,并根据接收到的信号生成原始TS流。In an example, before the step of extracting at least two target TS streams from the multiplexed original TS stream generated by the demodulator according to the packet identification code PID of the TS stream corresponding to each of the required multimedia programs, the method further includes: S20. Receive a signal, and generate an original TS stream according to the received signal.
举例来说,以数字电视为例进行说明,目前电视节目经压缩、打包形成的TS流通常经信道编码和调制后,形成射频信号发送到信道中,进行传输,此时,在步骤S20中,接收的信号则为射频信号,每个视频信号对应一路TS流,每路TS流中又包括至少一路电视节目对应的单节目TS流,每路电视节目对应的单节目TS流均具有对应的PID。在步骤S21中,根据接收到的信号生成原始TS流时,对接收到的每个射频信号进行处理,对应生成原始TS流,该原始TS流包括至少一路电视节目对应的单节目TS流。For example, digital television is taken as an example for description. Currently, a TS stream that is compressed and packaged by a television program is usually channel-coded and modulated, and a radio frequency signal is formed and transmitted to the channel for transmission. At this time, in step S20, The received signal is a radio frequency signal, and each video signal corresponds to one TS stream. Each TS stream further includes a single program TS stream corresponding to at least one television program, and each single program TS stream corresponding to each television program has a corresponding PID. . In step S21, when the original TS stream is generated according to the received signal, each received radio frequency signal is processed to generate an original TS stream, and the original TS stream includes a single program TS stream corresponding to at least one television program.
上述TS流处理方法的其他实施例可参照前述的多路TS流的处理方法中的实施例,在此不做赘述。For other embodiments of the foregoing TS stream processing method, reference may be made to the foregoing embodiments of the method for processing the multiple TS streams, and details are not described herein.
在上述实施方式的描述中,具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of the above embodiments, specific features, structures, materials or characteristics may be combined in any suitable manner in any one or more embodiments or examples.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application. It should be covered by the scope of protection of this application. Therefore, the scope of protection of the present application should be determined by the scope of the claims.
Claims (22)
Applications Claiming Priority (12)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810471962.3 | 2018-05-16 | ||
| CN201810470418.7A CN108712679A (en) | 2018-05-16 | 2018-05-16 | A kind of broadcast receiver |
| CN201810470234.0 | 2018-05-16 | ||
| CN201810469172.1A CN108600832A (en) | 2018-05-16 | 2018-05-16 | A method of TS streams are decrypted |
| CN201810470418.7 | 2018-05-16 | ||
| CN201810471962.3A CN108551590A (en) | 2018-05-16 | 2018-05-16 | TS method for stream processing and device are received for broadcast receiver |
| CN201810469738.0 | 2018-05-16 | ||
| CN201810469172.1 | 2018-05-16 | ||
| CN201810469837.9A CN108737889A (en) | 2018-05-16 | 2018-05-16 | A kind of TS method for stream processing and digital multimedia reception device |
| CN201810470234.0A CN108429928A (en) | 2018-05-16 | 2018-05-16 | A method of TS streams are decrypted |
| CN201810469837.9 | 2018-05-16 | ||
| CN201810469738.0A CN108650548A (en) | 2018-05-16 | 2018-05-16 | A method of TS streams are decrypted |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019219056A1 true WO2019219056A1 (en) | 2019-11-21 |
Family
ID=68539510
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/087205 Ceased WO2019219056A1 (en) | 2018-05-16 | 2019-05-16 | Ts processing method and device |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2019219056A1 (en) |
Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2001043444A2 (en) * | 1999-12-13 | 2001-06-14 | Scientific-Atlanta, Inc. | Method of identifying multiple digital streams within a multiplexed signal |
| CN1543216A (en) * | 2003-03-26 | 2004-11-03 | Common interface controller and method of descrambling transport stream channels | |
| CN103763579A (en) * | 2014-01-22 | 2014-04-30 | 深圳国微技术有限公司 | Method for recognizing multichannel transmission streams based on USB interface |
| CN103875230A (en) * | 2011-10-07 | 2014-06-18 | 晶像股份有限公司 | Identification and handling of data streams using coded preambles |
| CN108429928A (en) * | 2018-05-16 | 2018-08-21 | 青岛海信电器股份有限公司 | A method of TS streams are decrypted |
| CN108551590A (en) * | 2018-05-16 | 2018-09-18 | 青岛海信电器股份有限公司 | TS method for stream processing and device are received for broadcast receiver |
| CN108600832A (en) * | 2018-05-16 | 2018-09-28 | 青岛海信电器股份有限公司 | A method of TS streams are decrypted |
| CN108712679A (en) * | 2018-05-16 | 2018-10-26 | 青岛海信电器股份有限公司 | A kind of broadcast receiver |
| CN108737889A (en) * | 2018-05-16 | 2018-11-02 | 青岛海信电器股份有限公司 | A kind of TS method for stream processing and digital multimedia reception device |
-
2019
- 2019-05-16 WO PCT/CN2019/087205 patent/WO2019219056A1/en not_active Ceased
Patent Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2001043444A2 (en) * | 1999-12-13 | 2001-06-14 | Scientific-Atlanta, Inc. | Method of identifying multiple digital streams within a multiplexed signal |
| CN1543216A (en) * | 2003-03-26 | 2004-11-03 | Common interface controller and method of descrambling transport stream channels | |
| CN103875230A (en) * | 2011-10-07 | 2014-06-18 | 晶像股份有限公司 | Identification and handling of data streams using coded preambles |
| CN103763579A (en) * | 2014-01-22 | 2014-04-30 | 深圳国微技术有限公司 | Method for recognizing multichannel transmission streams based on USB interface |
| CN108429928A (en) * | 2018-05-16 | 2018-08-21 | 青岛海信电器股份有限公司 | A method of TS streams are decrypted |
| CN108551590A (en) * | 2018-05-16 | 2018-09-18 | 青岛海信电器股份有限公司 | TS method for stream processing and device are received for broadcast receiver |
| CN108600832A (en) * | 2018-05-16 | 2018-09-28 | 青岛海信电器股份有限公司 | A method of TS streams are decrypted |
| CN108712679A (en) * | 2018-05-16 | 2018-10-26 | 青岛海信电器股份有限公司 | A kind of broadcast receiver |
| CN108737889A (en) * | 2018-05-16 | 2018-11-02 | 青岛海信电器股份有限公司 | A kind of TS method for stream processing and digital multimedia reception device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7856034B2 (en) | Method and system for generating digital video broadcast (DVB) transport stream from direct satellite system (DSS) transport stream | |
| US9307287B2 (en) | Transport-stream provider, DAB signal provider, transport stream analyzer, DAB receiver, method, computer program, and transport stream signal | |
| CN100353745C (en) | Method of Constructing MPEG Program Stream from Encrypted MPEG Transport Stream | |
| KR102634779B1 (en) | Receiving devices, transmitting devices and data processing methods | |
| WO2005013112A1 (en) | Universal bidirectional serial data transport interface and its data stransport method | |
| CN101416483A (en) | Transport stream dejittering | |
| US9491437B2 (en) | Transmitter for transmitting data for constituting content, receiver for receiving and processing data, and method therefor | |
| JP3348683B2 (en) | Digital broadcast receiver | |
| CN102685591A (en) | Digital set-top box | |
| US9055351B2 (en) | Method for processing information in content receiver | |
| CN101325684B (en) | Method and system for transmitting ciphering control message based on mobile multimedia broadcast | |
| CN108551590A (en) | TS method for stream processing and device are received for broadcast receiver | |
| US8892888B2 (en) | Multiple stream decrypting and decoding systems and related methods thereof | |
| US7415014B2 (en) | Method and system for co-relating transport packets on different channels using a packet prioritization scheme | |
| US9100379B2 (en) | Transmitting apparatus, transmitting method, receiving apparatus, receiving method, program, and electronic apparatus | |
| US20020118608A1 (en) | Transmission device and method, reception device and method, recording medium and program | |
| US7742472B2 (en) | Signal processing apparatus and stream processing method | |
| CN108712679A (en) | A kind of broadcast receiver | |
| WO2019219056A1 (en) | Ts processing method and device | |
| CN101540915B (en) | Method for transmitting mobile multimedia broadcasting data, front-end system and terminal | |
| US20060197880A1 (en) | Signal processing device and stream processing method | |
| CN109743627A (en) | Playback method based on AVS+ Video coding digital movie packet | |
| JP2013258507A (en) | Digital broadcast receiver, program of the same, and digital broadcast transmitter | |
| JP2007288357A (en) | Video playback device | |
| WO2021151376A1 (en) | Reception/transmission method and reception/transmission apparatus |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19803940 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19803940 Country of ref document: EP Kind code of ref document: A1 |