CN108153873A - Compression method, television set and the readable storage medium storing program for executing of recorded file - Google Patents

Compression method, television set and the readable storage medium storing program for executing of recorded file Download PDF

Info

Publication number
CN108153873A
CN108153873A CN201711427251.8A CN201711427251A CN108153873A CN 108153873 A CN108153873 A CN 108153873A CN 201711427251 A CN201711427251 A CN 201711427251A CN 108153873 A CN108153873 A CN 108153873A
Authority
CN
China
Prior art keywords
packets
recorded file
compression
merging
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201711427251.8A
Other languages
Chinese (zh)
Other versions
CN108153873B (en
Inventor
李宏强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN201711427251.8A priority Critical patent/CN108153873B/en
Publication of CN108153873A publication Critical patent/CN108153873A/en
Application granted granted Critical
Publication of CN108153873B publication Critical patent/CN108153873B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/70Media network packetisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/184Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being bits, e.g. of the compressed video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression

Abstract

The invention discloses a kind of compression method of recorded file, television set and readable storage medium storing program for executing, by obtaining the TS packets of recorded file, are merged identical TS packets according to the default rule that merges;According to default compression algorithm, the TS packets after merging are compressed, complete the compression of the recorded file.The present invention is by using the characteristic of TS packets, i.e., the form of TS packets is fixed in recorded file, and due to the limitation of TS inclusion quantities, and recorded file needs that the TS packets of multiple identical PID are used continuously to transmit chunk data.By the way that multiple identical PID are merged, and the TS packets after merging are compressed, realize efficient lossless compression, not only it is substantially reduced the size of recorded file, convenient for the preservation and transmission of file, and compression method is simple, it is easy to use, solve it is existing treat recorded file it is corresponding record code stream volume it is larger and be not easy to preserve with transmission the technical issues of.

Description

Compression method, television set and the readable storage medium storing program for executing of recorded file
Technical field
The present invention relates to file recorded broadcast technical field more particularly to a kind of compression method of recorded file, television sets and can Read storage medium.
Background technology
According to ISOI3818 standards, pass through the transmitting stream TS streams of recorded file (Transport Stream, TS, transport stream Either code stream)) (188 bytes or other quantity byte etc.), realize the preservation and transmission of file, recorded file is usually direct The corresponding complete TS packets (Transport Stream Packet) of recorded file.But with the promotion of recorded file clarity, High definition recorded file popularity rate increasingly improves, and the corresponding recorded file volume of TS packets is increasing.The high definition of 60 seconds is such as recorded to regard During frequency, corresponding recording code stream is more than 400Mbytes.Therefore, when recorded file it is corresponding record code stream volume it is larger when, no Convenient for preserving and transmitting.
Invention content
It is a primary object of the present invention to provide a kind of compression method of recorded file, television set and readable storage medium storing program for executing, Aim to solve the problem that it is existing treat recorded file it is corresponding record code stream volume it is larger and be not easy to preserve with transmission the technical issues of.
To achieve the above object, the present invention provides a kind of compression method of recorded file, the compression side of the recorded file Method includes the following steps:
The TS packets of recorded file are obtained, are merged identical TS packets according to the default rule that merges;
According to default compression algorithm, the TS packets after merging are compressed, complete the compression of the recorded file.
Optionally, the TS packets for obtaining recorded file merge what rule merged identical TS packets according to default Before step, further include:
The TS packet header of the TS packets is replaced with to the TSP format headers of preset format, obtains the PID of the TS packets, and by institute PID is stated to store to the TSP format headers.
Optionally, it is described obtain recorded file transport stream (TS) packet, according to it is default merge rule by identical TS packets into The step of row merges specifically includes:
The TS packets of the recorded file are obtained, according to the PID, identical TS packets are merged;
The TS packet quantity merged is obtained, and the TS packet quantity of the merging is stored to the TSP format headers.
Optionally, the TS packets for obtaining recorded file merge what rule merged identical TS packets according to default After step, further include:
Judge in the TS packets with the presence or absence of empty packet;
When there is empty packet, the empty packet is deleted, and obtains the empty packet quantity of the empty packet, by the empty packet quantity storage To the TSP format headers.
Optionally, the basis presets compression algorithm, and the TS packets after merging are compressed, complete the recorded file After the step of compression, further include:
When receiving reduction instruction, according to the TSP format headers, decompression restores the recorded file.
Optionally, described when receiving reduction instruction, according to the TSP format headers, decompression restores the recorded file The step of specifically include:
The TS packet quantity of merging in the TSP format headers restores the TS packets of merging, and according to the TSP forms Empty packet quantity in head restores the empty packet of deletion.
Optionally, the basis presets compression algorithm, and the TS packets after merging are compressed, complete the recorded file After the step of compression, further include:
When receiving selective reduction instruction, the specified PID of the specified TS packets in the selective reduction instruction is obtained;
According to the TSP format headers, obtain in compressed recorded file with the specified matched TS packets of PID, as Specified TS packets, and decompress the reduction specified TS packets.
Optionally, the basis presets compression algorithm, and the TS packets after merging are compressed, complete the recorded file The step of compression, specifically includes:
According to gzip compression algorithms, the TS packets after merging are compressed, complete the compression of the recorded file.
In addition, to achieve the above object, the present invention also provides a kind of television set, the television set includes processor, storage Device and the condensing routine that can be performed on the memory and by the processor is stored in, wherein the condensing routine is by institute When stating processor and performing, the step of realizing the compression method of recorded file as described above.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium Condensing routine is stored on storage medium, when wherein condensing routine is executed by processor, realizes the pressure of recorded file as described above The step of contracting method.
The present invention provides a kind of compression method of recorded file, television set and readable storage medium storing program for executing, and text is recorded by obtaining The TS packets of part merge identical TS packets according to the default rule that merges;According to default compression algorithm, by the TS packets after merging It is compressed, completes the compression of the recorded file.In the above manner, the present invention is recorded by using the characteristic of TS packets The form of TS packets is fixed in file, and due to the limitation of TS inclusion quantities, and recorded file needs that multiple identical PID are used continuously TS packets transmit chunk data.By the way that multiple identical PID are merged, and the TS packets after merging are compressed, realized Efficient lossless compression is not only substantially reduced the size of recorded file, convenient for the preservation and transmission of file, and compression method letter It is single, it is easy to use, solve the existing skill for treating that the corresponding recording code stream volume of recorded file is larger and is not easy to preservation and transmits Art problem.
Description of the drawings
Fig. 1 is the television set hardware architecture diagram that the embodiment of the present invention is related to;
Fig. 2 is the flow diagram of the compression method first embodiment of recorded file of the present invention;
Fig. 3 is the merging schematic diagram of step S10 in Fig. 2;
Fig. 4 is the flow diagram of the compression method second embodiment of recorded file of the present invention;
Fig. 5 is the flow diagram of the compression method 3rd embodiment of recorded file of the present invention;
Fig. 6 is the reduction schematic diagram of step S40 of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The main thought of the embodiment of the present invention is:The TS packets of recorded file are obtained, according to the default rule that merges by phase Same TS packets merge;According to default compression algorithm, the TS packets after merging are compressed, complete the pressure of the recorded file Contracting, solve it is existing treat recorded file it is corresponding record code stream volume it is larger and be not easy to preserve with transmission the technical issues of.
The present embodiments relate to the compression method of recorded file be mainly used in television set, which can pass through Various ways are realized.For example, the fixed terminals such as intelligent TV set, liquid crystal TV set or curved surface television set.
The compressing terminal using P television sets as recorded file is illustrated in subsequent descriptions, those skilled in the art will Understand, other than being used in particular for the element of mobile purpose, construction according to the embodiment of the present invention can also be applied In other types of terminal.
With reference to Fig. 1, Fig. 1 is the television set hardware architecture diagram involved in the embodiment of the present invention.The present invention is implemented In example, television set can include processor 1001 (such as CPU), communication bus 1002, user interface 1003, network interface 1004, memory 1005.Wherein, communication bus 1002 is used to implement the connection communication between these components;User interface 1003 It can include display screen (Display), input unit such as keyboard (Keyboard);Network interface 1004 can optionally include Standard wireline interface and wireless interface (such as WI-FI interfaces);Memory 1005 can be high-speed RAM memory or steady Fixed memory (non-volatile memory), such as magnetic disk storage, memory 1005 optionally can also be independently of The storage device of aforementioned processor 1001.
It will be understood by those skilled in the art that the television set hardware configuration shown in Fig. 1 does not form the limit to television set It is fixed, it can include either combining certain components or different components arrangement than illustrating more or fewer components.
With continued reference to Fig. 1, operation system can be included as a kind of memory 1005 of computer readable storage medium in Fig. 1 System, network communication module and condensing routine.
In Fig. 1, network communication module is mainly used for Connection Service device, with server into row data communication;And processor 1001 can call the condensing routine stored in memory 1005, and perform following operate:
The TS packets of recorded file are obtained, are merged identical TS packets according to the default rule that merges;
In the present embodiment, according to the requirement of ISOI3818 standards, existing transmission file generally flows (188 words by using TS Section or other) carry out transferring content.It is usually to record recorded file corresponding complete TS packets during recording.Wherein, TS flows It is made of TS packets one by one, each TS packets are by packet header (Packet Header) and bag data (Packet Data) group Into.Its middle wrapping head indicates what attribute the TS packets are, and gives the unique network identifier PID of the bag data (Packet Identification, PID).But with the raising of high-definition program popularity rate, the corresponding recording code of recorded file The volume of stream is increasing.The high-definition video file of 60 seconds is such as recorded, it is more than 400Mbytes to record code stream.Due to recorded file Recording code stream volume it is more big more be not easy to preserve and transmit, therefore, how to reduce the recording code stream volume of the recorded file It is the current technical issues that need to address.The present embodiment needs that the TS of multiple identical PID is used continuously by using recorded file The characteristic to transmit chunk data is wrapped, multiple identical PID is merged, and the TS packets after merging are compressed, realized Efficient lossless compresses.Specifically, the TS packets of recorded file are obtained.Wherein, due to TS packets can only typing 188 byte-sizeds Recorded content.Therefore, the recorded file needs the TS packets of multiple identical PID to carry out typing content.Each TS packets are containing correspondence PID, the PID is the important parameter for identifying TS packets, for identifying data that TS packets are carried.When TS code streams generate, often The elementary stream of a kind of business (video, audio, data) is endowed a different identifier PID, and decoder is by means of PID Judge that some TS packet belongs to the elementary stream of which kind of business.As shown in figure 3, identical PID is merged, merge step For:Multiple TS packets of identical PID are obtained, extract a packet header Header, and retain the Header, then by multiple TS Payload is sequentially and serially coupled together.Wherein, the data after TS packets first character section are TS payload.In Fig. 3,0x47, TS1,0x47, TS2,0x47, TS3,0x47, TS4, wherein, the TS2 in TS1 and the 4th frame in 1 in second frame has identical PID can merge.A 0x47 is extracted, and in the first frame Header being stored in 2.TS1 and TS2 sequential series, and deposit It is stored in the second frame Payload in 2.The TS3 in 0x47 and the 6th frame in 1 in the 5th frame is empty packet, and sky packet is deleted, And the third frame Header memory storages in 2 delete the number of empty packet.
According to default compression algorithm, the TS packets after merging are compressed, complete the compression of the recorded file.
Specifically, it is after merging, i.e., multiple in the multiple TS packets merged with identical PID and/or after deleting empty packet Content after TS payload sequential series is compressed, and compressed content is preserved to Payload.After merging Payload volumes are more than the volume of original TS packets, then can improve compression efficiency, reduce and record code stream volume.
Further, processor 1001 may call upon the condensing routine stored in memory 1005, and perform following grasp Make:
The TS packet header of the TS packets is replaced with to the TSP format headers of preset format, obtains the PID of the TS packets, and by institute PID is stated to store to the TSP format headers.
Further, processor 1001 may call upon the condensing routine stored in memory 1005, and perform following grasp Make:
The TS packets of the recorded file are obtained, according to the PID, identical TS packets are merged;
The TS packet quantity merged is obtained, and the TS packet quantity of the merging is stored to the TSP format headers.
Further, processor 1001 may call upon the condensing routine stored in memory 1005, and perform following grasp Make:
Judge in the recorded file with the presence or absence of empty packet;
When there is empty packet, the empty packet is deleted, and obtains the empty packet quantity of the empty packet, by the empty packet quantity storage To the TSP format headers.
Further, processor 1001 may call upon the condensing routine stored in memory 1005, and perform following grasp Make:
When receiving reduction instruction, according to the TSP format headers, decompression restores the recorded file.
Further, processor 1001 may call upon the condensing routine stored in memory 1005, and perform following grasp Make:
The TS packet quantity of merging in the TSP format headers restores the TS packets of merging, and according to the TSP forms Empty packet quantity in head restores the empty packet of deletion.
Further, processor 1001 may call upon the condensing routine stored in memory 1005, and perform following grasp Make:
When receiving selective reduction instruction, the specified PID of the specified TS packets in the selective reduction instruction is obtained;
According to the TSP format headers, obtain in compressed recorded file with the specified matched TS packets of PID, as Specified TS packets, and decompress the reduction specified TS packets.
Further, processor 1001 may call upon the condensing routine stored in memory 1005, and perform following grasp Make:
According to gzip compression algorithms, the TS packets after merging are compressed, complete the compression of the recorded file.
Compressing terminal hardware configuration based on above-mentioned recorded file proposes each reality of compression method of recorded file of the present invention Apply example.
The present invention provides a kind of compression method of recorded file.
With reference to Fig. 2, Fig. 2 is the flow diagram of the compression method first embodiment of recorded file of the present invention.
In the present embodiment, the compression method of the recorded file includes the following steps:
Step S10 obtains the TS packets of recorded file, is merged identical TS packets according to the default rule that merges;
In the present embodiment, according to the requirement of ISOI3818 standards, existing transmission file is generally flowed, and generally pass through using TS The TS streams of 188 bytes carry out the transmission of content.It is usually to record recorded file corresponding complete TS packets during recording.But It is with the raising of high-definition program popularity rate, the corresponding volume for recording code stream of recorded file is increasing.As recorded 60 seconds High-definition video file, it is more than 400Mbytes to record code stream.Since the recording code stream volume of recorded file the big more is not easy to preserve And transmission, therefore, how to reduce the recording code stream volume of the recorded file is the current technical issues that need to address.This implementation Example by using recorded file needs that the TS packets of multiple identical PID are used continuously to transmit the characteristic of chunk data, by multiple phases It is merged with PID, and the TS packets after merging is compressed, realize efficient lossless compression.Specifically, recorded file is obtained TS packets.Wherein, due to TS packets can only 188 byte-sizeds of typing recorded content.Therefore, the recorded file needs more The TS packets of a identical PID carry out typing content.For each TS packets containing corresponding PID, the PID is the important ginseng for identifying TS packets Number, for identifying data that TS packets are carried.When TS code streams generate, per the basic code of one kind business (video, audio, data) Stream is endowed a different identifier PID, and decoder judges that some TS packet belongs to the base of which kind of business by means of PID This code stream.As shown in figure 3, identical PID is merged, merging step is:Multiple TS packets of identical PID are obtained, are extracted One packet header Header, and retain the Header, then multiple TS payload are sequentially and serially coupled together.Wherein, TS packets Data after one byte are TS payload.In Fig. 3,0x47, TS1、0x47、TS2、0x47、TS3、0x47、TS4, In, the TS in 1 in second frame1With the TS in the 4th frame2With identical PID, can merge.A 0x47 is extracted, and is stored In in the first frame Header in 2.TS1And TS2Sequential series, and in the second frame Payload being stored in 2.5th frame in 1 TS in interior 0x47 and the 6th frame3It is empty packet, sky packet is deleted, and the third frame Header memory storages in 2 delete sky The number of packet.
Step S20 according to default compression algorithm, the TS packets after merging is compressed, complete the pressure of the recorded file Contracting.
Specifically, it is after merging, i.e., multiple in the multiple TS packets merged with identical PID and/or after deleting empty packet Content after TS payload sequential series is compressed, and compressed content is preserved to Payload.After merging Payload volumes are more than the volume of original TS packets, then can improve compression efficiency, reduce and record code stream volume.
Further, according to gzip compression algorithms, the TS packets after merging is compressed, complete the pressure of the recorded file Contracting.
Specifically, the Payload contents after the merging are compressed, gzip (GNUzip) compression algorithm may be used.It will be literary After part content compression, can not only reduce memory space, but also when by network transmission file, it is possible to reduce transmission when Between.Gzip compression algorithms in the present embodiment are high in not only easy to use but also compression efficiency.
The present embodiment provides a kind of compression method of recorded file, television set and readable storage medium storing program for executing, are recorded by obtaining The TS packets of file merge identical TS packets according to the default rule that merges;According to default compression algorithm, by the TS after merging Packet is compressed, and completes the compression of the recorded file.In the above manner, the present invention is recorded by using the characteristic of TS packets The form of TS packets is fixed in file processed, and due to the limitation of TS inclusion quantities, and recorded file needs to be used continuously multiple identical The TS packets of PID transmit chunk data.By the way that multiple identical PID are merged, and the TS packets after merging are compressed, it is real Show efficient lossless compression, be not only substantially reduced the size of recorded file, convenient for the preservation and transmission of file, and compression method Simply, it is easy to use, solve it is existing treat recorded file it is corresponding record code stream volume it is larger and be not easy to preserve with transmission Technical problem.
With reference to Fig. 4, Fig. 4 is the refinement flow diagram of step S10 in Fig. 2.
Based on above-mentioned embodiment illustrated in fig. 2, before step S10, further include:
The TS packet header of the TS packets is replaced with the TSP format headers of preset format by step S01, obtains the TS packets PID, and the PID is stored to the TSP format headers.
Specifically, for the ease of merging and subsequent reduction, the first byte 0x47 in former TS packets, i.e. Header can be replaced It is changed to TSP format headers.Wherein, TSP format headers may include:PacketType, for representing TS packet numbers that recorded file has, PID, as identifier.AHF, as empty packet flag, as AHF==1, there are empty packets, and as AHF==0, there is no skies Packet.NumTS wraps specific number as sky.DNP, as the empty packet number deleted, you can with by reading the number, understanding is deleted Then the empty packet number removed carries out the filling of corresponding empty packet number.Payload, as the data after TS packet first character sections, 64K byte contents can at most be stored.The PID of each TS packets in the recorded file is obtained, and each PID is stored to corresponding In TSP format headers, in PID identifiers.
Step S10 is specifically included:
Step S11 obtains the TS packets of the recorded file, and according to the PID, identical TS packets are merged;
Specifically, each TS packets of the recorded file are obtained, and obtain multiple TS packets of identical PID, extract multiple TS A packet header Header in packet, and retain the Header, then multiple TS payload are sequentially and serially coupled together.
Step S12 obtains the TS packet quantity of merging, and the TS packet quantity of the merging is stored to the TSP format headers.
Specifically, the TS packet quantity of merging is obtained, and by the TS packet quantity sequential storages of merging to the TSP forms In head.
The present embodiment provides a kind of compression method of recorded file, television set and readable storage medium storing program for executing, are recorded by obtaining The TS packets of file merge identical TS packets according to the default rule that merges;According to default compression algorithm, by the TS after merging Packet is compressed, and completes the compression of the recorded file.In the above manner, the present invention is recorded by using the characteristic of TS packets The form of TS packets is fixed in file processed, and due to the limitation of TS inclusion quantities, and recorded file needs to be used continuously multiple identical The TS packets of PID transmit chunk data.By the way that multiple identical PID are merged, and the TS packets after merging are compressed, it is real Show efficient lossless compression, be not only substantially reduced the size of recorded file, convenient for the preservation and transmission of file, and compression method Simply, it is easy to use, solve it is existing treat recorded file it is corresponding record code stream volume it is larger and be not easy to preserve with transmission Technical problem.
With reference to Fig. 5, Fig. 5 is the flow diagram of the compression method 3rd embodiment of recorded file of the present invention.
Based on above-mentioned embodiment illustrated in fig. 2, after step S10, further include:
Step S31 is judged in the TS packets with the presence or absence of empty packet;
Specifically, it due to 188 byte inadequate after recorded file deblocking, needs largely to fill the empty packet of 0xff.In addition, Rate is broadcast in order to control, it is also desirable to it is a large amount of to be inserted into empty packet, and the sky packet content has no meaning.Therefore, sky packet can be deleted Carry out code stream physical examination diminution.By reading empty packet flag AHF, judge in the TS packets with the presence or absence of empty packet.
Step S32 when there is empty packet, deletes the sky packet, and obtains the empty packet quantity of the empty packet, by the empty packet Quantity is stored to the TSP format headers.
Specifically, in the sky packet flag AHF==1, then there is empty wrap in the TS packets.Obtain the institute in the TS Free packet, and delete packet of having time.Then the empty packet quantity is obtained, and the empty packet quantity is stored to the TSP forms In head, so as to follow-up lossless reduction.
The present embodiment provides a kind of compression method of recorded file, television set and readable storage medium storing program for executing, are recorded by obtaining The TS packets of file merge identical TS packets according to the default rule that merges;According to default compression algorithm, by the TS after merging Packet is compressed, and completes the compression of the recorded file.In the above manner, the present invention is recorded by using the characteristic of TS packets The form of TS packets is fixed in file processed, and due to the limitation of TS inclusion quantities, and recorded file needs to be used continuously multiple identical The TS packets of PID transmit chunk data.By the way that multiple identical PID are merged, and the TS packets after merging are compressed, it is real Show efficient lossless compression, be not only substantially reduced the size of recorded file, convenient for the preservation and transmission of file, and compression method Simply, it is easy to use, solve it is existing treat recorded file it is corresponding record code stream volume it is larger and be not easy to preserve with transmission Technical problem.
Further, the compression method of the recorded file further includes:
Step S40, when receiving reduction instruction, according to the TSP format headers, decompression restores the recorded file.
Specifically, the present embodiment can also be achieved lossless reduction after the recorded file is compressed, consequently facilitating record File processed is stored in transmission.I.e. in the reduction instruction for receiving extraneous triggering, the TS packets in the recorded file are obtained, so The TSP format headers of the TS packets are obtained afterwards, and the TSP format headers are read out, and the TSP format headers memory contains merging PID quantity, the empty packet quantity etc. deleted.It can be obtained successively in specific embodiment:PacketType, for representing recorded file The TS packet numbers having, PID, as identifier.AHF, as empty packet flag, as AHF==1, there are empty packets, work as AHF During==0, there is no skies to wrap.NumTS wraps specific number as sky.DNP, as the empty packet number deleted, you can read with passing through The number is taken, understands the empty packet number of deletion, then carries out the filling of corresponding empty packet number.Payload, as TS packets first Data after byte can at most store 64K byte contents.By above-mentioned mark content, corresponding decompression reduction is described to record text Each TS packets in part, so as to decompress the reduction recorded file.
Further, step S40 is specifically included:
Step S41, the TS packet quantity of the merging in the TSP format headers restore the TS packets of merging, and according to described Empty packet quantity in TSP format headers restores the empty packet of deletion.
Specifically, the TS packet quantity of the merging in the TSP format headers is obtained, is then restored and closed according to the TS packets quantity And TS packets.As shown in fig. 6, the Header in 3 in first frame is reduced in 4 the byte 0x47 in first frame, in 3 in second frame Payload be reduced to TS in 4 in second frame1With the TS in the 4th frame2, and according to two TS packet numbers of merging, in 4 Third frame in addition packet header byte 0x47, the Header in 3 in third frame is reduced to the TS in 4 in the 5th frame3With the 6th frame Interior TS4, wherein TS3And TS4For sky packet etc..
Step S51 when receiving selective reduction instruction, obtains specifying for the specified TS packets in the selective reduction instruction PID;
Specifically, the TSP format headers of the present embodiment have PID fields, can set filter, the data packet of specified PID It filters out, then performs restoring operation.Obtain the specified PID of the specified TS packets in the selective reduction instruction.
Step S52, according to the TSP format headers, obtain in compressed recorded file with the specified matched TS of PID Packet as specified TS packets, and decompresses the reduction specified TS packets.
Specifically, the PID included according to the TSP format headers, acquisition and the specified matched TS packets of PID, to make To specify TS packets.Then TS packets is specified to be decompressed and restoring operation this, to complete the restoring operation of the specified TS packets.
The present embodiment provides a kind of compression method of recorded file, television set and readable storage medium storing program for executing, are recorded by obtaining The TS packets of file merge identical TS packets according to the default rule that merges;According to default compression algorithm, by the TS after merging Packet is compressed, and completes the compression of the recorded file.In the above manner, the present invention is recorded by using the characteristic of TS packets The form of TS packets is fixed in file processed, and due to the limitation of TS inclusion quantities, and recorded file needs to be used continuously multiple identical The TS packets of PID transmit chunk data.By the way that multiple identical PID are merged, and the TS packets after merging are compressed, it is real Show efficient lossless compression, be not only substantially reduced the size of recorded file, convenient for the preservation and transmission of file, and compression method Simply, it is easy to use, solve it is existing treat recorded file it is corresponding record code stream volume it is larger and be not easy to preserve with transmission Technical problem.
Further, the present invention also provides a kind of television sets.
Television set of the present invention includes processor, memory and is stored on the memory and can be by the processor The condensing routine of execution when the condensing routine is performed by the processor, realizes the compression method of recorded file as described above The step of.
Wherein, condensing routine be performed realized method can refer to recorded file of the present invention compression method it is each Embodiment, details are not described herein again.
Further, the present invention also provides a kind of computer readable storage mediums.
Condensing routine is stored on computer readable storage medium of the present invention, wherein the condensing routine is executed by processor When, the step of realizing the compression method of recorded file as described above.
Wherein, condensing routine be performed realized method can refer to recorded file of the present invention compression method it is each Embodiment, details are not described herein again.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row His property includes, so that process, method, article or system including a series of elements not only include those elements, and And it further includes other elements that are not explicitly listed or further includes intrinsic for this process, method, article or system institute Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including this Also there are other identical elements in the process of element, method, article or system.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on such understanding, technical scheme of the present invention substantially in other words does the prior art Going out the part of contribution can be embodied in the form of software product, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disc, CD), including some instructions use so that a station terminal equipment (can be mobile phone, Computer, server, air conditioner or network equipment etc.) perform method described in each embodiment of the present invention.
It these are only the preferred embodiment of the present invention, be not intended to limit the scope of the invention, it is every to utilize this hair The equivalent structure or equivalent flow shift that bright specification and accompanying drawing content are made directly or indirectly is used in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of compression method of recorded file, which is characterized in that the compression method of the recorded file includes the following steps:
The TS packets of recorded file are obtained, are merged identical TS packets according to the default rule that merges;
According to default compression algorithm, the TS packets after merging are compressed, complete the compression of the recorded file.
2. the compression method of recorded file as described in claim 1, which is characterized in that the TS packets for obtaining recorded file, Before the step of being merged identical TS packets according to default merging rule, further include:
The TS packet header of the TS packets is replaced with to the TSP format headers of preset format, obtains the PID of the TS packets, and by the PID It stores to the TSP format headers.
3. the compression method of recorded file as claimed in claim 2, which is characterized in that the TS packets for obtaining recorded file, The step of being merged identical TS packets according to default merging rule specifically includes:
The TS packets of the recorded file are obtained, according to the PID, identical TS packets are merged;
The TS packet quantity merged is obtained, and the TS packet quantity of the merging is stored to the TSP format headers.
4. the compression method of recorded file as claimed in claim 3, which is characterized in that the TS packets for obtaining recorded file, After the step of being merged identical TS packets according to default merging rule, further include:
Judge in the TS packets with the presence or absence of empty packet;
When there is empty packet, the empty packet is deleted, and obtains the empty packet quantity of the empty packet, the empty packet quantity is stored to institute State TSP format headers.
5. the compression method of recorded file as claimed in claim 4, which is characterized in that the basis presets compression algorithm, will After the step of TS packets after merging are compressed, complete the compression of the recorded file, further include:
When receiving reduction instruction, according to the TSP format headers, decompression restores the recorded file.
6. the compression method of recorded file as claimed in claim 5, which is characterized in that it is described when receiving reduction instruction, According to the TSP format headers, decompress the step of restoring the recorded file and specifically include:
The TS packet quantity of merging in the TSP format headers restores the TS packets of merging, and according in the TSP format headers Empty packet quantity, restore the empty packet of deletion.
7. the compression method of recorded file as claimed in claim 4, which is characterized in that the basis presets compression algorithm, will After the step of TS packets after merging are compressed, complete the compression of the recorded file, further include:
When receiving selective reduction instruction, the specified PID of the specified TS packets in the selective reduction instruction is obtained;
According to the TSP format headers, obtain in compressed recorded file with the specified matched TS packets of PID, as specified TS packets, and decompress the reduction specified TS packets.
8. the compression method of the recorded file as described in any one in claim 1-7, which is characterized in that the basis is preset The step of compression algorithm compresses the TS packets after merging, the compression for completing the recorded file specifically includes:
According to gzip compression algorithms, the TS packets after merging are compressed, complete the compression of the recorded file.
9. a kind of television set, which is characterized in that the television set includes processor, memory and is stored in the memory Condensing routine that is upper and being performed by the processor, wherein when the condensing routine is performed by the processor, is realized as weighed Profit requires the step of compression method of the recorded file described in any one of 1 to 8.
10. a kind of computer readable storage medium, which is characterized in that compression journey is stored on the computer readable storage medium Sequence wherein when the condensing routine is executed by processor, is realized such as recorded file described in any item of the claim 1 to 8 The step of compression method.
CN201711427251.8A 2017-12-22 2017-12-22 Compression method of recorded file, television and readable storage medium Active CN108153873B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711427251.8A CN108153873B (en) 2017-12-22 2017-12-22 Compression method of recorded file, television and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711427251.8A CN108153873B (en) 2017-12-22 2017-12-22 Compression method of recorded file, television and readable storage medium

