WO2021052058A1 - Video processing method and apparatus, electronic device and storage medium - Google Patents

Video processing method and apparatus, electronic device and storage medium Download PDF

Info

Publication number
WO2021052058A1
WO2021052058A1 PCT/CN2020/108268 CN2020108268W WO2021052058A1 WO 2021052058 A1 WO2021052058 A1 WO 2021052058A1 CN 2020108268 W CN2020108268 W CN 2020108268W WO 2021052058 A1 WO2021052058 A1 WO 2021052058A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
segment
video segment
upload
identifier
Prior art date
Application number
PCT/CN2020/108268
Other languages
French (fr)
Chinese (zh)
Inventor
耿玉峰
周超
Original Assignee
北京达佳互联信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京达佳互联信息技术有限公司 filed Critical 北京达佳互联信息技术有限公司
Publication of WO2021052058A1 publication Critical patent/WO2021052058A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/70Media network packetisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Definitions

  • This application relates to the technical field of multimedia information processing, and in particular to a video processing method, device, electronic equipment, and storage medium.
  • Video upload is the core function of short video sharing software. It shortens the time-consuming video upload and the delay in distributing to users after uploading, which will greatly enhance the author's content production experience.
  • the time consumption of video uploading and sharing is limited by multiple processes such as terminal video transcoding speed, transcoding file size, uplink network bandwidth, and server transcoding time consumption, and there is a large room for optimization.
  • Short video sharing generally includes five steps: user shooting and editing works, video file terminal transcoding, video file network upload, server transcoding, and video file distribution.
  • terminal transcoding and uploading require the user to wait for completion. Otherwise, the software may be restricted from running on the server or killed by the system, causing the upload to fail.
  • the server transcoding can be asynchronous. Proceed, and then distribute through CDN (Content Delivery Network) after completion.
  • CDN Content Delivery Network
  • the original file first needs to be transcoded and compressed by the editing module to generate a small video file that is easy to upload, and then call the network interface to upload the file to the server.
  • the server receives the file, calls the transcoding service to further process the video (such as further compressing the size, transferring multiple files with different bitrates, etc.) before distributing it.
  • This application provides a video processing method, device, electronic equipment, and storage medium to at least solve the problem that the speed optimization of transcoding and transmission has reached a relative bottleneck in related technologies.
  • the form of video fragmentation can realize a highly parallel uploading video processing method in the three stages of client-side transcoding, uploading, and server-side transcoding. This method greatly saves the time required for the successful publication of users' video works.
  • a video processing method including:
  • each time a video segment is obtained After assigning a segment identifier to the video segment, upload the video segment and its corresponding segment identifier to the server, so that the server receives the video segment Then decode the video segment according to the segment identifier of the video segment; wherein, the segment identifier is used to mark the sequence of generating multiple video segments;
  • a video processing method including:
  • segment identifier decode each video segment
  • a video processing device including:
  • the first encoding module is configured to perform encoding of the video to be processed, and generate multiple video segments one by one according to the encoding sequence;
  • the uploading module is configured to execute each time a video segment is obtained, after assigning a segment identifier to the video segment, upload the video segment and its corresponding segment identifier to the server, so that the server is After receiving the video segment, decode the video segment according to the segment identifier of the video segment; wherein, the segment identifier is used to mark the sequence of generating multiple video segments;
  • the second encoding module is configured to perform the process of uploading each video segment, if the encoding for the to-be-processed video is not finished, at the same time continue to encode the to-be-processed video to obtain the next video segment.
  • a video processing device including:
  • the first receiving module is configured to receive each video segment of the to-be-processed video uploaded by the terminal and the segment identifier corresponding to each video segment;
  • the decoding module is configured to perform decoding of each video segment according to the segment identifier
  • the second receiving module is configured to perform, in the process of decoding each video segment, if there is an upload of the next video segment, simultaneously receive the next video segment.
  • an electronic device including:
  • a memory for storing computer programs, candidate intermediate data and result data generated by executing the computer programs
  • each time a video segment is obtained After assigning a segment identifier to the video segment, upload the video segment and its corresponding segment identifier to the server, so that the server receives the video segment Then decode the video segment according to the segment identifier of the video segment; wherein, the segment identifier is used to mark the sequence of generating multiple video segments;
  • a computer storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute any video provided in the embodiments of the present application. Approach.
  • FIG. 1 is a structural diagram of a terminal device provided by an embodiment of this application.
  • FIG. 2 is a schematic flowchart of a video serial upload method provided by an embodiment of the application
  • FIG. 3 is a sequence diagram of a video serial upload method provided by an embodiment of the application.
  • FIG. 4 is a schematic flowchart of a terminal side of a video processing method provided by an embodiment of this application;
  • FIG. 5 is a schematic flowchart of a server side of a video processing method provided by an embodiment of this application.
  • FIG. 6 is a sequence diagram of a video processing method provided by an embodiment of this application.
  • FIG. 7 is a schematic structural diagram of a terminal side of a video processing device provided by an embodiment of the application.
  • FIG. 8 is a schematic structural diagram of a server side of a video processing device provided by an embodiment of this application.
  • FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
  • Terminal devices can be smart phones, tablet computers, various wearable devices, vehicle-mounted devices, and so on.
  • Various applications such as social software, maps, etc., can be installed in the terminal device.
  • FIG. 1 shows a structural diagram of a possible terminal device.
  • the terminal device 100 includes: a radio frequency (RF) circuit 110, a power supply 120, a processor 130, a memory 140, an input unit 150, a display unit 160, a camera 170, a communication interface 180, and a wireless Components such as a wireless fidelity (Wireless Fidelity, WiFi) module 190.
  • RF radio frequency
  • the structure of the terminal device shown in FIG. 1 does not constitute a limitation on the terminal device.
  • the terminal device provided by the embodiment of the present application may include more or less components than those shown in the figure, or a combination of certain components. Some components, or different component arrangements.
  • the RF circuit 110 can be used to receive and send data during a communication or call. In particular, after the RF circuit 110 receives the downlink data from the base station, it sends it to the processor 130 for processing; in addition, it sends the uplink data to be sent to the base station.
  • the RF circuit 110 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, and the like.
  • LNA low noise amplifier
  • the RF circuit 110 may also communicate with the network and other devices through wireless communication.
  • the wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile Communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division Multiple Access). Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), Email, Short Messaging Service (SMS), etc.
  • GSM Global System of Mobile Communication
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • Email Short Messaging Service
  • the WiFi technology is a short-range wireless transmission technology.
  • the terminal device 100 can be connected to an access point (AP) through the WiFi module 190, so as to achieve data network access.
  • the WiFi module 190 can be used to receive and send data in the communication process.
  • the terminal device 100 may be physically connected with other devices through the communication interface 180.
  • the communication interface 180 and the communication interface of the other device are connected by a cable to realize data transmission between the terminal device 100 and the other device.
  • the terminal device 100 can implement communication services and send information to other contacts, the terminal device 100 needs to have a data transmission function, that is, the terminal device 100 needs to include a communication module inside.
  • FIG. 1 shows communication modules such as the RF circuit 110, the WiFi module 190, and the communication interface 180, it is understandable that there are at least one of the above-mentioned components or other functions in the terminal device 100.
  • a communication module (such as a Bluetooth module) for realizing communication for data transmission.
  • the terminal device 100 when the terminal device 100 is a mobile phone, the terminal device 100 may include the RF circuit 110 and may also include the WiFi module 190; when the terminal device 100 is a computer, the terminal device 100 may The communication interface 180 may be included, and the WiFi module 190 may also be included; when the terminal device 100 is a tablet computer, the terminal device 100 may include the WiFi module.
  • the memory 140 can be used to store software programs and modules.
  • the processor 130 executes various functional applications and data processing of the terminal device 100 by running software programs and modules stored in the memory 140.
  • the memory 140 may mainly include a program storage area and a data storage area.
  • the storage program area can store operating systems, various application programs (such as communication applications), and face recognition modules, etc.
  • the storage data area can store data created based on the use of the terminal device (such as various pictures and video files). And other multimedia files, as well as face information templates) and so on.
  • the memory 140 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the input unit 150 may be used to receive numeric or character information input by the user, and generate key signal input related to user settings and function control of the terminal device 100.
  • the input unit 150 may include a touch panel 151 and other input devices 152.
  • the touch panel 151 can collect user touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on or on the touch panel 151.
  • the touch panel 151 may include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller;
  • the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 130, and can receive and execute the commands sent by the processor 130.
  • the touch panel 151 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave.
  • the other input device 152 may include, but is not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, joystick, and the like.
  • the display unit 160 may be used to display information input by the user or information provided to the user and various menus of the terminal device 100.
  • the display unit 160 is the display system of the terminal device 100, and is used to present an interface and realize human-computer interaction.
  • the display unit 160 may include a display panel 161.
  • the display panel 161 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light emitting diode (Organic Light-Emitting Diode, OLED), etc.
  • the touch panel 151 can cover the display panel 161, and when the touch panel 151 detects a touch operation on or near it, it is transmitted to the processor 130 to determine the type of touch event, Then the processor 130 provides corresponding visual output on the display panel 161 according to the type of the touch event.
  • the touch panel 151 and the display panel 161 are used as two independent components to implement the input and input functions of the terminal device 100, but in some embodiments, the The touch panel 151 is integrated with the display panel 161 to realize the input and output functions of the terminal device 100.
  • the processor 130 is the control center of the terminal device 100, uses various interfaces and lines to connect various components, runs or executes software programs and/or modules stored in the memory 140, and calls The data in the memory 140 executes various functions of the terminal device 100 and processes data, thereby realizing various services based on the terminal device.
  • the processor 130 may include one or more processing units.
  • the processor 130 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 130.
  • the camera 170 is used for realizing the shooting function of the terminal device 100 and shooting pictures or videos.
  • the camera 170 can also be used to realize the scanning function of the terminal device 100 and scan the scanned object (two-dimensional code/barcode).
  • the terminal device 100 further includes a power source 120 (such as a battery) for supplying power to various components.
  • a power source 120 such as a battery
  • the power supply 120 may be logically connected to the processor 130 through a power management system, so that functions such as charging, discharging, and power consumption can be managed through the power management system.
  • the terminal device 100 may also include at least one sensor, an audio circuit, etc., which will not be repeated here.
  • short video sharing generally includes user shooting and editing works (step 201), terminal transcoding of video files (step 202), network uploading of video files (step 203), and server transcoding (step 204) and the five steps of video file distribution (step 205).
  • the three steps of terminal transcoding, video file uploading, and server transcoding are background processing processes that can be optimized.
  • FIG. 3 is a sequence diagram of a short video upload method.
  • the video processing flow of FIG. 3 may include the following steps 301 to 303.
  • Step 301 Terminal transcoding.
  • the terminal sequential transcoding of the video file to be processed in FIG. 3 generates video fragments CF1, CF2, CF3, CF4, and CF5.
  • step 302 is executed.
  • Step 302 File upload.
  • step 303 is continued.
  • Step 303 Transcoding on the server side.
  • the server When the server receives all the video segments of the video file to be processed, it starts to further transcode all the video segments of the video file to be processed on the server, for example, SF1, SF2, SF3, SF4, and SF5 in Figure 3 Fragmentation. After all the video segments of the video file to be processed are transcoded on the server side, the complete video file can be output and subsequent distribution processing can continue.
  • the present application provides a video processing method, which can realize the parallel processing of video file video segments in the above three steps, and save the time for the user's work to be successfully published.
  • This application explains the method separately from the terminal side and the server side.
  • the implementation on the terminal side is shown in Figure 4. The method includes:
  • Step 401 Encode the video to be processed, and generate multiple video segments one by one according to the encoding sequence
  • Video storage formats include fMP4 (Fragmented MP4, a file format). Unlike ordinary MP4 files, fMP4 allows video files to be organized in video fragments, and can be played in units of video fragments without waiting for the completion of the entire file processing, which solves the problem that MP4 cannot be streamed and played. At the same time, fMP4 also provides the possibility for parallel upload of short videos.
  • DASH Dynamic Adaptive Streaming over HTTP, HTTP-based dynamic adaptive streaming
  • HLS HTTP Live Streaming, HTTP-based streaming media network transmission
  • Step 402 After each video segment is obtained, after assigning a segment identifier to the video segment, upload the video segment and its corresponding segment identifier to the server, so that the server receives the After the video is segmented, the video segment is decoded according to the segment identifier of the video segment; wherein, the segment identifier is used to mark the sequence of generating multiple video segments;
  • the encoding performed on the terminal side (ie, terminal transcoding) and the upload of the video can be performed by two independent modules of the terminal.
  • the modules can communicate with each other.
  • the terminal first encodes the video to be processed, and generates multiple video segments one by one in the order of encoding; after each video segment is obtained, the message of the obtained video segment is output to the upload module, and the upload module detects this If a message is received, the upload of the video segment is immediately started. For example, when the encoding in the video file to be processed generates the first video segment, the information of the first video segment is output, and the upload module detects this information and immediately starts uploading the first video segment.
  • each video segment is assigned a segment identifier, where the segment identifier is used to mark the generation of multiple video segments.
  • the terminal receives the video segment and the corresponding segment identifier of the video segment, the terminal decodes each video segment according to the sequence identified in the segment identifier, thereby outputting the video file.
  • Step 403 In the process of uploading each video segment, if the encoding for the to-be-processed video is not finished, continue to encode the to-be-processed video at the same time to obtain the next video segment.
  • the terminal when starting the process of uploading video segments, the terminal does not pause the encoding and uploading of the video segments to be processed one by one. Therefore, for the same video to be processed as a whole, the encoding and uploading of the video to be processed It can be performed in parallel; for example, during the uploading process of the first video segment, the second video segment can be generated by encoding in parallel. Therefore, the uploading of the first video segment and the encoding of the second video segment are performed in parallel Processed, that is, after each encoded video segment is obtained, the upload of the video segment can be started.
  • the encoding of the video segment is executed one by one in serial, and does not affect the parallel processing of the video segments generated by each encoding Upload.
  • each video segment is an independent pipeline processing line, and after each video segment is encoded, the upload of the video segment can be started.
  • the first video segment is in the process of uploading, and at the same time, the terminal encodes the video to be processed to generate the second video segment. In this implementation manner, it is possible to save the time for uploading video fragments until the terminal obtains all the video fragments by encoding the entire to-be-processed video.
  • the video segments generated one by one are output to a file, and the offset of each video segment in the one file is recorded . Therefore, according to the offset of the video segment in the one file, the data corresponding to the video segment can be read from the one file according to the offset of the video segment; and the video can be uploaded The data of the fragments and the fragment identification are sent to the server.
  • each video segment is obtained, a corresponding video segment file is created for each video segment, and the storage address of each video segment file is recorded. Therefore, it is also possible to read the data of each video segment according to the storage address of the video segment file of each video segment; upload each video segment and the corresponding segment identifier to the server.
  • uploading the data corresponding to the video segment to the server needs to be implemented through an upload task. Therefore, every time a video segment is obtained, an upload task for the video segment is created. Wherein, when there are multiple upload tasks, the fragments corresponding to each upload task can be uploaded to the server at the same time. Through this method, the parallel execution of upload tasks of multiple video segments can be realized, thus saving the waiting time for uploading of each video segment.
  • a notification of the completion of the video upload is output. At this time, the upload process for the video segment has ended.
  • the method includes:
  • Step 501 Receive each video segment of the to-be-processed video uploaded by the terminal and the segment identifier corresponding to each video segment;
  • Step 502 Decode each video segment according to the segment identifier
  • Step 503 In the process of decoding each video segment, if there is an upload of the next video segment, simultaneously receive the next video segment.
  • each time the server receives a video segment it can start to decode the video segment, but you need to pay attention to the transcoding output as a file, so the server's decoding needs to be performed serially, so it needs to be maintained
  • the video frame information of the video segments can be obtained after decoding, and the decoded video segments can also be sorted according to the video frame information to obtain the entire complete video file.
  • the waiting time of each segment when performing serial processing in the related technology can be saved, and thus the time for the user to wait for the upload of the work can be saved.
  • FIG. 6 is a sequence diagram of a video processing method provided by this embodiment of the present application.
  • Figure 6 includes three main processes: terminal transcoding, uploading, and server transcoding. It can be seen that when the terminal transcodes the first video segment CF1 in the figure, the upload module of the first video segment UF1 starts immediately. During the upload of the first video segment UF1, the terminal transfers The second video segment CF2 obtained by transcoding the to-be-processed video one by one in the code is also being executed in parallel. Subsequently, when the transcoding of the second video segment CF2 in the transcoding stage of the terminal ends, the uploading of the second video segment UF2 is immediately started in the upload module. Among them, the transcoding of the terminal is a process of generating multiple video segments one by one according to the encoding sequence of the video to be processed.
  • the video to be processed is encoded to generate video segments one by one, but in the upload stage, each video segment has a different upload duration due to network, file size, etc. If the upload of the previous video segment has not been completed, and the next video segment has been transcoded at the terminal at this time, multiple video segments obtained after transcoding can be uploaded in parallel. For example, in Figure 6 for the upload of video segments UF3, UF4, and UF5, the upload of the video segment UF3 has not been completed, but the terminal has been transcoded to obtain the video segment CF4. At this time, for the video segment UF3 and The upload of the video segment UF4 can be executed in parallel in the upload module.
  • the upload of the video segment UF4 has not been completed, but the terminal has been transcoded to obtain the video segment CF5.
  • the upload of the video segments UF4 and UF5 can be performed in parallel. This method can be implemented through multiple uploads Mission accomplished.
  • the transcoding on the server side is performed serially.
  • the server-side transcoding of video segments starts after the upload of each video segment is completed.
  • the video segment SF1 on the server side in the figure starts transcoding on the server side as soon as it receives the upload of the video segment UF1.
  • the transcoding of the video segment SF2 is continued.
  • the transcoding of video segment SF5 ends, then the complete video file can be output and the subsequent video file distribution operation can be continued.
  • FIG. 7 is a schematic structural diagram of a video processing terminal device in an embodiment of the application.
  • the device includes: a first encoding module 701, an uploading module 702, and a second encoding module 703.
  • the first encoding module 701 is configured to perform encoding of the to-be-processed video, and generate multiple video segments one by one according to the encoding sequence;
  • the uploading module 702 is configured to perform every time a video segment is obtained, after assigning a segment identifier to the video segment, upload the video segment and its corresponding segment identifier to the server, so that the server After receiving the video segment, decode the video segment according to the segment identifier of the video segment; wherein, the segment identifier is used to mark the sequence of generating multiple video segments;
  • the second encoding module 703 is configured to perform the process of uploading each video segment, if the encoding for the to-be-processed video is not finished, at the same time continue to encode the to-be-processed video to obtain the next video segment .
  • the apparatus further includes:
  • the output module is configured to output the video segments generated one by one to a file, and record the offset of each video segment in the one file;
  • the upload module 702 is configured to execute:
  • the apparatus further includes:
  • the file creation module is configured to execute after each video segment is obtained, a corresponding video segment file is created for each video segment, and the storage address of each video segment file is recorded;
  • the upload module 702 is configured to execute:
  • the upload module 702 is configured to execute:
  • the segments corresponding to each upload task are uploaded to the server at the same time.
  • the apparatus further includes:
  • the notification module is configured to output a notification that the video upload is completed if it is determined that the upload of each video segment of the video is completed.
  • FIG. 8 is a schematic structural diagram of a video processing server device in an embodiment of the application.
  • the device includes: a first receiving module 801, a decoding module 802, and a second receiving module 803.
  • the first receiving module 801 is configured to receive each video segment of the to-be-processed video uploaded by the terminal and the segment identifier corresponding to each video segment;
  • the decoding module 802 is configured to perform decoding of each video segment according to the segment identifier
  • the second receiving module 803 is configured to perform, in the process of decoding each video segment, if there is an upload of the next video segment, simultaneously receive the next video segment.
  • the first receiving module 801 is configured to execute:
  • the decoding module is configured to execute:
  • the video segments are decoded in sequence according to the segment identifiers.
  • the apparatus further includes:
  • the sorting module is configured to perform the sorting of the video frames obtained by decoding each video segment according to the segment identifiers.
  • the electronic device may at least include at least one processor and at least one memory.
  • the memory stores a program code
  • the processor executes the steps in the image processing method according to various exemplary embodiments of the application described above in this specification.
  • the processor may execute step 401 to step 403 shown in FIG. 4 and step 501 to step 503 shown in FIG. 5.
  • the electronic device 130 according to this embodiment of the present application will be described below with reference to FIG. 9.
  • the electronic device 130 shown in FIG. 9 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present application.
  • the electronic device 130 is represented in the form of a general-purpose computing device.
  • the components of the electronic device 130 may include, but are not limited to: the aforementioned at least one processor 131, the aforementioned at least one memory 132, and a bus 133 connecting different system components (including the memory 132 and the processor 131).
  • the bus 133 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a processor, or a local bus using any bus structure among multiple bus structures.
  • the memory 132 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1321 and/or a cache memory 1322, and may further include a read-only memory (ROM) 1323.
  • RAM random access memory
  • ROM read-only memory
  • the memory 132 may also include a program/utility tool 1325 having a set of (at least one) program modules 1324.
  • program modules 1324 include but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each of the examples or some combination may include the realization of a network environment.
  • the electronic device 130 may also communicate with one or more external devices 134 (such as keyboards, pointing devices, etc.), and may also communicate with one or more devices that enable the target object to interact with the electronic device 130, and/or communicate with the
  • the electronic device 130 can communicate with any device (such as a router, a modem, etc.) that communicates with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 135.
  • the computing device 130 may also communicate with one or more networks (for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 136.
  • networks for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet
  • the network adapter 136 communicates with other modules for the electronic device 130 through the bus 133. It should be understood that although not shown in the figure, other hardware and/or software modules can be used in conjunction with the electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
  • various aspects of the video processing method provided in this application can also be implemented in the form of a program product, which includes program code.
  • the program product runs on a computer device
  • the program code is used to make the computer
  • the device executes the steps in the image processing method according to various exemplary embodiments of the application described above in this specification.
  • the computer device can execute steps 401 to 403 shown in FIG. 4 and the steps shown in FIG. 5 501-Step 503.
  • the program product can adopt any combination of one or more readable media.
  • the readable medium may be a readable signal medium or a readable storage medium.
  • the readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Type 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 of the above.
  • the program product for video processing of the embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a computing device.
  • CD-ROM portable compact disk read-only memory
  • the program product of this application is not limited to this.
  • the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, device, or device.
  • the readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and readable program code is carried therein. This propagated data signal can take many forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with the instruction execution system, apparatus, or device.
  • the program code contained on the readable medium can be transmitted by any suitable medium, including, but not limited to, wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
  • the program code for performing the operations of this application can be written in any combination of one or more programming languages.
  • Programming languages include object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural programming. Language-such as "C" language or similar programming language.
  • the program code can be executed entirely on the target computing device, partly executed on the target target device, executed as an independent software package, partly executed on the target computing device and partly executed on the remote computing device, or completely executed on the remote computing device Execute on the device or server.
  • the remote computing device can be connected to the target electronic device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using the Internet)
  • LAN local area network
  • WAN wide area network
  • the service provider comes to connect via the Internet).
  • this application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device, so The instruction device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.

