WO2018233539A1 - Video processing method, computer storage medium, and device - Google Patents

Video processing method, computer storage medium, and device Download PDF

Info

Publication number
WO2018233539A1
WO2018233539A1 PCT/CN2018/091241 CN2018091241W WO2018233539A1 WO 2018233539 A1 WO2018233539 A1 WO 2018233539A1 CN 2018091241 W CN2018091241 W CN 2018091241W WO 2018233539 A1 WO2018233539 A1 WO 2018233539A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
segment
transcoding
destination
terminal
Prior art date
Application number
PCT/CN2018/091241
Other languages
French (fr)
Chinese (zh)
Inventor
张志辉
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2018233539A1 publication Critical patent/WO2018233539A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234345Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements the reformatting operation being performed only on part of the stream, e.g. a region of the image or a time segment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/65Transmission of management data between client and server
    • H04N21/658Transmission by the client directed to the server
    • H04N21/6587Control parameters, e.g. trick play commands, viewpoint selection

Definitions

  • the present application relates to the field of computer information processing technologies, and in particular, to a video processing method, a computer storage medium, and a device.
  • the transcoding of the entire video file is directly started, and the target video file after the entire video file is transcoded, which takes up a large space, in order to control the storage cost.
  • the transcoded file is deleted, and the next time the video is viewed, the code needs to be re-transcoded, which wastes resources.
  • each video Going in and watching for a while will lead to multiple transcoding and deletion, resulting in a serious waste of resources.
  • a video processing method includes the following steps:
  • the video request carries a source video identifier, a URL of the source video, and a starting play time point, where the source video corresponding to the source video identifier includes video segments sequentially connected in time and end;
  • each of the A video segment in the video segment that is closest to the end time of the destination transcode segment, whose start time is after the end time, and that is not transcoded is transcoded to obtain a first video transcode segment.
  • a computer storage medium having stored thereon computer readable instructions that, when executed by a processor, cause the processor to perform the following steps:
  • the video request carries a source video identifier, a URL of the source video, and a starting play time point, where the source video corresponding to the source video identifier includes video segments sequentially connected in time and end;
  • each of the A video segment in the video segment that is closest to the end time of the destination transcode segment, whose start time is after the end time, and that is not transcoded is transcoded to obtain a first video transcode segment.
  • a computer device comprising a memory and a processor, the memory storing computer readable instructions, the computer readable instructions being executed by the processor such that the processor performs the following steps:
  • the video request carries a source video identifier, a URL of the source video, and a starting play time point, where the source video corresponding to the source video identifier includes video segments sequentially connected in time and end;
  • each of the A video segment in the video segment that is closest to the end time of the destination transcode segment, whose start time is after the end time, and that is not transcoded is transcoded to obtain a first video transcode segment.
  • the target video transcoding segment corresponding to the initial playing time point needs to be determined, and further, the video conversion is performed. Whether the first stored video transcode segment whose code end has the closest end time and the start time after the end time satisfies the preset condition, only when the first stored video transcode segment satisfies the preset condition The transcoding is performed, and the transcoding of the entire video source is started when the terminal requests the video. When the user exits the video playback, a large amount of waste is generated.
  • the method in this embodiment can only be based on the preset condition.
  • a code parameter transcoding a video segment of each of the video segments that is closest to an end time of the destination transcoding segment, a start time after the end time, and not transcoded, to obtain a first video transcoding Segmentation, which greatly reduces the transcoding work, saves resources, and does not waste a lot of resources even if the user quits.
  • FIG. 1 is a schematic diagram of an application environment of a video processing method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram showing the internal structure of a computer device in an embodiment
  • FIG. 3 is a schematic flow chart of a video processing method according to an embodiment
  • FIG. 4 is a schematic flow chart of a video processing method according to another embodiment
  • FIG. 5 is a schematic diagram of a video processing method according to an embodiment
  • FIG. 6 is a block diagram of a video processing apparatus of an embodiment
  • FIG. 7 is a block diagram of a video processing device of another embodiment.
  • FIG. 1 is a schematic diagram of a working environment of a video processing method in an embodiment of the present application.
  • an application environment involves a terminal 110 and a server 120.
  • the terminal 110 and the server 120 are connected through a network 130.
  • the terminal 110 and the server 120 are connected. Communication can be through network 130.
  • the terminal 110 When the terminal 110 needs to watch the video, it first needs to send a video request to the server 120, and the server 120 receives the video request sent by the terminal 110 and makes a judgment when it is closest to the end time of the destination video transcoding segment, and the start time is in the After the first stored video transcoding segment after the end time meets the preset condition, the video segment is transcoded to obtain the first video transcoding segment, and the destination video transcoding segment can be sent to the terminal 110, where the terminal 110 is After receiving the video transcoding segment of the destination, the terminal can perform playback, so that the terminal 110 can play the target video transcoding segment.
  • the terminal 110 can be any device capable of realizing intelligent input and output, receiving the destination video transcoding segment and playing, for example, a desktop computer or a mobile terminal, and the mobile terminal can be a smart phone, a tablet computer, a car computer, and a wearable device. Smart devices, etc.
  • the server 120 may be a server on which the platform for transcoding is located; the server 120 may be one or more.
  • the embodiment relates to a scheme in which the server 120 performs transcoding and can transmit the destination video transcode segment to the terminal 110.
  • the terminal 110 can play the target video file sent by the server 120 to implement information intelligent operation.
  • FIG. 1 An internal structural diagram of a computer device in one embodiment is shown in FIG.
  • the computer device can be the server 120 of FIG.
  • the computer device includes a processor 121, a memory 122, and a network interface 123 connected by a system bus.
  • the memory 122 includes a nonvolatile storage medium 1221 and a memory 1222.
  • the non-volatile storage medium 1221 of the computer device stores an operating system and computer readable instructions that, when executed by the processor 121, cause the processor 121 to perform a video processing method.
  • the processor 121 of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device.
  • the memory 1222 of the computer device provides an environment for operation of the video processing device in the non-volatile storage medium, and the memory 124 can store computer readable instructions that, when executed by the processor 121, can cause the processor 121 performs a video processing method.
  • the network interface of the computer device is used to connect and communicate with the network 130.
  • FIG. 2 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied.
  • the specific server may include a ratio. More or fewer components are shown in the figures, or some components are combined, or have different component arrangements.
  • a video processing method applied to a server in an embodiment is provided, which is applicable to the server 120 in FIG. 1, and includes steps S310-S340.
  • S310 Receive a video request sent by the terminal.
  • the video request carries the source video identifier, the URL of the source video (Uniform Resource Locator), and the starting play time point.
  • the source video corresponding to the source video identifier includes video segments that are sequentially connected at the beginning and the end of the video. It can be understood that the source video corresponding to the source video identifier includes video segments that are sequentially stitched together in the first and last time. For example, for the source video identified as A, it may be movie A, the duration is 90 minutes, and the movie A is end to end by each video segment according to time.
  • the splicing in sequence may include, for example, 9 video clips (which may be the 1st-9th video clips), each video clip has a duration of 10 minutes, and each video clip has a start play time and an end time.
  • each video segment corresponds to a time range, and the corresponding time range of the first video segment is (0, 10), and the time range corresponding to the next video segment, that is, the second video segment is (10, 20), and so on.
  • the time range corresponding to the ninth video segment is (80, 90), and the above nine video segments are spliced end to end in chronological order to form the source video A.
  • Each source video has its own unique identifier.
  • the source video identifier can indicate the identity of the source video, so that the server can know which source video the terminal wants to request.
  • the source video is stored in the server, and the source video is stored with a URL.
  • the URL can be located to the location of the source video storage, and the source video can be read to obtain the source video. After receiving the video request sent by the terminal, the source video can be The URL of the source video gets the corresponding source video.
  • the server When the server sends a video to the terminal, it needs to perform segmental transmission. That is, the source video includes video segments that are connected in sequence at each end of the time. After the video segment is transcoded, it is sent to the terminal to implement segmentation of the video.
  • the initial broadcast time point carried by the terminal is the time point at which the request source video starts playing. For example, if the user requests to play the movie A starting from the 30th minute, the starting playback time point is the 30th minute. If it is played at the beginning of movie A, the starting playback time point is the 0th minute.
  • S320 Acquire a transcoding parameter, and determine a destination video transcoding segment corresponding to the starting playing time point.
  • the transcoding parameters may be determined according to the terminal information and the network information to obtain the transcoding parameters.
  • the terminal information and the network information may be known from the video request sent by the terminal, that is, the video request may further include terminal information and network information.
  • the terminal information may include a terminal model or/and a model of the terminal player, and the network information may include network speed or network throughput, etc., where the network information refers to network information corresponding to the network where the terminal is located.
  • the terminal needs to perform video playback by sending a video request, and the terminal requests the video segment corresponding to the starting playback time point, and the video segment corresponding to the transcoded video segment corresponding to the video segment is sent to the terminal, thereby requiring in the server Determining the destination video transcoding segment corresponding to the starting playback time point for subsequent transmission to the terminal for playback.
  • the video segment corresponding to the starting playback time point in the source video is corresponding to the destination video transcoding segment
  • the destination video transcoding segment is the segment after the video segment corresponding to the initial playback time point.
  • the segment, the start time and the end time of the video segment and the corresponding video transcoding segment are correspondingly the same.
  • the video segment of the corresponding source video can be obtained, if the video segment has been stored.
  • the video segment corresponds to the destination video transcoding segment after the transcoding, and the destination video transcoding segment corresponding to the starting playing time point is also obtained to determine the destination video transcoding segment. If not, the device needs to The video segment corresponding to the start playing time point is transcoded to determine the destination video transcoding segment.
  • the server performs transcoding when there is a first stored video transcoding segment that satisfies a preset condition in the stored video transcoding segment to reduce the transcoding workload.
  • the terminal plays sequentially, as the playback progresses, what is needed is the chronological video transcoding segment after the destination video transcoding segment, if it is closest to the end time of the destination video transcoding segment, and starts The first stored video transcoding segment after the end time meets the preset condition, indicating that the transcoding condition is satisfied, that is, the first stored video transcoding segment may not be sufficient to support subsequent playback requirements, and transcoding is required.
  • the video segment of each video segment that is closest to the end time of the destination transcoding segment, the start time is after the end time, and is not transcoded is transcoded to obtain the first video transcoding.
  • the segment, that is, the untranscoded video segment after the determined destination transcoding segment is transcoded to ensure the number of transcoded segments that can be sent to the terminal, ensuring playback quality.
  • the untranscoded video segment may be a preset number of consecutive untranscoded video segments, and the number of the first video transcode segments is a preset number of segments.
  • the destination video transcoding segment corresponding to the initial playing time point needs to be determined, and further, it is determined that the end time of the destination video transcoding segment is the closest. And whether the first stored video transcoding segment after the end time meets the preset condition, and the transcoding is performed only when the first stored video transcoding segment satisfies the preset condition, which can be avoided.
  • the terminal requests the video, the transcoding of the entire video source is started, and a large amount of waste is generated when the user exits the video playback.
  • the method in this embodiment only transcodes the video segment and the destination according to the transcoding parameter when the preset condition is met.
  • the video clip with the latest end time of the segment and the start time after the end time is transcoded to obtain the first video transcoding segment, which greatly reduces the transcoding work and saves resources even if the user quits. Will not cause a lot of waste of resources
  • the step of determining the destination video transcoding segment corresponding to the initial playing time point comprises: when the starting playing time point is within the time period of the stored video transcoding segment corresponding to the source video identifier, Obtaining the destination video transcoding segment from the stored video transcoding segment; when the starting playing time point is not within the time period of the stored video transcoding segment corresponding to the source video identifier, starting the playing time in the source video The video segment corresponding to the point is transcoded, and the destination video transcoding segment corresponding to the starting playback time point is obtained.
  • determining the destination video transcoding segmentation process there are two cases, one is that in the stored video transcoding segment, there is already a video transcoding segment corresponding to the starting playing time point, and each is stored.
  • the video transcoding segment has a corresponding start and end time, and can determine whether the stored video transcoding segment is determined by determining whether the starting playing time point is within the time period of the stored video transcoding segment corresponding to the source video identifier. Whether there is a destination video transcoding segment corresponding to the initial playing time, that is, if the video transcoding segment corresponding to the video segment where the starting playback time point required by the terminal is already stored, there is no need to perform transcoding.
  • the destination video transcoding segment corresponding to the initial playing time point is obtained directly from the stored video transcoding segment.
  • the other is that there is no video transcoding segment corresponding to the starting playing time point in the stored video transcoding segment, and the terminal needs to play the video transcoding segment corresponding to the starting playing time point.
  • the video segment corresponding to the starting playing time point in the source video needs to be transcoded to obtain the destination video transcoding segment corresponding to the starting playing time point, and the subsequent terminal can perform the playback after receiving the destination video transcoding segment.
  • the first stored video transcode segment satisfies a preset condition when the consecutive number of first stored video transcode segments is less than a preset number.
  • the end time of the segmentation with the destination video transcoding needs to be the closest, and the starting time is The continuous number of the first stored video transcoding segments after the end time is compared with the preset number. When the consecutive number is less than the preset number, it indicates that the current first stored video transcoding segment may not be sufficient to support the playback of the terminal.
  • the end time of each of the video segments and the destination transcoding segment is the closest, and the starting time is in the
  • the video segment after the end time and not transcoded is transcoded to obtain a first video transcoding segment, and preferably, the transcoded video segment is transcoded for a preset number of segments, without The video segment of the code is transcoded to avoid transcoding a large number of untranscoded video segments, which consumes a lot of resources and increases the transcoding burden.
  • the method further includes:
  • S340 Return, to the terminal, the first request response information, where the first request response information includes a URL of the destination video transcoding segment and media information, where the media information includes a duration and a start time point;
  • S350 Receive and respond to the first fragment playback request sent by the terminal according to the first request response information, and return, to the terminal, first fragmentation response information, where the first fragmentation response information includes the destination video transcoding segment.
  • the destination video transcode segment corresponding to the URL, and the first fragment playback request carries the URL of the destination video transcoding segment.
  • the above steps S340-S350 are applied to the server.
  • the destination video transcoding segment may also be sent to the terminal, and the terminal receives the It can be played later.
  • the destination video transcoding segment since the video transcoding segment corresponding to the initial playing time point, that is, the above-mentioned destination video transcoding segment, already exists in the stored video transcoding segment, the destination video transcoding segment The segment has its corresponding URL.
  • the server sends the destination video transcoding segment to the terminal, the first request response information carrying the URL of the destination video transcoding segment is first returned to the terminal, and the terminal receives the first request.
  • the server returns the destination to the terminal.
  • the destination video transcode segment corresponding to the URL of the video transcoding segment can be played by the terminal receiving.
  • the first request response information may further include media information such as the duration and the start time point, and after being sent to the terminal, the terminal may notify the terminal of the media information such as the duration of the destination video transcoding segment and the start time point, and the terminal may also The above media information is displayed for the user to watch.
  • the destination video transcoding segment is returned to the terminal.
  • the video transcoding segment corresponding to the starting playing time point is not stored in the stored video transcoding segment, and the transcoding is required to obtain the destination video transcoding segment, and at this time, the purpose is not
  • the video transcode segment is stored, and there is no corresponding URL address.
  • the server directly transmits the destination video transcode segment obtained by the transcoding to the terminal, and the terminal receives and plays.
  • the video processing method further includes the steps of:
  • Transcoding segmentation storage updating the stored video transcoding segment, the playing integrity of the first video transcoding segment is the length of time of the first video transcoding segment sent to the terminal and the segmentation of the first video transcoding segment The ratio of the duration.
  • the user when the user requests to quit the video through the terminal, the user sends a video exit request to the server.
  • the server receives the video exit request, if the code is being transcoded, the code is immediately stopped to reduce the transcoding workload and save resources.
  • the storage avoids repeated transcoding when the subsequent terminal requests the first video transcoding segment, and saves the transcoding resource.
  • the number of the first video transcoding segments is more than one, that is, the number of the first video transcoding segments may be the preset number of segments, the number of times of playing or/and the number of the first video transcoding segments is obtained. After playing the completeness degree, the first video transcoding segments may be sorted according to the number of times of playing or/and the playing integrity of each first video transcoding segment, and the number of playing times or/and the fullness of the playing integrity is advanced. A plurality of first video transcode segments are stored for storage to ensure the playback popularity or/and integrity of the stored first video transcode segments.
  • the video transcoding segment corresponding to the beginning time of the source video is highly likely to be requested, and in order to save the transcoding resource, it can be stored, that is, received.
  • the code After the video exit request is sent, after the code is stopped, it is determined whether the source video start time is within the time period of the stored video transcode segment corresponding to the source video identifier, and if not, the beginning of the source video
  • the video segment corresponding to the time is transcoded, and the first video transcode segment is obtained and stored.
  • the first destination video transcode is segmentally stored and updated.
  • the video transcoding segment is stored, wherein the first destination video transcoding segment is a destination video transcoding segment that is not in the stored video transcoding segment, and the playback integrity of the first destination video transcoding segment is The ratio of the length of time of the first destination video transcoding segment sent to the terminal to the duration of the first destination video transcoding segment.
  • the server not only needs to analyze the playing condition and the user promotion situation of the first video transcoding segment to determine whether to store, but also needs to analyze the playing condition of the first destination video transcoding segment and the user dragging situation.
  • the number of playbacks of the video transcoding segment of a destination or/and the integrity of the playback meet the corresponding preset value, it indicates that the first destination video transcoding segment is often played or/and the user drags during playback is good.
  • the first destination video transcoding segment may be stored to prevent repeated transcoding when the subsequent terminal requests the first destination video transcoding segment, thereby saving transcoding resources.
  • the process of the video processing method described above is specifically described in a specific embodiment, and the video processing method is applied to the server 120.
  • the video will be input into the server 120, which can be decoded to obtain the source video. After the source video is segmented, each video segment can be obtained.
  • the steps of the video processing method of this implementation are as follows:
  • the server 120 receives the video request from the terminal 110, and can obtain the source video according to the URL in the video request.
  • the transcoding parameters may include the code rate and the resolution.
  • the index management module 124 is activated (the function of the index management module 124 can be implemented by the HTTP server in FIG. 5), and the initial playback time is searched in the index management module 124 according to the initial playback time point and the source video identifier carried in the video request. Whether the time point is within the time period of the stored video transcoding segment corresponding to the source video identifier, that is, whether the transcoded slice requested by the terminal is in the stored video transcoding segment.
  • the media information (time length, start time, encryption, etc.) of the destination video transcoding segment corresponding to the initial playback time point and the destination video transcoding segmentation The URL is written into the index file, that is, the file suffixed as m3u8, and the first request response information is returned to the terminal 110 to carry the information of the file terminal suffixed as m3u8, and the terminal 110 sends the information to the server 120 according to the URL of the destination video transcoding segment. Carrying the URL first fragment playback request of the destination video transcoding segment, and the server 120 returns the destination video transcoding corresponding to the URL of the destination video transcoding segment to the terminal 110 in response to the first fragment playback request. Segmentation, the terminal 110 can play the video transcoding segment of the destination.
  • the transcoding module 125 determines whether to perform transcoding according to a preset preset number.
  • the predetermined number of values may be determined based on the ratio of the duration of the existing transcoded consecutive destination video transcoding to the current speed of the server 120 spitting data.
  • Transcoding is performed when the consecutive number of first stored video transcode segments closest to the end time of the destination video transcode segment and the start time is less than the preset number, Transcoding parameters, transcoding each video segment of each of the video segments that is closest to the end time of the destination transcoding segment, the start time is after the end time, and the number of preset segments that are not transcoded Obtain a preset number of segments of the first video transcoding segment without transcoding the entire source video.
  • the preset number of segments may be determined by the network metric of the current server and the resource occupancy rate. When the consecutive number of the first stored video transcoding segments is not less than the preset number, it indicates that the transcoding condition is not satisfied, and no transcoding is performed at this time, and the transcoding resources are saved.
  • the transcoding parameter is sent to the distributed system, and the transcoding of the untranscoded video segment is obtained, the first video transcoding segment is obtained, and an index is established, and the web server 126 is present. It can be sent to the terminal via the HTTP protocol.
  • the server 120 stops the transcoding.
  • the server 120 After receiving the exit video request and exiting the transcoding, the server 120 starts the TOP transcoding segmentation statistics module 127, and switches to the first video according to the number of times of the first video transcoding segment or/and the integrity of the playback.
  • the code segments are sorted, and the preset number of first video transcode segments with the number of play times or/and the fullness of playback are stored to ensure the playback popularity or/and integrity of the stored first video transcode segments. degree.
  • the index management module 124 can be added to manage the stored video transcoding segments to prevent repeated transcoding.
  • the transcoding module can avoid the transcoding of the entire source video when the terminal requests the video, which greatly reduces the transcoding workload.
  • the TOP transcoding segmentation statistics module 127 is added, and the preset number of first video transcoding segments with the number of play times or/and the fullness of the playback integrity may be stored, thereby counting the segments repeatedly viewed by the user, and reducing the transcoding. Quantity and storage.
  • the video processing method in this embodiment is applied to the server 120, and the video broadcast and on-demand of the terminal 110 can be implemented.
  • the amount of transcoding by the server 120 can be reduced and storage resources can be saved. According to the current volume of cloud storage, it can save 40% of the transcoding amount and 80% of the storage resources. It also provides a fast first-screen user experience and enhances product competitiveness.
  • a computer device is also provided.
  • the internal structure of the computer device can be as shown in FIG. 2, and the computer device is provided with a video processing device, and the device includes various modules, and each module can be all or part of It is implemented by software, hardware or a combination thereof.
  • a video processing apparatus in an embodiment is provided, which can be disposed in the server 120 of FIG. 1, and includes:
  • the video request receiving module 610 is configured to receive a video request sent by the terminal, where the video request carries the source video identifier, the URL of the source video, and the starting play time point, and the source video corresponding to the source video identifier includes each video segment sequentially connected in time and end. .
  • the transcoding segment determining module 620 is configured to obtain a transcoding parameter, and determine a destination video transcoding segment corresponding to the starting playing time point.
  • the transcoding module 630 is configured to: when the first stored video transcoding segment that is closest to the end time of the destination video transcoding segment and the start time is after the end time meets the preset condition, according to the transcoding parameter, A video segment of each video segment that is closest to the end time of the destination transcoding segment, the start time is after the end time, and the untranscoded video segment is transcoded to obtain the first video transcode segment.
  • the transcoding segment determining module 620 includes a transcoding segment obtaining module and a destination video transcoding module.
  • a transcoding segment obtaining module configured to obtain a destination video transcoding segment from the stored video transcoding segment when the starting playing time point is within a time period of the stored video transcoding segment corresponding to the source video identifier .
  • the target video transcoding module is configured to transcode the video segment corresponding to the starting playing time point in the source video when the starting playing time point is not within the time period of the stored video transcoding segment corresponding to the source video identifier, The destination video transcoding segment corresponding to the starting playback time point is obtained.
  • the first stored video transcode segment satisfies a preset condition when the consecutive number of first stored video transcode segments is less than a preset number.
  • the video request further includes terminal information as well as network information.
  • the transcoding segment determining module determines the transcoding parameter according to the terminal information and the network information.
  • the video processing apparatus further includes:
  • the first request response information sending module 640 is configured to: after the transcoding segment obtaining module obtains the target video transcoding segment from the stored video transcoding segment, return the first request response information to the terminal, and the first request response information
  • the first fragment response information sending module 650 is configured to receive and respond to the first fragment playback request sent by the terminal according to the first request response information, and return a first fragmentation response information to the terminal, where the The fragmentation response information includes the destination video transcoding segment corresponding to the URL of the destination video transcoding segment, and the first fragmentation playback request carries the URL of the destination video transcoding segment.
  • the video processing device further includes:
  • a sending module configured to: after obtaining the destination video transcoding segment corresponding to the initial playing time point, the video transcoding module returns the destination video transcoding segment to the terminal.
  • the video processing device further includes an update module.
  • the foregoing update module is configured to stop transcoding when receiving the video exit request of the source video identifier sent by the terminal, and satisfy the corresponding preset value in the number of times of playing or/and the completeness of the playback of the first video transcoding segment.
  • the first video transcode segment is stored, and the stored video transcode segment is updated.
  • the play integrity of the first video transcode segment is the length of time and the first time of the first video transcode segment sent to the terminal. The ratio of the length of the video transcode segment.
  • the updating module is further configured to: when the transcoding is stopped, when the number of times of playing or/and the playing integrity of the first destination video transcoding segment meets the corresponding preset value, the first purpose is Video transcoding segmentation storage, updating the stored video transcoding segment, wherein the first destination video transcoding segment is a destination video transcoding segment that is not in the stored video transcoding segment, and the first destination video is rotated.
  • the playback integrity of the code segment is the ratio of the length of time of the first destination video transcoding segment sent to the terminal to the duration of the first destination video transcoding segment.
  • the video processing device corresponds to the video processing method described above, and the technical features corresponding to the video processing method in the video processing device are not described herein.
  • a computer storage medium having stored thereon computer readable instructions that, when executed by a processor, cause the processor to perform the steps of the video processing method described above.
  • An embodiment of the present application also provides a computer device including a memory and a processor, the memory storing computer readable instructions, when the computer readable instructions are executed by the processor, causing the processor to execute The above video processing method.
  • the various steps in the various embodiments of the present application are not necessarily performed in the order indicated by the steps. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in the embodiments may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be executed at different times, and the execution of these sub-steps or stages The order is also not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of the other steps.
  • Non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in a variety of formats, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization chain.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • Synchlink DRAM SLDRAM
  • Memory Bus Radbus
  • RDRAM Direct RAM
  • DRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Abstract