Publications (2)

Publication Number Publication Date
CN108153873A true CN108153873A (en) 2018-06-12
CN108153873B CN108153873B (en) 2022-04-22

Family

ID=62462711

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711427251.8A Active CN108153873B (en) 2017-12-22 2017-12-22 Compression method of recorded file, television and readable storage medium

Country Status (1)

Country Link
CN (1) CN108153873B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108833945A (en) * 2018-06-29 2018-11-16 井冈山电器有限公司 A kind of method and device flowed using single channel DMA simultaneous transmission multichannel TS
CN108965295A (en) * 2018-07-17 2018-12-07 郑州云海信息技术有限公司 A kind of compressing file merging method and relevant apparatus
CN109743573A (en) * 2018-12-29 2019-05-10 深圳Tcl新技术有限公司 Media playing method, device, intelligent terminal and computer readable storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060126948A1 (en) * 2004-11-29 2006-06-15 Takahiro Fukuhara Image compression apparatus and method, and program and recording medium
CN101043620A (en) * 2006-06-19 2007-09-26 华为技术有限公司 TV program transmission method and apparatus
CN102012818A (en) * 2010-12-01 2011-04-13 广东威创视讯科技股份有限公司 Screen recording method and device
CN103329514A (en) * 2010-11-23 2013-09-25 Lg电子株式会社 Broadcast signal transmitting apparatus, broadcast signal receiving apparatus, and broadcast signal transceiving method in broadcast signal transmitting and receiving apparatuses
CN103873860A (en) * 2014-03-18 2014-06-18 深信服网络科技(深圳)有限公司 Document transmission method and device
US20150302039A1 (en) * 2014-04-16 2015-10-22 Disney Enterprises, Inc. Methods and systems of archiving media files
CN105049920A (en) * 2015-07-27 2015-11-11 青岛海信移动通信技术股份有限公司 Method and device for recording multimedia files
CN105740298A (en) * 2014-12-12 2016-07-06 北京奇虎科技有限公司 File processing method and apparatus, and server-side equipment
CN106776663A (en) * 2015-11-25 2017-05-31 腾讯科技(深圳)有限公司 The compression method and device of audio file

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060126948A1 (en) * 2004-11-29 2006-06-15 Takahiro Fukuhara Image compression apparatus and method, and program and recording medium
CN101043620A (en) * 2006-06-19 2007-09-26 华为技术有限公司 TV program transmission method and apparatus
CN103329514A (en) * 2010-11-23 2013-09-25 Lg电子株式会社 Broadcast signal transmitting apparatus, broadcast signal receiving apparatus, and broadcast signal transceiving method in broadcast signal transmitting and receiving apparatuses
CN102012818A (en) * 2010-12-01 2011-04-13 广东威创视讯科技股份有限公司 Screen recording method and device
CN103873860A (en) * 2014-03-18 2014-06-18 深信服网络科技(深圳)有限公司 Document transmission method and device
US20150302039A1 (en) * 2014-04-16 2015-10-22 Disney Enterprises, Inc. Methods and systems of archiving media files
CN105740298A (en) * 2014-12-12 2016-07-06 北京奇虎科技有限公司 File processing method and apparatus, and server-side equipment
CN105049920A (en) * 2015-07-27 2015-11-11 青岛海信移动通信技术股份有限公司 Method and device for recording multimedia files
CN106776663A (en) * 2015-11-25 2017-05-31 腾讯科技(深圳)有限公司 The compression method and device of audio file

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108833945A (en) * 2018-06-29 2018-11-16 井冈山电器有限公司 A kind of method and device flowed using single channel DMA simultaneous transmission multichannel TS
CN108965295A (en) * 2018-07-17 2018-12-07 郑州云海信息技术有限公司 A kind of compressing file merging method and relevant apparatus
CN108965295B (en) * 2018-07-17 2021-09-17 郑州云海信息技术有限公司 File compression and combination method and related device
CN109743573A (en) * 2018-12-29 2019-05-10 深圳Tcl新技术有限公司 Media playing method, device, intelligent terminal and computer readable storage medium