Abstract

The present application relates to a video processing method and apparatus, an electronic device and a storage medium, and relates to the technical field of multimedia information processing. The video processing method comprises: encoding a video to be processed, and generating a plurality of video fragments one by one according to an encoding sequence; when each video fragment is obtained, and after a fragment identifier is allocated to the video fragment, uploading the video fragment and the corresponding fragment identifier to a serving end, so as to enable the serving end to decode the video fragment according to the fragment identifier of the video fragment after receiving the video fragment, wherein the fragment identifier is used for marking the sequence of generating a plurality of video fragments; and in the process of uploading each video fragment, if the encoding for the video to be processed is not finished, continuously encoding the video to be processed to obtain the next video fragment. Through the uploading of the method, most of the time for uploading and decoding by the serving end is saved, and therefore, the overall time consumption is markedly reduced.

Description

视频处理方法、装置、电子设备及存储介质Video processing method, device, electronic equipment and storage medium
相关申请的交叉引用Cross-references to related applications
本申请要求在2019年09月20日提交中国专利局、申请号为201910894816.6、发明名称为“视频处理方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on September 20, 2019, the application number is 201910894816.6, and the invention title is "video processing methods, devices, electronic equipment and storage media", the entire contents of which are incorporated by reference In this application.
技术领域Technical field
本申请涉及多媒体信息处理技术领域,特别涉及一种视频处理方法、装置、电子设备及存储介质。This application relates to the technical field of multimedia information processing, and in particular to a video processing method, device, electronic equipment, and storage medium.
背景技术Background technique
视频上传是短视频分享类软件最核心的功能,缩短视频上传的耗时以及上传完成后分发给用户的延迟,将大大提升作者的内容生产体验。而视频上传分享的耗时受到终端视频转码速度、转码后文件大小、上行网络带宽、服务端转码耗时等多个流程限制,存在较大的优化空间。Video upload is the core function of short video sharing software. It shortens the time-consuming video upload and the delay in distributing to users after uploading, which will greatly enhance the author's content production experience. The time consumption of video uploading and sharing is limited by multiple processes such as terminal video transcoding speed, transcoding file size, uplink network bandwidth, and server transcoding time consumption, and there is a large room for optimization.
短视频分享一般包括用户拍摄和编辑作品、视频文件终端转码、视频文件网络上传、服务端转码以及视频文件分发五个步骤。其中除用户拍摄和编辑作品属于用户主动行为,终端转码和上传都需要用户等待完成,否则可能出现软件在服务端被限制运行或被系统杀死从而造成上传失败,服务端转码则可以异步进行,待完成后再通过CDN(Content Delivery Network,内容分发网络)进行分发。一般来说,用户通过终端编辑完成后,首先原始文件需要经过编辑模块进行转码和压缩,生成体积较小便于上传的视频文件,然后调用网络接口将文件上传到服务端。服务端接收到文件,调用转码服务对视频进行进一步处理(如进一步压缩大小,转多路不同码率文件等)之后进行分发。Short video sharing generally includes five steps: user shooting and editing works, video file terminal transcoding, video file network upload, server transcoding, and video file distribution. In addition to the user’s initiative to shoot and edit works, terminal transcoding and uploading require the user to wait for completion. Otherwise, the software may be restricted from running on the server or killed by the system, causing the upload to fail. The server transcoding can be asynchronous. Proceed, and then distribute through CDN (Content Delivery Network) after completion. Generally speaking, after the user finishes editing through the terminal, the original file first needs to be transcoded and compressed by the editing module to generate a small video file that is easy to upload, and then call the network interface to upload the file to the server. The server receives the file, calls the transcoding service to further process the video (such as further compressing the size, transferring multiple files with different bitrates, etc.) before distributing it.
发明人发现:相关技术中,在提高转码、上传速度各方面均进行了优化, 但发明人发现业界转码、传输的速度优化均已达到了相对瓶颈,优化空间有限。The inventor found that related technologies have been optimized in terms of improving transcoding and uploading speed, but the inventor found that the industry's transcoding and transmission speed optimization has reached a relative bottleneck, and the optimization space is limited.
发明内容Summary of the invention
本申请提供了一种视频处理方法、装置、电子设备及存储介质,用以至少解决相关技术中,针对转码、传输的速度优化已达到了相对瓶颈的问题,提出的一种使视频文件以视频分片的形式在客户端转码、上传、服务端转码三个阶段可整体实现高度并行进行上传的视频处理方法,该方法极大的节省用户的视频作品成功发布所需要的时间。This application provides a video processing method, device, electronic equipment, and storage medium to at least solve the problem that the speed optimization of transcoding and transmission has reached a relative bottleneck in related technologies. The form of video fragmentation can realize a highly parallel uploading video processing method in the three stages of client-side transcoding, uploading, and server-side transcoding. This method greatly saves the time required for the successful publication of users' video works.
根据本申请实施例的第一方面,提供一种视频处理方法,包括:According to a first aspect of the embodiments of the present application, a video processing method is provided, including:
对待处理视频进行编码,按编码先后顺序逐一生成多个视频分片;Encode the video to be processed, and generate multiple video segments one by one according to the encoding sequence;
每得到一个视频分片,为所述视频分片分配分片标识后,上传所述视频分片及其对应的分片标识到服务端,以使所述服务端在接收到所述视频分片后根据所述视频分片的分片标识对所述视频分片进行解码;其中,所述分片标识用于标记生成多个视频分片的前后顺序;Each time a video segment is obtained, after assigning a segment identifier to the video segment, upload the video segment and its corresponding segment identifier to the server, so that the server receives the video segment Then decode the video segment according to the segment identifier of the video segment; wherein, the segment identifier is used to mark the sequence of generating multiple video segments;
上传每个视频分片的过程中,若针对所述待处理视频的编码未结束,则同时对所述待处理视频继续进行编码以得到下一视频分片。In the process of uploading each video segment, if the encoding of the to-be-processed video is not completed, the encoding of the to-be-processed video is continued at the same time to obtain the next video segment.
根据本申请实施例的第二方面,提供一种视频处理方法,包括:According to a second aspect of the embodiments of the present application, a video processing method is provided, including:
接收终端上传的待处理视频的各视频分片以及各视频分片对应的分片标识;Receiving each video segment of the to-be-processed video uploaded by the terminal and the segment identifier corresponding to each video segment;
依据分片标识,对各视频分片进行解码;According to the segment identifier, decode each video segment;
在对各视频分片进行解码的过程中,若存在下一视频分片的上传,则同时进行对所述下一视频分片的接收。In the process of decoding each video segment, if there is an upload of the next video segment, the next video segment is received at the same time.
根据本申请实施例的第三方面,提供一种视频处理装置,包括:According to a third aspect of the embodiments of the present application, a video processing device is provided, including:
第一编码模块,被配置为执行对待处理视频进行编码,按编码先后顺序逐一生成多个视频分片;The first encoding module is configured to perform encoding of the video to be processed, and generate multiple video segments one by one according to the encoding sequence;
上传模块,被配置为执行每得到一个视频分片,为所述视频分片分配分 片标识后,上传所述视频分片及其对应的分片标识到服务端,以使所述服务端在接收到所述视频分片后根据所述视频分片的分片标识对所述视频分片进行解码;其中,所述分片标识用于标记生成多个视频分片的前后顺序;The uploading module is configured to execute each time a video segment is obtained, after assigning a segment identifier to the video segment, upload the video segment and its corresponding segment identifier to the server, so that the server is After receiving the video segment, decode the video segment according to the segment identifier of the video segment; wherein, the segment identifier is used to mark the sequence of generating multiple video segments;
第二编码模块,被配置为执行上传每个视频分片的过程中,若针对所述待处理视频的编码未结束,则同时对所述待处理视频继续进行编码以得到下一视频分片。The second encoding module is configured to perform the process of uploading each video segment, if the encoding for the to-be-processed video is not finished, at the same time continue to encode the to-be-processed video to obtain the next video segment.
根据本申请实施例的第四方面,提供一种视频处理装置,包括:According to a fourth aspect of the embodiments of the present application, a video processing device is provided, including:
第一接收模块,被配置为执行接收终端上传的待处理视频的各视频分片以及各视频分片对应的分片标识;The first receiving module is configured to receive each video segment of the to-be-processed video uploaded by the terminal and the segment identifier corresponding to each video segment;
解码模块,被配置为执行依据分片标识,对各视频分片进行解码;The decoding module is configured to perform decoding of each video segment according to the segment identifier;
第二接收模块,被配置为执行在对各视频分片进行解码的过程中,若存在下一视频分片的上传,则同时进行对所述下一视频分片的接收。The second receiving module is configured to perform, in the process of decoding each video segment, if there is an upload of the next video segment, simultaneously receive the next video segment.
根据本申请实施例的第五方面,提供一种电子设备,包括:According to a fifth aspect of the embodiments of the present application, an electronic device is provided, including:
存储器,用于存储计算机程序,以及执行所述计算机程序产生的候选中间数据以及结果数据;A memory for storing computer programs, candidate intermediate data and result data generated by executing the computer programs;
处理器,用于:Processor for:
对待处理视频进行编码,按编码先后顺序逐一生成多个视频分片;Encode the video to be processed, and generate multiple video segments one by one according to the encoding sequence;
每得到一个视频分片,为所述视频分片分配分片标识后,上传所述视频分片及其对应的分片标识到服务端,以使所述服务端在接收到所述视频分片后根据所述视频分片的分片标识对所述视频分片进行解码;其中,所述分片标识用于标记生成多个视频分片的前后顺序;Each time a video segment is obtained, after assigning a segment identifier to the video segment, upload the video segment and its corresponding segment identifier to the server, so that the server receives the video segment Then decode the video segment according to the segment identifier of the video segment; wherein, the segment identifier is used to mark the sequence of generating multiple video segments;
上传每个视频分片的过程中,若针对所述待处理视频的编码未结束,则同时对所述待处理视频继续进行编码以得到下一视频分片。In the process of uploading each video segment, if the encoding of the to-be-processed video is not completed, the encoding of the to-be-processed video is continued at the same time to obtain the next video segment.
根据本申请实施例的第六方面,提供一种计算机存储介质,所述计算机存储介质存储有计算机可执行指令,所述计算机可执行指令用于执行如本申请实施例提供的任一所述视频处理方法。According to a sixth aspect of the embodiments of the present application, a computer storage medium is provided, the computer storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute any video provided in the embodiments of the present application. Approach.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理,并不构成对本申请的不当限定。The drawings here are incorporated into the specification and constitute a part of the specification, show embodiments conforming to the application, and together with the specification are used to explain the principle of the application, and do not constitute an improper limitation of the application.
图1为本申请实施例提供的一种终端设备的结构图;FIG. 1 is a structural diagram of a terminal device provided by an embodiment of this application;
图2为本申请实施例提供的视频串行上传方法的流程示意图;2 is a schematic flowchart of a video serial upload method provided by an embodiment of the application;
图3为本申请实施例提供的视频串行上传方法的时序图;FIG. 3 is a sequence diagram of a video serial upload method provided by an embodiment of the application;
图4为本申请实施例提供的一种视频处理方法的终端侧的流程示意图;4 is a schematic flowchart of a terminal side of a video processing method provided by an embodiment of this application;
图5为本申请实施例提供的一种视频处理方法的服务端侧的流程示意图;FIG. 5 is a schematic flowchart of a server side of a video processing method provided by an embodiment of this application;
图6为本申请实施例提供的一种视频处理方法的时序图;FIG. 6 is a sequence diagram of a video processing method provided by an embodiment of this application;
图7为本申请实施例提供的一种视频处理装置的终端侧的结构示意图;FIG. 7 is a schematic structural diagram of a terminal side of a video processing device provided by an embodiment of the application;
图8为本申请实施例提供的一种视频处理装置的服务端侧的结构示意图;FIG. 8 is a schematic structural diagram of a server side of a video processing device provided by an embodiment of this application;
图9为本申请实施例提供的电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
具体实施方式detailed description
为了使本领域普通人员更好地理解本申请的技术方案,下面将结合附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to enable those of ordinary skill in the art to better understand the technical solutions of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings.
本申请实施例涉及的终端设备,又可以称为用户设备(user equipment,UE)。终端设备可以是智能手机、平板电脑、各类可穿戴设备、车载设备等。终端设备中可以安装各种应用程序,比如社交软件、地图等。The terminal equipment involved in the embodiments of the present application may also be referred to as user equipment (UE). Terminal devices can be smart phones, tablet computers, various wearable devices, vehicle-mounted devices, and so on. Various applications, such as social software, maps, etc., can be installed in the terminal device.
本申请实施例涉及的多个,是指大于或等于两个。The multiple mentioned in the embodiments of the present application refer to greater than or equal to two.
本申请实施例提供了一种视频处理方法及终端设备,该方法适用于终端设备中。图1示出了一种可能的终端设备的结构图。参阅图1所示,所述终端设备100包括:射频(Radio Frequency,RF)电路110、电源120、处理器130、存储器140、输入单元150、显示单元160、摄像头170、通信接口180、以及无线保真(Wireless Fidelity,WiFi)模块190等部件。本领域技术人员可以理解,图1中示出的终端设备的结构并不构成对终端设备的限定,本申请实 施例提供的终端设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。The embodiments of the present application provide a video processing method and terminal equipment, and the method is suitable for terminal equipment. Figure 1 shows a structural diagram of a possible terminal device. 1, the terminal device 100 includes: a radio frequency (RF) circuit 110, a power supply 120, a processor 130, a memory 140, an input unit 150, a display unit 160, a camera 170, a communication interface 180, and a wireless Components such as a wireless fidelity (Wireless Fidelity, WiFi) module 190. Those skilled in the art can understand that the structure of the terminal device shown in FIG. 1 does not constitute a limitation on the terminal device. The terminal device provided by the embodiment of the present application may include more or less components than those shown in the figure, or a combination of certain components. Some components, or different component arrangements.
下面结合图1对所述终端设备100的各个构成部件进行具体的介绍:Hereinafter, each component of the terminal device 100 will be specifically introduced with reference to FIG. 1:
所述RF电路110可用于通信或通话过程中,数据的接收和发送。特别地,所述RF电路110在接收到基站的下行数据后,发送给所述处理器130处理;另外,将待发送的上行数据发送给基站。通常,所述RF电路110包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。The RF circuit 110 can be used to receive and send data during a communication or call. In particular, after the RF circuit 110 receives the downlink data from the base station, it sends it to the processor 130 for processing; in addition, it sends the uplink data to be sent to the base station. Generally, the RF circuit 110 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, and the like.
此外,RF电路110还可以通过无线通信与网络和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE)、电子邮件、短消息服务(Short Messaging Service,SMS)等。In addition, the RF circuit 110 may also communicate with the network and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile Communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division Multiple Access). Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), Email, Short Messaging Service (SMS), etc.
WiFi技术属于短距离无线传输技术,所述终端设备100通过WiFi模块190可以连接接入点(Access Point,AP),从而实现数据网络的访问。所述WiFi模块190可用于通信过程中,数据的接收和发送。The WiFi technology is a short-range wireless transmission technology. The terminal device 100 can be connected to an access point (AP) through the WiFi module 190, so as to achieve data network access. The WiFi module 190 can be used to receive and send data in the communication process.
所述终端设备100可以通过所述通信接口180与其他设备实现物理连接。在一个实施例中,所述通信接口180与所述其他设备的通信接口通过电缆连接,实现所述终端设备100和其他设备之间的数据传输。The terminal device 100 may be physically connected with other devices through the communication interface 180. In one embodiment, the communication interface 180 and the communication interface of the other device are connected by a cable to realize data transmission between the terminal device 100 and the other device.
由于在本申请实施例中,所述终端设备100能够实现通信业务,向其他联系人发送信息,因此所述终端设备100需要具有数据传输功能,即所述终端设备100内部需要包含通信模块。虽然图1示出了所述RF电路110、所述WiFi模块190、和所述通信接口180等通信模块,但是可以理解的是,所述终端设备100中存在上述部件中的至少一个或者其他用于实现通信的通信模块(如蓝牙模块),以进行数据传输。Since in the embodiment of the present application, the terminal device 100 can implement communication services and send information to other contacts, the terminal device 100 needs to have a data transmission function, that is, the terminal device 100 needs to include a communication module inside. Although FIG. 1 shows communication modules such as the RF circuit 110, the WiFi module 190, and the communication interface 180, it is understandable that there are at least one of the above-mentioned components or other functions in the terminal device 100. A communication module (such as a Bluetooth module) for realizing communication for data transmission.
例如,当所述终端设备100为手机时,所述终端设备100可以包含所述RF电路110,还可以包含所述WiFi模块190;当所述终端设备100为计算机时,所述终端设备100可以包含所述通信接口180,还可以包含所述WiFi模块190;当所述终端设备100为平板电脑时,所述终端设备100可以包含所述WiFi模块。For example, when the terminal device 100 is a mobile phone, the terminal device 100 may include the RF circuit 110 and may also include the WiFi module 190; when the terminal device 100 is a computer, the terminal device 100 may The communication interface 180 may be included, and the WiFi module 190 may also be included; when the terminal device 100 is a tablet computer, the terminal device 100 may include the WiFi module.
所述存储器140可用于存储软件程序以及模块。所述处理器130通过运行存储在所述存储器140的软件程序以及模块,从而执行所述终端设备100的各种功能应用以及数据处理。The memory 140 can be used to store software programs and modules. The processor 130 executes various functional applications and data processing of the terminal device 100 by running software programs and modules stored in the memory 140.
在一个实施例中,所述存储器140可以主要包括存储程序区和存储数据区。其中,存储程序区可存储操作系统、各种应用程序(比如通信应用)以及人脸识别模块等;存储数据区可存储根据所述终端设备的使用所创建的数据(比如各种图片、视频文件等多媒体文件,以及人脸信息模板)等。In an embodiment, the memory 140 may mainly include a program storage area and a data storage area. Among them, the storage program area can store operating systems, various application programs (such as communication applications), and face recognition modules, etc.; the storage data area can store data created based on the use of the terminal device (such as various pictures and video files). And other multimedia files, as well as face information templates) and so on.
此外,所述存储器140可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。In addition, the memory 140 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
所述输入单元150可用于接收用户输入的数字或字符信息,以及产生与所述终端设备100的用户设置以及功能控制有关的键信号输入。The input unit 150 may be used to receive numeric or character information input by the user, and generate key signal input related to user settings and function control of the terminal device 100.
在一个实施例中,输入单元150可包括触控面板151以及其他输入设备152。In one embodiment, the input unit 150 may include a touch panel 151 and other input devices 152.
其中,所述触控面板151,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在所述触控面板151上或在所述触控面板151附近的操作),并根据预先设定的程式驱动相应的连接装置。在一个实施例中,所述触控面板151可以包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给所述处理器130,并能接收所述处理器130发来的命令并加以执行。此外,可以采用电阻式、电容式、 红外线以及表面声波等多种类型实现所述触控面板151。Wherein, the touch panel 151, also called a touch screen, can collect user touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on or on the touch panel 151. The operation near the touch panel 151), and drive the corresponding connection device according to the preset program. In one embodiment, the touch panel 151 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 130, and can receive and execute the commands sent by the processor 130. In addition, the touch panel 151 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave.
在一个实施例中,所述其他输入设备152可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。In an embodiment, the other input device 152 may include, but is not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, joystick, and the like.
所述显示单元160可用于显示由用户输入的信息或提供给用户的信息以及所述终端设备100的各种菜单。所述显示单元160即为所述终端设备100的显示系统,用于呈现界面,实现人机交互。The display unit 160 may be used to display information input by the user or information provided to the user and various menus of the terminal device 100. The display unit 160 is the display system of the terminal device 100, and is used to present an interface and realize human-computer interaction.
所述显示单元160可以包括显示面板161。在一个实施例中,所述显示面板161可以采用液晶显示屏(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置。The display unit 160 may include a display panel 161. In one embodiment, the display panel 161 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light emitting diode (Organic Light-Emitting Diode, OLED), etc.
进一步的,所述触控面板151可覆盖所述显示面板161,当所述触控面板151检测到在其上或附近的触摸操作后,传送给所述处理器130以确定触摸事件的类型,随后所述处理器130根据触摸事件的类型在所述显示面板161上提供相应的视觉输出。Further, the touch panel 151 can cover the display panel 161, and when the touch panel 151 detects a touch operation on or near it, it is transmitted to the processor 130 to determine the type of touch event, Then the processor 130 provides corresponding visual output on the display panel 161 according to the type of the touch event.
虽然在图1中,所述触控面板151与所述显示面板161是作为两个独立的部件来实现所述终端设备100的输入和输入功能,但是在某些实施例中,可以将所述触控面板151与所述显示面板161集成而实现所述终端设备100的输入和输出功能。Although in FIG. 1, the touch panel 151 and the display panel 161 are used as two independent components to implement the input and input functions of the terminal device 100, but in some embodiments, the The touch panel 151 is integrated with the display panel 161 to realize the input and output functions of the terminal device 100.
所述处理器130是所述终端设备100的控制中心,利用各种接口和线路连接各个部件,通过运行或执行存储在所述存储器140内的软件程序和/或模块,以及调用存储在所述存储器140内的数据,执行所述终端设备100的各种功能和处理数据,从而实现基于所述终端设备的多种业务。The processor 130 is the control center of the terminal device 100, uses various interfaces and lines to connect various components, runs or executes software programs and/or modules stored in the memory 140, and calls The data in the memory 140 executes various functions of the terminal device 100 and processes data, thereby realizing various services based on the terminal device.
在一个实施例中,所述处理器130可包括一个或多个处理单元。在一个实施例中,所述处理器130可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到所述处理器130中。In an embodiment, the processor 130 may include one or more processing units. In an embodiment, the processor 130 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 130.
所述摄像头170,用于实现所述终端设备100的拍摄功能,拍摄图片或视频。所述摄像头170还可以用于实现终端设备100的扫描功能,对扫描对象(二维码/条形码)进行扫描。The camera 170 is used for realizing the shooting function of the terminal device 100 and shooting pictures or videos. The camera 170 can also be used to realize the scanning function of the terminal device 100 and scan the scanned object (two-dimensional code/barcode).
所述终端设备100还包括用于给各个部件供电的电源120(比如电池)。在一个实施例中,所述电源120可以通过电源管理系统与所述处理器130逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗等功能。The terminal device 100 further includes a power source 120 (such as a battery) for supplying power to various components. In one embodiment, the power supply 120 may be logically connected to the processor 130 through a power management system, so that functions such as charging, discharging, and power consumption can be managed through the power management system.
尽管未示出,所述终端设备100还可以包括至少一种传感器、音频电路等,在此不再赘述。Although not shown, the terminal device 100 may also include at least one sensor, an audio circuit, etc., which will not be repeated here.
在一个实施例中,参阅图2,短视频分享一般包括用户拍摄和编辑作品(步骤201)、视频文件终端转码(步骤202)、视频文件网络上传(步骤203)、服务端转码(步骤204)以及视频文件分发(步骤205)五个步骤。其中,终端转码、视频文件上传、服务端转码三个步骤是后台的处理过程,可进行优化。In one embodiment, referring to Figure 2, short video sharing generally includes user shooting and editing works (step 201), terminal transcoding of video files (step 202), network uploading of video files (step 203), and server transcoding (step 204) and the five steps of video file distribution (step 205). Among them, the three steps of terminal transcoding, video file uploading, and server transcoding are background processing processes that can be optimized.
目前,相关技术中一般实现终端转码、视频文件上传、服务端转码各阶段性能的优化均已达到了相对瓶颈,优化空间有限。参阅图3,为短视频上传方法的时序图,图3的视频处理流程可包括如下步骤301至步骤303的内容。At present, in related technologies, the performance optimization of terminal transcoding, video file upload, and server transcoding generally has reached a relative bottleneck, and the optimization space is limited. Refer to FIG. 3, which is a sequence diagram of a short video upload method. The video processing flow of FIG. 3 may include the following steps 301 to 303.
步骤301:终端转码。Step 301: Terminal transcoding.
用户在拍摄并编辑完作品后,首先要进行的是在终端的转码,例如图3中的对于待处理视频文件进行终端顺序转码,生成视频分片CF1、CF2、CF3、CF4以及CF5。当得到全部的视频分片后,执行步骤302。After the user finishes shooting and editing the work, the first thing to do is transcoding at the terminal. For example, the terminal sequential transcoding of the video file to be processed in FIG. 3 generates video fragments CF1, CF2, CF3, CF4, and CF5. When all the video segments are obtained, step 302 is executed.
步骤302:文件上传。Step 302: File upload.
当得到全部完成转码的视频分片后,开始对待处理视频文件转码完成的视频分片进行整体上传,例如图3中UF1、UF2、UF3、UF4以及UF5各视频分片。当待处理视频文件的全部视频分片上传完成后,继续执行步骤303。After all the video segments that have been transcoded are obtained, the video segments that have been transcoded for the video file to be processed are uploaded as a whole, such as the video segments of UF1, UF2, UF3, UF4, and UF5 in FIG. 3. When all the video segments of the to-be-processed video file are uploaded, step 303 is continued.
步骤303:服务端转码。Step 303: Transcoding on the server side.
当服务端接收到待处理视频文件的全部视频分片后,开始在服务端对于待处理视频文件的全部视频分片进行进一步转码,例如图3中SF1、SF2、SF3、SF4以及SF5各视频分片。当待处理视频文件的全部视频分片在服务端转码完 成后,即可输出完整的视频文件并继续进行后续分发的处理。When the server receives all the video segments of the video file to be processed, it starts to further transcode all the video segments of the video file to be processed on the server, for example, SF1, SF2, SF3, SF4, and SF5 in Figure 3 Fragmentation. After all the video segments of the video file to be processed are transcoded on the server side, the complete video file can be output and subsequent distribution processing can continue.
有鉴于此,本申请提供了一种视频处理方法,该方法可实现上述三个步骤中对于视频文件视频分片的并行处理,节省了用户的作品成功发布的时间。本申请从终端侧和服务端侧分别对该方法进行解释,首先在终端侧方面的实施如图4所示,该方法包括:In view of this, the present application provides a video processing method, which can realize the parallel processing of video file video segments in the above three steps, and save the time for the user's work to be successfully published. This application explains the method separately from the terminal side and the server side. First of all, the implementation on the terminal side is shown in Figure 4. The method includes:
步骤401:对待处理视频进行编码,按编码先后顺序逐一生成多个视频分片;Step 401: Encode the video to be processed, and generate multiple video segments one by one according to the encoding sequence;
其中,在流媒体传输领域,如视频点播常用的DASH(Dynamic Adaptive Streaming over HTTP,基于HTTP的动态自适应流)以及HLS(HTTP Live Streaming,基于HTTP的流媒体网络传输)协议,短视频常用的视频存储的格式有fMP4(Fragmented MP4,一种文件格式)。与普通MP4文件不同的是,fMP4允许以视频分片方式组织视频文件,无需等待整个文件处理完成就能以视频分片为单位进行播放,解决了MP4不能流式传输播放的问题。同时fMP4也为短视频的并行上传提供了可能性。Among them, in the field of streaming media transmission, such as the commonly used DASH (Dynamic Adaptive Streaming over HTTP, HTTP-based dynamic adaptive streaming) and HLS (HTTP Live Streaming, HTTP-based streaming media network transmission) protocols commonly used in video on demand, short videos are commonly used Video storage formats include fMP4 (Fragmented MP4, a file format). Unlike ordinary MP4 files, fMP4 allows video files to be organized in video fragments, and can be played in units of video fragments without waiting for the completion of the entire file processing, which solves the problem that MP4 cannot be streamed and played. At the same time, fMP4 also provides the possibility for parallel upload of short videos.
步骤402:每得到一个视频分片,为所述视频分片分配分片标识后,上传所述视频分片及其对应的分片标识到服务端,以使所述服务端在接收到所述视频分片后根据所述视频分片的分片标识对所述视频分片进行解码;其中,所述分片标识用于标记生成多个视频分片的前后顺序;Step 402: After each video segment is obtained, after assigning a segment identifier to the video segment, upload the video segment and its corresponding segment identifier to the server, so that the server receives the After the video is segmented, the video segment is decoded according to the segment identifier of the video segment; wherein, the segment identifier is used to mark the sequence of generating multiple video segments;
在一个实施例中,终端侧执行的编码(即终端转码)和视频的上传可以由终端两个独立的模块分别进行。各模块之间可以相互通信。用户完成视频编辑后,终端首先对待处理视频进行编码,按编码先后顺序逐一生成多个视频分片;每得到一个视频分片后,输出得到视频分片的消息给上传模块,上传模块监测到这一消息,则立即启动对于该视频分片的上传。例如,当待处理视频文件中的编码生成第一个视频分片后,输出得到第一视频分片的信息,上传模块检测到这一信息,则立刻启动对于该第一视频分片的上传。In one embodiment, the encoding performed on the terminal side (ie, terminal transcoding) and the upload of the video can be performed by two independent modules of the terminal. The modules can communicate with each other. After the user completes the video editing, the terminal first encodes the video to be processed, and generates multiple video segments one by one in the order of encoding; after each video segment is obtained, the message of the obtained video segment is output to the upload module, and the upload module detects this If a message is received, the upload of the video segment is immediately started. For example, when the encoding in the video file to be processed generates the first video segment, the information of the first video segment is output, and the upload module detects this information and immediately starts uploading the first video segment.
此外,在得到视频分片时,为使服务端按照视频分片的顺序进行解码,为每个视频分片分配分片标识,其中,所述分片标识用于标记生成多个视频 分片的前后顺序;当终端接收到视频分片和该视频分片对应的分片标识时,按照分片标识中标识的顺序对各视频分片进行终端的解码,从而输出视频文件。In addition, when the video segments are obtained, in order to enable the server to decode the video segments in the order of the video segments, each video segment is assigned a segment identifier, where the segment identifier is used to mark the generation of multiple video segments. Before and after the sequence; when the terminal receives the video segment and the corresponding segment identifier of the video segment, the terminal decodes each video segment according to the sequence identified in the segment identifier, thereby outputting the video file.
步骤403:上传每个视频分片的过程中,若针对所述待处理视频的编码未结束,则同时对所述待处理视频继续进行编码以得到下一视频分片。Step 403: In the process of uploading each video segment, if the encoding for the to-be-processed video is not finished, continue to encode the to-be-processed video at the same time to obtain the next video segment.
在一个实施例中,当启动视频分片上传的过程中,终端对于待处理视频的编码逐一生成视频分片并没有暂停,因此对于同一待处理视频整体而言,该待处理视频的编码和上传可并行进行;例如,在对第一视频分片的上传过程中,可并行进行编码生成第二视频分片,因此,对于第一视频分片的上传和第二视频分片的编码是并行进行处理的,即每个编码得到了视频分片,即可启动对于该视频分片的上传,对视频分片的编码是串行逐一执行的,不影响并行进行对各编码生成的视频分片的上传。在这个过程中,终端对于待处理视频文件的编码与对视频分片的上传是在并行执行的。可理解为,每个视频分片都是独立一条流水处理线,当每编码得到一个视频分片后,就可启动该视频分片的上传。例如,第一视频分片正在上传的过程中,同时终端进行对待处理视频的编码生成第二视频分片。在这种实施方式下,可节省之前视频分片上传需要等到终端对于整个待处理视频编码得到全部视频分片才进行上传的时间。In one embodiment, when starting the process of uploading video segments, the terminal does not pause the encoding and uploading of the video segments to be processed one by one. Therefore, for the same video to be processed as a whole, the encoding and uploading of the video to be processed It can be performed in parallel; for example, during the uploading process of the first video segment, the second video segment can be generated by encoding in parallel. Therefore, the uploading of the first video segment and the encoding of the second video segment are performed in parallel Processed, that is, after each encoded video segment is obtained, the upload of the video segment can be started. The encoding of the video segment is executed one by one in serial, and does not affect the parallel processing of the video segments generated by each encoding Upload. In this process, the terminal's encoding of the to-be-processed video file and uploading of video segments are executed in parallel. It can be understood that each video segment is an independent pipeline processing line, and after each video segment is encoded, the upload of the video segment can be started. For example, the first video segment is in the process of uploading, and at the same time, the terminal encodes the video to be processed to generate the second video segment. In this implementation manner, it is possible to save the time for uploading video fragments until the terminal obtains all the video fragments by encoding the entire to-be-processed video.
在一个实施例中,当按编码先后顺序逐一生成多个视频分片时,将逐一生成的视频分片输出到一个文件中,并记录每个视频分片在所述一个文件中的偏移量。因此,根据视频分片在所述的一个文件中的偏移量,即可从所述一个文件中根据视频分片的偏移量读取与该视频分片对应的数据;并上传所述视频分片的数据以及分片标识到所述服务端。In one embodiment, when multiple video segments are generated one by one in the encoding sequence, the video segments generated one by one are output to a file, and the offset of each video segment in the one file is recorded . Therefore, according to the offset of the video segment in the one file, the data corresponding to the video segment can be read from the one file according to the offset of the video segment; and the video can be uploaded The data of the fragments and the fragment identification are sent to the server.
或者,在另一个实施例中,每得到一个视频分片后,为每个视频分片分别建立对应的视频分片文件,并记录各视频分片文件的存储地址。因此,也可根据各视频分片的视频分片文件的存储地址,读取各视频分片的数据;并将各视频分片与对应的分片标识上传到所述服务端。Or, in another embodiment, after each video segment is obtained, a corresponding video segment file is created for each video segment, and the storage address of each video segment file is recorded. Therefore, it is also possible to read the data of each video segment according to the storage address of the video segment file of each video segment; upload each video segment and the corresponding segment identifier to the server.
在一个实施例中,将视频分片对应的数据上传到服务端需要通过上传任务实现。因此,每得到一个视频分片时,则创建对所述视频分片的上传任务。其中,当存在多个上传任务时,可同时上传各上传任务对应的分片到所述服务端。通过该方法可实现多个视频分片的上传任务的并行执行,因此节省了各视频分片上传等待的时间。In an embodiment, uploading the data corresponding to the video segment to the server needs to be implemented through an upload task. Therefore, every time a video segment is obtained, an upload task for the video segment is created. Wherein, when there are multiple upload tasks, the fragments corresponding to each upload task can be uploaded to the server at the same time. Through this method, the parallel execution of upload tasks of multiple video segments can be realized, thus saving the waiting time for uploading of each video segment.
在一个实施例中,当用户上传的各视频分片的编码结果全部上传完毕时,则输出视频上传完成的通知,此时对于视频分片的上传流程已经结束。In one embodiment, when the encoding results of each video segment uploaded by the user are all uploaded, a notification of the completion of the video upload is output. At this time, the upload process for the video segment has ended.
另一方面,从服务端方面的实施如图5所示,该方法包括:On the other hand, the implementation from the server side is shown in Figure 5. The method includes:
步骤501:接收终端上传的待处理视频的各视频分片以及各视频分片对应的分片标识;Step 501: Receive each video segment of the to-be-processed video uploaded by the terminal and the segment identifier corresponding to each video segment;
步骤502:依据分片标识,对各视频分片进行解码;Step 502: Decode each video segment according to the segment identifier;
步骤503:在对各视频分片进行解码的过程中,若存在下一视频分片的上传,则同时进行对所述下一视频分片的接收。Step 503: In the process of decoding each video segment, if there is an upload of the next video segment, simultaneously receive the next video segment.
在一个实施例中,服务端每接收到一个视频分片,就可以开始对该视频分片进行解码处理,但需要注意转码输出为一个文件,所以服务端的解码需要串行进行,因此需要维护一个用于接收视频分片的接收队列,根据输出编码结果时为每个视频分片分配的分片标识进行排序,其中,所述分片标识用于标记生成多个视频分片的前后顺序;因此按照分片标识,可依序对视频分片进行解码。或者,在一个实施例中,解码后可得到视频分片的视频帧信息,根据该视频帧信息也可对解码完成的视频分片进行排序,得到整个完整的视频文件。In one embodiment, each time the server receives a video segment, it can start to decode the video segment, but you need to pay attention to the transcoding output as a file, so the server's decoding needs to be performed serially, so it needs to be maintained A receiving queue for receiving video segments, sorted according to the segment identifier assigned to each video segment when outputting the encoding result, wherein the segment identifier is used to mark the sequence of generating multiple video segments; Therefore, the video segments can be decoded in sequence according to the segment identifiers. Alternatively, in one embodiment, the video frame information of the video segments can be obtained after decoding, and the decoded video segments can also be sorted according to the video frame information to obtain the entire complete video file.
通过终端侧和服务端侧对于视频分片的并行上传以及服务端解码的处理,可节省相关技术中执行串行处理方式时每个分片的等待时间,因此可节省用户等待作品上传的时间。Through the parallel upload of video segments and the processing of server-side decoding on the terminal side and the server side, the waiting time of each segment when performing serial processing in the related technology can be saved, and thus the time for the user to wait for the upload of the work can be saved.
下面采用另一实施例对本申请提供的一种视频处理方法进一步说明,参阅图6,为本申请实施例提供的一种视频处理方法的时序图。The following uses another embodiment to further illustrate a video processing method provided by the present application. Refer to FIG. 6, which is a sequence diagram of a video processing method provided by this embodiment of the present application.
图6中,包含终端转码、上传以及服务端转码三个主要的过程。可以看 到,图中在终端转码得到第一个视频分片CF1时,在上传模块对于第一视频分片UF1的上传立即开始,在进行第一视频分片UF1上传的过程中,终端转码中对于待处理视频逐一进行转码得到第二视频分片CF2也在并行执行中。后续当终端转码阶段对于第二视频分片CF2的转码结束后,在上传模块中立即开始对于第二视频分片UF2的上传。其中,终端的转码是对待处理视频按编码先后顺序逐一生成多个视频分片的过程。Figure 6 includes three main processes: terminal transcoding, uploading, and server transcoding. It can be seen that when the terminal transcodes the first video segment CF1 in the figure, the upload module of the first video segment UF1 starts immediately. During the upload of the first video segment UF1, the terminal transfers The second video segment CF2 obtained by transcoding the to-be-processed video one by one in the code is also being executed in parallel. Subsequently, when the transcoding of the second video segment CF2 in the transcoding stage of the terminal ends, the uploading of the second video segment UF2 is immediately started in the upload module. Among them, the transcoding of the terminal is a process of generating multiple video segments one by one according to the encoding sequence of the video to be processed.
在一个实施例中,在终端转码阶段,对于待处理视频进行编码生成视频分片是顺序逐一执行的,但在上传阶段中,各个视频分片由于网络、文件大小等原因具有不同的上传时长,若对于前序视频分片的上传还未完成,此时已经完成在终端转码得到了下一视频分片,则可对多个转码完成的得到的视频分片进行并行上传。例如,图6中对于视频分片UF3、UF4以及UF5的上传,其中对于视频分片UF3的上传还未完成,但是终端已经转码完成得到视频分片CF4的,此时对于视频分片UF3以及视频分片UF4的上传可在上传模块中同步并行执行。同理,对于视频分片UF4的上传还未完成,但是终端已经转码得到视频分片CF5,此时可并行进行对于视频分片UF4和UF5的上传,该方式在实施时可通过多个上传任务实现。In one embodiment, in the terminal transcoding stage, the video to be processed is encoded to generate video segments one by one, but in the upload stage, each video segment has a different upload duration due to network, file size, etc. If the upload of the previous video segment has not been completed, and the next video segment has been transcoded at the terminal at this time, multiple video segments obtained after transcoding can be uploaded in parallel. For example, in Figure 6 for the upload of video segments UF3, UF4, and UF5, the upload of the video segment UF3 has not been completed, but the terminal has been transcoded to obtain the video segment CF4. At this time, for the video segment UF3 and The upload of the video segment UF4 can be executed in parallel in the upload module. In the same way, the upload of the video segment UF4 has not been completed, but the terminal has been transcoded to obtain the video segment CF5. At this time, the upload of the video segments UF4 and UF5 can be performed in parallel. This method can be implemented through multiple uploads Mission accomplished.
在一个实施例中,因为要输出一个完整的视频文件,所以在服务端的转码是串行顺序执行的。其中,对于视频分片的服务端转码是在每个视频分片上传完成后就开始进行的。例如图中服务端的视频分片SF1是在接收到视频分片UF1的上传就立即开始在服务端进行转码。在一个实施例中,当完成视频分片SF1的转码并且此时已经接收到视频分片UF2,则继续进行视频分片SF2的转码。直到所有视频分片在服务端转码全部结束,如图视频分片SF5的转码结束,则可输出完整的视频文件并继续进行后续的视频文件分发的操作。In one embodiment, because a complete video file is to be output, the transcoding on the server side is performed serially. Among them, the server-side transcoding of video segments starts after the upload of each video segment is completed. For example, the video segment SF1 on the server side in the figure starts transcoding on the server side as soon as it receives the upload of the video segment UF1. In one embodiment, when the transcoding of the video segment SF1 is completed and the video segment UF2 has been received at this time, the transcoding of the video segment SF2 is continued. Until all video segments are transcoded on the server side, as shown in the figure, the transcoding of video segment SF5 ends, then the complete video file can be output and the subsequent video file distribution operation can be continued.
图7,为本申请实施例中一种视频处理终端装置的结构示意图,该装置包括:第一编码模块701、上传模块702以及第二编码模块703。FIG. 7 is a schematic structural diagram of a video processing terminal device in an embodiment of the application. The device includes: a first encoding module 701, an uploading module 702, and a second encoding module 703.
第一编码模块701,被配置为执行对待处理视频进行编码,按编码先后顺 序逐一生成多个视频分片;The first encoding module 701 is configured to perform encoding of the to-be-processed video, and generate multiple video segments one by one according to the encoding sequence;
上传模块702,被配置为执行每得到一个视频分片,为所述视频分片分配分片标识后,上传所述视频分片及其对应的分片标识到服务端,以使所述服务端在接收到所述视频分片后根据所述视频分片的分片标识对所述视频分片进行解码;其中,所述分片标识用于标记生成多个视频分片的前后顺序;The uploading module 702 is configured to perform every time a video segment is obtained, after assigning a segment identifier to the video segment, upload the video segment and its corresponding segment identifier to the server, so that the server After receiving the video segment, decode the video segment according to the segment identifier of the video segment; wherein, the segment identifier is used to mark the sequence of generating multiple video segments;
第二编码模块703,被配置为执行上传每个视频分片的过程中,若针对所述待处理视频的编码未结束,则同时对所述待处理视频继续进行编码以得到下一视频分片。The second encoding module 703 is configured to perform the process of uploading each video segment, if the encoding for the to-be-processed video is not finished, at the same time continue to encode the to-be-processed video to obtain the next video segment .
在一个实施例中,在所述第一编码模块701被配置为执行所述按编码先后顺序逐一生成多个视频分片之后,所述装置还包括:In an embodiment, after the first encoding module 701 is configured to perform the generation of multiple video segments one by one in the encoding sequence, the apparatus further includes:
输出模块,被配置为执行将逐一生成的视频分片输出到一个文件中,并记录每个视频分片在所述一个文件中的偏移量;The output module is configured to output the video segments generated one by one to a file, and record the offset of each video segment in the one file;
所述上传模块702,被配置为执行:The upload module 702 is configured to execute:
针对每个视频分片,根据记录的所述视频分片的偏移量,从所述一个文件中读取与所述视频分片对应的数据;For each video segment, read data corresponding to the video segment from the one file according to the recorded offset of the video segment;
上传所述视频分片的数据以及分片标识到所述服务端。Upload the data of the video segment and the segment identifier to the server.
在一个实施例中,在所述第一编码模块701被配置为执行所述按编码先后顺序逐一生成多个视频分片之后,所述装置还包括:In an embodiment, after the first encoding module 701 is configured to perform the generation of multiple video segments one by one in the encoding sequence, the apparatus further includes:
文件建立模块,被配置为执行每得到一个视频分片后,为每个视频分片分别建立对应的视频分片文件,并记录各视频分片文件的存储地址;The file creation module is configured to execute after each video segment is obtained, a corresponding video segment file is created for each video segment, and the storage address of each video segment file is recorded;
所述上传模块702,被配置为执行:The upload module 702 is configured to execute:
根据各视频分片的视频分片文件的存储地址,读取各视频分片的数据;Read the data of each video segment according to the storage address of the video segment file of each video segment;
并将各视频分片与对应的分片标识上传到所述服务端。And upload each video segment and the corresponding segment identifier to the server.
在一个实施例中,所述上传模块702,被配置为执行:In one embodiment, the upload module 702 is configured to execute:
每得到一个视频分片时,创建对所述视频分片的上传任务;Each time a video segment is obtained, an upload task for the video segment is created;
当存在多个上传任务时,同时上传各上传任务对应的分片到所述服务端。When there are multiple upload tasks, the segments corresponding to each upload task are uploaded to the server at the same time.
在一个实施例中,在所述上传模块702被配置为执行将每个视频分片上 传到所述服务端之后,所述装置还包括:In an embodiment, after the upload module 702 is configured to execute uploading each video segment to the server, the apparatus further includes:
通知模块,被配置为执行若确定所述视频的各视频分片上传完毕,则输出视频上传完成的通知。The notification module is configured to output a notification that the video upload is completed if it is determined that the upload of each video segment of the video is completed.
参阅图8,为本申请实施例中一种视频处理服务端装置的结构示意图,该装置包括:第一接收模块801、解码模块802以及第二接收模块803。Refer to FIG. 8, which is a schematic structural diagram of a video processing server device in an embodiment of the application. The device includes: a first receiving module 801, a decoding module 802, and a second receiving module 803.
第一接收模块801,被配置为执行接收终端上传的待处理视频的各视频分片以及各视频分片对应的分片标识;The first receiving module 801 is configured to receive each video segment of the to-be-processed video uploaded by the terminal and the segment identifier corresponding to each video segment;
解码模块802,被配置为执行依据分片标识,对各视频分片进行解码;The decoding module 802 is configured to perform decoding of each video segment according to the segment identifier;
第二接收模块803,被配置为执行在对各视频分片进行解码的过程中,若存在下一视频分片的上传,则同时进行对所述下一视频分片的接收。The second receiving module 803 is configured to perform, in the process of decoding each video segment, if there is an upload of the next video segment, simultaneously receive the next video segment.
在一个实施例中,所述第一接收模块801,被配置为执行:In an embodiment, the first receiving module 801 is configured to execute:
将终端上传的视频分片存储到接收队列中;Store the video segments uploaded by the terminal in the receiving queue;
根据分片标识对接收队列中的视频分片进行排序;Sort the video fragments in the receiving queue according to the fragment identifier;
所述解码模块,被配置为执行:The decoding module is configured to execute:
按照分片标识,依序对视频分片进行解码。The video segments are decoded in sequence according to the segment identifiers.
在一个实施例中,在所述第一接收模块801被配置为执行所述依序对视频分片进行解码之后,所述装置还包括:In an embodiment, after the first receiving module 801 is configured to perform the sequential decoding of video segments, the apparatus further includes:
排序模块,被配置为执行将各视频分片通过解码得到的视频帧,按照分片标识进行排序。The sorting module is configured to perform the sorting of the video frames obtained by decoding each video segment according to the segment identifiers.
在介绍了本申请示例性实施方式中的视频处理方法和装置之后,接下来,介绍本申请的另一示例性实施方式的电子设备。After introducing the video processing method and device in the exemplary embodiment of the present application, next, the electronic device of another exemplary embodiment of the present application is introduced.
所属技术领域的技术人员能够理解,本申请的各个方面可以实现为系统、方法或程序产品。因此,本申请的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。Those skilled in the art can understand that various aspects of the present application can be implemented as a system, a method, or a program product. Therefore, each aspect of the present application can be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which can be collectively referred to herein as "Circuit", "Module" or "System".
在一些可能的实施方式中,根据本申请的电子设备可以至少包括至少一个处理器、以及至少一个存储器。其中,存储器存储有程序代码,当程序代 码被处理器执行时,使得处理器执行本说明书上述描述的根据本申请各种示例性实施方式的图像处理方法中的步骤。例如,处理器可以执行如图4中所示的步骤401-步骤403以及图5中所示的步骤501-步骤503。In some possible implementation manners, the electronic device according to the present application may at least include at least one processor and at least one memory. Wherein, the memory stores a program code, and when the program code is executed by the processor, the processor executes the steps in the image processing method according to various exemplary embodiments of the application described above in this specification. For example, the processor may execute step 401 to step 403 shown in FIG. 4 and step 501 to step 503 shown in FIG. 5.
下面参照图9来描述根据本申请的这种实施方式的电子设备130。图9显示的电子设备130仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。The electronic device 130 according to this embodiment of the present application will be described below with reference to FIG. 9. The electronic device 130 shown in FIG. 9 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present application.
如图9所示,电子设备130以通用计算装置的形式表现。电子设备130的组件可以包括但不限于:上述至少一个处理器131、上述至少一个存储器132、连接不同系统组件(包括存储器132和处理器131)的总线133。As shown in FIG. 9, the electronic device 130 is represented in the form of a general-purpose computing device. The components of the electronic device 130 may include, but are not limited to: the aforementioned at least one processor 131, the aforementioned at least one memory 132, and a bus 133 connecting different system components (including the memory 132 and the processor 131).
总线133表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器、外围总线、处理器或者使用多种总线结构中的任意总线结构的局域总线。The bus 133 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a processor, or a local bus using any bus structure among multiple bus structures.
存储器132可以包括易失性存储器形式的可读介质,例如随机存取存储器(RAM)1321和/或高速缓存存储器1322,还可以进一步包括只读存储器(ROM)1323。The memory 132 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1321 and/or a cache memory 1322, and may further include a read-only memory (ROM) 1323.
存储器132还可以包括具有一组(至少一个)程序模块1324的程序/实用工具1325,这样的程序模块1324包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。The memory 132 may also include a program/utility tool 1325 having a set of (at least one) program modules 1324. Such program modules 1324 include but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each of the examples or some combination may include the realization of a network environment.
电子设备130也可以与一个或多个外部设备134(例如键盘、指向设备等)通信,还可与一个或者多个使得目标对象能与电子设备130交互的设备通信,和/或与使得所述电子设备130能与一个或多个其它计算装置进行通信的任何设备(例如路由器、调制解调器等)通信。这种通信可以通过输入/输出(I/O)接口135进行。并且,计算装置130还可以通过网络适配器136与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器136通过总线133与用于电子设备130的其它模块通信。应当理解,尽管图中未示出,可以结合电子设备130使用其 它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理器、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The electronic device 130 may also communicate with one or more external devices 134 (such as keyboards, pointing devices, etc.), and may also communicate with one or more devices that enable the target object to interact with the electronic device 130, and/or communicate with the The electronic device 130 can communicate with any device (such as a router, a modem, etc.) that communicates with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 135. In addition, the computing device 130 may also communicate with one or more networks (for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 136. As shown in the figure, the network adapter 136 communicates with other modules for the electronic device 130 through the bus 133. It should be understood that although not shown in the figure, other hardware and/or software modules can be used in conjunction with the electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
在一些可能的实施方式中,本申请提供的视频处理方法的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当程序产品在计算机设备上运行时,程序代码用于使计算机设备执行本说明书上述描述的根据本申请各种示例性实施方式的图像处理方法中的步骤,例如,计算机设备可以执行如图4中所示的步骤401-步骤403以及图5中所示的步骤501-步骤503。In some possible implementation manners, various aspects of the video processing method provided in this application can also be implemented in the form of a program product, which includes program code. When the program product runs on a computer device, the program code is used to make the computer The device executes the steps in the image processing method according to various exemplary embodiments of the application described above in this specification. For example, the computer device can execute steps 401 to 403 shown in FIG. 4 and the steps shown in FIG. 5 501-Step 503.
程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The program product can adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Type 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 of the above.
本申请的实施方式的用于视频处理的程序产品可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在计算装置上运行。然而,本申请的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,所述程序可以被指令执行系统、装置或者器件使用或者与其结合使用。The program product for video processing of the embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a computing device. However, the program product of this application is not limited to this. In this document, the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, device, or device.
可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括——但不限于——电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,所述可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。The readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and readable program code is carried therein. This propagated data signal can take many forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. The readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with the instruction execution system, apparatus, or device.
可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于——无线、有线、光缆、RF等,或者上述的任意合适的组合。The program code contained on the readable medium can be transmitted by any suitable medium, including, but not limited to, wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
可以以一种或多种程序设计语言的任意组合来编写用于执行本申请操作的程序代码,程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在目标对象计算装置上执行、部分地在目标对象设备上执行、作为一个独立的软件包执行、部分在目标对象计算装置上部分在远程计算装置上执行、或者完全在远程计算装置或服务端上执行。在涉及远程计算装置的情形中,远程计算装置可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到目标对象电子设备,或者,可以连接到外部电子设备(例如利用因特网服务提供商来通过因特网连接)。The program code for performing the operations of this application can be written in any combination of one or more programming languages. Programming languages include object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural programming. Language-such as "C" language or similar programming language. The program code can be executed entirely on the target computing device, partly executed on the target target device, executed as an independent software package, partly executed on the target computing device and partly executed on the remote computing device, or completely executed on the remote computing device Execute on the device or server. In the case of a remote computing device, the remote computing device can be connected to the target electronic device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using the Internet) The service provider comes to connect via the Internet).
应当注意,尽管在上文详细描述中提及了装置的若干单元或子单元,但是这种划分仅仅是示例性的并非强制性的。实际上,根据本申请的实施方式,上文描述的两个或更多单元的特征和功能可以在一个单元中具体化。反之,上文描述的一个单元的特征和功能可以进一步划分为由多个单元来具体化。It should be noted that although several units or subunits of the device are mentioned in the above detailed description, this division is only exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
此外,尽管在附图中以特定顺序描述了本申请方法的操作,但是,这并非要求或者暗示必须按照所述特定顺序来执行这些操作,或是必须执行全部所示的操作才能实现期望的结果。附加地或备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,和/或将一个步骤分解为多个步骤执行。In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that these operations must be performed in the specific order, or that all the operations shown must be performed to achieve the desired result. . Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and/or one step may be decomposed into multiple steps for execution.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通 过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This application is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of this application. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在所述计算机可读存储器中的指令产生包括指令装置的制造品,所述指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device, so The instruction device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求指出。Those skilled in the art will easily think of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptive changes of this application. These variations, uses, or adaptive changes follow the general principles of this application and include common knowledge or customary technical means in the technical field that are not disclosed in this application. . The description and embodiments are only regarded as exemplary, and the true scope and spirit of the application are pointed out by the following claims.

Claims (25)

  1. 一种视频处理方法,包括:A video processing method, including:
    对待处理视频进行编码,按编码先后顺序逐一生成多个视频分片;Encode the video to be processed, and generate multiple video segments one by one according to the encoding sequence;
    每得到一个视频分片,为所述视频分片分配分片标识后,上传所述视频分片及其对应的分片标识到服务端,以使所述服务端在接收到所述视频分片后根据所述视频分片的分片标识对所述视频分片进行解码;其中,所述分片标识用于标记生成多个视频分片的前后顺序;Each time a video segment is obtained, after assigning a segment identifier to the video segment, upload the video segment and its corresponding segment identifier to the server, so that the server receives the video segment Then decode the video segment according to the segment identifier of the video segment; wherein, the segment identifier is used to mark the sequence of generating multiple video segments;
    上传每个视频分片的过程中,若针对所述待处理视频的编码未结束,则同时对所述待处理视频继续进行编码以得到下一视频分片。In the process of uploading each video segment, if the encoding of the to-be-processed video is not completed, the encoding of the to-be-processed video is continued at the same time to obtain the next video segment.
  2. 根据权利要求1所述的方法,所述按编码先后顺序逐一生成多个视频分片之后,所述方法还包括:The method according to claim 1, after the multiple video segments are generated one by one according to the encoding sequence, the method further comprises:
    将逐一生成的视频分片输出到一个文件中,并记录每个视频分片在所述一个文件中的偏移量;Output the video segments generated one by one to a file, and record the offset of each video segment in the one file;
    所述上传所述视频分片及其对应的分片标识到服务端,包括:The uploading of the video segment and its corresponding segment identifier to the server includes:
    针对每个视频分片,根据记录的所述视频分片的偏移量,从所述一个文件中读取与所述视频分片对应的数据;For each video segment, read data corresponding to the video segment from the one file according to the recorded offset of the video segment;
    上传所述视频分片的数据以及分片标识到所述服务端。Upload the data of the video segment and the segment identifier to the server.
  3. 根据权利要求1所述的方法,所述按编码先后顺序逐一生成多个视频分片之后,所述方法还包括:The method according to claim 1, after the multiple video segments are generated one by one according to the encoding sequence, the method further comprises:
    每得到一个视频分片后,为每个视频分片分别建立对应的视频分片文件,并记录各视频分片文件的存储地址;After each video segment is obtained, a corresponding video segment file is created for each video segment, and the storage address of each video segment file is recorded;
    所述上传所述视频分片及其对应的分片标识到服务端,包括:The uploading of the video segment and its corresponding segment identifier to the server includes:
    根据各视频分片的视频分片文件的存储地址,读取各视频分片的数据;Read the data of each video segment according to the storage address of the video segment file of each video segment;
    并将各视频分片与对应的分片标识上传到所述服务端。And upload each video segment and the corresponding segment identifier to the server.
  4. 根据权利要求1所述的方法,所述上传所述视频分片及其对应的分片标识到服务端,包括:The method according to claim 1, wherein the uploading the video segment and its corresponding segment identifier to the server includes:
    每得到一个视频分片时,创建对所述视频分片的上传任务;Each time a video segment is obtained, an upload task for the video segment is created;
    当存在多个上传任务时,同时上传各上传任务对应的分片到所述服务端。When there are multiple upload tasks, the segments corresponding to each upload task are uploaded to the server at the same time.
  5. 根据权利要求1-4中任一所述的方法,在将每个视频分片上传到所述服务端之后,所述方法还包括:The method according to any one of claims 1-4, after uploading each video segment to the server, the method further comprises:
    若确定所述视频的各视频分片上传完毕,则输出视频上传完成的通知。If it is determined that the upload of each video segment of the video is completed, a notification of the completion of the video upload is output.
  6. 一种视频处理方法,包括:A video processing method, including:
    接收终端上传的待处理视频的各视频分片以及各视频分片对应的分片标识;Receiving each video segment of the to-be-processed video uploaded by the terminal and the segment identifier corresponding to each video segment;
    依据分片标识,对各视频分片进行解码;According to the segment identifier, decode each video segment;
    在对各视频分片进行解码的过程中,若存在下一视频分片的上传,则同时进行对所述下一视频分片的接收。In the process of decoding each video segment, if there is an upload of the next video segment, the next video segment is received at the same time.
  7. 根据权利要求6所述的方法,所述接收终端上传的视频的各视频分片以及各视频分片的分片标识,包括:The method according to claim 6, wherein said receiving each video segment of the video uploaded by the terminal and the segment identifier of each video segment comprises:
    将终端上传的视频分片存储到接收队列中;Store the video segments uploaded by the terminal in the receiving queue;
    根据分片标识对接收队列中的视频分片进行排序;Sort the video fragments in the receiving queue according to the fragment identifier;
    所述依据分片标识,对各视频分片进行解码,包括:The decoding of each video segment according to the segment identifier includes:
    按照分片标识,依序对视频分片进行解码。The video segments are decoded in sequence according to the segment identifiers.
  8. 根据权利要求7所述的方法,所述依序对视频分片进行解码之后,还包括:The method according to claim 7, after the decoding the video slices in sequence, further comprising:
    将各视频分片通过解码得到的视频帧,按照分片标识进行排序。The video frames obtained by decoding each video segment are sorted according to the segment identifiers.
  9. 一种视频处理装置,包括:A video processing device includes:
    第一编码模块,被配置为执行对待处理视频进行编码,按编码先后顺序逐一生成多个视频分片;The first encoding module is configured to perform encoding of the video to be processed, and generate multiple video segments one by one according to the encoding sequence;
    上传模块,被配置为执行每得到一个视频分片,为所述视频分片分配分片标识后,上传所述视频分片及其对应的分片标识到服务端,以使所述服务端在接收到所述视频分片后根据所述视频分片的分片标识对所述视频分片进行解码;其中,所述分片标识用于标记生成多个视频分片的前后顺序;The uploading module is configured to execute each time a video segment is obtained, after assigning a segment identifier to the video segment, upload the video segment and its corresponding segment identifier to the server, so that the server is After receiving the video segment, decode the video segment according to the segment identifier of the video segment; wherein, the segment identifier is used to mark the sequence of generating multiple video segments;
    第二编码模块,被配置为执行上传每个视频分片的过程中,若针对所述待处理视频的编码未结束,则同时对所述待处理视频继续进行编码以得到下一视频分片。The second encoding module is configured to perform the process of uploading each video segment, if the encoding for the to-be-processed video is not finished, at the same time continue to encode the to-be-processed video to obtain the next video segment.
  10. 根据权利要求9所述的装置,在所述第一编码模块被配置为执行所述按编码先后顺序逐一生成多个视频分片之后,所述装置还包括:The apparatus according to claim 9, after the first encoding module is configured to perform the generation of multiple video segments one by one in the encoding sequence, the apparatus further comprises:
    输出模块,被配置为执行将逐一生成的视频分片输出到一个文件中,并记录每个视频分片在所述一个文件中的偏移量;The output module is configured to output the video segments generated one by one to a file, and record the offset of each video segment in the one file;
    所述上传模块,被配置为执行:The upload module is configured to execute:
    针对每个视频分片,根据记录的所述视频分片的偏移量,从所述一个文件中读取与所述视频分片对应的数据;For each video segment, read data corresponding to the video segment from the one file according to the recorded offset of the video segment;
    上传所述视频分片的数据以及分片标识到所述服务端。Upload the data of the video segment and the segment identifier to the server.
  11. 根据权利要求9所述的装置,在所述第一编码模块被配置为执行所述按编码先后顺序逐一生成多个视频分片之后,所述装置还包括:The apparatus according to claim 9, after the first encoding module is configured to perform the generation of multiple video segments one by one in the encoding sequence, the apparatus further comprises:
    文件建立模块,被配置为执行每得到一个视频分片后,为每个视频分片分别建立对应的视频分片文件,并记录各视频分片文件的存储地址;The file creation module is configured to execute after each video segment is obtained, a corresponding video segment file is created for each video segment, and the storage address of each video segment file is recorded;
    所述上传模块,被配置为执行:The upload module is configured to execute:
    根据各视频分片的视频分片文件的存储地址,读取各视频分片的数据;Read the data of each video segment according to the storage address of the video segment file of each video segment;
    并将各视频分片与对应的分片标识上传到所述服务端。And upload each video segment and the corresponding segment identifier to the server.
  12. 根据权利要求9所述的装置,所述上传模块,被配置为执行:The apparatus according to claim 9, wherein the upload module is configured to execute:
    每得到一个视频分片时,创建对所述视频分片的上传任务;Each time a video segment is obtained, an upload task for the video segment is created;
    当存在多个上传任务时,同时上传各上传任务对应的分片到所述服务端。When there are multiple upload tasks, the segments corresponding to each upload task are uploaded to the server at the same time.
  13. 根据权利要求9-12中任一所述的装置,在所述上传模块被配置为执行将每个视频分片上传到所述服务端之后,所述装置还包括:The apparatus according to any one of claims 9-12, after the upload module is configured to execute uploading each video segment to the server, the apparatus further comprises:
    通知模块,被配置为执行若确定所述视频的各视频分片上传完毕,则输出视频上传完成的通知。The notification module is configured to output a notification that the video upload is completed if it is determined that the upload of each video segment of the video is completed.
  14. 一种视频处理装置,包括:A video processing device includes:
    第一接收模块,被配置为执行接收终端上传的待处理视频的各视频分片 以及各视频分片对应的分片标识;The first receiving module is configured to receive each video segment of the to-be-processed video uploaded by the terminal and the segment identifier corresponding to each video segment;
    解码模块,被配置为执行依据分片标识,对各视频分片进行解码;The decoding module is configured to perform decoding of each video segment according to the segment identifier;
    第二接收模块,被配置为执行在对各视频分片进行解码的过程中,若存在下一视频分片的上传,则同时进行对所述下一视频分片的接收。The second receiving module is configured to perform, in the process of decoding each video segment, if there is an upload of the next video segment, simultaneously receive the next video segment.
  15. 根据权利要求14所述的装置,所述第一接收模块,被配置为执行:The apparatus according to claim 14, wherein the first receiving module is configured to execute:
    将终端上传的视频分片存储到接收队列中;Store the video segments uploaded by the terminal in the receiving queue;
    根据分片标识对接收队列中的视频分片进行排序;Sort the video fragments in the receiving queue according to the fragment identifier;
    所述解码模块,被配置为执行:The decoding module is configured to execute:
    按照分片标识,依序对视频分片进行解码。The video segments are decoded in sequence according to the segment identifiers.
  16. 根据权利要求15所述的装置,在所述第一接收模块被配置为执行所述依序对视频分片进行解码之后,所述装置还包括:The apparatus according to claim 15, after the first receiving module is configured to perform the sequential decoding of video segments, the apparatus further comprises:
    排序模块,被配置为执行将各视频分片通过解码得到的视频帧,按照分片标识进行排序。The sorting module is configured to perform the sorting of the video frames obtained by decoding each video segment according to the segment identifiers.
  17. 一种电子设备,包括:An electronic device including:
    存储器,用于存储计算机程序,以及执行所述计算机程序产生的候选中间数据以及结果数据;A memory for storing computer programs, candidate intermediate data and result data generated by executing the computer programs;
    处理器,用于:Processor for:
    对待处理视频进行编码,按编码先后顺序逐一生成多个视频分片;Encode the video to be processed, and generate multiple video segments one by one according to the encoding sequence;
    每得到一个视频分片,为所述视频分片分配分片标识后,上传所述视频分片及其对应的分片标识到服务端,以使所述服务端在接收到所述视频分片后根据所述视频分片的分片标识对所述视频分片进行解码;其中,所述分片标识用于标记生成多个视频分片的前后顺序;Each time a video segment is obtained, after assigning a segment identifier to the video segment, upload the video segment and its corresponding segment identifier to the server, so that the server receives the video segment Then decode the video segment according to the segment identifier of the video segment; wherein, the segment identifier is used to mark the sequence of generating multiple video segments;
    上传每个视频分片的过程中,若针对所述待处理视频的编码未结束,则同时对所述待处理视频继续进行编码以得到下一视频分片。In the process of uploading each video segment, if the encoding of the to-be-processed video is not completed, the encoding of the to-be-processed video is continued at the same time to obtain the next video segment.
  18. 根据权利要求17所述的电子设备,所述处理器在执行所述按编码先后顺序逐一生成多个视频分片之后,还用于:The electronic device according to claim 17, after the processor executes the generation of multiple video segments one by one in the encoding sequence, the processor is further configured to:
    将逐一生成的视频分片输出到一个文件中,并记录每个视频分片在所述 一个文件中的偏移量;Output the video segments generated one by one to a file, and record the offset of each video segment in the one file;
    所述上传所述视频分片及其对应的分片标识到服务端,包括:The uploading of the video segment and its corresponding segment identifier to the server includes:
    针对每个视频分片,根据记录的所述视频分片的偏移量,从所述一个文件中读取与所述视频分片对应的数据;For each video segment, read data corresponding to the video segment from the one file according to the recorded offset of the video segment;
    上传所述视频分片的数据以及分片标识到所述服务端。Upload the data of the video segment and the segment identifier to the server.
  19. 根据权利要求17所述的电子设备,所述处理器在执行所述按编码先后顺序逐一生成多个视频分片之后,还用于:The electronic device according to claim 17, after the processor executes the generation of multiple video segments one by one in the encoding sequence, the processor is further configured to:
    每得到一个视频分片后,为每个视频分片分别建立对应的视频分片文件,并记录各视频分片文件的存储地址;After each video segment is obtained, a corresponding video segment file is created for each video segment, and the storage address of each video segment file is recorded;
    所述上传所述视频分片及其对应的分片标识到服务端,包括:The uploading of the video segment and its corresponding segment identifier to the server includes:
    根据各视频分片的视频分片文件的存储地址,读取各视频分片的数据;Read the data of each video segment according to the storage address of the video segment file of each video segment;
    并将各视频分片与对应的分片标识上传到所述服务端。And upload each video segment and the corresponding segment identifier to the server.
  20. 根据权利要求17所述的电子设备,所述处理器执行所述上传所述视频分片及其对应的分片标识到服务端时,具体用于:The electronic device according to claim 17, when the processor executes the uploading of the video segment and its corresponding segment identifier to the server, it is specifically configured to:
    每得到一个视频分片时,创建对所述视频分片的上传任务;Each time a video segment is obtained, an upload task for the video segment is created;
    当存在多个上传任务时,同时上传各上传任务对应的分片到所述服务端。When there are multiple upload tasks, the segments corresponding to each upload task are uploaded to the server at the same time.
  21. 根据权利要求17-20中任一所述的电子设备,所述处理器执行在将每个视频分片上传到所述服务端之后,还用于:According to the electronic device according to any one of claims 17-20, the processor executes after uploading each video segment to the server, and is further configured to:
    若确定所述视频的各视频分片上传完毕,则输出视频上传完成的通知。If it is determined that the upload of each video segment of the video is completed, a notification of the completion of the video upload is output.
  22. 一种电子设备,包括:An electronic device including:
    存储器,用于存储计算机程序,以及执行所述计算机程序产生的候选中间数据以及结果数据;A memory for storing computer programs, candidate intermediate data and result data generated by executing the computer programs;
    处理器,用于:Processor for:
    接收终端上传的待处理视频的各视频分片以及各视频分片对应的分片标识;Receiving each video segment of the to-be-processed video uploaded by the terminal and the segment identifier corresponding to each video segment;
    依据分片标识,对各视频分片进行解码;According to the segment identifier, decode each video segment;
    在对各视频分片进行解码的过程中,若存在下一视频分片的上传,则同 时进行对所述下一视频分片的接收。In the process of decoding each video segment, if there is an upload of the next video segment, the next video segment is received at the same time.
  23. 根据权利要求22所述的电子设备,所述处理器执行所述接收终端上传的视频的各视频分片以及各视频分片的分片标识时,具体用于:The electronic device according to claim 22, when the processor executes each video segment of the video uploaded by the receiving terminal and the segment identifier of each video segment, it is specifically configured to:
    将终端上传的视频分片存储到接收队列中;Store the video segments uploaded by the terminal in the receiving queue;
    根据分片标识对接收队列中的视频分片进行排序;Sort the video fragments in the receiving queue according to the fragment identifier;
    所述依据分片标识,对各视频分片进行解码,包括:The decoding of each video segment according to the segment identifier includes:
    按照分片标识,依序对视频分片进行解码。The video segments are decoded in sequence according to the segment identifiers.
  24. 根据权利要求23所述的电子设备,所述处理器质执行所述依序对视频分片进行解码之后,还用于:The electronic device according to claim 23, after the processor is further configured to: after performing the decoding of video segments in sequence:
    将各视频分片通过解码得到的视频帧,按照分片标识进行排序。The video frames obtained by decoding each video segment are sorted according to the segment identifiers.
  25. 一种计算机存储介质,所述计算机存储介质存储有计算机可执行指令,其特征在于,所述计算机可执行指令用于执行如权利要求1-8中任一权利要求所述的方法。A computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the method according to any one of claims 1-8.
PCT/CN2020/108268 2019-09-20 2020-08-10 Video processing method and apparatus, electronic device and storage medium WO2021052058A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910894816.6A CN110602122A (en) 2019-09-20 2019-09-20 Video processing method and device, electronic equipment and storage medium
CN201910894816.6 2019-09-20

Publications (1)

Publication Number Publication Date
WO2021052058A1 true WO2021052058A1 (en) 2021-03-25

Family

ID=68862084

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/108268 WO2021052058A1 (en) 2019-09-20 2020-08-10 Video processing method and apparatus, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN110602122A (en)
WO (1) WO2021052058A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113132484A (en) * 2021-04-20 2021-07-16 北京奇艺世纪科技有限公司 Data transmission method and device
US20220303642A1 (en) * 2021-03-19 2022-09-22 Product Development Associates, Inc. Securing video distribution
CN115225710A (en) * 2022-06-17 2022-10-21 中国电信股份有限公司 Data packet transmission method and device, electronic equipment and storage medium
CN115589488A (en) * 2022-09-30 2023-01-10 摩尔线程智能科技(北京)有限责任公司 Video transcoding system, method, GPU, electronic device and storage medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602122A (en) * 2019-09-20 2019-12-20 北京达佳互联信息技术有限公司 Video processing method and device, electronic equipment and storage medium
CN112104442B (en) * 2020-08-31 2023-12-05 宁波三星医疗电气股份有限公司 Message reply method of electric power acquisition terminal
CN115190352A (en) * 2022-05-18 2022-10-14 上海亘岩网络科技有限公司 Video data storage method and device, computer readable storage medium and electronic equipment
CN115988241A (en) * 2022-12-12 2023-04-18 苏州五指互联网络科技有限公司 Data transmission method for uploading short video in fragment mode

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101964894A (en) * 2010-08-24 2011-02-02 中国科学院深圳先进技术研究院 Method and system for parallel trans-coding of video slicing
CN102098304A (en) * 2011-01-25 2011-06-15 北京天纵网联科技有限公司 Method for simultaneously recording and uploading audio/video of mobile phone
CN102447893A (en) * 2010-09-30 2012-05-09 北京沃安科技有限公司 Method and system for real-time acquisition and release of videos of mobile phone
WO2014041547A1 (en) * 2012-09-13 2014-03-20 Yevvo Entertainment Inc. Live video broadcasting from a mobile device
CN104822079A (en) * 2014-12-31 2015-08-05 北京奇艺世纪科技有限公司 Video file real-time publication method and system
CN105611429A (en) * 2016-02-04 2016-05-25 北京金山安全软件有限公司 Video file backup method and device and electronic equipment
CN105681715A (en) * 2016-03-03 2016-06-15 腾讯科技(深圳)有限公司 Audio and video processing method and apparatus
US20180227602A1 (en) * 2016-08-31 2018-08-09 Living As One, Llc System and method for asynchronous uploading of live digital multimedia with guaranteed delivery
CN110602122A (en) * 2019-09-20 2019-12-20 北京达佳互联信息技术有限公司 Video processing method and device, electronic equipment and storage medium

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090094652A1 (en) * 2007-10-03 2009-04-09 Eatlime, Inc. Methods and Apparatus for Simultaneous Uploading and Streaming of Media
US20120243602A1 (en) * 2010-09-23 2012-09-27 Qualcomm Incorporated Method and apparatus for pipelined slicing for wireless display
US20120102154A1 (en) * 2010-10-26 2012-04-26 Futurewei Technologies, Inc. Cloud-Based Transcoding Platform Systems and Methods
GB2503711B (en) * 2012-07-05 2014-10-15 Quixel Holdings Ltd Video data communication
CN103297807A (en) * 2013-06-21 2013-09-11 哈尔滨工业大学深圳研究生院 Hadoop-platform-based method for improving video transcoding efficiency
CN104427353B (en) * 2013-09-05 2017-09-29 北京大学 Video transmission method and equipment
CN105721811A (en) * 2015-05-15 2016-06-29 乐视云计算有限公司 Live video recording method and system
CN105338424B (en) * 2015-10-29 2019-10-08 努比亚技术有限公司 A kind of method for processing video frequency and system
CN105357593B (en) * 2015-10-30 2019-06-07 努比亚技术有限公司 A kind of methods, devices and systems of uploaded videos
IL245860A0 (en) * 2016-05-25 2016-07-31 Giraffic Tech Ltd A method of stabilized adaptive video streaming for high dynamic range (hdr)
CN108632642B (en) * 2017-03-16 2021-09-03 杭州海康威视数字技术股份有限公司 Streaming media pushing method and device
CN107483471B (en) * 2017-09-05 2021-03-02 成都索贝数码科技股份有限公司 Multimedia data transmission system suitable for remote cooperation
US10873754B2 (en) * 2017-12-12 2020-12-22 Coherent Logix, Incorporated Low latency video codec and transmission with parallel processing
CN108848384A (en) * 2018-06-19 2018-11-20 复旦大学 A kind of efficient parallel code-transferring method towards multi-core platform

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101964894A (en) * 2010-08-24 2011-02-02 中国科学院深圳先进技术研究院 Method and system for parallel trans-coding of video slicing
CN102447893A (en) * 2010-09-30 2012-05-09 北京沃安科技有限公司 Method and system for real-time acquisition and release of videos of mobile phone
CN102098304A (en) * 2011-01-25 2011-06-15 北京天纵网联科技有限公司 Method for simultaneously recording and uploading audio/video of mobile phone
WO2014041547A1 (en) * 2012-09-13 2014-03-20 Yevvo Entertainment Inc. Live video broadcasting from a mobile device
CN104822079A (en) * 2014-12-31 2015-08-05 北京奇艺世纪科技有限公司 Video file real-time publication method and system
CN105611429A (en) * 2016-02-04 2016-05-25 北京金山安全软件有限公司 Video file backup method and device and electronic equipment
CN105681715A (en) * 2016-03-03 2016-06-15 腾讯科技(深圳)有限公司 Audio and video processing method and apparatus
US20180227602A1 (en) * 2016-08-31 2018-08-09 Living As One, Llc System and method for asynchronous uploading of live digital multimedia with guaranteed delivery
CN110602122A (en) * 2019-09-20 2019-12-20 北京达佳互联信息技术有限公司 Video processing method and device, electronic equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220303642A1 (en) * 2021-03-19 2022-09-22 Product Development Associates, Inc. Securing video distribution
CN113132484A (en) * 2021-04-20 2021-07-16 北京奇艺世纪科技有限公司 Data transmission method and device
CN115225710A (en) * 2022-06-17 2022-10-21 中国电信股份有限公司 Data packet transmission method and device, electronic equipment and storage medium
CN115589488A (en) * 2022-09-30 2023-01-10 摩尔线程智能科技(北京)有限责任公司 Video transcoding system, method, GPU, electronic device and storage medium
CN115589488B (en) * 2022-09-30 2023-09-08 摩尔线程智能科技(北京)有限责任公司 Video transcoding system, method, GPU, electronic device and storage medium