A video processing method, a computer storage medium, and a device. The method comprises: receiving a video request sent by a terminal, the video request carrying an identifier of a source video, a URL of the source video and a start playing time point, and a source video corresponding to the identifier of the source video comprising video clips sequentially connected in a head-to-tail manner according to time; obtaining a transcoding parameter, and determining a target video transcoding segment corresponding to the start playing time point; and when a first stored video transcoding segment whose start time is closest to the end time of the target video transcoding segment and whose start time is behind the end time of the target video transcoding segment satisfies a preset condition, transcoding, according to the transcoding parameter, a video clip among the video clips whose start time is closest to the end time of the target video transcoding segment, whose start time is behind the end time of the target video transcoding segment and which is not transcoded, so as to obtain a first video transcoding segment. Based on the method, transcoding resources can be saved.

Description

视频处理方法、计算机存储介质及设备Video processing method, computer storage medium and device
本申请要求于2017年06月23日提交中国专利局,申请号为2017104875773,申请名称为“视频处理方法及装置、计算机存储介质及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application entitled "Video Processing Method and Apparatus, Computer Storage Media and Equipment", filed on June 23, 2017, with the application number of 2017104875773, the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本申请涉及计算机信息处理技术领域,特别涉及一种视频处理方法、计算机存储介质及设备。The present application relates to the field of computer information processing technologies, and in particular, to a video processing method, a computer storage medium, and a device.
背景技术Background technique
随着计算机技术的不断发展,人们可通过终端观看各种视频,由于视频格式的多样性,往往需要对视频进行转码,适应视频播放要求。With the continuous development of computer technology, people can watch various videos through the terminal. Due to the diversity of video formats, it is often necessary to transcode the video to meet the requirements of video playback.
然而,目前的视频转码方式中,在接收到终端的请求后,直接开始整个视频文件的转码,得到整个视频文件转码后的目标视频文件,会占用较大的空间,为了控制存储成本,又会在用户观看完视频后,删除转码后的文件,下次再对该视频进行观看时需要重新进行转码,浪费资源,另外,如果有用户对多个视频的请求,每个视频都进去看一会退出来,这样会导致要进行多次转码和删除,导致资源的严重浪费。However, in the current video transcoding mode, after receiving the request of the terminal, the transcoding of the entire video file is directly started, and the target video file after the entire video file is transcoded, which takes up a large space, in order to control the storage cost. After the user finishes watching the video, the transcoded file is deleted, and the next time the video is viewed, the code needs to be re-transcoded, which wastes resources. In addition, if there is a user request for multiple videos, each video Going in and watching for a while will lead to multiple transcoding and deletion, resulting in a serious waste of resources.
发明内容Summary of the invention
根据本申请提供的各种实施例,提出一种视频处理方法、计算机存储介质及设备。In accordance with various embodiments provided herein, a video processing method, computer storage medium, and device are presented.
一种视频处理方法,包括以下步骤:A video processing method includes the following steps:
接收终端发送的视频请求,所述视频请求携带源视频标识、源视频的URL和起始播放时间点,其中,与所述源视频标识对应的源视频包括时间首尾依次相连的各视频片段;Receiving a video request sent by the terminal, where the video request carries a source video identifier, a URL of the source video, and a starting play time point, where the source video corresponding to the source video identifier includes video segments sequentially connected in time and end;
获取转码参数,确定所述起始播放时间点对应的目的视频转码分段;Obtaining a transcoding parameter, and determining a destination video transcoding segment corresponding to the initial playing time point;
当与目的视频转码分段的结尾时间最近、且起始时间在所述结尾时间之后的第一已存储视频转码分段满足预设条件时,根据所述转码参数,对各所述视频片段中与所述目的转码分段的结尾时间最近、起始时间在所述结尾时间之后、且未转码的视频片段进行转码,获得第一视频转码分段。When the first stored video transcode segment closest to the end time of the destination video transcoding segment and the start time is after the end time meets a preset condition, according to the transcoding parameter, each of the A video segment in the video segment that is closest to the end time of the destination transcode segment, whose start time is after the end time, and that is not transcoded is transcoded to obtain a first video transcode segment.
一种计算机存储介质,其上存储有计算机可读指令,该计算机可读指令被处理器执行时,使得处理器执行如下步骤:A computer storage medium having stored thereon computer readable instructions that, when executed by a processor, cause the processor to perform the following steps:
接收终端发送的视频请求,所述视频请求携带源视频标识、源视频的URL和起始播放时间点,其中,与所述源视频标识对应的源视频包括时间首尾依次相连的各视频片段;Receiving a video request sent by the terminal, where the video request carries a source video identifier, a URL of the source video, and a starting play time point, where the source video corresponding to the source video identifier includes video segments sequentially connected in time and end;
获取转码参数,确定所述起始播放时间点对应的目的视频转码分段;Obtaining a transcoding parameter, and determining a destination video transcoding segment corresponding to the initial playing time point;
当与目的视频转码分段的结尾时间最近、且起始时间在所述结尾时间之后的第一已存储视频转码分段满足预设条件时,根据所述转码参数,对各所述视频片段中与所述目的转码分段的结尾时间最近、起始时间在所述结尾时间之后、且未转码的视频片段进行转码,获得第一视频转码分段。When the first stored video transcode segment closest to the end time of the destination video transcoding segment and the start time is after the end time meets a preset condition, according to the transcoding parameter, each of the A video segment in the video segment that is closest to the end time of the destination transcode segment, whose start time is after the end time, and that is not transcoded is transcoded to obtain a first video transcode segment.
一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行如下步骤:A computer device comprising a memory and a processor, the memory storing computer readable instructions, the computer readable instructions being executed by the processor such that the processor performs the following steps:
接收终端发送的视频请求,所述视频请求携带源视频标识、源视频的URL和起始播放时间点,其中,与所述源视频标识对应的源视频包括时间首尾依次相连的各视频片段;Receiving a video request sent by the terminal, where the video request carries a source video identifier, a URL of the source video, and a starting play time point, where the source video corresponding to the source video identifier includes video segments sequentially connected in time and end;
获取转码参数,确定所述起始播放时间点对应的目的视频转码分段;Obtaining a transcoding parameter, and determining a destination video transcoding segment corresponding to the initial playing time point;
当与目的视频转码分段的结尾时间最近、且起始时间在所述结尾时间之后的第一已存储视频转码分段满足预设条件时,根据所述转码参数,对各所述视频片段中与所述目的转码分段的结尾时间最近、起始时间在所述结尾时间之后、且未转码的视频片段进行转码,获得第一视频转码分段。When the first stored video transcode segment closest to the end time of the destination video transcoding segment and the start time is after the end time meets a preset condition, according to the transcoding parameter, each of the A video segment in the video segment that is closest to the end time of the destination transcode segment, whose start time is after the end time, and that is not transcoded is transcoded to obtain a first video transcode segment.
通过上述视频处理方法、计算机存储介质及设备,在接收到终端发送的 视频请求后,需要确定所述起始播放时间点对应的目的视频转码分段,另外,还需去判断与目的视频转码分段的结尾时间最近、且起始时间在所述结尾时间之后的第一已存储视频转码分段是否满足预设条件,只有在第一已存储视频转码分段满足预设条件时,才会进行转码,可以避免在终端请求视频时启动整个视频源的转码,用户退出视频播放时产生大量的浪费,本实施例的方法只有在满足预设条件时才会根据所述转码参数,对各所述视频片段中与所述目的转码分段的结尾时间最近、起始时间在所述结尾时间之后、且未转码的视频片段进行转码,获得第一视频转码分段,这样大大减少了转码工作,节省资源,即使用户退出也不会造成大量资源的浪费。After the video processing method, the computer storage medium, and the device are received, after receiving the video request sent by the terminal, the target video transcoding segment corresponding to the initial playing time point needs to be determined, and further, the video conversion is performed. Whether the first stored video transcode segment whose code end has the closest end time and the start time after the end time satisfies the preset condition, only when the first stored video transcode segment satisfies the preset condition The transcoding is performed, and the transcoding of the entire video source is started when the terminal requests the video. When the user exits the video playback, a large amount of waste is generated. The method in this embodiment can only be based on the preset condition. a code parameter, transcoding a video segment of each of the video segments that is closest to an end time of the destination transcoding segment, a start time after the end time, and not transcoded, to obtain a first video transcoding Segmentation, which greatly reduces the transcoding work, saves resources, and does not waste a lot of resources even if the user quits.
附图说明DRAWINGS
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present application. Other drawings may also be obtained from those of ordinary skill in the art in light of the inventive work.
图1为本申请一个实施例的视频处理方法的应用环境示意图;1 is a schematic diagram of an application environment of a video processing method according to an embodiment of the present application;
图2为一个实施例中的计算机设备的内部结构示意图;2 is a schematic diagram showing the internal structure of a computer device in an embodiment;
图3为一个实施例的视频处理方法的流程示意图;3 is a schematic flow chart of a video processing method according to an embodiment;
图4为另一个实施例的视频处理方法的流程示意图;4 is a schematic flow chart of a video processing method according to another embodiment;
图5为一具体实施例的视频处理方法的原理图;FIG. 5 is a schematic diagram of a video processing method according to an embodiment; FIG.
图6为一个实施例的视频处理装置的模块示意图;6 is a block diagram of a video processing apparatus of an embodiment;
图7为另一个实施例的视频处理装置的模块示意图。7 is a block diagram of a video processing device of another embodiment.
具体实施方式Detailed ways
为使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步的详细说明。应当理解,此处所描述的具体实施方式仅仅用以解释本申请,并不限定本申请的保护范围。The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the application and are not intended to limit the scope of the application.
图1示出了本申请一个实施例中视频处理方法的工作环境示意图,如图1所示,其应用环境涉及终端110和服务器120,终端110和服务器120通过网络130连接,终端110及服务器120可以通过网络130进行通信。终端110需要观看视频时,首先要向服务器120发送视频请求,服务器120接收到终端110发送的视频请求后进行判断,当与目的视频转码分段的结尾时间最近、且起始时间在所述结尾时间之后的第一已存储视频转码分段满足预设条件时对视频片段进行转码处理,获得第一视频转码分段,可向终端110发送目的视频转码分段,终端110在接收到该目的视频转码分段后可进行播放,以便终端110实现目的视频转码分段的播放。1 is a schematic diagram of a working environment of a video processing method in an embodiment of the present application. As shown in FIG. 1 , an application environment involves a terminal 110 and a server 120. The terminal 110 and the server 120 are connected through a network 130. The terminal 110 and the server 120 are connected. Communication can be through network 130. When the terminal 110 needs to watch the video, it first needs to send a video request to the server 120, and the server 120 receives the video request sent by the terminal 110 and makes a judgment when it is closest to the end time of the destination video transcoding segment, and the start time is in the After the first stored video transcoding segment after the end time meets the preset condition, the video segment is transcoded to obtain the first video transcoding segment, and the destination video transcoding segment can be sent to the terminal 110, where the terminal 110 is After receiving the video transcoding segment of the destination, the terminal can perform playback, so that the terminal 110 can play the target video transcoding segment.
其中,终端110可以是任何一种能够实现智能输入输出、接收目的视频转码分段并播放的设备,例如,台式电脑或移动终端,移动终端可以是智能手机、平板电脑、车载电脑、穿戴式智能设备等。该服务器120可以是进行转码的平台所在的服务器;服务器120可以为一个或多个。本实施例涉及的是服务器120进行转码并可将目的视频转码分段发送给终端110的方案,终端110可对服务器120发送的目标视频文件进行播放实现信息智能操作。The terminal 110 can be any device capable of realizing intelligent input and output, receiving the destination video transcoding segment and playing, for example, a desktop computer or a mobile terminal, and the mobile terminal can be a smart phone, a tablet computer, a car computer, and a wearable device. Smart devices, etc. The server 120 may be a server on which the platform for transcoding is located; the server 120 may be one or more. The embodiment relates to a scheme in which the server 120 performs transcoding and can transmit the destination video transcode segment to the terminal 110. The terminal 110 can play the target video file sent by the server 120 to implement information intelligent operation.
一个实施例中的计算机设备的内部结构图如图2所示。该计算机设备可以是图1中的服务器120。如图2所示,该计算机设备包括通过系统总线连接的处理器121、存储器122和网络接口123,存储器122包括非易失性存储介质1221和内存1222。其中,计算机设备的存非易失性储介质1221存储有操作系统和计算机可读指令,该计算机可读指令被处理器121执行时,可使得处理器121执行一种视频处理方法。计算机设备的处理器121用于提供计算和控制能力,支撑整个计算机设备的运行。计算机设备的内存1222为非易失性存储介质中的视频处理装置的运行提供环境,该内存124中可储存有计算机可读指令,该计算机可读指令被处理器121执行时,可使得处理器121执行一种视频处理方法。计算机设备的网络接口用于与网络130连接和通信。An internal structural diagram of a computer device in one embodiment is shown in FIG. The computer device can be the server 120 of FIG. As shown in FIG. 2, the computer device includes a processor 121, a memory 122, and a network interface 123 connected by a system bus. The memory 122 includes a nonvolatile storage medium 1221 and a memory 1222. The non-volatile storage medium 1221 of the computer device stores an operating system and computer readable instructions that, when executed by the processor 121, cause the processor 121 to perform a video processing method. The processor 121 of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory 1222 of the computer device provides an environment for operation of the video processing device in the non-volatile storage medium, and the memory 124 can store computer readable instructions that, when executed by the processor 121, can cause the processor 121 performs a video processing method. The network interface of the computer device is used to connect and communicate with the network 130.
本领域技术人员可以理解,图2中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的服务器的限定, 具体的服务器可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。It will be understood by those skilled in the art that the structure shown in FIG. 2 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied. The specific server may include a ratio. More or fewer components are shown in the figures, or some components are combined, or have different component arrangements.
请参阅图3,提供一个实施例中的应用在服务器的视频处理方法,可应用于图1中的服务器120,包括步骤S310-步骤S340。Referring to FIG. 3, a video processing method applied to a server in an embodiment is provided, which is applicable to the server 120 in FIG. 1, and includes steps S310-S340.
S310:接收终端发送的视频请求。S310: Receive a video request sent by the terminal.
其中,视频请求携带源视频标识、源视频的URL(Uniform Resource Locator,统一资源定位符)和起始播放时间点,与源视频标识对应的源视频包括时间首尾依次相连的各视频片段。可以理解,源视频标识对应的源视频包括首尾时间依次拼接的各视频片段,例如,对于标识为A的源视频,可以是电影A,时长为90分钟,电影A是由各视频片段按照时间首尾依次拼接而成的,比如,可以包括9个视频片段(可以是第1-9个视频片段),每个视频片段的时长为10分钟,每个视频片段对应有起始播放时间和结尾时间,即每个视频片段对应有一个时间范围,第1个视频片段对应时间范围为(0,10],则下一个视频片段即第2个视频片段对应的时间范围为(10,20],依次类推,第9个视频片段对应的时间范围为(80,90],上述9个视频片段按照时间先后顺序首尾依次拼接形成源视频A。The video request carries the source video identifier, the URL of the source video (Uniform Resource Locator), and the starting play time point. The source video corresponding to the source video identifier includes video segments that are sequentially connected at the beginning and the end of the video. It can be understood that the source video corresponding to the source video identifier includes video segments that are sequentially stitched together in the first and last time. For example, for the source video identified as A, it may be movie A, the duration is 90 minutes, and the movie A is end to end by each video segment according to time. The splicing in sequence may include, for example, 9 video clips (which may be the 1st-9th video clips), each video clip has a duration of 10 minutes, and each video clip has a start play time and an end time. That is, each video segment corresponds to a time range, and the corresponding time range of the first video segment is (0, 10), and the time range corresponding to the next video segment, that is, the second video segment is (10, 20), and so on. The time range corresponding to the ninth video segment is (80, 90), and the above nine video segments are spliced end to end in chronological order to form the source video A.
当有终端向服务器请求源视频的播放时,由于源视频格式的多样性以及终端可播放的视频的格式等因素,服务器往往需要对源视频进行转码后发给终端,终端才能正常播放。每个源视频有其对应的唯一标识,通过源视频标识可指示源视频的身份,即可让服务器了解终端想要请求的是哪个源视频。源视频是存储在服务器中,源视频存储后对应有URL,通过URL可定位到源视频存储的位置,即可读取源视频以获取源视频,在接收到终端发送的视频请求后,可根据源视频的URL获取对应的源视频。服务器在向终端发送视频时,需要进行分段发送,即源视频包括了各时间首尾依次相连的各视频片段,通过对视频片段进行转码后将其发送给终端,实现视频的分段发送。另外,终端在进行视频请求时,携带的起始播时间点为请求源视频开始播放的时间点,例如,用户请求播放从第30分钟开始的电影A,则起始播放时间点 为第30分钟,如果是电影A开头进行播放,则起始播放时间点为第0分钟。When a terminal requests playback of the source video from the server, due to factors such as the diversity of the source video format and the format of the video that can be played by the terminal, the server often needs to transcode the source video and send it to the terminal, so that the terminal can play normally. Each source video has its own unique identifier. The source video identifier can indicate the identity of the source video, so that the server can know which source video the terminal wants to request. The source video is stored in the server, and the source video is stored with a URL. The URL can be located to the location of the source video storage, and the source video can be read to obtain the source video. After receiving the video request sent by the terminal, the source video can be The URL of the source video gets the corresponding source video. When the server sends a video to the terminal, it needs to perform segmental transmission. That is, the source video includes video segments that are connected in sequence at each end of the time. After the video segment is transcoded, it is sent to the terminal to implement segmentation of the video. In addition, when the video request is made, the initial broadcast time point carried by the terminal is the time point at which the request source video starts playing. For example, if the user requests to play the movie A starting from the 30th minute, the starting playback time point is the 30th minute. If it is played at the beginning of movie A, the starting playback time point is the 0th minute.
S320:获取转码参数,确定起始播放时间点对应的目的视频转码分段。S320: Acquire a transcoding parameter, and determine a destination video transcoding segment corresponding to the starting playing time point.
在后续需要对视频片段进行转码时,需要根据转码参数进行转码,转码参数决定转码后的视频的效果。在本实施例中,为了适应不同终端的需求以及不同网络的情况,可根据终端信息以及网络信息确定转码参数,以获取转码参数。终端信息以及网络信息可从终端发送的视频请求中获知,即视频请求还可包括终端信息以及网络信息。终端信息可以包括终端型号或/和终端播放器的型号等,网络信息可以包括网络速度或/网络吞吐量等,此处的网络信息是指终端所在的网络对应的网络信息。When the video clip needs to be transcoded later, it needs to be transcoded according to the transcoding parameter, and the transcoding parameter determines the effect of the transcoded video. In this embodiment, in order to adapt to the requirements of different terminals and different networks, the transcoding parameters may be determined according to the terminal information and the network information to obtain the transcoding parameters. The terminal information and the network information may be known from the video request sent by the terminal, that is, the video request may further include terminal information and network information. The terminal information may include a terminal model or/and a model of the terminal player, and the network information may include network speed or network throughput, etc., where the network information refers to network information corresponding to the network where the terminal is located.
终端发送视频请求需要进行视频播放,且终端请求的是起始播放时间点所对应的视频片段,由于发送给终端的是该视频片段对应的转码后的视频分段,从而,在服务器中需要确定起始播放时间点对应的目的视频转码分段,以便后续发送给终端进行播放。其中,源视频中起始播放时间点对应的视频片段是与上述目的视频转码分段是对应的,上述目的视频转码分段是上述起始播放时间点对应的视频片段转码后的分段,视频片段与其对应的视频转码分段的起始时间以及结尾时间均是对应相同的,在获知起始播放时间点后,即可获知其对应的源视频的视频片段,若已存储了该视频片段对应转码后的目的视频转码分段,也可获知起始播放时间点对应的目的视频转码分段,以确定目的视频转码分段,若未存储,则需对上述起始播放时间点对应的视频片段进行转码以确定目的视频转码分段。The terminal needs to perform video playback by sending a video request, and the terminal requests the video segment corresponding to the starting playback time point, and the video segment corresponding to the transcoded video segment corresponding to the video segment is sent to the terminal, thereby requiring in the server Determining the destination video transcoding segment corresponding to the starting playback time point for subsequent transmission to the terminal for playback. The video segment corresponding to the starting playback time point in the source video is corresponding to the destination video transcoding segment, and the destination video transcoding segment is the segment after the video segment corresponding to the initial playback time point. The segment, the start time and the end time of the video segment and the corresponding video transcoding segment are correspondingly the same. After the starting playback time point is known, the video segment of the corresponding source video can be obtained, if the video segment has been stored. The video segment corresponds to the destination video transcoding segment after the transcoding, and the destination video transcoding segment corresponding to the starting playing time point is also obtained to determine the destination video transcoding segment. If not, the device needs to The video segment corresponding to the start playing time point is transcoded to determine the destination video transcoding segment.
S330:当与目的视频转码分段的结尾时间最近、且起始时间在结尾时间之后的第一已存储视频转码分段满足预设条件时,根据转码参数,对各视频片段中与目的转码分段的结尾时间最近、起始时间在结尾时间之后、且未转码的视频片段进行转码,获得第一视频转码分段。S330: when the first stored video transcoding segment closest to the end time of the destination video transcoding segment and the starting time is after the end time meets a preset condition, according to the transcoding parameter, for each video segment The video segment of the destination transcoding segment with the closest end time and the starting time after the end time and the untranscoded video is transcoded to obtain the first video transcoding segment.
服务器是在已存储视频转码分段中有满足预设条件的第一已存储视频转码分段时才进行转码,以减少转码工作量。由于在终端顺序播放过程中,随着播放的推移,需要的是目的视频转码分段之后沿时间顺序的视频转码分段, 若与目的视频转码分段的结尾时间最近、且起始时间在结尾时间之后的第一已存储视频转码分段满足预设条件,表示满足转码条件,即第一已存储视频转码分段可能不足以支撑后续的播放要求,需要进行转码,此时,根据转码参数,对各视频片段中与目的转码分段的结尾时间最近、起始时间在结尾时间之后、且未转码的视频片段进行转码,获得第一视频转码分段,也就是对已确定的目的转码分段之后的未转码的视频片段进行转码,以确保能发送给终端的转码分段的数量,确保播放质量。The server performs transcoding when there is a first stored video transcoding segment that satisfies a preset condition in the stored video transcoding segment to reduce the transcoding workload. As the terminal plays sequentially, as the playback progresses, what is needed is the chronological video transcoding segment after the destination video transcoding segment, if it is closest to the end time of the destination video transcoding segment, and starts The first stored video transcoding segment after the end time meets the preset condition, indicating that the transcoding condition is satisfied, that is, the first stored video transcoding segment may not be sufficient to support subsequent playback requirements, and transcoding is required. At this time, according to the transcoding parameter, the video segment of each video segment that is closest to the end time of the destination transcoding segment, the start time is after the end time, and is not transcoded is transcoded to obtain the first video transcoding. The segment, that is, the untranscoded video segment after the determined destination transcoding segment is transcoded to ensure the number of transcoded segments that can be sent to the terminal, ensuring playback quality.
在本实施例中,上述未转码的视频片段可以为预设分段数量个连续的未转码的视频片段,则上述第一视频转码分段的数量为预设分段数量。In this embodiment, the untranscoded video segment may be a preset number of consecutive untranscoded video segments, and the number of the first video transcode segments is a preset number of segments.
通过上述视频处理方法,在接收到终端发送的视频请求后,需要确定起始播放时间点对应的目的视频转码分段,另外,还需去判断与目的视频转码分段的结尾时间最近、且起始时间在结尾时间之后的第一已存储视频转码分段是否满足预设条件,只有在第一已存储视频转码分段满足预设条件时,才会进行转码,可以避免在终端请求视频时启动整个视频源的转码,用户退出视频播放时产生大量的浪费,本实施例的方法只有在满足预设条件时才会根据转码参数,对各视频片段中与目的转码分段的结尾时间最近、起始时间在结尾时间之后、且未转码的视频片段进行转码,获得第一视频转码分段,这样大大减少了转码工作,节省资源,即使用户退出也不会造成大量资源的浪费After the video processing method is received, after receiving the video request sent by the terminal, the destination video transcoding segment corresponding to the initial playing time point needs to be determined, and further, it is determined that the end time of the destination video transcoding segment is the closest. And whether the first stored video transcoding segment after the end time meets the preset condition, and the transcoding is performed only when the first stored video transcoding segment satisfies the preset condition, which can be avoided. When the terminal requests the video, the transcoding of the entire video source is started, and a large amount of waste is generated when the user exits the video playback. The method in this embodiment only transcodes the video segment and the destination according to the transcoding parameter when the preset condition is met. The video clip with the latest end time of the segment and the start time after the end time is transcoded to obtain the first video transcoding segment, which greatly reduces the transcoding work and saves resources even if the user quits. Will not cause a lot of waste of resources
在其中一个实施例中,确定起始播放时间点对应的目的视频转码分段的步骤包括:当起始播放时间点在源视频标识对应的已存储视频转码分段的时间段内时,从已存储视频转码分段中获取目的视频转码分段;当起始播放时间点不在源视频标识对应的已存储视频转码分段的时间段内时,对源视频中起始播放时间点对应的视频片段进行转码,获得起始播放时间点对应的目的视频转码分段。In one embodiment, the step of determining the destination video transcoding segment corresponding to the initial playing time point comprises: when the starting playing time point is within the time period of the stored video transcoding segment corresponding to the source video identifier, Obtaining the destination video transcoding segment from the stored video transcoding segment; when the starting playing time point is not within the time period of the stored video transcoding segment corresponding to the source video identifier, starting the playing time in the source video The video segment corresponding to the point is transcoded, and the destination video transcoding segment corresponding to the starting playback time point is obtained.
在确定目的视频转码分段过程中,由于存在两种情况,一种是在已存储视频转码分段中已经有了与起始播放时间点对应的视频转码分段,每个已存 储视频转码分段有对应的起始和结尾时间,通过判断起始播放时间点是否在源视频标识对应的已存储视频转码分段的时间段内即可判断已存储视频转码分段中是否有与该起始播放时间对应的目的视频转码分段,即若终端所需的起始播放时间点所在的视频片段对应的视频转码分段已经存储了,无需在进行转码了,直接从已存储视频转码分段中获取该起始播放时间点对应的目的视频转码分段。另一种是在已存储视频转码分段中未有与起始播放时间点对应的视频转码分段,而终端需要播放的是该起始播放时间点对应的视频转码分段,此时,需要对源视频中起始播放时间点对应的视频片段进行转码,获得起始播放时间点对应的目的视频转码分段,后续终端接收该目的视频转码分段后可进行播放。In determining the destination video transcoding segmentation process, there are two cases, one is that in the stored video transcoding segment, there is already a video transcoding segment corresponding to the starting playing time point, and each is stored. The video transcoding segment has a corresponding start and end time, and can determine whether the stored video transcoding segment is determined by determining whether the starting playing time point is within the time period of the stored video transcoding segment corresponding to the source video identifier. Whether there is a destination video transcoding segment corresponding to the initial playing time, that is, if the video transcoding segment corresponding to the video segment where the starting playback time point required by the terminal is already stored, there is no need to perform transcoding. The destination video transcoding segment corresponding to the initial playing time point is obtained directly from the stored video transcoding segment. The other is that there is no video transcoding segment corresponding to the starting playing time point in the stored video transcoding segment, and the terminal needs to play the video transcoding segment corresponding to the starting playing time point. The video segment corresponding to the starting playing time point in the source video needs to be transcoded to obtain the destination video transcoding segment corresponding to the starting playing time point, and the subsequent terminal can perform the playback after receiving the destination video transcoding segment.
在其中一个实施例中,当第一已存储视频转码分段的连续数量小于预设数量时,第一已存储视频转码分段满足预设条件。In one of the embodiments, the first stored video transcode segment satisfies a preset condition when the consecutive number of first stored video transcode segments is less than a preset number.
为了确保终端能比较顺畅地接收到服务器发送的目的视频转码分段,实现顺畅播放,同时节省转码资源,需要对与目的视频转码分段的结尾时间最近、且起始时间在所述结尾时间之后的第一已存储视频转码分段的连续数量与预设数量进行比较,当连续数量小于预设数量时,表示当前第一已存储视频转码分段可能不足以支撑终端的播放要求,为了确保发送给终端的目的视频转码分段的顺畅,且又要节省转码资源,对各所述视频片段中与所述目的转码分段的结尾时间最近、起始时间在所述结尾时间之后、且未转码的视频片段进行转码,获得第一视频转码分段,优选地,对预设分段数量的为转码的视频片段进行转码,无需对所有未转码的视频片段进行转码,避免对大量未转码的视频片段进行转码耗费大量资源以及增加转码负担。In order to ensure that the terminal can receive the destination video transcoding segment sent by the server smoothly, and achieve smooth playback, and save transcoding resources, the end time of the segmentation with the destination video transcoding needs to be the closest, and the starting time is The continuous number of the first stored video transcoding segments after the end time is compared with the preset number. When the consecutive number is less than the preset number, it indicates that the current first stored video transcoding segment may not be sufficient to support the playback of the terminal. Requirement, in order to ensure the smoothness of the destination video transcoding segment sent to the terminal, and to save the transcoding resources, the end time of each of the video segments and the destination transcoding segment is the closest, and the starting time is in the The video segment after the end time and not transcoded is transcoded to obtain a first video transcoding segment, and preferably, the transcoded video segment is transcoded for a preset number of segments, without The video segment of the code is transcoded to avoid transcoding a large number of untranscoded video segments, which consumes a lot of resources and increases the transcoding burden.
请参阅图4,在其中一个实施例中,从所述已存储视频转码分段中获取所述目的视频转码分段之后,还包括:Referring to FIG. 4, in one embodiment, after obtaining the destination video transcoding segment from the stored video transcoding segment, the method further includes:
S340:向终端返回第一请求响应信息,第一请求响应信息包括目的视频转码分段的URL和媒体信息,媒体信息包括时长和起始时间点;S340: Return, to the terminal, the first request response information, where the first request response information includes a URL of the destination video transcoding segment and media information, where the media information includes a duration and a start time point;
S350:接收并响应终端根据第一请求响应信息发送的第一分片播放请求, 向所述终端返回第一分片响应信息,所述第一分片响应信息包括所述目的视频转码分段的URL对应的所述目的视频转码分段,第一分片播放请求携带目的视频转码分段的URL。S350: Receive and respond to the first fragment playback request sent by the terminal according to the first request response information, and return, to the terminal, first fragmentation response information, where the first fragmentation response information includes the destination video transcoding segment. The destination video transcode segment corresponding to the URL, and the first fragment playback request carries the URL of the destination video transcoding segment.
上述步骤S340-S350应用于服务器中,服务器从所述已存储视频转码分段中获取所述目的视频转码分段之后,还可将该目的视频转码分段发送给终端,终端接收到后可进行播放。在本实施例中,由于在已存储视频转码分段中已经有了与起始播放时间点对应的视频转码分段即上述所述目的视频转码分段,则该目的视频转码分段有其对应的URL,如此,服务器向终端发送该目的视频转码分段时,首先向终端返回携带目的视频转码分段的URL的第一请求响应信息,终端在接收到该第一请求响应信息后向服务器发送携带目的视频转码分段的URL的第一分片播放请求,以请求上述目的视频转码分段,服务器接收到该第一分片播放请求后,向终端返回该目的视频转码分段的URL对应的目的视频转码分段,终端接收即可播放。另外,第一请求响应信息还可包括时长和起始时间点等媒体信息,发送给终端后,以告知终端上述目的视频转码分段的时长以及起始时间点等媒体信息,终端也可对上述媒体信息进行显示,以便用户观看。The above steps S340-S350 are applied to the server. After the server obtains the destination video transcoding segment from the stored video transcoding segment, the destination video transcoding segment may also be sent to the terminal, and the terminal receives the It can be played later. In this embodiment, since the video transcoding segment corresponding to the initial playing time point, that is, the above-mentioned destination video transcoding segment, already exists in the stored video transcoding segment, the destination video transcoding segment The segment has its corresponding URL. When the server sends the destination video transcoding segment to the terminal, the first request response information carrying the URL of the destination video transcoding segment is first returned to the terminal, and the terminal receives the first request. Sending a first fragment playback request carrying the URL of the destination video transcoding segment to the server, in response to the information, requesting the destination video transcoding segment, and after receiving the first fragment playback request, the server returns the destination to the terminal. The destination video transcode segment corresponding to the URL of the video transcoding segment can be played by the terminal receiving. In addition, the first request response information may further include media information such as the duration and the start time point, and after being sent to the terminal, the terminal may notify the terminal of the media information such as the duration of the destination video transcoding segment and the start time point, and the terminal may also The above media information is displayed for the user to watch.
在其中一个实施例中,获得所述起始播放时间点对应的目的视频转码分段之后,向所述终端返回所述目的视频转码分段。In one embodiment, after obtaining the destination video transcoding segment corresponding to the initial playing time point, the destination video transcoding segment is returned to the terminal.
即在本实施例中,已存储视频转码分段中未有与起始播放时间点对应的视频转码分段,需要进行转码获得目的视频转码分段,此时,是未对目的视频转码分段进行存储的,并没有对应的URL地址,服务器直接将转码获得的目的视频转码分段发送给终端,终端接收进行播放即可。That is, in this embodiment, the video transcoding segment corresponding to the starting playing time point is not stored in the stored video transcoding segment, and the transcoding is required to obtain the destination video transcoding segment, and at this time, the purpose is not The video transcode segment is stored, and there is no corresponding URL address. The server directly transmits the destination video transcode segment obtained by the transcoding to the terminal, and the terminal receives and plays.
在其中一个实施例中,上述视频处理方法还包括步骤:In one embodiment, the video processing method further includes the steps of:
当接收到终端发送的携带源视频标识的视频退出请求时,停止转码,并在第一视频转码分段的播放次数或/和播放完整度满足对应的预设值时,将第一视频转码分段存储,更新已存储视频转码分段,第一视频转码分段的播放完整度为发送给终端的第一视频转码分段的时间长度与第一视频转码分段的 时长的比值。When receiving the video exit request carrying the source video identifier sent by the terminal, stopping the transcoding, and when the number of times of playing or/and the playing integrity of the first video transcoding segment meets the corresponding preset value, the first video is used. Transcoding segmentation storage, updating the stored video transcoding segment, the playing integrity of the first video transcoding segment is the length of time of the first video transcoding segment sent to the terminal and the segmentation of the first video transcoding segment The ratio of the duration.
即用户通过终端请求退出视频时,向服务器发送视频退出请求,服务器接收该视频退出请求时,若正在转码,则立即停止转码,以减少转码工作量,节省资源。同时,还需要对第一视频转码分段的播放情况(对应播放次数,即播放热度)以及用户拖动情况(对应播放完整度)进行分析,当第一视频转码分段的播放次数或/和播放完整度满足对应的预设值时,表示该第一视频转码分段是常被播放的或/和播放时用户拖动情况良好,则可对该第一视频转码分段进行存储,避免后续终端请求该第一视频转码分段时重复转码,节省转码资源。That is, when the user requests to quit the video through the terminal, the user sends a video exit request to the server. When the server receives the video exit request, if the code is being transcoded, the code is immediately stopped to reduce the transcoding workload and save resources. At the same time, it is also necessary to analyze the playing condition of the first video transcoding segment (corresponding to the playing times, that is, the playing heat) and the user dragging situation (corresponding to the playing integrity), when the first video transcode segment is played or And when the playback integrity satisfies the corresponding preset value, indicating that the first video transcoding segment is frequently played or/and the user dragging is good during playback, the first video transcoding segment may be performed. The storage avoids repeated transcoding when the subsequent terminal requests the first video transcoding segment, and saves the transcoding resource.
可以理解,由于第一视频转码分段的数量不止一个,即第一视频转码分段的数量可以为预设分段数量,在得到各第一视频转码分段的播放次数或/和播放完整度后,可根据各第一视频转码分段的播放次数或/和播放完整度后对各第一视频转码分段进行排序,将播放次数或/和播放完整度靠前的预设数目个第一视频转码分段进行存储,以确保存储的第一视频转码分段的播放热度或/和完整度。It can be understood that, since the number of the first video transcoding segments is more than one, that is, the number of the first video transcoding segments may be the preset number of segments, the number of times of playing or/and the number of the first video transcoding segments is obtained. After playing the completeness degree, the first video transcoding segments may be sorted according to the number of times of playing or/and the playing integrity of each first video transcoding segment, and the number of playing times or/and the fullness of the playing integrity is advanced. A plurality of first video transcode segments are stored for storage to ensure the playback popularity or/and integrity of the stored first video transcode segments.
另外,由于用户需要观看视频时,一般是从开头开始你,所以源视频开头时间对应的视频转码分段被请求的可能性非常大,为了节省转码资源,可对其进行存储,即接收到视频退出请求,停止转码后,判断源视频开头时间是否在在所述源视频标识对应的已存储视频转码分段的时间段内时,若不在,对所述源视频中所述开头时间对应的视频片段进行转码,获得开头视频转码分段并存储。In addition, since the user needs to watch the video, generally starting from the beginning, the video transcoding segment corresponding to the beginning time of the source video is highly likely to be requested, and in order to save the transcoding resource, it can be stored, that is, received. After the video exit request is sent, after the code is stopped, it is determined whether the source video start time is within the time period of the stored video transcode segment corresponding to the source video identifier, and if not, the beginning of the source video The video segment corresponding to the time is transcoded, and the first video transcode segment is obtained and stored.
在其中一个实施例中,停止转码后,当第一目的视频转码分段的播放次数或/和播放完整度满足对应的预设值时,将第一目的视频转码分段存储,更新已存储视频转码分段,其中,第一目的视频转码分段为未在已存储视频转码分段中的目的视频转码分段,第一目的视频转码分段的播放完整度为发送给终端的第一目的视频转码分段的时间长度与第一目的视频转码分段的时长的比值。In one embodiment, after the transcoding is stopped, when the number of times of playing or/and the fullness of the playback of the first destination video transcoding segment meets the corresponding preset value, the first destination video transcode is segmentally stored and updated. The video transcoding segment is stored, wherein the first destination video transcoding segment is a destination video transcoding segment that is not in the stored video transcoding segment, and the playback integrity of the first destination video transcoding segment is The ratio of the length of time of the first destination video transcoding segment sent to the terminal to the duration of the first destination video transcoding segment.
即服务器不仅需要对上述第一视频转码分段的播放情况和用户推动情况分析以决定是否存储,还需要对第一目的视频转码分段的播放情况以及用户拖动情况进行分析,当第一目的视频转码分段的播放次数或/和播放完整度满足对应的预设值时,表示该第一目的视频转码分段是常被播放的或/和播放时用户拖动情况良好,则可对该第一目的视频转码分段进行存储,避免后续终端请求该第一目的视频转码分段时重复转码,节省转码资源。That is, the server not only needs to analyze the playing condition and the user promotion situation of the first video transcoding segment to determine whether to store, but also needs to analyze the playing condition of the first destination video transcoding segment and the user dragging situation. When the number of playbacks of the video transcoding segment of a destination or/and the integrity of the playback meet the corresponding preset value, it indicates that the first destination video transcoding segment is often played or/and the user drags during playback is good. The first destination video transcoding segment may be stored to prevent repeated transcoding when the subsequent terminal requests the first destination video transcoding segment, thereby saving transcoding resources.
请参阅图5,下面以一具体实施例对上述视频处理方法的过程加以具体说明,该视频处理方法应用于服务器120。Referring to FIG. 5, the process of the video processing method described above is specifically described in a specific embodiment, and the video processing method is applied to the server 120.
首先将视频会输入到服务器120中,可对其进行解码获得源视频,源视频分段后可获得各视频片段。本实施的视频处理方法的步骤具体如下:First, the video will be input into the server 120, which can be decoded to obtain the source video. After the source video is segmented, each video segment can be obtained. The steps of the video processing method of this implementation are as follows:
(1)服务器120接收终端110发送视频请求,根据视频请求中的URL可拿到源视频。(1) The server 120 receives the video request from the terminal 110, and can obtain the source video according to the URL in the video request.
(2)根据视频请求中的终端信息以及网络信息,分析终端及网络特点,决定转码参数,转码参数可以包括码率以及分辨率等。(2) According to the terminal information and network information in the video request, analyze the characteristics of the terminal and the network, and determine the transcoding parameters, and the transcoding parameters may include the code rate and the resolution.
(3)启动索引管理模块124(可通过图5中HTTP服务器实现索引管理模块124的功能),根据视频请求中携带的起始播放时间点和源视频标识在索引管理模块124中查找起始播放时间点是否在所述源视频标识对应的已存储视频转码分段的时间段内,也就是查找终端请求的转码分片是否在已存储视频转码分段中。如果在,将已存储视频转码分段中所述起始播放时间点对应的目的视频转码分段的媒体信息(时长、起始时间和加密等信息等)及目的视频转码分段的URL写入索引文件即后缀为m3u8的文件中,向所述终端110返回第一请求响应信息携带后缀为m3u8的文件终端的信息,终端110再根据目的视频转码分段的URL向服务器120发送携带目的视频转码分段的URL第一分片播放请求,服务器120响应第一分片播放请求,向所述终端110返回所述目的视频转码分段的URL对应的所述目的视频转码分段,终端110即可播放该目的视频转码分段。(3) The index management module 124 is activated (the function of the index management module 124 can be implemented by the HTTP server in FIG. 5), and the initial playback time is searched in the index management module 124 according to the initial playback time point and the source video identifier carried in the video request. Whether the time point is within the time period of the stored video transcoding segment corresponding to the source video identifier, that is, whether the transcoded slice requested by the terminal is in the stored video transcoding segment. If, at the stored video transcoding segment, the media information (time length, start time, encryption, etc.) of the destination video transcoding segment corresponding to the initial playback time point and the destination video transcoding segmentation The URL is written into the index file, that is, the file suffixed as m3u8, and the first request response information is returned to the terminal 110 to carry the information of the file terminal suffixed as m3u8, and the terminal 110 sends the information to the server 120 according to the URL of the destination video transcoding segment. Carrying the URL first fragment playback request of the destination video transcoding segment, and the server 120 returns the destination video transcoding corresponding to the URL of the destination video transcoding segment to the terminal 110 in response to the first fragment playback request. Segmentation, the terminal 110 can play the video transcoding segment of the destination.
(4)转码模块125,根据预先设定的预设数量,判断是否进行转码。该 预设数量的值可以根据现有已转码连续的目的视频转码的时长跟目前服务器120吐数据的速度的比值确定。当与目的视频转码分段的结尾时间最近、且起始时间在所述结尾时间之后的第一已存储视频转码分段的连续数量小于预设数量时,进行转码,即根据所述转码参数,对各所述视频片段中与所述目的转码分段的结尾时间最近、起始时间在所述结尾时间之后、且未转码的预设分段数量各视频片段进行转码,获得预设分段数量个第一视频转码分段,无需对整个源视频进行转码。其中,预设分段数量可由目前服务器的网络吞度量以及资源占有率所决定。当第一已存储视频转码分段的连续数量不小于预设数量时,表示不满足转码条件,此时不进行转码,节省转码资源。(4) The transcoding module 125 determines whether to perform transcoding according to a preset preset number. The predetermined number of values may be determined based on the ratio of the duration of the existing transcoded consecutive destination video transcoding to the current speed of the server 120 spitting data. Transcoding is performed when the consecutive number of first stored video transcode segments closest to the end time of the destination video transcode segment and the start time is less than the preset number, Transcoding parameters, transcoding each video segment of each of the video segments that is closest to the end time of the destination transcoding segment, the start time is after the end time, and the number of preset segments that are not transcoded Obtain a preset number of segments of the first video transcoding segment without transcoding the entire source video. The preset number of segments may be determined by the network metric of the current server and the resource occupancy rate. When the consecutive number of the first stored video transcoding segments is not less than the preset number, it indicates that the transcoding condition is not satisfied, and no transcoding is performed at this time, and the transcoding resources are saved.
(5)进行转码时,将转码参数发给分布式系统,对上述未转码的视频片段的转码,获得第一视频转码分段,并为其建立索引,并存在网页服务器126中,可将其通过HTTP协议将其发送给终端。(5) When performing transcoding, the transcoding parameter is sent to the distributed system, and the transcoding of the untranscoded video segment is obtained, the first video transcoding segment is obtained, and an index is established, and the web server 126 is present. It can be sent to the terminal via the HTTP protocol.
(8)当服务器120接收到终端发送的退出视频请求时,即用户退出视频观看,服务器120停止转码。(8) When the server 120 receives the exit video request sent by the terminal, that is, the user exits the video viewing, the server 120 stops the transcoding.
(10)服务器120接收到退出视频请求并退出转码之后,启动TOP转码分段统计模块127,根据第一视频转码分段的播放次数或/和播放完整度后对各第一视频转码分段进行排序,将播放次数或/和播放完整度靠前的预设数目个第一视频转码分段进行存储,以确保存储的第一视频转码分段的播放热度或/和完整度。(10) After receiving the exit video request and exiting the transcoding, the server 120 starts the TOP transcoding segmentation statistics module 127, and switches to the first video according to the number of times of the first video transcoding segment or/and the integrity of the playback. The code segments are sorted, and the preset number of first video transcode segments with the number of play times or/and the fullness of playback are stored to ensure the playback popularity or/and integrity of the stored first video transcode segments. degree.
综上可知,增加了索引管理模块124可以管理已存储视频转码分段,防止重复转码。设置的转码模块,可以避免在终端请求视频的时候就启动整各源视频的转码,大大的减少了转码工作量。增加了TOP转码分段统计模块127,可以存储播放次数或/和播放完整度靠前的预设数目个第一视频转码分段,以此来统计用户反复观看的分段,减少转码量和存储量。In summary, the index management module 124 can be added to manage the stored video transcoding segments to prevent repeated transcoding. The transcoding module can avoid the transcoding of the entire source video when the terminal requests the video, which greatly reduces the transcoding workload. The TOP transcoding segmentation statistics module 127 is added, and the preset number of first video transcoding segments with the number of play times or/and the fullness of the playback integrity may be stored, thereby counting the segments repeatedly viewed by the user, and reducing the transcoding. Quantity and storage.
本实施例的视频处理方法应用在服务器120中,可实现终端110的视频直播、点播中。可减少服务器120的转码量和节省存储资源。按目前云存储的体量,大概能节省40%的转码量和80%的存储资源。同时还可以提供快速 的首屏用户体验,提升产品竞争力。The video processing method in this embodiment is applied to the server 120, and the video broadcast and on-demand of the terminal 110 can be implemented. The amount of transcoding by the server 120 can be reduced and storage resources can be saved. According to the current volume of cloud storage, it can save 40% of the transcoding amount and 80% of the storage resources. It also provides a fast first-screen user experience and enhances product competitiveness.
在一个实施例中,还提供了一种计算机设备,该计算机设备的内部结构可如图2所示,该计算机设备中设置有视频处理装置,装置中包括各个模块,每个模块可以全部或部分通过软件、硬件或其组合来实现。In an embodiment, a computer device is also provided. The internal structure of the computer device can be as shown in FIG. 2, and the computer device is provided with a video processing device, and the device includes various modules, and each module can be all or part of It is implemented by software, hardware or a combination thereof.
如图6所示,提供一个实施例中的视频处理装置,可设置于图1中服务器120,包括:As shown in FIG. 6, a video processing apparatus in an embodiment is provided, which can be disposed in the server 120 of FIG. 1, and includes:
视频请求接收模块610,用于接收终端发送的视频请求,视频请求携带源视频标识、源视频的URL、起始播放时间点,与源视频标识对应的源视频包括时间首尾依次相连的各视频片段。The video request receiving module 610 is configured to receive a video request sent by the terminal, where the video request carries the source video identifier, the URL of the source video, and the starting play time point, and the source video corresponding to the source video identifier includes each video segment sequentially connected in time and end. .
转码分段确定模块620,用于获取转码参数,确定起始播放时间点对应的目的视频转码分段。The transcoding segment determining module 620 is configured to obtain a transcoding parameter, and determine a destination video transcoding segment corresponding to the starting playing time point.
转码模块630,用于当与目的视频转码分段的结尾时间最近、且起始时间在结尾时间之后的第一已存储视频转码分段满足预设条件时,根据转码参数,对各视频片段中与目的转码分段的结尾时间最近、起始时间在结尾时间之后、且未转码的视频片段进行转码,获得第一视频转码分段。The transcoding module 630 is configured to: when the first stored video transcoding segment that is closest to the end time of the destination video transcoding segment and the start time is after the end time meets the preset condition, according to the transcoding parameter, A video segment of each video segment that is closest to the end time of the destination transcoding segment, the start time is after the end time, and the untranscoded video segment is transcoded to obtain the first video transcode segment.
在其中一个实施例中,上述转码分段确定模块620包括:转码分段获取模块和目的视频转码模块。In one embodiment, the transcoding segment determining module 620 includes a transcoding segment obtaining module and a destination video transcoding module.
转码分段获取模块,用于当起始播放时间点在源视频标识对应的已存储视频转码分段的时间段内时,从已存储视频转码分段中获取目的视频转码分段。a transcoding segment obtaining module, configured to obtain a destination video transcoding segment from the stored video transcoding segment when the starting playing time point is within a time period of the stored video transcoding segment corresponding to the source video identifier .
目的视频转码模块,用于当起始播放时间点不在源视频标识对应的已存储视频转码分段的时间段内时,对源视频中起始播放时间点对应的视频片段进行转码,获得起始播放时间点对应的目的视频转码分段。The target video transcoding module is configured to transcode the video segment corresponding to the starting playing time point in the source video when the starting playing time point is not within the time period of the stored video transcoding segment corresponding to the source video identifier, The destination video transcoding segment corresponding to the starting playback time point is obtained.
在其中一个实施例中,当第一已存储视频转码分段的连续数量小于预设数量时,第一已存储视频转码分段满足预设条件。In one of the embodiments, the first stored video transcode segment satisfies a preset condition when the consecutive number of first stored video transcode segments is less than a preset number.
在其中一个实施例中,视频请求还包括终端信息以及网络信息。In one of the embodiments, the video request further includes terminal information as well as network information.
转码分段确定模块根据终端信息以及网络信息确定转码参数。The transcoding segment determining module determines the transcoding parameter according to the terminal information and the network information.
请参阅图7,在其中一个实施例中,上述视频处理装置,还包括:Referring to FIG. 7, in one embodiment, the video processing apparatus further includes:
第一请求响应信息发送模块640,用于上述转码分段获取模块从已存储视频转码分段中获取目的视频转码分段之后,向终端返回第一请求响应信息,第一请求响应信息包括目的视频转码分段的URL和媒体信息,媒体信息包括时长和起始时间点。The first request response information sending module 640 is configured to: after the transcoding segment obtaining module obtains the target video transcoding segment from the stored video transcoding segment, return the first request response information to the terminal, and the first request response information The URL and media information including the destination video transcoding segment, the media information including the duration and the starting time point.
第一分片响应信息发送模块650,用于接收并响应所述终端根据所述第一请求响应信息发送的第一分片播放请求,向所述终端返回第一分片响应信息,所述第一分片响应信息包括所述目的视频转码分段的URL对应的所述目的视频转码分段,所述第一分片播放请求携带所述目的视频转码分段的URL。The first fragment response information sending module 650 is configured to receive and respond to the first fragment playback request sent by the terminal according to the first request response information, and return a first fragmentation response information to the terminal, where the The fragmentation response information includes the destination video transcoding segment corresponding to the URL of the destination video transcoding segment, and the first fragmentation playback request carries the URL of the destination video transcoding segment.
在其中一个实施例中,上述视频处理装置,还包括:In one embodiment, the video processing device further includes:
发送模块,用于上述目的视频转码模块获得起始播放时间点对应的目的视频转码分段之后,向所述终端返回所述目的视频转码分段。And a sending module, configured to: after obtaining the destination video transcoding segment corresponding to the initial playing time point, the video transcoding module returns the destination video transcoding segment to the terminal.
在其中一个实施例中,上述视频处理装置,还包括更新模块。In one embodiment, the video processing device further includes an update module.
上述更新模块,用于当接收到终端发送的携带源视频标识的视频退出请求时,停止转码,并在第一视频转码分段的播放次数或/和播放完整度满足对应的预设值时,将第一视频转码分段存储,更新已存储视频转码分段,第一视频转码分段的播放完整度为发送给终端的第一视频转码分段的时间长度与第一视频转码分段的时长的比值。The foregoing update module is configured to stop transcoding when receiving the video exit request of the source video identifier sent by the terminal, and satisfy the corresponding preset value in the number of times of playing or/and the completeness of the playback of the first video transcoding segment. The first video transcode segment is stored, and the stored video transcode segment is updated. The play integrity of the first video transcode segment is the length of time and the first time of the first video transcode segment sent to the terminal. The ratio of the length of the video transcode segment.
在其中一个实施例中,上述更新模块,还用于在停止转码后,当第一目的视频转码分段的播放次数或/和播放完整度满足对应的预设值时,将第一目的视频转码分段存储,更新已存储视频转码分段,其中,第一目的视频转码分段为未在已存储视频转码分段中的目的视频转码分段,第一目的视频转码分段的播放完整度为发送给终端的第一目的视频转码分段的时间长度与第一目的视频转码分段的时长的比值。In one embodiment, the updating module is further configured to: when the transcoding is stopped, when the number of times of playing or/and the playing integrity of the first destination video transcoding segment meets the corresponding preset value, the first purpose is Video transcoding segmentation storage, updating the stored video transcoding segment, wherein the first destination video transcoding segment is a destination video transcoding segment that is not in the stored video transcoding segment, and the first destination video is rotated. The playback integrity of the code segment is the ratio of the length of time of the first destination video transcoding segment sent to the terminal to the duration of the first destination video transcoding segment.
上述视频处理装置与上述视频处理方法对应,对于视频处理装置中与上述视频处理方法对应的技术特征,在此不作赘述。The video processing device corresponds to the video processing method described above, and the technical features corresponding to the video processing method in the video processing device are not described herein.
本申请的一个实施例中,还提供一种计算机存储介质,其上存储有计算 机可读指令,该计算机可读指令被处理器执行时,使得所述处理器执行上述视频处理方法的步骤。In one embodiment of the present application, there is also provided a computer storage medium having stored thereon computer readable instructions that, when executed by a processor, cause the processor to perform the steps of the video processing method described above.
本申请的一个实施例还提供一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行上述视频处理方法。An embodiment of the present application also provides a computer device including a memory and a processor, the memory storing computer readable instructions, when the computer readable instructions are executed by the processor, causing the processor to execute The above video processing method.
应该理解的是,虽然本申请各实施例中的各个步骤并不是必然按照步骤标号指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,各实施例中至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that the various steps in the various embodiments of the present application are not necessarily performed in the order indicated by the steps. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in the embodiments may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be executed at different times, and the execution of these sub-steps or stages The order is also not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of the other steps.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person skilled in the art can understand that all or part of the process of implementing the above embodiments can be completed by a computer program to instruct related hardware, and the computer program can be stored in a non-volatile computer readable storage medium. The computer program, when executed, may include the flow of an embodiment of the methods as described above. Any reference to a memory, storage, database or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of formats, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization chain. Synchlink DRAM (SLDRAM), Memory Bus (Rambus) Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM).
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技 术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. For the sake of brevity of description, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, It is considered to be the range described in this specification.
以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above embodiments are merely illustrative of several embodiments of the present application, and the description thereof is more specific and detailed, but is not to be construed as limiting the scope of the claims. It should be noted that a number of variations and modifications may be made by those skilled in the art without departing from the spirit and scope of the present application. Therefore, the scope of the invention should be determined by the appended claims.

Claims (18)

  1. 一种视频处理方法,其特征在于,应用于服务器,包括以下步骤:A video processing method is characterized in that, applied to a server, the following steps are included:
    接收终端发送的视频请求,所述视频请求携带源视频标识、源视频的URL和起始播放时间点,其中,与所述源视频标识对应的源视频包括时间首尾依次相连的各视频片段;Receiving a video request sent by the terminal, where the video request carries a source video identifier, a URL of the source video, and a starting play time point, where the source video corresponding to the source video identifier includes video segments sequentially connected in time and end;
    获取转码参数,确定所述起始播放时间点对应的目的视频转码分段;Obtaining a transcoding parameter, and determining a destination video transcoding segment corresponding to the initial playing time point;
    当与目的视频转码分段的结尾时间最近、且起始时间在所述结尾时间之后的第一已存储视频转码分段满足预设条件时,根据所述转码参数,对各所述视频片段中与所述目的转码分段的结尾时间最近、起始时间在所述结尾时间之后、且未转码的视频片段进行转码,获得第一视频转码分段。When the first stored video transcode segment closest to the end time of the destination video transcoding segment and the start time is after the end time meets a preset condition, according to the transcoding parameter, each of the A video segment in the video segment that is closest to the end time of the destination transcode segment, whose start time is after the end time, and that is not transcoded is transcoded to obtain a first video transcode segment.
  2. 根据权利要求1所述的视频处理方法,其特征在于,所述确定所述起始播放时间点对应的目的视频转码分段的步骤包括:The video processing method according to claim 1, wherein the step of determining the destination video transcoding segment corresponding to the initial playing time point comprises:
    当所述起始播放时间点在所述源视频标识对应的已存储视频转码分段的时间段内时,从所述已存储视频转码分段中获取所述目的视频转码分段;Obtaining the destination video transcoding segment from the stored video transcoding segment when the initial playing time point is within a time period of the stored video transcoding segment corresponding to the source video identifier;
    当所述起始播放时间点不在所述源视频标识对应的已存储视频转码分段的时间段内时,对所述源视频中所述起始播放时间点对应的视频片段进行转码,获得所述起始播放时间点对应的目的视频转码分段。When the initial play time point is not within the time period of the stored video transcode segment corresponding to the source video identifier, the video segment corresponding to the start play time point in the source video is transcoded. Obtaining a destination video transcoding segment corresponding to the initial playing time point.
  3. 根据权利要求2所述的视频处理方法,其特征在于,所述从所述已存储视频转码分段中获取所述目的视频转码分段之后,还包括:The video processing method according to claim 2, wherein after the obtaining the destination video transcoding segment from the stored video transcoding segment, the method further comprises:
    向所述终端返回第一请求响应信息,所述第一请求响应信息包括所述和媒体信息,所述媒体信息包括时长和起始时间点;Returning, to the terminal, first request response information, where the first request response information includes the sum media information, where the media information includes a duration and a start time point;
    接收并响应所述终端根据所述第一请求响应信息发送的第一分片播放请求,向所述终端返回第一分片响应信息,所述第一分片响应信息包括所述目的视频转码分段的URL对应的所述目的视频转码分段,所述第一分片播放请求携带所述目的视频转码分段的URL。Receiving and responding to the first fragment playback request sent by the terminal according to the first request response information, returning, to the terminal, first fragmentation response information, where the first fragmentation response information includes the destination video transcoding The destination video transcoding segment corresponding to the segmented URL, where the first fragment playback request carries the URL of the destination video transcoding segment.
  4. 根据权利要求2所述的视频处理方法,其特征在于,获得所述起始播放时间点对应的目的视频转码分段之后,向所述终端返回所述目的视频转码 分段。The video processing method according to claim 2, wherein after the destination video transcoding segment corresponding to the initial playing time point is obtained, the destination video transcoding segment is returned to the terminal.
  5. 根据权利要求1所述的视频处理方法,其特征在于,还包括步骤:The video processing method according to claim 1, further comprising the steps of:
    当接收到所述终端发送的携带所述源视频标识的视频退出请求时,停止转码,并在所述第一视频转码分段的播放次数或/和播放完整度满足对应的预设值时,将所述第一视频转码分段存储,更新所述已存储视频转码分段,所述第一视频转码分段的播放完整度为发送给所述终端的所述第一视频转码分段的时间长度与所述第一视频转码分段的时长的比值。When receiving the video exit request that is sent by the terminal and carrying the source video identifier, stopping the transcoding, and the playing times or/and the playing integrity of the first video transcoding segment satisfy the corresponding preset value. The first video transcode segment is stored, and the stored video transcode segment is updated, and the play integrity of the first video transcode segment is the first video sent to the terminal. The ratio of the length of time of the transcoded segment to the duration of the first video transcoded segment.
  6. 根据权利要求5所述的视频处理方法,其特征在于,停止转码后,当第一目的视频转码分段的播放次数或/和播放完整度满足对应的所述预设值时,将所述第一目的视频转码分段存储,更新所述已存储视频转码分段,其中,所述第一目的视频转码分段为未在所述已存储视频转码分段中的所述目的视频转码分段,所述第一目的视频转码分段的播放完整度为发送给所述终端的所述第一目的视频转码分段的时间长度与所述第一目的视频转码分段的时长的比值。The video processing method according to claim 5, wherein, after the transcoding is stopped, when the number of times of playback or/and the completeness of playback of the first destination video transcoding segment meets the corresponding preset value, Transmitting the stored video transcode segment for the first purpose video transcode segmentation, wherein the first destination video transcode segment is the one not in the stored video transcode segment The destination video transcoding segment, the playing integrity of the first destination video transcoding segment is the length of time of the first destination video transcoding segment sent to the terminal, and the first destination video transcoding The ratio of the length of the segment.
  7. 一种计算机存储介质,其上存储有计算机可读指令,其特征在于,该计算机可读指令被处理器执行时,使得所述处理器执行如下步骤:A computer storage medium having stored thereon computer readable instructions, wherein the computer readable instructions are executed by a processor such that the processor performs the following steps:
    接收终端发送的视频请求,所述视频请求携带源视频标识、源视频的URL和起始播放时间点,其中,与所述源视频标识对应的源视频包括时间首尾依次相连的各视频片段;Receiving a video request sent by the terminal, where the video request carries a source video identifier, a URL of the source video, and a starting play time point, where the source video corresponding to the source video identifier includes video segments sequentially connected in time and end;
    获取转码参数,确定所述起始播放时间点对应的目的视频转码分段;Obtaining a transcoding parameter, and determining a destination video transcoding segment corresponding to the initial playing time point;
    当与目的视频转码分段的结尾时间最近、且起始时间在所述结尾时间之后的第一已存储视频转码分段满足预设条件时,根据所述转码参数,对各所述视频片段中与所述目的转码分段的结尾时间最近、起始时间在所述结尾时间之后、且未转码的视频片段进行转码,获得第一视频转码分段。When the first stored video transcode segment closest to the end time of the destination video transcoding segment and the start time is after the end time meets a preset condition, according to the transcoding parameter, each of the A video segment in the video segment that is closest to the end time of the destination transcode segment, whose start time is after the end time, and that is not transcoded is transcoded to obtain a first video transcode segment.
  8. 根据权利要7所述的存储介质,其特征在于,所述确定所述起始播放时间点对应的目的视频转码分段的步骤包括:The storage medium according to claim 7, wherein the step of determining the destination video transcoding segment corresponding to the initial playing time point comprises:
    当所述起始播放时间点在所述源视频标识对应的已存储视频转码分段的 时间段内时,从所述已存储视频转码分段中获取所述目的视频转码分段;Obtaining the destination video transcoding segment from the stored video transcoding segment when the initial playing time point is within a time period of the stored video transcoding segment corresponding to the source video identifier;
    当所述起始播放时间点不在所述源视频标识对应的已存储视频转码分段的时间段内时,对所述源视频中所述起始播放时间点对应的视频片段进行转码,获得所述起始播放时间点对应的目的视频转码分段。When the initial play time point is not within the time period of the stored video transcode segment corresponding to the source video identifier, the video segment corresponding to the start play time point in the source video is transcoded. Obtaining a destination video transcoding segment corresponding to the initial playing time point.
  9. 根据权利要求8所述的存储介质,其特征在于,所述处理器执行所述从所述已存储视频转码分段中获取所述目的视频转码分段之后,还执行步骤:The storage medium according to claim 8, wherein after the processor performs the obtaining the target video transcoding segment from the stored video transcoding segment, the method further comprises the steps of:
    向所述终端返回第一请求响应信息,所述第一请求响应信息包括所述和媒体信息,所述媒体信息包括时长和起始时间点;Returning, to the terminal, first request response information, where the first request response information includes the sum media information, where the media information includes a duration and a start time point;
    接收并响应所述终端根据所述第一请求响应信息发送的第一分片播放请求,向所述终端返回第一分片响应信息,所述第一分片响应信息包括所述目的视频转码分段的URL对应的所述目的视频转码分段,所述第一分片播放请求携带所述目的视频转码分段的URL。Receiving and responding to the first fragment playback request sent by the terminal according to the first request response information, returning, to the terminal, first fragmentation response information, where the first fragmentation response information includes the destination video transcoding The destination video transcoding segment corresponding to the segmented URL, where the first fragment playback request carries the URL of the destination video transcoding segment.
  10. 根据权利要求8所述的存储介质,其特征在于,所述处理器执行获得所述起始播放时间点对应的目的视频转码分段之后,还执行步骤:The storage medium according to claim 8, wherein after the processor performs the obtaining of the destination video transcoding segment corresponding to the initial playing time point, the method further comprises:
    向所述终端返回所述目的视频转码分段。Returning the destination video transcoding segment to the terminal.
  11. 根据权利要求7所述的存储介质,其特征在于,所述处理器还执行如下步骤:The storage medium of claim 7, wherein the processor further performs the following steps:
    当接收到所述终端发送的携带所述源视频标识的视频退出请求时,停止转码,并在所述第一视频转码分段的播放次数或/和播放完整度满足对应的预设值时,将所述第一视频转码分段存储,更新所述已存储视频转码分段,所述第一视频转码分段的播放完整度为发送给所述终端的所述第一视频转码分段的时间长度与所述第一视频转码分段的时长的比值。When receiving the video exit request that is sent by the terminal and carrying the source video identifier, stopping the transcoding, and the playing times or/and the playing integrity of the first video transcoding segment satisfy the corresponding preset value. The first video transcode segment is stored, and the stored video transcode segment is updated, and the play integrity of the first video transcode segment is the first video sent to the terminal. The ratio of the length of time of the transcoded segment to the duration of the first video transcoded segment.
  12. 根据权利要求11所述的存储介质,其特征在于,所述处理器还执行如下步骤:The storage medium of claim 11, wherein the processor further performs the following steps:
    停止转码后,当第一目的视频转码分段的播放次数或/和播放完整度满足对应的所述预设值时,将所述第一目的视频转码分段存储,更新所述已存储视频转码分段,其中,所述第一目的视频转码分段为未在所述已存储视频转 码分段中的所述目的视频转码分段,所述第一目的视频转码分段的播放完整度为发送给所述终端的所述第一目的视频转码分段的时间长度与所述第一目的视频转码分段的时长的比值。After the transcoding is stopped, when the number of times of playback or/and the completeness of the playback of the first destination video transcoding segment meets the corresponding preset value, the first destination video transcode is segmentally stored, and the Storing a video transcoding segment, wherein the first destination video transcoding segment is the destination video transcoding segment not in the stored video transcoding segment, the first destination video transcoding segment The playback integrity of the segment is the ratio of the length of time of the first destination video transcoding segment sent to the terminal to the duration of the first destination video transcoding segment.
  13. 一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,计算机程序被处理器执行时,使得处理器执行如下步骤:A computer device comprising a memory and a processor, wherein the computer stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
    接收终端发送的视频请求,所述视频请求携带源视频标识、源视频的URL和起始播放时间点,其中,与所述源视频标识对应的源视频包括时间首尾依次相连的各视频片段;Receiving a video request sent by the terminal, where the video request carries a source video identifier, a URL of the source video, and a starting play time point, where the source video corresponding to the source video identifier includes video segments sequentially connected in time and end;
    获取转码参数,确定所述起始播放时间点对应的目的视频转码分段;Obtaining a transcoding parameter, and determining a destination video transcoding segment corresponding to the initial playing time point;
    当与目的视频转码分段的结尾时间最近、且起始时间在所述结尾时间之后的第一已存储视频转码分段满足预设条件时,根据所述转码参数,对各所述视频片段中与所述目的转码分段的结尾时间最近、起始时间在所述结尾时间之后、且未转码的视频片段进行转码,获得第一视频转码分段。When the first stored video transcode segment closest to the end time of the destination video transcoding segment and the start time is after the end time meets a preset condition, according to the transcoding parameter, each of the A video segment in the video segment that is closest to the end time of the destination transcode segment, whose start time is after the end time, and that is not transcoded is transcoded to obtain a first video transcode segment.
  14. 根据权利要13所述的计算机设备,其特征在于,所述确定所述起始播放时间点对应的目的视频转码分段的步骤包括:The computer device according to claim 13, wherein the step of determining the destination video transcoding segment corresponding to the initial playing time point comprises:
    当所述起始播放时间点在所述源视频标识对应的已存储视频转码分段的时间段内时,从所述已存储视频转码分段中获取所述目的视频转码分段;Obtaining the destination video transcoding segment from the stored video transcoding segment when the initial playing time point is within a time period of the stored video transcoding segment corresponding to the source video identifier;
    当所述起始播放时间点不在所述源视频标识对应的已存储视频转码分段的时间段内时,对所述源视频中所述起始播放时间点对应的视频片段进行转码,获得所述起始播放时间点对应的目的视频转码分段。When the initial play time point is not within the time period of the stored video transcode segment corresponding to the source video identifier, the video segment corresponding to the start play time point in the source video is transcoded. Obtaining a destination video transcoding segment corresponding to the initial playing time point.
  15. 根据权利要求14所述的计算机设备,其特征在于,所述处理器执行所述从所述已存储视频转码分段中获取所述目的视频转码分段之后,还执行步骤:The computer device according to claim 14, wherein after the processor performs the obtaining the target video transcoding segment from the stored video transcoding segment, the method further comprises the steps of:
    向所述终端返回第一请求响应信息,所述第一请求响应信息包括所述和媒体信息,所述媒体信息包括时长和起始时间点;Returning, to the terminal, first request response information, where the first request response information includes the sum media information, where the media information includes a duration and a start time point;
    接收并响应所述终端根据所述第一请求响应信息发送的第一分片播放请求,向所述终端返回第一分片响应信息,所述第一分片响应信息包括所述目 的视频转码分段的URL对应的所述目的视频转码分段,所述第一分片播放请求携带所述目的视频转码分段的URL。Receiving and responding to the first fragment playback request sent by the terminal according to the first request response information, returning, to the terminal, first fragmentation response information, where the first fragmentation response information includes the destination video transcoding The destination video transcoding segment corresponding to the segmented URL, where the first fragment playback request carries the URL of the destination video transcoding segment.
  16. 根据权利要求14所述的计算机设备,其特征在于,所述处理器执行获得所述起始播放时间点对应的目的视频转码分段之后,还执行步骤:The computer device according to claim 14, wherein after the processor performs the obtaining of the destination video transcoding segment corresponding to the initial playing time point, the method further comprises the steps of:
    向所述终端返回所述目的视频转码分段。Returning the destination video transcoding segment to the terminal.
  17. 根据权利要求13所述的计算机设备,其特征在于,所述处理器还执行如下步骤:The computer device of claim 13, wherein the processor further performs the following steps:
    当接收到所述终端发送的携带所述源视频标识的视频退出请求时,停止转码,并在所述第一视频转码分段的播放次数或/和播放完整度满足对应的预设值时,将所述第一视频转码分段存储,更新所述已存储视频转码分段,所述第一视频转码分段的播放完整度为发送给所述终端的所述第一视频转码分段的时间长度与所述第一视频转码分段的时长的比值。When receiving the video exit request that is sent by the terminal and carrying the source video identifier, stopping the transcoding, and the playing times or/and the playing integrity of the first video transcoding segment satisfy the corresponding preset value. The first video transcode segment is stored, and the stored video transcode segment is updated, and the play integrity of the first video transcode segment is the first video sent to the terminal. The ratio of the length of time of the transcoded segment to the duration of the first video transcoded segment.
  18. 根据权利要求17所述的计算机设备,其特征在于,所述处理器还执行如下步骤:The computer device according to claim 17, wherein said processor further performs the following steps:
    停止转码后,当第一目的视频转码分段的播放次数或/和播放完整度满足对应的所述预设值时,将所述第一目的视频转码分段存储,更新所述已存储视频转码分段,其中,所述第一目的视频转码分段为未在所述已存储视频转码分段中的所述目的视频转码分段,所述第一目的视频转码分段的播放完整度为发送给所述终端的所述第一目的视频转码分段的时间长度与所述第一目的视频转码分段的时长的比值。After the transcoding is stopped, when the number of times of playback or/and the completeness of the playback of the first destination video transcoding segment meets the corresponding preset value, the first destination video transcode is segmentally stored, and the Storing a video transcoding segment, wherein the first destination video transcoding segment is the destination video transcoding segment not in the stored video transcoding segment, the first destination video transcoding segment The playback integrity of the segment is the ratio of the length of time of the first destination video transcoding segment sent to the terminal to the duration of the first destination video transcoding segment.
PCT/CN2018/091241 2017-06-23 2018-06-14 Video processing method, computer storage medium, and device WO2018233539A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710487577.3 2017-06-23
CN201710487577.3A CN107333148B (en) 2017-06-23 2017-06-23 Method for processing video frequency and device, computer storage medium and equipment

Publications (1)

Publication Number Publication Date
WO2018233539A1 true WO2018233539A1 (en) 2018-12-27

Family

ID=60195597

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/091241 WO2018233539A1 (en) 2017-06-23 2018-06-14 Video processing method, computer storage medium, and device

Country Status (2)

Country Link
CN (1) CN107333148B (en)
WO (1) WO2018233539A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107333148B (en) * 2017-06-23 2019-01-08 腾讯科技(深圳)有限公司 Method for processing video frequency and device, computer storage medium and equipment
CN110198474B (en) * 2018-02-27 2022-03-15 中兴通讯股份有限公司 Code stream processing method and device
CN110113669B (en) * 2019-06-14 2021-07-16 北京达佳互联信息技术有限公司 Method and device for acquiring video data, electronic equipment and storage medium
CN114245175A (en) * 2021-12-15 2022-03-25 北京度友信息技术有限公司 Video transcoding method and device, electronic equipment and storage medium
CN114630177A (en) * 2022-03-25 2022-06-14 阿里巴巴(中国)有限公司 Video transcoding method and related device thereof
CN114866843B (en) * 2022-05-06 2023-08-11 杭州登虹科技有限公司 Video data encryption system for network video monitoring

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024456A (en) * 2011-09-27 2013-04-03 腾讯科技(深圳)有限公司 Online video playing method and video playing server
CN105872807A (en) * 2016-05-16 2016-08-17 乐视控股(北京)有限公司 Video playing method and system
US20160241913A1 (en) * 2015-02-13 2016-08-18 Opera Software Ireland Limited Partial Video Pre-Fetch
CN106791930A (en) * 2017-01-04 2017-05-31 北京百度网讯科技有限公司 A kind of method for processing video frequency and device
CN107333148A (en) * 2017-06-23 2017-11-07 腾讯科技(深圳)有限公司 Method for processing video frequency and device, computer-readable storage medium and equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8464302B1 (en) * 1999-08-03 2013-06-11 Videoshare, Llc Method and system for sharing video with advertisements over a network
US20080148330A1 (en) * 2000-02-03 2008-06-19 Gad Liwerant Method and system for sharing video over a network
CN105245940A (en) * 2015-10-08 2016-01-13 北京时医康科技发展有限公司 Method and player for online playing high definition videos on narrow bandwidth

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024456A (en) * 2011-09-27 2013-04-03 腾讯科技(深圳)有限公司 Online video playing method and video playing server
US20160241913A1 (en) * 2015-02-13 2016-08-18 Opera Software Ireland Limited Partial Video Pre-Fetch
CN105872807A (en) * 2016-05-16 2016-08-17 乐视控股(北京)有限公司 Video playing method and system
CN106791930A (en) * 2017-01-04 2017-05-31 北京百度网讯科技有限公司 A kind of method for processing video frequency and device
CN107333148A (en) * 2017-06-23 2017-11-07 腾讯科技(深圳)有限公司 Method for processing video frequency and device, computer-readable storage medium and equipment

