[go: up one dir, main page]

CN115834925B - Video transcoding method, device, equipment and medium - Google Patents

Video transcoding method, device, equipment and medium Download PDF

Info

Publication number
CN115834925B
CN115834925B CN202211482467.5A CN202211482467A CN115834925B CN 115834925 B CN115834925 B CN 115834925B CN 202211482467 A CN202211482467 A CN 202211482467A CN 115834925 B CN115834925 B CN 115834925B
Authority
CN
China
Prior art keywords
slice
transcoded
video frame
target
video
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211482467.5A
Other languages
Chinese (zh)
Other versions
CN115834925A (en
Inventor
易正宏
邓志明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Xunlei Networking Technologies Co Ltd
Original Assignee
Shenzhen Xunlei Networking Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Xunlei Networking Technologies Co Ltd filed Critical Shenzhen Xunlei Networking Technologies Co Ltd
Priority to CN202211482467.5A priority Critical patent/CN115834925B/en
Publication of CN115834925A publication Critical patent/CN115834925A/en
Application granted granted Critical
Publication of CN115834925B publication Critical patent/CN115834925B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application discloses a video transcoding method, device, equipment and medium, which comprise the steps of obtaining a slice request for a first target slice sent by a first playing end, determining a target initial video frame to be transcoded corresponding to the first target slice if the first target slice does not exist in a local cache, transcoding from the target initial video frame, and sending the transcoded video frame to the first playing end after any video frame is transcoded. Therefore, the frame is used as granularity, the sending and broadcasting of the transcoding and broadcasting are realized, the slicing transcoding is not required to be completed, the time delay can be reduced, and the user experience is improved.

Description

Video transcoding method, device, equipment and medium
Technical Field
The present application relates to the field of video transcoding technologies, and in particular, to a video transcoding method, device, apparatus, and medium.
Background
At present, the playing device plays the video file online, and there are two schemes generally, one is to play the original video, but the playing is limited by the decoding capability of the bandwidth/playing device, and the playing may not be smooth and is easy to be blocked. The other is a scheme of slice transcoding, each time a slice is transcoded, data is returned, delay is caused, and user experience is poor.
Disclosure of Invention
Accordingly, the present application is directed to a video transcoding method, apparatus, device, and medium, which can reduce delay, thereby improving user experience. The specific scheme is as follows:
in a first aspect, the present application discloses a video transcoding method, applied to a server, comprising:
Acquiring a slice request aiming at a first target slice sent by a first playing end;
If the first target slice does not exist in the local cache, determining a target initial video frame to be transcoded corresponding to the first target slice, transcoding from the target initial video frame, and transmitting the transcoded video frame to the first playing end after any video frame is transcoded.
Optionally, the transcoding from the target initial video frame starts, and each time any video frame is transcoded, the transcoded video frame is sent to the first playing end, including:
Transcoding is started from the target initial video frame, and if any video frame is transcoded, the transcoded video frame is written into a shared memory;
And taking out the transcoded video frame from the shared memory and sending the transcoded video frame to the first playing end.
Optionally, the obtaining the slice request for the first target slice sent by the first playing end includes:
acquiring a video playing request sent by a first playing end, and returning a virtual list file based on the video playing request;
And acquiring a slice request for a first target slice, which is sent by the first playing end based on the virtual list file.
Optionally, each time any video frame is transcoded, the transcoded video frame is sent to the first playing end, including:
establishing a communication link with the first playing end based on the slicing request;
and maintaining the communication link, and transmitting any video frame after transcoding to the first playing end based on each time the communication link transcodes.
Optionally, the method further comprises:
and when all video frames corresponding to the first target slice are transcoded to obtain the first target slice, judging whether the local buffer memory has sufficient buffer memory space, if not, reading the latest read-write operation time of each slice in the local buffer memory, clearing the slice with the earliest latest read-write operation time from the local buffer memory, and storing the first target slice into the local buffer memory.
Optionally, if the slice request is a request corresponding to accurate positioning, determining the target initial video frame to be transcoded corresponding to the first target slice includes determining a key frame closest to a positioning time point from the video data to be transcoded corresponding to the first target slice, and determining the key frame as the target initial video frame to be transcoded, and if the slice request is not a request corresponding to accurate positioning, determining the target initial video frame to be transcoded corresponding to the first target slice includes determining a first frame of the video data to be transcoded corresponding to the first target slice as the target initial video frame to be transcoded.
Optionally, before determining the target initial video frame to be transcoded corresponding to the first target slice, the method further includes:
If transcoding of the video to be transcoded corresponding to the second target slice is currently performed, and the number of slices at intervals between the second target slice and the first target slice is smaller than a preset threshold, waiting for a video frame corresponding to the first target slice which is transcoded based on a slice request sent by a second playing end, otherwise triggering and determining a target initial video frame to be transcoded corresponding to the first target slice;
The second target slice is a slice requested by the second playing end, and the second target slice and the first target slice are slices of the same video resource.
In a second aspect, the present application discloses a video transcoding device, applied to a server, including:
the slice request acquisition module is used for acquiring a slice request aiming at a first target slice sent by the first playing end;
the local buffer judgment module is used for judging whether the first target slice exists in the local buffer;
the initial frame determining module is used for determining a target initial video frame to be transcoded corresponding to the first target slice if the local buffer judging module judges that the first target slice does not exist in the local buffer;
a video frame transcoding module for transcoding from the target initial video frame;
and the video frame transmitting module is used for transmitting any video frame after the video frame transcoding module transcodes the video frame to the first playing end.
In a third aspect, the application discloses an electronic device comprising a memory and a processor, wherein:
the memory is used for storing a computer program;
The processor is configured to execute the computer program to implement the video transcoding method.
In a fourth aspect, the present application discloses a computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the video transcoding method described above.
As can be seen, the present application obtains a slice request for a first target slice sent by a first playing end, if the first target slice does not exist in a local cache, determines a target initial video frame to be transcoded corresponding to the first target slice, starts transcoding from the target initial video frame, and sends the transcoded video frame to the first playing end after any video frame is transcoded. That is, when there is no slice requested by the playing end in the local buffer, the method determines the target initial video frame to be transcoded, then transcodes the video frame by frame, and after transcoding, sends the transcoded video frame to the playing end, thus, with the frame as granularity, the method realizes the sending of the transcoded video frame while the playing end receives and plays the transcoded video frame while the playing end receives, and does not need to wait for the completion of the slice transcoding, thereby reducing the delay and improving the user experience.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a video transcoding method according to the present application;
FIG. 2 is a schematic diagram of a specific M3U8 file according to the present application;
FIG. 3 is a schematic diagram illustrating interaction between a specific playing end and a server end according to the present application;
FIG. 4 is a schematic diagram of video transcoding according to an embodiment of the present application;
FIG. 5 is a schematic view of a slice buffer according to one embodiment of the present application;
FIG. 6 is a flowchart of a specific video transcoding method according to the present application;
fig. 7 is a schematic structural diagram of a video transcoding device according to the present application;
Fig. 8 is a block diagram of an electronic device according to the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
At present, the playing device plays the video file online, and there are two schemes generally, one is to play the original video, but the playing is limited by the decoding capability of the bandwidth/playing device, and the playing may not be smooth and is easy to be blocked. The other is a scheme of slice transcoding, each time a slice is transcoded, data is returned, delay is caused, and user experience is poor. If all transcoded slices of the original video file are stored in the server to avoid latency, a significant amount of memory is consumed by the server. If the slices are to be divided with the frame granularity, the video file has the key frames and the common frames, the key frames contain complete information, the data are large, each slice is required to be the key frame, and the requirement on the bandwidth is high. Therefore, the video transcoding scheme provided by the application can reduce delay, thereby improving user experience. And meanwhile, the massive consumption of the memory of the server is avoided, and the requirement on bandwidth is reduced.
Referring to fig. 1, an embodiment of the present application discloses a video transcoding method, which is applied to a server, and includes:
step S11, a slice request aiming at a first target slice and sent by a first playing end is obtained.
In a specific embodiment, the server may acquire a video playing request sent by the first playing end, return a virtual list file based on the video playing request, and acquire a slice request for a first target slice sent by the first playing end based on the virtual list file. It will be appreciated that the virtual list file contains identification information for each slice. Also, slices may be partitioned based on file time of the video asset, and slice partitioning parameters may be configured, such as 10 seconds as one slice.
The virtual list file may be an M3U8 list file. When a user requests a video resource, a virtual M3U8 list file (namely a virtual transcoded slice file sequence) is returned, each slice in the M3U8 list file is in a task_id/segment_id.ts format, and each video playing request is identified by a unique task_id. For example, referring to fig. 2, fig. 2 is a schematic diagram of a specific M3U8 file according to an embodiment of the present application. Further, referring to fig. 3, fig. 3 is a schematic interaction diagram of a specific playing end and a server according to an embodiment of the present application. When the user requests the playlist, the virtual M3U8 list file is returned according to the file duration of the video resource request, and the user requests slicing based on the M3U8 list file. Wherein M3U8 is HTTP LIVE STREAMING index file of live broadcast. M3U8 may be considered essentially as an M3U format file, M3U8 file encoded using UTF-8 characters. TS is an audio-video encapsulation format, which is commonly referred to as MPEG2-TS. Among them, TS is an abbreviation of "Transport Stream", and file extension is. TS.
Step S12, if the first target slice does not exist in the local cache, determining a target initial video frame to be transcoded corresponding to the first target slice, transcoding from the target initial video frame, and transmitting the transcoded video frame to the first playing end after any video frame is transcoded.
In a specific embodiment, a communication link with the first playing end can be established based on the slicing request, the communication link is maintained, and if any video frame is transcoded based on the communication link, the transcoded video frame is sent to the first playing end. In one embodiment, the transcoded video frame may be sent to the first playing end in Http Chunck mode. Wherein Http Chunck the block transport encoding (Chunked transfer encoding) is a data transport mechanism in the hypertext transport protocol (HTTP) that allows the data sent by the application server to the client application to be split into multiple parts that better support dynamic content formats.
And the method can start transcoding from the target initial video frame, write the transcoded video frame into a shared memory after any video frame is transcoded, take out the transcoded video frame from the shared memory and send the transcoded video frame to the first playing end. Further, the encoding thread can be utilized to start transcoding from the target initial video frame, and each time any video frame is transcoded, the transcoded video frame is written into the shared memory and a data update notification is sent to the sending thread, the data update notification is obtained by utilizing the sending thread, the transcoded video frame is taken out from the shared memory and is sent to the first playing end.
Further, when all video frames corresponding to the first target slice are transcoded to obtain the first target slice, judging whether the local buffer has sufficient buffer space, if not, reading the latest read-write operation time of each slice in the local buffer, clearing the slice with the earliest latest read-write operation time from the local buffer, and storing the first target slice into the local buffer. I.e. to preferentially reject slices that have not been operated recently. The embodiment of the application can save any video frame after transcoding to a temporary file when transcoding is finished, and determine the temporary file as the first target slice and save the first target slice to a local cache when all video frames corresponding to the first target slice are saved to the temporary file. For example, slices during transcoding may be saved as temporary tmp files, and only one slice completed may be renamed to the ts file, with the untransformed slice data being sent only in memory and not by other sessions.
For example, referring to fig. 4, fig. 4 is a schematic diagram of video transcoding according to an embodiment of the present application. If the requested slice does not exist in the local cache, the Http request is maintained, the slice is specified by transcoding, the encoded audio and video frames can be written into a memory opened in advance by a memory sharing mode after each time an audio and video frame is encoded by an encoding thread, meanwhile, a notification is sent to a Http sending thread to inform that the data is updated, the Http sending thread takes out the corresponding audio and video frame from the same memory and immediately sends the transcoded audio and video frame to a player through the Http connection. It should be noted that, when the requested slice does not exist, the standard Http server returns 404 that the file cannot be found, in the embodiment of the present application, the client and the server keep the Http link, and each transcode one frame is sent, and compared with the prior art that the data is returned after the slice is transcoded, the present application uses the frame as the operation granularity to write a transcoded audio/video frame by the encoding thread in a memory sharing manner and read the audio/video frame by the sending thread in real time, and sends the encoded audio/video frame to the network in a HttpChunck manner, and the data is returned in real time while the slice is transcoded. And, through customizing the transcoding multiplexer, when transcoding data write multiplexing (organizing the coded audio and video streams together according to a certain mode), the coded data are stored in the memory, and the data in the chip are sent to the requesting party in real time in a HttpChunck block transmission mode, httpChunck allows the server to send the data according to the chip, and the method is suitable for dynamically generating scenes with uncertain data size. Therefore, the user-defined multiplexer updates the latest audio and video data in the shared memory and sends the latest audio and video data to the playing end in real time in a Http Chunck mode through the network while writing and multiplexing the audio and video frames, and does not need to wait for the completion of slicing transcoding, so that the time consumption of data request is greatly reduced.
And, the shared memory can be created in advance, for example, the default size is 10M, the shared memory can be created when the video transcoding service instance is created, for the member variable of the instance, new audio/video generation can be called back to the data updating function of the instance through the write_packet pointer function of the custom multiplexer when writing multiplexing, and when the space opened up before is insufficient for storing the frame data, a larger space can be opened up again. The video transcoding service is used for realizing the video transcoding method provided by the application. And the audio and video data in the shared memory are not specially processed after being sent to the HTTP, the memory corresponding to the audio and video data sent before can be covered until the next time or the next time when new audio and video data frames come, the read-write thread is locked to determine the read-write position, the read-write is started from which position during the read, and the write is started from which position during the write, so that the memory can be ensured to continuously have new data write-in and data read-out.
Further, referring to fig. 5, fig. 5 is a schematic view of a specific slice buffer disclosed in the embodiment of the present application, after the slice transcoding is completed, the slice is written into a disk for storage, and if the size of the buffer specified by the configuration file exceeds the set size, the slice is eliminated according to the LRU (i.e. LEAST RECENTLY Used, least recently Used) principle.
In addition, in the embodiment of the present application, if the first target slice exists in the local cache, the first target slice is directly returned. For example, referring to fig. 6, fig. 6 is a flowchart of a specific video transcoding method according to an embodiment of the present application. If the requested slice exists, the slice data is returned directly, and the slice exists by returning the data from the beginning (key frame position). Otherwise, the slice is transcoded in real time and simultaneously audio and video data is read in the form of Http Chunck with the frame as the operation granularity and the data is sent to the network return data in the form of Http Chunck.
In a specific embodiment, if the slice request is a request corresponding to accurate positioning, determining a key frame closest to a positioning time point from video data to be transcoded corresponding to the first target slice, and determining the key frame as a target initial video frame to be transcoded, and if the slice request is not a request corresponding to accurate positioning, determining a first frame of the video data to be transcoded corresponding to the first target slice as a target initial video frame to be transcoded.
That is, when the scheme provided by the embodiment of the application is used for accurately positioning, the situation that the latest key frame is accurately positioned for transcoding can be ensured, and for a request corresponding to inaccurate positioning, transcoding is started from the first frame corresponding to the slice. The request corresponding to the inaccurate positioning includes playing the video resource for the first time, and inaccurate positioning in the playing process, for example, when the user clicks at 2 minutes and 35 seconds and slices every 10 seconds, a frame beginning at 2 minutes and 30 seconds, that is, the first frame of the slice, is transcoded. The method can judge which slice the clicking position belongs to according to the file time of M3U8, transcode the video frame and return, if the player is positioned accurately, the player starts decoding from the key frame to the playing point to start rendering data, otherwise, if the player is not positioned accurately, the player starts playing directly from time rounding to the slice head.
Further, before determining the target initial video frame to be transcoded corresponding to the first target slice, if transcoding is currently being performed on the video to be transcoded corresponding to the second target slice, and the number of slices spaced between the second target slice and the first target slice is smaller than a preset threshold, waiting for the video frame corresponding to the first target slice, which is transcoded based on the slice request sent by the second playing end, otherwise triggering the step of determining the target initial video frame to be transcoded corresponding to the first target slice, wherein the second target slice is the slice requested by the second playing end, and the second target slice and the first target slice are slices of the same video resource. The preset threshold may be set according to the slice duration, for example, may be set to 3.
That is, the slice requested by the user is already in the previous user request transcoding, at which time the subsequent user waits for the previous transcoding to be completed. Specifically, the slice index of the current requested slice may be based on that if the current slice is the transcoding task of the same video resource, and the current transcoding position is not rotated by a slice with a distance less than the preset threshold value, and the previous task is waited for being completely rotated.
As can be seen, in the embodiment of the present application, a slice request for a first target slice sent by a first playing end is obtained, if the first target slice does not exist in a local cache, a target initial video frame to be transcoded corresponding to the first target slice is determined, transcoding is started from the target initial video frame, and after any video frame is transcoded, the transcoded video frame is sent to the first playing end. That is, when there is no slice requested by the playing end in the local buffer, the embodiment of the application determines the target initial video frame to be transcoded first, then transcodes the video frame by frame, and after transcoding, sends the transcoded video frame to the playing end, thus, with the frame as granularity, the sending of transcoding and the receiving and playing of playing end are realized, the waiting for the completion of slice transcoding is not needed, the delay can be reduced, and the user experience is improved.
Referring to fig. 7, a video transcoding device, applied to a server, includes:
The slice request acquisition module 11 is configured to acquire a slice request for a first target slice sent by a first playing end;
A local buffer determination module 12, configured to determine whether the first target slice exists in the local buffer;
an initial frame determining module 13, configured to determine, if the local buffer determination module determines that the first target slice does not exist in the local buffer, a target initial video frame to be transcoded corresponding to the first target slice;
a video frame transcoding module 14 for transcoding from the target initial video frame;
and the video frame sending module 15 is configured to send the video frame to the first playing end after the video frame transcoding module transcodes any video frame.
As can be seen, in the embodiment of the present application, a slice request for a first target slice sent by a first playing end is obtained, if the first target slice does not exist in a local cache, a target initial video frame to be transcoded corresponding to the first target slice is determined, transcoding is started from the target initial video frame, and after any video frame is transcoded, the transcoded video frame is sent to the first playing end. That is, when there is no slice requested by the playing end in the local buffer, the embodiment of the application determines the target initial video frame to be transcoded first, then transcodes the video frame by frame, and after transcoding, sends the transcoded video frame to the playing end, thus, with the frame as granularity, the sending of transcoding and the receiving and playing of playing end are realized, the waiting for the completion of slice transcoding is not needed, the delay can be reduced, and the user experience is improved.
In one embodiment, the video frame transcoding module 14 is specifically configured to transcode from the target initial video frame, write the transcoded video frame into the shared memory after any video frame is transcoded, and the corresponding video frame sending module 15 is specifically configured to take out the transcoded video frame from the shared memory and send the transcoded video frame to the first playing end.
The slice request obtaining module 11 is specifically configured to obtain a video play request sent by a first playing end, return a virtual list file based on the video play request, and obtain a slice request for a first target slice sent by the first playing end based on the virtual list file.
Further, the device also comprises a link establishment and maintenance module for establishing a communication link with the first playing end based on the slicing request, and a video frame sending module 15 for sending the video frame to the first playing end when the video frame transcoding module transcodes any video frame based on the communication link.
Further, the device also comprises a slice buffer module for:
and when all video frames corresponding to the first target slice are transcoded to obtain the first target slice, judging whether the local buffer memory has sufficient buffer memory space, if not, reading the latest read-write operation time of each slice in the local buffer memory, clearing the slice with the earliest latest read-write operation time from the local buffer memory, and storing the first target slice into the local buffer memory.
In one embodiment, the initial frame determining module 13 is specifically configured to determine, if the slice request is a request corresponding to accurate positioning, a key frame closest to a positioning time point from video data to be transcoded corresponding to the first target slice, and determine the key frame as a target initial video frame to be transcoded;
in another embodiment, the initial frame determining module 13 is specifically configured to determine, if the slice request is not a request corresponding to accurate positioning, a first frame of video data to be transcoded corresponding to the first target slice as a target initial video frame to be transcoded.
Further, the device also comprises a waiting module, which is used for waiting for the video frame corresponding to the first target slice which is requested to be transcoded based on the slice sent by the second playing end if the transcoding of the video to be transcoded corresponding to the second target slice is currently performed and the number of the slices at the interval between the second target slice and the first target slice is smaller than a preset threshold value, otherwise triggering and determining the target initial video frame corresponding to the first target slice to be transcoded;
The second target slice is a slice requested by the second playing end, and the second target slice and the first target slice are slices of the same video resource.
Referring to fig. 8, an embodiment of the present application discloses an electronic device 20, which includes a processor 21 and a memory 22, wherein the memory 22 is used for storing a computer program, and the processor 21 is used for executing the computer program, and the video transcoding method disclosed in the foregoing embodiment.
For the specific process of the video transcoding method, reference may be made to the corresponding content disclosed in the foregoing embodiment, and no further description is given here.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk or an optical disk, and the storage mode may be transient storage or permanent storage.
In addition, the electronic device 20 further includes a power supply 23, a communication interface 24, an input/output interface 25, and a communication bus 26, where the power supply 23 is configured to provide working voltages for each hardware device on the electronic device 20, the communication interface 24 is capable of creating a data transmission channel between the electronic device 20 and an external device, and the communication protocol to be followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein, and the input/output interface 25 is configured to obtain external input data or output data to the external device, and a specific interface type thereof may be selected according to specific application needs and is not specifically limited herein.
Further, the embodiment of the application also discloses a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to realize the video transcoding method disclosed in the previous embodiment.
For the specific process of the video transcoding method, reference may be made to the corresponding content disclosed in the foregoing embodiment, and no further description is given here.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The foregoing describes in detail a video transcoding method, apparatus, device and medium, and specific examples are provided herein to illustrate the principles and embodiments of the present application, and the above examples are provided to assist in understanding the method and core ideas of the present application, and meanwhile, to those skilled in the art, according to the ideas of the present application, there are variations in the specific embodiments and application scope, so the disclosure should not be construed as limiting the present application.

Claims (9)

1. The video transcoding method is characterized by being applied to a server and comprising the following steps:
Acquiring a slice request aiming at a first target slice sent by a first playing end;
If the first target slice does not exist in the local cache, determining a target initial video frame to be transcoded corresponding to the first target slice, transcoding from the target initial video frame, and transmitting the transcoded video frame to the first playing end after any video frame is transcoded;
before determining the target initial video frame to be transcoded corresponding to the first target slice, the method further includes:
If transcoding of the video to be transcoded corresponding to the second target slice is currently performed, and the number of slices at intervals between the second target slice and the first target slice is smaller than a preset threshold, waiting for a video frame corresponding to the first target slice which is transcoded based on a slice request sent by a second playing end, otherwise triggering and determining a target initial video frame to be transcoded corresponding to the first target slice;
The second target slice is a slice requested by the second playing end, and the second target slice and the first target slice are slices of the same video resource.
2. The method for transcoding video according to claim 1, wherein said transcoding from said target initial video frame, each time any video frame is transcoded, transmitting the transcoded video frame to said first playback end includes:
Transcoding is started from the target initial video frame, and if any video frame is transcoded, the transcoded video frame is written into a shared memory;
And taking out the transcoded video frame from the shared memory and sending the transcoded video frame to the first playing end.
3. The method of video transcoding according to claim 1, wherein the obtaining the slice request for the first target slice sent by the first playing end includes:
acquiring a video playing request sent by a first playing end, and returning a virtual list file based on the video playing request;
And acquiring a slice request for a first target slice, which is sent by the first playing end based on the virtual list file.
4. The method for transcoding video according to claim 1, wherein each time any video frame is transcoded, sending the transcoded video frame to the first playback end includes:
establishing a communication link with the first playing end based on the slicing request;
and maintaining the communication link, and transmitting any video frame after transcoding to the first playing end based on each time the communication link transcodes.
5. The video transcoding method of claim 1, further comprising:
and when all video frames corresponding to the first target slice are transcoded to obtain the first target slice, judging whether the local buffer memory has sufficient buffer memory space, if not, reading the latest read-write operation time of each slice in the local buffer memory, clearing the slice with the earliest latest read-write operation time from the local buffer memory, and storing the first target slice into the local buffer memory.
6. The method for transcoding video of claim 1, wherein,
If the slice request is a request corresponding to accurate positioning, determining a target initial video frame to be transcoded corresponding to the first target slice includes determining a key frame nearest to a positioning time point from video data to be transcoded corresponding to the first target slice, and determining the key frame as the target initial video frame to be transcoded;
If the slice request is not a request corresponding to accurate positioning, determining the target initial video frame to be transcoded corresponding to the first target slice includes determining a first frame of video data to be transcoded corresponding to the first target slice as the target initial video frame to be transcoded.
7. A video transcoding device, applied to a server, comprising:
the slice request acquisition module is used for acquiring a slice request aiming at a first target slice sent by the first playing end;
the local buffer judgment module is used for judging whether the first target slice exists in the local buffer;
the initial frame determining module is used for determining a target initial video frame to be transcoded corresponding to the first target slice if the local buffer judging module judges that the first target slice does not exist in the local buffer;
a video frame transcoding module for transcoding from the target initial video frame;
The video frame transmitting module is used for transmitting any video frame after the video frame transcoding module transcodes the video frame to the first playing end;
wherein the apparatus further comprises:
The waiting module is used for waiting for a video frame corresponding to a first target slice which is requested to be transcoded based on a slice sent by a second playing end if transcoding of a video to be transcoded corresponding to a second target slice is currently carried out and the number of slices at intervals between the second target slice and the first target slice is smaller than a preset threshold, otherwise triggering a step of determining a target initial video frame corresponding to the first target slice and to be transcoded;
The second target slice is a slice requested by the second playing end, and the second target slice and the first target slice are slices of the same video resource.
8. An electronic device comprising a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor for executing the computer program to implement the video transcoding method of any of claims 1 to 6.
9. A computer readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the video transcoding method of any of claims 1 to 6.
CN202211482467.5A 2022-11-24 2022-11-24 Video transcoding method, device, equipment and medium Active CN115834925B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211482467.5A CN115834925B (en) 2022-11-24 2022-11-24 Video transcoding method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211482467.5A CN115834925B (en) 2022-11-24 2022-11-24 Video transcoding method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN115834925A CN115834925A (en) 2023-03-21
CN115834925B true CN115834925B (en) 2025-05-09

Family

ID=85531140

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211482467.5A Active CN115834925B (en) 2022-11-24 2022-11-24 Video transcoding method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115834925B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118632044B (en) * 2024-08-02 2024-12-20 阿里云计算有限公司 Audio and video transcoding processing and playback method, device, storage medium and program product

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103428491A (en) * 2013-07-05 2013-12-04 北京电视台 Method and device for transcoding in file transmitting process
CN105049876A (en) * 2015-08-17 2015-11-11 深圳市路通网络技术有限公司 Real-time trans-coding-based method and device for realizing time shift
CN105763960A (en) * 2016-03-01 2016-07-13 青岛海信传媒网络技术有限公司 Method and apparatus for network video playing

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103686202B (en) * 2012-09-18 2018-06-19 中兴通讯股份有限公司 Transcoding live transmission method and system based on HTTP under a kind of DLNA
CN107333148B (en) * 2017-06-23 2019-01-08 腾讯科技(深圳)有限公司 Method for processing video frequency and device, computer storage medium and equipment
US11206415B1 (en) * 2020-09-14 2021-12-21 Apple Inc. Selectable transcode engine systems and methods
CN112929755B (en) * 2021-01-21 2022-08-16 稿定(厦门)科技有限公司 Video file playing method and device in progress dragging process

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103428491A (en) * 2013-07-05 2013-12-04 北京电视台 Method and device for transcoding in file transmitting process
CN105049876A (en) * 2015-08-17 2015-11-11 深圳市路通网络技术有限公司 Real-time trans-coding-based method and device for realizing time shift
CN105763960A (en) * 2016-03-01 2016-07-13 青岛海信传媒网络技术有限公司 Method and apparatus for network video playing

Also Published As

Publication number Publication date
CN115834925A (en) 2023-03-21

Similar Documents

Publication Publication Date Title
US11356493B2 (en) Systems and methods for cloud storage direct streaming
US10469885B2 (en) Playback synchronization among adaptive bitrate streaming clients
US7725557B2 (en) Client-side caching of streaming media content
CN107968790B (en) Virtualization in Adaptive Stream Creation and Delivery
CN110933517B (en) Rate switching method, client and computer-readable storage medium
KR101702562B1 (en) Storage file format for multimedia streaming file, storage method and client apparatus using the same
US20120246335A1 (en) Method, terminal, and server for implementing fast playout
US20110055881A1 (en) Media file on-demand method, system and appartus
CN101242430B (en) Fixed data pre-access method in peer network order system
CN108063769B (en) Method and device for realizing content service and content distribution network node
WO2013078620A1 (en) Method, device and system for delivering live telecast content
JP2016519895A (en) Media file reception and media file transmission method, apparatus, and system
US11496536B2 (en) Method of requesting video, computing device, and computer-program product
WO2021017958A1 (en) Video transcoding method and apparatus
CN115834925B (en) Video transcoding method, device, equipment and medium
CN112104885B (en) System and method for accelerating M3U8 initial playing speed in live broadcasting
KR20140041256A (en) Dynamic and adaptive streaming system over http
US11997366B2 (en) Method and apparatus for processing adaptive multi-view streaming
WO2025138933A1 (en) Streaming transcoding method and apparatus
CN116389787A (en) Audio and video transcoding playing method
CN116389774B (en) Method for improving playing efficiency and player
EP4391559B1 (en) Method for delivering an audio and/or video content and transcoding proxy implementing said method
CN114866822B (en) Live broadcast push stream method and device, and live broadcast pull stream method and device
KR20070024747A (en) Streaming service device and method using network switching
KR102763961B1 (en) Method and apparatus for selecting and receiving stream in distributed network based multimedia streaming service

Legal Events

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