Also Published As

Publication number Publication date
CN110602122A (en) 2019-12-20

Similar Documents

Publication Publication Date Title
WO2021052058A1 (en) Video processing method and apparatus, electronic device and storage medium
CN108989885B (en) Video file transcoding system, segmentation method, transcoding method and device
US11082490B2 (en) Method and apparatus for execution of applications in a cloud system
US20180247652A1 (en) Method and system for speech recognition processing
WO2017076143A1 (en) Method, apparatus, and system for switching video live stream to video-on-demand data
WO2017008627A1 (en) Multimedia live broadcast method, apparatus and system
CN108848060B (en) Multimedia file processing method, processing system and computer readable storage medium
US20140250158A1 (en) Method and device for obtaining file
US9282443B2 (en) Short message service (SMS) message segmentation
WO2018036352A1 (en) Video data coding and decoding methods, devices and systems, and storage medium
US11522922B2 (en) Multimedia data processing method and apparatus, storage medium, and electronic device
JP6467503B2 (en) Cloud streaming service system, data compression method for preventing memory bottleneck, and apparatus therefor
CN111382123B (en) File storage method, device, equipment and storage medium
CN104041064A (en) Minimal cognitive mode for wireless display devices
CN104639985A (en) Multimedia playing control method and system
CN106850770B (en) Efficient transmission method based on cloud computing service
CN109995743A (en) A kind of processing method and terminal of multimedia file
US10362156B2 (en) Realization method and apparatus for operation function in two-way radio, and two-way radio terminal
WO2013078614A1 (en) Audio compression algorithm selection method, device and communication system in scenario of virtual desktop
US20050165983A1 (en) System and method for processing data in kernel area by a user command
WO2020107168A1 (en) Video decoding method and device, electronic apparatus, and computer-readable storage medium
US20240054009A1 (en) Processing system, and information processing apparatus and method
KR102307539B1 (en) System for cloud streaming service, method of image cloud streaming service using process shortering and apparatus for the same
US11086592B1 (en) Distribution of audio recording for social networks
KR20200115314A (en) User interface screen recovery method in cloud streaming service and apparatus therefor

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20865846

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20865846

Country of ref document: EP

Kind code of ref document: A1