Also Published As

Publication number Publication date
CN107333148B (en) 2019-01-08
CN107333148A (en) 2017-11-07

Similar Documents

Publication Publication Date Title
WO2018233539A1 (en) Video processing method, computer storage medium, and device
CN108848060B (en) Multimedia file processing method, processing system and computer readable storage medium
WO2017096830A1 (en) Content delivery method and scheduling proxy server for cdn platform
US10476928B2 (en) Network video playback method and apparatus
US11490173B2 (en) Switch of audio and video
CN111277869B (en) Video playing method, device, equipment and storage medium
CN108063769B (en) Method and device for realizing content service and content distribution network node
US9356985B2 (en) Streaming video to cellular phones
CN104506950A (en) Multithread download method and download device in network streaming media play, and download equipment
CN104539977A (en) Live broadcast previewing method and device
US20210321149A1 (en) Method of playing video, computing device, and computer program product
CN104219286A (en) Method and device for processing stream media, client, CDN (content delivery network) node server and terminal
CN110113655B (en) Video playing method and device and user terminal
WO2020155959A1 (en) Definition switching method and apparatus, computer device, and readable storage medium
US10419798B2 (en) Method and apparatus for just-in-time transcoding
US20160029050A1 (en) Hybrid Stream Delivery
US9411809B1 (en) Remote content presentation queues
CN110290396B (en) Video processing method, device, system, equipment and storage medium
WO2013185547A1 (en) Caching server service method, caching server and system thereof
CN113485972A (en) Multimedia sharing method, device, mobile terminal and storage medium
CN112565877A (en) Screen projection method and system, electronic equipment and storage medium
US11838560B2 (en) Method and system for playing back streaming content using local streaming server
CN112243136A (en) Content playing method, video storage method and equipment
CN114301848A (en) CDN-based communication method, system, device and storage medium
CN115460184A (en) Methods, systems, and media for delivering non-manifest streaming media content

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: 18819686

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: 18819686

Country of ref document: EP

Kind code of ref document: A1