Also Published As

Publication number Publication date
CN108153873B (en) 2022-04-22

Similar Documents

Publication Publication Date Title
CN107465954B (en) The generation method and Related product of dynamic thumbnail
CN108153873A (en) Compression method, television set and the readable storage medium storing program for executing of recorded file
KR100717008B1 (en) Method and apparatus for transmitting and receiving of partial font file
US9930570B2 (en) Method and apparatus for packet header compression
CN109246435B (en) Method and device for transmitting redirected data of USB (universal serial bus) equipment, local device and remote server
CN103988518A (en) Image transmission device, image transmission method, image reception device, and image reception method
CN102289829A (en) Method and device for storing and restoring image and system for processing image
CN102821279A (en) Picture compression method keeping with alpha channel
CN105446975B (en) A kind of file packing method and device
CN109862364A (en) A kind of sending, receiving method and device of ultra high-definition video
CN106937113A (en) Method for compressing image and device based on mixing colourity sample rate
CN109729299A (en) A kind of sending, receiving method and device of ultra high-definition video
CN106776663A (en) The compression method and device of audio file
CN109151570A (en) A kind of Streaming Media processing method, system and associated component based on HTML5
CN107094144A (en) The method for packing and de-encapsulation method of base band frame
CN105592081A (en) Method for converting videos between terminal and server
CN107749815A (en) A kind of data transmission method, processing method and processing device
CN105704215B (en) Shared file system and corresponding document sending method and device
CN111193928B (en) Method and apparatus for delivering region of interest information in video
CN107179947A (en) A kind of network picture method for down loading and system for mobile terminal
CN113573059B (en) Image display method, image display apparatus, storage medium, and electronic apparatus
CN104219537A (en) Video data processing method, device and system
CN105578008A (en) Method of improving USB 2.0 camera high resolution high frame rate based on android terminal
KR102561581B1 (en) Method and apparatus for random access of high-efficiency video coding bitstream for MPEG media transmission
KR101683409B1 (en) Encapsulation of video scanning format information for media transport and storage

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant