Video processing method, device and server
By acquiring video stream slice records and playback progress during video processing, the transcoding and slicing processes are decoupled, solving the problem of wasted transcoding resources, achieving consistency and flexibility in video slice positions, and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DOUYIN VISION CO LTD
- Filing Date
- 2022-08-29
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, to ensure correct continuity when switching between videos of different resolutions during video slicing, the server needs to transcode and synchronously slice videos of all resolutions, resulting in a waste of transcoding resources.
The server receives a video playback request, obtains the video stream encoding associated with multiple video parameters, determines the target encoding for transcoding, obtains the segment records of the already sliced video stream, and performs segmentation processing on the video stream based on the playback progress and the segment records to obtain video segments.
By decoupling the transcoding and slicing processes, server transcoding resources are saved, and the consistent slicing positions of video streams with different resolutions are ensured, improving the flexibility of slicing processing and user experience.
Smart Images

Figure CN117676273B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of video processing technology, and in particular to a video processing method, apparatus, and server. Background Technology
[0002] Servers can slice videos and send these slices to electronic devices so users can watch the content immediately. For example, a server can slice a live stream video and send the slices to electronic devices, allowing users to watch the live stream content as soon as it's available.
[0003] Currently, when slicing videos of different resolutions, to ensure that users see the same content when switching resolutions, the slice positions of videos associated with each resolution need to be synchronized. To achieve this, the server can generate videos of multiple resolutions simultaneously and slice them synchronously at the same position in each video. For example, the server can generate standard definition, high definition, and ultra-high definition live videos and slice them at the same position in each of the three bitrates, enabling the server to send the corresponding live video slices to electronic devices upon request. However, in this method, to ensure that the live videos of different resolutions can be correctly connected and presented to the user when switching between them, the server transcodes and slices all videos synchronously, resulting in a waste of transcoding resources. Summary of the Invention
[0004] This disclosure provides a video processing method, apparatus, and server to solve the technical problem of wasted transcoding resources in the prior art.
[0005] In a first aspect, this disclosure provides a video processing method, the method comprising:
[0006] The device receives a playback request for a first video and obtains multiple video stream encodings associated with multiple video parameters of the first video. The playback request includes target video parameters for the electronic device to play the first video, and the multiple video parameters include the target video parameters.
[0007] Among the plurality of video stream encodings, a target encoding associated with the target video parameters is determined, and the target encoding is transcoded to obtain a first video stream;
[0008] The first playback progress of the first video stream and the slice record of the second video stream are determined, wherein the second video stream is the video stream that has undergone transcoding and slicing processing in the encoding of the plurality of video streams;
[0009] Based on the first playback progress and the slice record, the first video stream is sliced to obtain video slices, and the video slices are sent to the electronic device.
[0010] Secondly, this disclosure provides a video processing apparatus, including a receiving module, a first determining module, a transcoding module, a second determining module, a processing module, and a transmitting module, wherein:
[0011] The receiving module is configured to receive a playback request for a first video and obtain multiple video stream encodings associated with multiple video parameters of the first video. The playback request includes target video parameters for the electronic device to play the first video, and the multiple video parameters include the target video parameters.
[0012] The first determining module is configured to determine, among the plurality of video stream encodings, a target encoding associated with the target video parameters;
[0013] The transcoding module is used to transcode the target encoding to obtain a first video stream;
[0014] The second determining module is used to determine the first playback progress of the first video stream and the slice record of the second video stream, wherein the second video stream is a video stream that has undergone transcoding and slicing processing in the encoding of the plurality of video streams;
[0015] The processing module is used to perform segmentation processing on the first video stream based on the first playback progress and the segment record to obtain video segments;
[0016] The sending module is used to send the video slice to the electronic device.
[0017] Thirdly, embodiments of this disclosure provide a server, including: a processor and a memory;
[0018] The memory stores computer-executed instructions;
[0019] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the video processing methods described in the first aspect above and various possible aspects of the first aspect.
[0020] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the video processing methods described in the first aspect and various possible aspects thereof.
[0021] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the video processing methods described in the first aspect above and various possible aspects of the first aspect.
[0022] This disclosure provides a video processing method, apparatus, and server. The server receives a playback request for a first video and obtains multiple video parameters associated with multiple video stream encodings of the first video. The playback request includes target video parameters for the electronic device to play the first video. The multiple video parameters include the target video parameters. A target encoding associated with the target video parameters is determined from the multiple video stream encodings, and the target encoding is transcoded to obtain a first video stream. A first playback progress of the first video stream and a segment record of a second video stream are determined. The second video stream is a video stream that has already undergone transcoding and segmentation processing from the multiple video stream encodings. Based on the first playback progress and the segment record, the first video stream is segmented to obtain video slices, which are then sent to the electronic device. In this method, since the server can obtain the segment records of other segmented video streams and segment the first video stream based on its playback progress and segment records, the segment position of the first video stream is the same as the segment position of video streams with other video parameters. Therefore, it is not necessary to simultaneously generate video streams with other video parameters for synchronous segmentation, thereby saving the server's transcoding resources. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present disclosure;
[0025] Figure 2 A flowchart illustrating a video processing method provided in an embodiment of this disclosure;
[0026] Figure 3 A schematic diagram of a slice recording provided in an embodiment of this disclosure;
[0027] Figure 4 This is a schematic diagram illustrating a process of sending video slices according to an embodiment of the present disclosure;
[0028] Figure 5 A flowchart illustrating a method for obtaining video slices provided in an embodiment of this disclosure;
[0029] Figure 6 A schematic diagram illustrating a process for determining the position of a first slice, provided in an embodiment of this disclosure;
[0030] Figure 7A This is a schematic diagram illustrating a slicing process for a first video stream, provided as an embodiment of the present disclosure.
[0031] Figure 7B This is a schematic diagram illustrating another method for slicing a first video stream according to an embodiment of the present disclosure.
[0032] Figure 8 This is a schematic diagram illustrating a slicing process for a first video stream, provided as an embodiment of the present disclosure.
[0033] Figure 9 This is a schematic diagram illustrating an embodiment of the present disclosure for obtaining slice records of a second video stream;
[0034] Figure 10 This is a schematic diagram illustrating a process for obtaining slice records according to an embodiment of the present disclosure;
[0035] Figure 11 A schematic diagram illustrating the initialization of slice recording of a first video stream according to an embodiment of this disclosure;
[0036] Figure 12 This is a schematic diagram of a video processing method provided in an embodiment of the present disclosure;
[0037] Figure 13 This is a schematic diagram of the structure of a video processing apparatus provided in an embodiment of the present disclosure;
[0038] Figure 14 This is a schematic diagram of another video processing apparatus provided in an embodiment of the present disclosure;
[0039] Figure 15 This is a schematic diagram of the structure of a server provided in an embodiment of the present disclosure. Detailed Implementation
[0040] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0041] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0042] To facilitate understanding, the concepts involved in the embodiments of this disclosure will be explained first.
[0043] Electronic device: A device with wireless transceiver capabilities. Electronic devices can be deployed on land, including indoors or outdoors, handheld, wearable, or vehicle-mounted; they can also be deployed on water (such as on ships). These electronic devices can be mobile phones, tablets, computers with wireless transceiver capabilities, virtual reality (VR) electronic devices, augmented reality (AR) electronic devices, wireless terminals in industrial control, vehicle-mounted electronic devices, wireless terminals in self-driving vehicles, wireless electronic devices in remote medical care, wireless electronic devices in smart grids, wireless electronic devices in transportation safety, wireless electronic devices in smart cities, wireless electronic devices in smart homes, wearable electronic devices, etc. The electronic devices involved in the embodiments of this disclosure can also be referred to as terminals, user equipment (UE), access electronic devices, vehicle-mounted terminals, industrial control terminals, UE units, UE stations, mobile stations, mobile stations, remote stations, remote electronic devices, mobile devices, UE electronic devices, wireless communication devices, UE agents, or UE devices, etc. Electronic devices can be fixed or mobile.
[0044] Video slicing: This involves dividing a video into multiple segments, each of which is called a video slice. For example, in the live streaming field, servers can send live video to electronic devices using streaming methods, allowing users to watch the live content in real time. Therefore, servers can slice the live video and then send these slices to electronic devices in segments, reducing latency and improving the user experience.
[0045] In related technologies, servers can slice video and send these slices to electronic devices, allowing users to watch video content in real time and reducing playback latency. A single video can be associated with videos of different resolutions (e.g., standard definition, high definition, and ultra-high definition). To ensure that users see the same content when switching between resolutions, videos of different resolutions can be sliced synchronously. Therefore, when slicing a video of any resolution, the server can simultaneously generate videos of all resolutions and slice them at the same location. However, to ensure that the live videos of different resolutions can be correctly connected and presented to the user when switching between them, the server transcodes all videos of all resolutions and slices them synchronously, resulting in a waste of transcoding resources.
[0046] To address the technical problems in related technologies, this disclosure provides a video processing method. The method involves obtaining a playback request for target video parameters of a first video played by an electronic device, obtaining multiple video stream encodings associated with multiple video parameters of the first video, determining a target encoding associated with the target video parameters from among the multiple video stream encodings, transcoding the target encoding to obtain a first video stream, determining the playback progress of the first video stream, and at least one slice record of a second video stream that has already undergone transcoding and slicing processing, determining the first slice position with the latest playback progress among the multiple slice positions based on the playback progress associated with multiple slice positions in the slice record, and slicing the first video stream based on the first playback progress and the first slice position to obtain video slices. This decouples video transcoding and video slicing, thus improving the flexibility of slicing processing. Furthermore, since the server can slice the first video stream based on the slice records of other video streams, the server can obtain only the first video stream, and the slice position of the first video stream can be consistent with the slice positions of other video streams, thereby saving server transcoding resources.
[0047] Below, in conjunction with Figure 1 The application scenarios of the embodiments of this disclosure will be described.
[0048] Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this disclosure. Please refer to [link / reference]. Figure 1This includes a server and electronic devices. The electronic devices send a request message to the server to play the first ultra-high-definition (UHD) video. When the server receives this message, it can transcode the UHD video stream from multiple resolution video streams associated with the first video to obtain the UHD first video. It also obtains the segment records of other segmented video streams. Based on the playback progress of the UHD first video and the segment records of other video streams, the server slices the UHD first video in real time, obtaining multiple UHD first video segments, and sends these real-time UHD first video segments to the electronic devices. In this way, because the server can slice the UHD first video based on the segment records of other video streams, the segment position of the UHD first video can be consistent with the segment positions of other video streams. Furthermore, the server can obtain only the UHD first video without transcoding other resolution first videos (e.g., standard definition, high definition, etc.), thus saving server transcoding resources.
[0049] The technical solutions of this disclosure and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.
[0050] Figure 2 This is a schematic flowchart illustrating a video processing method provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 2 The method may include:
[0051] S201. Receive the playback request of the first video and obtain the multiple video stream encodings associated with the multiple video parameters of the first video.
[0052] The execution entity of this disclosure embodiment can be a server or a video processing device installed in a server. The video processing device can be implemented in software, or it can be implemented using a combination of software and hardware.
[0053] The first video can include live video. For example, the first video can be live video, where the server can acquire live video recorded by electronic devices in real time and send the live video to other electronic devices.
[0054] Optionally, the first video may also include a pre-recorded video. For example, the first video can be any type of video, such as a short video, a long video, a movie video, or an animation video; this embodiment of the disclosure does not limit this.
[0055] Optionally, the first video includes multiple video stream encodings associated with multiple video parameters. Optionally, the video parameters may include parameters such as the resolution of the first video and the bitrate of the transcoding, which are not limited in this embodiment. Optionally, the multiple video parameters include target video parameters. For example, the server can perform transcoding (decoding) processing on the video stream encoding to obtain the corresponding video stream.
[0056] Optionally, the video parameters of the multiple video streams may differ. For example, the first video may be associated with standard definition (SD), high definition (HD), and ultra-high definition (UHD) video encoding, respectively. Optionally, the playback request may include the target video parameters for the electronic device to play the first video. For example, if the electronic device requests to play SD live video, the target video parameter may be the resolution of SD; if the electronic device requests to play HD live video, the target video parameter may be the resolution of HD; and if the electronic device requests to play UHD video, the target video parameter may be the bitrate transcoded to HD resolution.
[0057] Optionally, after receiving a playback request for the first video, the server can obtain multiple video stream codes corresponding to multiple video parameters associated with the first video. For example, when the server determines that an electronic device requests to play the first video, it can obtain multiple video stream codes of multiple resolutions associated with the first video from the database.
[0058] S202. Determine the target code associated with the target video parameters among multiple video stream codes, and transcode the target code to obtain the first video stream.
[0059] Optionally, the first video stream can be a video stream associated with the target video parameters. For example, if the target video parameter is standard definition (SD), then the first video stream is an SD video stream (the video content is the same as the content of the first video); if the target video parameter is high definition (HD), then the first video stream is an HD video stream; if the target video parameter is ultra-high definition (UHD), then the first video stream is an UHD video stream.
[0060] Optionally, the server can determine the target encoding from multiple video stream encodings based on the target video parameters, and then transcode the target encoding to obtain the first video stream. For example, the database may include video stream encodings associated with multiple video parameters. The server can determine the target encoding from multiple video stream encodings based on the identifier of the target video parameters, and then transcode the target encoding to obtain the first video stream.
[0061] S203. Determine the first playback progress of the first video stream and the slice record of the second video stream.
[0062] Optionally, the first playback progress is used to indicate the current playback time of the first video stream. For example, the first playback progress can be the 5th second, 10th second, 15th second, etc., of the first video stream. For example, the server can determine the first playback progress of the first video stream based on the currently playing video frames. It should be noted that the server can also obtain the first playback progress of the first video stream through other methods, and this embodiment of the disclosure does not limit this.
[0063] Optionally, the second video stream can be a video stream that has undergone transcoding and slicing among multiple video stream encodings. For example, the second video stream could be a video stream that has already been requested and obtained. Before the server generates the first video stream, the electronic device has already requested a second video stream of a different resolution and has already sliced that second video stream. For instance, when a user watches a high-definition live video on an electronic device, if the user switches from high-definition to ultra-high-definition, the electronic device requests the ultra-high-definition live video from the server. Since the high-definition live video has already undergone slicing during playback, it is the second video stream, and the server can obtain the slice records of the high-definition live video.
[0064] Optionally, the second video stream can be a video stream associated with the video parameters used when the first video was played for the first time. For example, when a user watches a live video for the first time using an electronic device, if the user selects standard definition (SD) for the live video, the second video stream can be the SD live video; if the user selects high definition (HD) for the live video, the second video stream can be the HD live video; and if the user selects ultra-high definition (UHD) for the live video, the second video stream can be the UHD live video.
[0065] Optionally, the slice record includes multiple slice positions. For example, the slice record of the second video stream may include each slice position of the video stream of multiple video parameters associated with the first video before the server obtains the first video stream. For example, the slice position may be the position of a video frame in the first video stream, or it may be a timestamp associated with a video frame in the first video stream; this disclosure does not limit this.
[0066] Optionally, the slice record may also include the slice number. For example, since the slice positions of the multiple resolution video streams associated with the first video must be the same, the slice record may include the slice number associated with each slice position.
[0067] Below, in conjunction with Figure 3 The slice records are explained.
[0068] Figure 3 This is a schematic diagram of a slice recording provided in an embodiment of this disclosure. Please refer to... Figure 3 This includes segment records. Each segment record contains segment position A, segment position B, and segment position C. The playback progress associated with segment position A is less than the playback progress associated with segment position B, and the playback progress associated with segment position B is less than the playback progress associated with segment position C. Segment 1 can be obtained based on segment positions A and B, and segment 2 can be obtained based on segment positions B and C. Segment 1 is the first segment, and segment 2 is the second segment.
[0069] S204. Based on the first playback progress and segment record of the first video stream, perform segmentation processing on the first video stream to obtain video segments.
[0070] The server can slice the first video stream to obtain video slices based on the following feasible implementation: determining the first slice position with the latest playback progress among multiple slice positions based on the playback progress associated with multiple slice positions.
[0071] Optionally, the first slice position is the slice position of the latest slice in the slice record. For example, the slice position can be a timestamp, and the first slice position is the largest timestamp in the slice record. For example, the slice record includes slice position A and slice position B, the playback progress associated with slice position A is playback progress A, and the playback progress associated with slice position B is playback progress B. If playback progress B is slower than playback progress A, then slice position A is determined to be the first slice position; if playback progress A is slower than playback progress B, then slice position B is determined to be the first slice position.
[0072] It should be noted that the latest first slice position can be a position that has already been sliced or a position that has not yet been sliced; this embodiment of the disclosure does not limit this. For example, if the server has not yet sliced at the first slice position, it means that the latest video slice has not yet been generated. The latest video slice can only be obtained after the server slices at the first slice position.
[0073] Based on the first playback progress and the first slice position, the first video stream is sliced to obtain video slices. For example, the server can determine whether the first video stream has slicing decision-making authority by the relationship between the first playback progress and the first slice position. If the first video stream is the fastest playing video, then the first video stream has slicing decision-making authority, and the server can slice the first video stream based on a preset slicing strategy. If there are other video streams with different resolutions that play faster than the first video stream, then the first video stream does not have slicing decision-making authority, and the server can slice the first video stream based on the slicing records of other video streams.
[0074] S205. Send video slices to electronic devices.
[0075] Optionally, when the server obtains a video slice from the first video stream, it may send the video slice to the electronic device. For example, the server may divide the first video stream into multiple video slices, and the server may send the video slice to the electronic device each time it obtains a video slice, or the server may send multiple video slices to the electronic device in the order of the slices when it obtains multiple video slices. This embodiment of the present disclosure does not limit this.
[0076] Below, in conjunction with Figure 4 This section explains the process of sending video slices to electronic devices.
[0077] Figure 4 This is a schematic diagram illustrating a process for sending video slices according to an embodiment of this disclosure. Please refer to... Figure 4 This includes a server and electronic devices. The server can slice the first video stream based on the slice records. When the server obtains slice A and slice B from the first video stream, it sends slice A and slice B to the electronic devices. In this way, each time the server obtains a video slice from the first video stream, it can promptly send that video slice to the electronic devices, allowing users to watch the video content immediately and improving the user experience.
[0078] This disclosure provides a video processing method. The method involves receiving a playback request for a first video and obtaining multiple video stream encodings associated with multiple video parameters of the first video. The playback request includes target video parameters for an electronic device to play the first video. A target encoding associated with the target video parameters is determined from the multiple video stream encodings, and the target encoding is transcoded to obtain a first video stream. A first playback progress of the first video stream and a slice record of a second video stream that has undergone transcoding and slicing processing from the multiple video stream encodings are determined. Based on the first playback progress and the slice record, the first video stream is sliced to obtain video slices, and the video slices are sent to the electronic device. In this method, since the server can obtain slice records of other video streams and slice the first video stream based on the first playback progress and slice record, the slice position of the first video stream is the same as the slice positions of other video streams. This eliminates the need to simultaneously generate video streams of other resolutions for synchronous slicing, thereby saving server transcoding resources.
[0079] exist Figure 2 Based on the embodiments shown, the following, in conjunction with Figure 5 The process of slicing the first video stream based on the first playback progress and slice records to obtain video slices in the above video processing method is explained.
[0080] Figure 5 This is a flowchart illustrating a method for obtaining video slices according to an embodiment of this disclosure. Please refer to... Figure 5 The method process includes:
[0081] S501. Based on the playback progress associated with multiple slice positions, determine the first slice position with the latest playback progress among the multiple slice positions.
[0082] Below, in conjunction with Figure 6 The process of determining the position of the first slice is explained.
[0083] Figure 6 This is a schematic diagram illustrating a process for determining the position of a first slice, as provided in an embodiment of this disclosure. Please refer to... Figure 6 This includes segment records. Each segment record contains segment position A, segment position B, and segment position C. The playback progress associated with segment position A is slower than that associated with segment position B, and the playback progress associated with segment position B is slower than that associated with segment position C. Since the playback progress associated with segment position C is the fastest, the first segment position can be determined as segment position C.
[0084] S502. Based on the first playback progress and the first slice position, the first video stream is sliced to obtain the video slice.
[0085] Optionally, based on the first playback progress and the first slice position, the first video stream is sliced to obtain video slices, with the following two cases:
[0086] Case 1: The first playback progress is less than or equal to the second playback progress associated with the first slice position.
[0087] If the first playback progress is less than or equal to the second playback progress associated with the first slice position, then the second video stream is checked in the slice record to see if it is sliced at the first playback progress position, the detection result is obtained, and the first video stream is sliced based on the detection result.
[0088] Optionally, the detection result can be used to indicate whether the second video stream is sliced at the first playback progress point. For example, since the first playback progress point is less than the second playback progress point, it means that the playback progress of other video streams with different resolutions is faster than that of the first video stream. Therefore, the server can detect in the slice record whether other video streams with different resolutions are sliced at the first playback progress point, and perform slice processing on the first video stream based on the detection result.
[0089] Optionally, based on the detection results, the first video stream is sliced. Specifically, if the detection results indicate that the second video stream is sliced at the first playback progress point, then the first video stream is sliced at the first playback progress point to obtain video slices. For example, if other video streams that play faster are sliced at the first playback progress point, the server can slice the first video stream at the first playback progress point so that the slice position of the first video stream is the same as the slice position of other video streams. This ensures that the same slices at different resolutions play the same video content, thereby improving the video playback effect and enhancing the user experience.
[0090] If the detection result indicates that the second video stream was not sliced at the first playback progress point, then the server obtains the second slice position after the first playback progress point and slices the first video stream at the playback progress point associated with the second slice position to obtain video slices. For example, if other faster-playing video streams were not sliced at the first playback progress point, the server will not slice the first video stream at that position either. Instead, the server can obtain the next slice position after that position and slice the first video stream at the playback progress point associated with the next slice position. For example, if the first playback progress point is video frame A, and the playback progress of the next slice position after video frame A is video frame B (the timestamp of video frame A is less than the timestamp of video frame B), if other faster-playing video streams were not sliced at the position of video frame A but were sliced at the position of video frame B, then the server will not slice the first video stream at the position of video frame A, but will slice the first video stream at the position of video frame B.
[0091] Below, in conjunction with Figures 7A-7B The process of slicing the first video stream in this case will be explained.
[0092] Figure 7A This is a schematic diagram illustrating a slicing process of a first video stream according to an embodiment of this disclosure. Please refer to... Figure 7AThe system includes a first video stream and a second video stream. The second video stream has been playing from second 10 to second 20, and is segmented at seconds 10, 12, 14, 16, 18, and 20. When the first video stream is at second 6, since its playback progress is slower than that at second 10, the first video stream before second 10 can be discarded (or not segmented). Segmentation is then performed on the first video stream at second 10. When the first video stream reaches second 12, since the second video stream is segmented at second 12, the first video stream is also segmented at that position, ensuring that the segmentation positions of the first and second video streams are the same. Furthermore, segmenting the first video stream eliminates the need for transcoding other video streams of different resolutions, thus saving server transcoding resources.
[0093] Figure 7B This is a schematic diagram illustrating another method of slicing a first video stream according to an embodiment of this disclosure. Please refer to... Figure 7B This includes a first video stream and a second video stream, where the second video stream has been playing from the 10th second to the 20th second. The second video stream is sliced at the 10th, 12th, and 20th seconds, resulting in two slices. When the first video stream is at 12 seconds, since the second video stream is sliced at the 12th second, the first video stream is also sliced at the 12th second. When the first video stream is at 14 seconds, since the second video stream is not sliced at the 14th second, the first video stream is not sliced at the 14th second either. When the first video stream is at 20 seconds, it is sliced at the 20th second. Thus, although the first video stream could be sliced at the 14th second, because the second video stream is not sliced at the 14th second, the first video stream is also not sliced at the 14th second, ensuring that the slice positions of the first and second video streams are the same. Furthermore, when slicing the first video stream, there is no need to transcode other video streams of different resolutions, thereby saving server transcoding resources.
[0094] Scenario 2: The first playback progress is greater than the second playback progress.
[0095] If the first playback progress is greater than the second playback progress, then the server obtains the first duration between the first playback progress and the playback progress associated with the previous slice position, and performs slice processing on the first video stream based on the first duration. For example, if the first playback progress is greater than or equal to the second playback progress, it means that the first video stream has the fastest playback progress and has the decision-making power for slicing. Therefore, the server can obtain the first duration between the first playback progress and the playback progress associated with the previous slice position, and perform slice processing on the first video stream based on the first duration to obtain multiple video slices. It should be noted that if the server performs slicing at the first slice position, then the previous slice position is the first slice position; if the server does not perform slicing at the first slice position, then the previous slice position is the slice position before the first slice position.
[0096] Optionally, based on a first duration, the first video is sliced, specifically including: if the first duration is greater than or equal to a first threshold, the first video stream is sliced at the first playback position to obtain video slices. For example, if the first duration is greater than or equal to the first threshold, it means that the video length of the slice has reached the threshold, and the server can slice the first video stream at the first playback position.
[0097] If the first duration is less than the first threshold, the first video stream is sliced until the first duration equals the first threshold, resulting in video slices. For example, if the first duration is less than the first threshold, it means the video slice is not long enough, and the server does not slice at the first playback progress. Playback continues until the first duration equals the first threshold, at which point the server can slice the first video stream.
[0098] Below, in conjunction with Figure 8 The process of slicing the first video stream in this case will be explained.
[0099] Figure 8 This is a schematic diagram illustrating a slicing process of a first video stream according to an embodiment of this disclosure. Please refer to... Figure 8 The system includes a first video stream and a second video stream. The second video stream has been playing from second 10 to second 20, and is segmented at seconds 10, 12, 14, 16, 18, and 20. When the first video stream is at second 22, because its playback progress is faster than that of second 20, the first video stream has the decision-making power to segment at that position. When the second video stream reaches second 22, it can segment itself based on the segmentation record of the first video stream at that position.
[0100] This disclosure provides a method for obtaining video slices. Based on the playback progress associated with multiple slice positions, a first slice position with the latest playback progress is determined among the multiple slice positions. Based on the first playback progress and the first slice position, a first video stream is sliced to obtain the video slices. In this way, the server can flexibly slice the first video stream based on the first slice position and the first playback progress, improving the flexibility of slicing. Furthermore, when the first video stream is not the fastest playing video stream, the server slices the first video stream based on the slice record, ensuring that the slice positions of video streams of multiple resolutions are the same, eliminating the need to simultaneously generate video streams of other resolutions for synchronous slicing, thereby saving server transcoding resources.
[0101] Based on any of the above embodiments, the video processing method further includes the process of acquiring slice records of the second video stream. Below, in conjunction with... Figure 9 The process of acquiring slice records of the second video stream is explained.
[0102] Figure 9 This is a schematic diagram illustrating an embodiment of the present disclosure of acquiring slice records of a second video stream. Please refer to [link / reference]. Figure 9 The method process includes:
[0103] S901, Obtain playback information for the second video stream.
[0104] Optionally, the playback information may include the playback progress of the second video stream and the current video frame information. For example, the playback information may include the duration of the currently playing segment of the second video stream, whether the currently playing video frame is a keyframe, etc. For example, the server may determine the duration of the currently playing segment of the second video stream based on the playback progress of the second video stream, the server may determine whether the currently playing video is a keyframe through the optical flow information of the second video stream, and the server may also obtain the playback information of the second video stream through other means, which are not limited in this embodiment.
[0105] Optionally, the second video stream can be the video stream from the first playback of the first video. For example, when a user watches a live video for the first time using an electronic device, if the user selects standard definition (SD) for the live video, the second video stream can be the SD live video. It should be noted that since the second video stream is the video stream from the first playback of the first video, there are no segment records associated with the first video in the server, and the second video stream has segmentation decision-making power.
[0106] S902. Based on the playback information, the second video stream is sliced to obtain slice records.
[0107] The server can perform segmentation processing on the second video stream to obtain segment records based on the following feasible implementation: if the playback information indicates that the currently playing video frame in the second video stream is a keyframe, and / or, the playback information indicates that the duration of the currently playing segment in the second video stream has reached a second threshold, then the second video stream is segmented to obtain segment records. It should be noted that each time the server performs segmentation processing on the second video stream, the server can obtain the playback progress associated with the segment position (e.g., timestamps of video frames) and the segment sequence number (e.g., the first segment, the second segment, etc.), and synchronize this information to the segment records.
[0108] Below, in conjunction with Figure 10 The process of obtaining slice records is explained.
[0109] Figure 10 This is a schematic diagram illustrating a process for obtaining slice records according to an embodiment of this disclosure. Please refer to... Figure 10 This includes a second video stream. The second video stream begins playback at the 10-second mark, and a slice is taken at that 10-second position. When the second video stream reaches the 12-second mark, a slice is taken at that 12-second position. Similarly, when the second video stream reaches the 14-second mark, a slice is taken at that 14-second position. This results in a slice record for the second video stream, including slices at the 10-second, 12-second, and 14-second marks.
[0110] This disclosure provides a method for obtaining slice records of a second video stream. The method involves obtaining playback information of the second video stream. If the playback information indicates that the currently playing video frame is a keyframe, and / or the playback information indicates that the duration of the currently playing slice in the second video stream has reached a second threshold, then the second video stream is sliced to obtain slice records. Thus, since the second video stream is the first time the first video stream is played, it possesses slicing decision-making power. Slicing the second video stream using keyframes or slice duration can improve the accuracy of slicing.
[0111] Based on any of the above embodiments, the video processing method further includes the process of initializing the segment recording of the first video stream. Below, in conjunction with... Figure 11 The process of initializing the slice recording of the first video stream is explained.
[0112] Figure 11 This is a schematic diagram illustrating the initialization of slice recording of a first video stream according to an embodiment of this disclosure. Please refer to... Figure 11 The method process includes:
[0113] S1101. Determine whether the first video stream is the video stream that was switched for the first time.
[0114] If so, then execute S1102.
[0115] If not, then execute S1103.
[0116] Optionally, if the target video parameters (e.g., resolution) associated with the first video stream are being played for the first time, then the first video stream is determined to be the video stream being switched for the first time. If the first video stream with the target video parameters is not being played for the first time, then the first video stream is determined not to be the video stream being switched for the first time. For example, when an electronic device requests to play a high-definition live video, if the server has previously sent a high-definition live video to the electronic device, then the high-definition live video is determined not to be played for the first time; if the server has not previously sent a high-definition live video to the electronic device, then the high-definition live video is determined to be played for the first time.
[0117] S1102. Determine the third slice position with the slowest playback progress among multiple slice positions, and initialize the slice record of the first video stream based on the first playback progress and the third slice position.
[0118] Optionally, the third slice position is the slice position of the oldest slice in the slice record. For example, the slice record includes slice position A and slice position B, the playback progress associated with slice position A is playback progress A, and the playback progress associated with slice position B is playback progress B. If playback progress A is slower than playback progress B, then slice position A is determined to be the third slice position; if playback progress A is faster than playback progress B, then slice position B is determined to be the third slice position.
[0119] Initializing the segment records of the first video stream is used to synchronize the segment records of the second video stream to the first video stream. Optionally, the segment records of the first video stream can be initialized based on the following feasible implementation: if the first playback progress is less than the third playback progress associated with the third segment position, the first video stream is discarded. For example, if the first playback progress is less than the third playback progress associated with the third segment position, it means that the playback progress of the first video stream is slow, and there is no segment record for that playback progress in the server (e.g., as the live video plays, the server will delete outdated segment positions in the segment records). The server can discard the first video stream, thereby improving the user's viewing experience.
[0120] If the first playback progress is greater than or equal to the third playback progress associated with the third slice position, the target slice associated with the first playback progress is determined in the slice record, and the slice record of the first video stream is initialized as the slice record of the target slice. For example, if the first playback progress is greater than or equal to the third playback progress associated with the third slice position, it means that the playback progress of the first video stream is relatively fast. The server can determine the target slice to which the first playback progress belongs (e.g., the first playback progress is at the 2nd second, and the target slice is from the 1st to the 3rd second), and synchronize the slice sequence number, slice position (timestamp of the video frame), and other information of the target slice to the slice record of the first video stream.
[0121] S1103, Stop initializing the segment recording of the first video stream.
[0122] Optionally, if the first video stream is not the first video stream switched to, it means that the server has already sent the video slices of the first video stream to the electronic device, and the first video stream has synchronized the slice records of other video streams (e.g., the first video stream starts slicing from the 3rd slice position, etc.). Therefore, the server does not need to initialize the slice records of the first video stream.
[0123] This disclosure provides a method for initializing slice recording of a first video stream. The method determines whether the first video stream is the first video stream switched to. If so, it determines the third slice position with the slowest playback progress among multiple slice positions, and initializes slice recording of the first video stream based on the first playback progress and the third slice position. If not, it stops initializing slice recording of the first video stream. In this way, when the first video stream is played for the first time, the server can synchronize slice recording of the video stream at that bitrate, thereby avoiding slicing errors in the first video stream and improving the accuracy of the first video stream slicing.
[0124] Based on any of the above embodiments, the following, in conjunction with Figure 12 The process of the above video processing method will be explained.
[0125] Figure 12 This is a schematic diagram illustrating a video processing method provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 12 This includes: servers and electronic devices. The electronic device sends a request message to the server to play the ultra-high-definition first video. When the server receives the message, it can obtain the ultra-high-definition video stream encoding from the video stream encoding associated with multiple video parameters of the first video, and transcode the preceding video stream encoding to obtain the ultra-high-definition first video, and obtain the slice records of other video streams.
[0126] Please see Figure 12The segment record includes segments at 10 seconds, 12 seconds, 14 seconds, 16 seconds, 18 seconds, and 20 seconds. The first HD video stream starts playing at 12 seconds and continues until 15 seconds. Since other video streams are segmented at 12 and 14 seconds but not at 15 seconds, the server segments the first HD video stream at 12 and 14 seconds.
[0127] Please see Figure 12 When the first HD video stream reaches 20 seconds, since other video streams are sliced at 16, 18, and 20 seconds, the server slices the first HD video stream at these times. This allows the server to divide the 10-second HD video stream into slices A, B, C, and D. The server then sends slices A, B, C, and D sequentially to the electronic device (the server sends one slice as soon as it receives one slice). In this way, when the first video stream is not the fastest playing stream, the server slices the first video stream based on the slice record, ensuring that the slice positions of multiple bitrate video streams are the same. This eliminates the need to simultaneously generate other bitrate video streams for synchronous slicing, thus saving server transcoding resources.
[0128] Figure 13 This is a schematic diagram of the structure of a video processing apparatus provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 13 The video processing device 130 includes a receiving module 131, a first determining module 132, a transcoding module 133, a second determining module 134, a processing module 135, and a sending module 136, wherein:
[0129] The receiving module 131 is used to receive a playback request for a first video and obtain multiple video stream encodings associated with multiple video parameters of the first video. The playback request includes target video parameters for the electronic device to play the first video, and the multiple video parameters include the target video parameters.
[0130] The first determining module 132 is used to determine, among the plurality of video stream encodings, a target encoding associated with the target video parameters;
[0131] The transcoding module 133 is used to transcode the target encoding to obtain a first video stream;
[0132] The second determining module 134 is used to determine the first playback progress of the first video stream and the slice record of the second video stream, wherein the second video stream is a video stream that has undergone transcoding and slicing processing in the encoding of the plurality of video streams;
[0133] The processing module 135 is used to perform segmentation processing on the first video stream based on the first playback progress and the segment record to obtain video segments;
[0134] The sending module 136 is used to send the video slice to the electronic device.
[0135] In one possible implementation, the processing module 135 is specifically used for:
[0136] Based on the playback progress associated with the multiple slice positions, determine the first slice position with the latest playback progress among the multiple slice positions;
[0137] Based on the first playback progress and the first slice position, the first video stream is sliced to obtain the video slice.
[0138] In one possible implementation, the processing module 135 is specifically used for:
[0139] If the first playback progress is less than or equal to the second playback progress associated with the first slice position, then the second video stream is detected in the slice record to determine whether it is sliced at the first playback progress position, and a detection result is obtained. Based on the detection result, the first video stream is sliced.
[0140] If the first playback progress is greater than the second playback progress, then the first duration between the first playback progress and the playback progress associated with the previous slice position is obtained, and the first video stream is sliced based on the first duration.
[0141] In one possible implementation, the processing module 135 is specifically used for:
[0142] If the detection result indicates that the second video stream is sliced at the first playback progress, then the first video stream is sliced at the first playback progress to obtain the video slice;
[0143] If the detection result indicates that the second video stream was not sliced at the first playback progress, then the second slice position after the first playback progress is obtained, and the first video stream is sliced at the playback progress associated with the second slice position to obtain the video slice.
[0144] In one possible implementation, the processing module 135 is specifically used for:
[0145] If the first duration is greater than or equal to the first threshold, then the first video stream is sliced at the first playback progress point to obtain the video slice;
[0146] If the first duration is less than the first threshold, then the first video stream is sliced until the first duration equals the first threshold to obtain the video slice.
[0147] The video processing apparatus provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effects are similar, and will not be described again here.
[0148] Figure 14 This is a schematic diagram of another video processing apparatus provided in an embodiment of this disclosure. Figure 13 Based on what is shown, please refer to Figure 14 The video processing device 130 further includes an acquisition module 137, which is used for:
[0149] Obtain playback information for the second video stream;
[0150] Based on the playback information, the second video stream is sliced to obtain the slice record.
[0151] In one possible implementation, the acquisition module 137 is specifically used for:
[0152] If the playback information indicates that the video frame currently being played in the second video stream is a keyframe, and / or the playback information indicates that the duration of the segment currently being played in the second video stream has reached a second threshold, then the second video stream is sliced to obtain the segment record.
[0153] In one possible implementation, the video processing device 130 further includes a judgment module 138, the judgment module 138 being used for:
[0154] Determine whether the first bitrate of the first video stream is the same as the bitrate of the first switch;
[0155] If so, determine the third slice position with the slowest playback progress among the multiple slice positions, and initialize the slice record of the first video stream based on the first playback progress and the third slice position;
[0156] If not, then stop initializing the segment recording of the first video stream.
[0157] In one possible implementation, the determining module 136 is specifically used for:
[0158] If the first playback progress is less than the third playback progress associated with the third slice position, then the first video stream is discarded;
[0159] If the first playback progress is greater than or equal to the third playback progress associated with the third slice position, then the target slice associated with the first playback progress is determined in the slice record, and the slice record of the first video stream is initialized as the slice record of the target slice.
[0160] The video processing apparatus provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effect are similar, and will not be repeated here.
[0161] Figure 15 This is a schematic diagram of the structure of a server provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 15 The diagram illustrates a structural schematic suitable for implementing the server 1500 of the embodiments of this disclosure. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 15 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0162] like Figure 15 As shown, server 1500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1502 or a program loaded from storage device 1508 into random access memory (RAM) 1503. RAM 1503 also stores various programs and data required for the operation of server 1500. Processing device 1501, ROM 1502, and RAM 1503 are interconnected via bus 1504. Input / output (I / O) interface 1505 is also connected to bus 1504.
[0163] Typically, the following devices can be connected to I / O interface 1505: input devices 1506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1509. Communication device 1509 allows server 1500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 15 A server 1500 with various devices is shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0164] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 1509, or installed from a storage device 1508, or installed from a ROM 1502. When the computer program is executed by a processing device 1501, it performs the functions defined in the methods of embodiments of this disclosure.
[0165] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0166] The aforementioned computer-readable medium may be included in the aforementioned server; or it may exist independently and not assembled into the server.
[0167] The aforementioned computer-readable medium carries one or more programs, which, when executed by the server, cause the server to perform the method shown in the above embodiments.
[0168] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0169] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0170] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0171] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0172] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0173] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0174] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0175] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A video processing method, characterized in that, include: The device receives a playback request for a first video and obtains multiple video stream encodings associated with multiple video parameters of the first video. The playback request includes target video parameters for the electronic device to play the first video, and the multiple video parameters include the target video parameters. Among the plurality of video stream encodings, a target encoding associated with the target video parameters is determined, and the target encoding is transcoded to obtain a first video stream; The first playback progress of the first video stream and the slice record of the second video stream are determined, wherein the second video stream is a video stream that has undergone transcoding and slicing processing in the encoding of the plurality of video streams; wherein the slice record includes the slice position of each slice of the video stream of the plurality of video parameters associated with the first video before the first video stream is obtained; Based on the first playback progress and the slice record, the first video stream is sliced to obtain video slices, and the video slices are sent to the electronic device.
2. The method according to claim 1, characterized in that, The slice record includes multiple slice locations; Based on the first playback progress and the segment record, the first video stream is segmented to obtain video segments, including: Based on the playback progress associated with the multiple slice positions, determine the first slice position with the latest playback progress among the multiple slice positions; Based on the first playback progress and the first slice position, the first video stream is sliced to obtain the video slice.
3. The method according to claim 2, characterized in that, Based on the first playback progress and the first slice position, the first video stream is sliced to obtain the video slice, including: If the first playback progress is less than or equal to the second playback progress associated with the first slice position, then the second video stream is detected in the slice record to determine whether it is sliced at the first playback progress position, and a detection result is obtained. Based on the detection result, the first video stream is sliced. If the first playback progress is greater than the second playback progress, then the first duration between the first playback progress and the playback progress associated with the previous slice position is obtained, and the first video stream is sliced based on the first duration.
4. The method according to claim 3, characterized in that, Based on the detection results, the first video stream is sliced, including: If the detection result indicates that the second video stream is sliced at the first playback progress, then the first video stream is sliced at the first playback progress to obtain the video slice; If the detection result indicates that the second video stream was not sliced at the first playback progress, then the second slice position after the first playback progress is obtained, and the first video stream is sliced at the playback progress associated with the second slice position to obtain the video slice.
5. The method according to claim 3 or 4, characterized in that, Based on the first duration, the first video stream is sliced, including: If the first duration is greater than or equal to the first threshold, then the first video stream is sliced at the first playback progress point to obtain the video slice; If the first duration is less than the first threshold, then the first video stream is sliced until the first duration equals the first threshold to obtain the video slice.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Obtain playback information for the second video stream; Based on the playback information, the second video stream is sliced to obtain the slice record.
7. The method according to claim 6, characterized in that, Based on the playback information, the second video stream is sliced to obtain the slice record, including: If the playback information indicates that the video frame currently being played in the second video stream is a keyframe, and / or the playback information indicates that the duration of the segment currently being played in the second video stream has reached a second threshold, then the second video stream is sliced to obtain the segment record.
8. The method according to any one of claims 2-5, characterized in that, The method further includes: Determine whether the first video stream is the video stream that was switched for the first time; If so, determine the third slice position with the slowest playback progress among the multiple slice positions, and initialize the slice record of the first video stream based on the first playback progress and the third slice position; If not, then stop initializing the segment recording of the first video stream.
9. The method according to claim 8, characterized in that, Based on the first playback progress and the third slice position, initialize the slice record of the first video stream, including: If the first playback progress is less than the third playback progress associated with the third slice position, then the first video stream is discarded; If the first playback progress is greater than or equal to the third playback progress associated with the third slice position, then the target slice associated with the first playback progress is determined in the slice record, and the slice record of the first video stream is initialized as the slice record of the target slice.
10. A video processing apparatus, characterized in that, It includes a receiving module, a first determining module, a transcoding module, a second determining module, a processing module, and a sending module, wherein: The receiving module is configured to receive a playback request for a first video and obtain multiple video stream encodings associated with multiple video parameters of the first video. The playback request includes target video parameters for the electronic device to play the first video, and the multiple video parameters include the target video parameters. The first determining module is used to determine, among the plurality of video stream encodings, a target encoding associated with the target video parameter; The transcoding module is used to transcode the target encoding to obtain a first video stream; The second determining module is used to determine the first playback progress of the first video stream and the slice record of the second video stream, wherein the second video stream is a video stream that has undergone transcoding and slicing processing in the encoding of the plurality of video streams; wherein the slice record includes the position of each slice of the video stream of the plurality of video parameters associated with the first video before the first video stream is obtained; The processing module is used to perform segmentation processing on the first video stream based on the first playback progress and the segment record to obtain video segments; The sending module is used to send the video slice to the electronic device.
11. A server, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the video processing method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the video processing method as described in any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the video processing method as described in any one of claims 1 to 9.