CN109788339B - Video recording method and device, electronic equipment and storage medium - Google Patents

Video recording method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109788339B
CN109788339B CN201910100316.0A CN201910100316A CN109788339B CN 109788339 B CN109788339 B CN 109788339B CN 201910100316 A CN201910100316 A CN 201910100316A CN 109788339 B CN109788339 B CN 109788339B
Authority
CN
China
Prior art keywords
video
screenshot
recorded
frames
processes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910100316.0A
Other languages
Chinese (zh)
Other versions
CN109788339A (en
Inventor
周林
周崇兴
杨建东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910100316.0A priority Critical patent/CN109788339B/en
Publication of CN109788339A publication Critical patent/CN109788339A/en
Application granted granted Critical
Publication of CN109788339B publication Critical patent/CN109788339B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Television Signal Processing For Recording (AREA)

Abstract

The disclosure discloses a video recording method, a video recording device, an electronic device and a storage medium. Wherein, the method comprises the following steps: acquiring a video recording request, and determining a video file matched with the video recording request; establishing at least two screenshot processes, and distributing all video frames to be recorded corresponding to the video file to the at least two screenshot processes; capturing the distributed video frames to be recorded in the video file in parallel through the at least two capturing processes; and synthesizing the screenshot images acquired by the at least two screenshot processes into a recorded video corresponding to the video file. The video recording method and the video recording device solve the problems that a video recording process in the prior art is a serial process, the recording time is long, and the recording efficiency is low, can adopt a parallel recording scheme to record videos, and greatly improve the recording efficiency.

Description

Video recording method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to video processing technologies, and in particular, to a video recording method and apparatus, an electronic device, and a storage medium.
Background
The user makes animation in the webpage, and the generated animation can be played in the webpage. In many scenarios, a user needs to record an animation in a web page into a video to meet business requirements.
In the prior art, a video recording process generally includes, while playing an animation, performing a screenshot operation on each frame of image in the animation in sequence according to a time sequence, and capturing each frame of image included in the animation. And then synthesizing each frame of image into a video, and finishing the video recording.
The prior art has the defects that the recording process is a serial process, the recording time is long, and the recording efficiency is low.
Disclosure of Invention
The present disclosure provides a video recording method, apparatus, electronic device and storage medium, so as to optimize an existing video recording scheme and improve recording efficiency.
In a first aspect, an embodiment of the present disclosure provides a video recording method, including:
acquiring a video recording request, and determining a video file matched with the video recording request;
establishing at least two screenshot processes, and distributing all video frames to be recorded corresponding to the video file to the at least two screenshot processes;
performing screenshot on the distributed video frames to be recorded in a video file in parallel through at least two screenshot processes;
and combining the screenshot images acquired by the at least two screenshot processes into a recorded video corresponding to the video file.
In the above scheme, optionally, the video file is an animation file in a web page.
In the foregoing scheme, optionally, at least two screenshot processes are established, and all to-be-recorded video frames corresponding to the video file are allocated to the at least two screenshot processes, including:
according to the frame number of the video frame to be recorded contained in the video file, establishing a screenshot process consistent with the frame number of the video frame to be recorded contained in the video file;
and respectively distributing frame positioning information of a video frame to be recorded in the video file for each screenshot process.
In the foregoing solution, optionally, the screenshot, in a video file, of the distributed video frame to be recorded in parallel through at least two screenshot processes includes:
the following operations are executed in parallel through each screenshot process:
playing the video file;
calling a preset image interface, and jumping the playing progress of the video file to a video position matched with the allocated frame positioning information;
and capturing a video frame to be recorded at the video position of the video file.
In the foregoing scheme, optionally, at least two screenshot processes are established, and all to-be-recorded video frames corresponding to the video file are allocated to the at least two screenshot processes, including:
establishing a number M of screenshot processes; wherein M is less than the number N of video frames to be recorded contained in the video file;
calculating a downward rounding result K of the frame number N of the video frames to be recorded divided by the number M;
acquiring frame positioning information of K frames of video frames to be recorded from all video frames to be recorded in sequence, and respectively allocating the frame positioning information to M-1 screenshot processes;
and distributing frame positioning information of the last N- (M-1) K frames of video frames to be recorded in the video file to the Mth screenshot process.
In the foregoing solution, optionally, the screenshot, in a video file, of the distributed video frame to be recorded in parallel through at least two screenshot processes includes:
the following operations are executed in parallel through each screenshot process:
playing the video file;
calling a preset image interface, and sequentially jumping the playing progress of the video file to a video position matched with each piece of allocated frame positioning information;
and capturing a video frame to be recorded at the video position.
In a second aspect, an embodiment of the present disclosure further provides a video recording apparatus, including:
the request acquisition module is used for acquiring a video recording request and determining a video file matched with the video recording request;
the video frame distribution module is used for establishing at least two screenshot processes and distributing all video frames to be recorded corresponding to the video file to the at least two screenshot processes;
the screenshot module is used for carrying out screenshot on the distributed video frames to be recorded in the video file in parallel through at least two screenshot processes;
and the video synthesis module is used for synthesizing the screenshot images acquired by the at least two screenshot processes into a recorded video corresponding to the video file.
In the above scheme, optionally, the video file is an animation file in a web page.
In the foregoing solution, optionally, the video frame allocation module includes:
the first process establishing unit is used for establishing a screenshot process consistent with the frame number of the video frame to be recorded contained in the video file according to the frame number of the video frame to be recorded contained in the video file;
and the first process distribution unit is used for distributing frame positioning information of a video frame to be recorded in the video file for each screenshot process.
In the foregoing scheme, optionally, the screenshot module includes:
a first parallel unit, configured to perform the following operations in parallel through each screenshot process:
playing the video file;
calling a preset image interface, and jumping the playing progress of the video file to a video position matched with the allocated frame positioning information;
and capturing a video frame to be recorded at the video position of the video file.
In the foregoing solution, optionally, the video frame allocation module includes:
the second process establishing unit is used for establishing the number M of screenshot processes; wherein M is less than the number N of video frames to be recorded contained in the video file;
the calculating unit is used for calculating a down rounding result K obtained by dividing the number N of the video frames to be recorded by the number M;
the second process distribution unit is used for sequentially acquiring frame positioning information of K frames of video frames to be recorded from all the video frames to be recorded and distributing the frame positioning information to the M-1 screenshot processes;
and the third process distribution unit is used for distributing the frame positioning information of the last N- (M-1) K frames of video frames to be recorded in the video file to the Mth screenshot process.
In the foregoing scheme, optionally, the screenshot module includes:
a second parallel unit, configured to perform the following operations in parallel through each screenshot process:
playing the video file;
calling a preset image interface, and sequentially jumping the playing progress of the video file to a video position matched with each piece of allocated frame positioning information;
and capturing a video frame to be recorded at the video position.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, including:
one or more processors;
storage means for storing one or more programs;
when executed by one or more processors, the one or more programs cause the one or more processors to implement a video recording method as described in embodiments of the present disclosure.
In a fourth aspect, the disclosed embodiments also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the video recording method according to the disclosed embodiments.
The method and the device for recording the video have the advantages that at least two screenshot processes are established, all the video frames to be recorded corresponding to the video file are distributed to the at least two screenshot processes, then the distributed video frames to be recorded are screenshot in the video file in parallel through the at least two screenshot processes, and screenshot images obtained by the at least two screenshot processes are synthesized into the recorded video corresponding to the video file, so that the problems that the video recording process in the prior art is a serial process, the recording time is long, and the recording efficiency is low are solved, the video recording can be carried out by adopting a parallel recording scheme, and the recording efficiency is greatly improved.
Drawings
Fig. 1 is a flowchart of a video recording method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a video recording method according to an embodiment of the disclosure;
fig. 3 is a flowchart of a video recording method according to an embodiment of the disclosure;
fig. 4 is a schematic structural diagram of a video recording apparatus according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the disclosure and are not limiting of the disclosure. It should be further noted that, for the convenience of description, only some of the structures relevant to the present disclosure are shown in the drawings, not all of them.
Fig. 1 is a flowchart of a video recording method according to an embodiment of the present disclosure. The present embodiment is applicable to the case of performing video recording, and the method may be performed by a video recording apparatus, which may be implemented in software and/or hardware, and may be configured in an electronic device, for example, a terminal device or a server. As shown in fig. 1, the method may include the steps of:
step 101, acquiring a video recording request, and determining a video file matched with the video recording request.
The video recording request is used for requesting to record a video file. Optionally, the video file is an animation file in a webpage. The user makes animation in the webpage, and the generated animation file can be played in the webpage. And the user requests to record the animation file in the webpage by sending a video recording request. After a video recording request sent by a user is obtained, a video file matched with the video recording request is determined.
And 102, establishing at least two screenshot processes, and distributing all video frames to be recorded corresponding to the video file to the at least two screenshot processes.
Video generally refers to various techniques for capturing, recording, processing, storing, transmitting, and reproducing a series of still images as electrical signals. When the continuous image changes more than 24 frames per second, human eyes cannot distinguish a single static image according to the persistence of vision principle, and the static image looks smooth and continuous, so that the continuous image is called a video. The video file is composed of a plurality of frames of images. One frame of image in the video file is a frame of video frame to be recorded.
The screen capture process is a process for screen capturing an image. And establishing at least two screenshot processes, and distributing all video frames to be recorded corresponding to the video file to the at least two screenshot processes. Namely, each frame of video to be recorded has a matched screenshot process, and screenshot operation is carried out on the video.
Specifically, each frame of the video frame to be recorded has unique frame positioning information. And when the video file is manufactured, setting a preset image interface corresponding to each frame of video frame to be recorded. The playing progress of the video file can be jumped to a specified frame of video frame to be recorded through a preset image interface. The frame positioning information is interface information of a preset image interface of a video frame to be recorded. Therefore, the frame positioning information of all the video frames to be recorded corresponding to the video file is distributed to at least two screenshot processes. And the screenshot process can call a preset image interface according to the distributed frame positioning information when the video file is played, jump the playing progress of the video file to a video position matched with the frame positioning information, and screenshot a frame of video frame to be recorded at the video position.
In a specific example, according to the number of video frames to be recorded contained in a video file, a screenshot process consistent with the number of the video frames to be recorded contained in the video file is established, and then frame positioning information of one frame of the video frames to be recorded in the video file is distributed for each screenshot process. For example, the number of frames of a video frame to be recorded included in a video file is 200, 200 screenshot processes are established, and frame positioning information of one frame of the video frame to be recorded in the video file is distributed for each screenshot process. Namely, each frame of video to be recorded has a unique corresponding screenshot process, and screenshot operation is carried out on the video.
In another specific example, a number M of screenshot processes is established; and M is less than the number N of the video frames to be recorded contained in the video file. After the frame number N of the video frames to be recorded contained in the video file is determined, splitting a screenshot task of the N video frames to be recorded into M screenshot tasks, and distributing the M screenshot tasks to M screenshot processes. Specifically, a down-rounding result K obtained by dividing the number N of video frames to be recorded by the number M is calculated. And then sequentially acquiring frame positioning information of K frames of video frames to be recorded from all the video frames to be recorded, respectively allocating the frame positioning information to M-1 screenshot processes, and allocating the frame positioning information of the last N- (M-1) × K frames of video frames to be recorded in the video file to the Mth screenshot process. For example, a 100 number of screen shot processes are established. The video file contains 216 frames of video frames to be recorded. The rounding-down result K is equal to 2 after the number of frames 216 of the video frame to be recorded is divided by the number 100. And sequentially acquiring 2 frames of video frames to be recorded from all the video frames to be recorded, and respectively allocating the 2 frames of video frames to be recorded to 99 screenshot processes. And distributing the last 18 video frames to be recorded in the video file to the 100 th screenshot process.
And 103, performing screenshot on the distributed video frames to be recorded in the video file in parallel through at least two screenshot processes.
The following operations are executed in parallel through each screenshot process: playing the video file; calling a preset image interface, and sequentially jumping the playing progress of the video file to a video position matched with each piece of allocated frame positioning information; and capturing a frame of video frame to be recorded at the video position of the video file to obtain a corresponding captured image.
And 104, synthesizing the screenshot images acquired by the at least two screenshot processes into a recorded video corresponding to the video file.
After acquiring the screenshot image corresponding to each to-be-recorded video frame through at least two screenshot processes, according to a preset frame rate and the sequence of the to-be-recorded video frame corresponding to each screenshot image in a video file, synthesizing all the screenshot images acquired by the at least two screenshot processes into a recorded video corresponding to the video file.
According to the technical scheme, at least two screenshot processes are established, all the video frames to be recorded corresponding to the video file are distributed to the at least two screenshot processes, then the distributed video frames to be recorded are screenshot in the video file in parallel through the at least two screenshot processes, and screenshot images obtained by the at least two screenshot processes are synthesized into a recorded video corresponding to the video file, so that the problems that the video recording process in the prior art is a serial process, the recording time is long, and the recording efficiency is low are solved, the video recording can be performed by adopting a parallel recording scheme, and the recording efficiency is greatly improved.
Fig. 2 is a flowchart of a video recording method according to an embodiment of the present disclosure. This embodiment may be combined with various alternatives in one or more of the above embodiments, and in this embodiment, the video file is an animation file in a web page.
And establishing at least two screenshot processes, and distributing all video frames to be recorded corresponding to the video file to the at least two screenshot processes, which may include: according to the frame number of the video frame to be recorded contained in the video file, establishing a screenshot process consistent with the frame number of the video frame to be recorded contained in the video file; and respectively distributing frame positioning information of a video frame to be recorded in the video file for each screenshot process.
And through at least two screenshot processes, in the video file, screenshot is performed on the distributed video frame to be recorded in parallel, which may include: the following operations are executed in parallel through each screenshot process: playing the video file; calling a preset image interface, and jumping the playing progress of the video file to a video position matched with the allocated frame positioning information; and capturing a video frame to be recorded at the video position of the video file.
As shown in fig. 2, the method may include the steps of:
step 201, a video recording request is obtained, and a video file matched with the video recording request is determined.
Step 202, according to the number of the video frames to be recorded contained in the video file, establishing a screenshot process consistent with the number of the video frames to be recorded contained in the video file.
The video file is an animation file in a webpage. The number of video frames to be recorded contained in the video file is the number of image frames contained in the animation file. For example, the number of image frames included in an animation file is 200 frames. And establishing screenshot processes consistent with the frame number of the video frames to be recorded contained in the video file, namely establishing 200 screenshot processes.
Step 203, distributing frame positioning information of a video frame to be recorded in the video file for each screenshot process.
Each frame of video to be recorded has unique frame positioning information. And when the video file is manufactured, setting a preset image interface corresponding to each frame of video frame to be recorded. The playing progress of the video file can be jumped to a specified frame of video frame to be recorded through a preset image interface. The frame positioning information is interface information of a preset image interface of a video frame to be recorded. And respectively distributing frame positioning information of a video frame to be recorded in the video file for each screenshot process. Namely, each frame of the video frame to be recorded has a unique corresponding screenshot process, and screenshot operation is carried out on the screenshot process.
Step 204, executing the following operations in parallel through each screenshot process: playing the video file; calling a preset image interface, and jumping the playing progress of the video file to a video position matched with the allocated frame positioning information; and capturing a video frame to be recorded at the video position of the video file.
Wherein, a screenshot process corresponds to the frame positioning information of a frame of video frame to be recorded. And executing screenshot operation in parallel through each screenshot process to complete the screenshot task of all the video frames to be recorded.
Specifically, each screenshot process plays a video file, and when the video file is played, a preset image interface is called according to the distributed frame positioning information, the playing progress of the video file is jumped to a video position matched with the frame positioning information, and a frame of video frame to be recorded at the video position is subjected to screenshot.
And step 205, combining the screenshot images obtained by the at least two screenshot processes into a recorded video corresponding to the video file.
In the technical scheme of this embodiment, screenshot processes consistent with the number of frames of video frames to be recorded included in a video file are established, frame positioning information of one frame of video frame to be recorded in the video file is respectively allocated to each screenshot process, and then the following operations are executed in parallel through each screenshot process: playing the video file; calling a preset image interface, and jumping the playing progress of the video file to a video position matched with the allocated frame positioning information; the method comprises the steps of capturing a frame of video frame to be recorded at the video position of a video file, establishing a capturing process consistent with the frame number of the video frame to be recorded, completing capturing operation of all the video frames to be recorded in parallel through the established capturing process, realizing parallel recording and improving recording efficiency.
Fig. 3 is a flowchart of a video recording method according to an embodiment of the present disclosure. In this embodiment, at least two screenshot processes are established, and all to-be-recorded video frames corresponding to the video file are allocated to the at least two screenshot processes, which may be combined with each alternative in one or more of the above embodiments, and include: establishing a number M of screenshot processes; wherein M is less than the number N of video frames to be recorded contained in the video file; calculating a downward rounding result K of the frame number N of the video frames to be recorded divided by the number M; acquiring frame positioning information of K frames of video frames to be recorded from all video frames to be recorded in sequence, and respectively allocating the frame positioning information to M-1 screenshot processes; and distributing frame positioning information of the last N- (M-1) K frames of video frames to be recorded in the video file to the Mth screenshot process.
And through at least two screenshot processes, in the video file, screenshot is performed on the distributed video frame to be recorded in parallel, which may include: the following operations are executed in parallel through each screenshot process: playing the video file; calling a preset image interface, and sequentially jumping the playing progress of the video file to a video position matched with each piece of allocated frame positioning information; and capturing a video frame to be recorded at the video position.
As shown in fig. 3, the method may include the steps of:
step 301, a video recording request is obtained, and a video file matched with the video recording request is determined.
Step 302, establishing a number M of screenshot processes; and M is less than the number N of the video frames to be recorded contained in the video file.
The number M may be preset according to a service requirement. For example, a 100 number of screen shot processes are established. The video file contains 216 frames of video frames to be recorded.
Step 303, calculating a rounding-down result K obtained by dividing the number of frames N of the video frame to be recorded by the number M.
Wherein rounding-down means that when the result of the calculation is not an integer, an integer smaller than the result of the calculation is taken. For example, a 100 number of screen shot processes are established. The video file contains 216 frames of video frames to be recorded. The rounding-down result K is equal to 2 after the number of frames 216 of the video frame to be recorded is divided by the number 100.
And step 304, sequentially acquiring frame positioning information of K frames of video frames to be recorded from all the video frames to be recorded, and respectively allocating the frame positioning information to M-1 screenshot processes.
And acquiring frame positioning information of K frames of video frames to be recorded, which are respectively allocated to M frames of video frames to be recorded, from all the video frames to be recorded in sequence according to the sequence of the video frames to be recorded contained in the video file, and respectively allocating the frame positioning information to M-1 screenshot processes. For example, the rounding-down result K obtained by dividing the number 216 of video frames to be recorded by the number 100 is equal to 2. And sequentially acquiring 2 frames of video frames to be recorded from all the video frames to be recorded, and respectively allocating the 2 frames of video frames to be recorded to 99 screenshot processes.
And 305, distributing frame positioning information of the last N- (M-1) K frames of video frames to be recorded in the video file to the Mth screenshot process.
And distributing the frame positioning information of the video frame to be recorded corresponding to the first M-1 screenshot processes to the Mth screenshot process according to the downward rounding result K, and distributing the remaining last N- (M-1) × K frame video frame to be recorded to the frame positioning information of the Mth frame video frame to be recorded.
Therefore, after the frame number N of the video frames to be recorded contained in the video file is determined, the screenshot tasks of the N video frames to be recorded are split into M screenshot tasks and distributed to M screenshot processes.
For example, the rounding-down result K obtained by dividing the number 216 of video frames to be recorded by the number 100 is equal to 2. And sequentially acquiring 2 frames of video frames to be recorded from all the video frames to be recorded, and respectively allocating the 2 frames of video frames to be recorded to 99 screenshot processes. And distributing the last 18 video frames to be recorded in the video file to the 100 th screenshot process.
Step 306, executing the following operations in parallel through each screenshot process: playing the video file; calling a preset image interface, and sequentially jumping the playing progress of the video file to a video position matched with each piece of allocated frame positioning information; and capturing a video frame to be recorded at the video position.
One screenshot process may correspond to frame positioning information of multiple frames of video frames to be recorded, and screenshot operation of the multiple frames of video frames to be recorded needs to be completed. And executing screenshot operation in parallel through each screenshot process to complete the screenshot task of all the video frames to be recorded.
Specifically, each screenshot process plays a video file, and when the video file is played, a preset image interface is called according to each allocated frame positioning information respectively, and the playing progress of the video file is sequentially jumped to a video position matched with each allocated frame positioning information; and capturing a video frame to be recorded at the video position. Therefore, each screenshot process completes screenshot operation of the corresponding multi-frame video frame to be recorded in parallel.
And 307, synthesizing the screenshot images acquired by the at least two screenshot processes into a recorded video corresponding to the video file.
According to the technical scheme, the screenshot processes of the number M are established; the method comprises the following steps that M is smaller than the number N of video frame frames to be recorded contained in a video file, then a downward integral result K obtained by dividing the number N of the video frame frames to be recorded by the number M is calculated, frame positioning information of the K video frames to be recorded is sequentially obtained from all the video frames to be recorded and is respectively distributed to M-1 screenshot processes, frame positioning information of the last N- (M-1) × K video frames to be recorded in the video file is distributed to the Mth screenshot process, and then the following operations are executed in parallel through each screenshot process: playing the video file; calling a preset image interface, and sequentially jumping the playing progress of the video file to a video position matched with each piece of allocated frame positioning information; the method comprises the steps of capturing a video frame to be recorded at a video position, splitting a capturing task of the N frames of the video frame to be recorded into M capturing tasks after determining the number N of the video frame to be recorded contained in a video file, distributing the M capturing tasks to M capturing processes, completing capturing operation on all the video frames to be recorded in parallel through the M capturing processes, realizing parallel recording and improving recording efficiency.
Fig. 4 is a schematic structural diagram of a video recording apparatus according to an embodiment of the present disclosure. The embodiment can be applied to the video recording. The apparatus can be implemented in software and/or hardware, and the apparatus can be configured in an electronic device. As shown in fig. 4, the apparatus may include: a request acquisition module 401, a video frame allocation module 402, a screenshot module 403 and a video composition module 404.
The request obtaining module 401 is configured to obtain a video recording request, and determine a video file matched with the video recording request; a video frame allocation module 402, configured to establish at least two screenshot processes, and allocate all to-be-recorded video frames corresponding to the video file to the at least two screenshot processes; a screenshot module 403, configured to perform screenshot on the allocated video frame to be recorded in a video file in parallel through at least two screenshot processes; and a video synthesizing module 404, configured to synthesize the screenshot images obtained in the at least two screenshot processes into a recorded video corresponding to the video file.
According to the technical scheme, at least two screenshot processes are established, all the video frames to be recorded corresponding to the video file are distributed to the at least two screenshot processes, then the distributed video frames to be recorded are screenshot in the video file in parallel through the at least two screenshot processes, and screenshot images obtained by the at least two screenshot processes are synthesized into a recorded video corresponding to the video file, so that the problems that the video recording process in the prior art is a serial process, the recording time is long, and the recording efficiency is low are solved, the video recording can be performed by adopting a parallel recording scheme, and the recording efficiency is greatly improved.
Optionally, on the basis of the above technical solution, the video file may be an animation file in a web page.
Optionally, on the basis of the foregoing technical solution, the video frame allocation module 402 may include: the first process establishing unit is used for establishing a screenshot process consistent with the frame number of the video frame to be recorded contained in the video file according to the frame number of the video frame to be recorded contained in the video file; and the first process distribution unit is used for distributing frame positioning information of a video frame to be recorded in the video file for each screenshot process.
Optionally, on the basis of the foregoing technical solution, the screenshot module 403 may include: a first parallel unit, configured to perform the following operations in parallel through each screenshot process: playing the video file; calling a preset image interface, and jumping the playing progress of the video file to a video position matched with the allocated frame positioning information; and capturing a video frame to be recorded at the video position of the video file.
Optionally, on the basis of the foregoing technical solution, the video frame allocation module 402 may include: the second process establishing unit is used for establishing the number M of screenshot processes; wherein M is less than the number N of video frames to be recorded contained in the video file; the calculating unit is used for calculating a down rounding result K obtained by dividing the number N of the video frames to be recorded by the number M; the second process distribution unit is used for sequentially acquiring frame positioning information of K frames of video frames to be recorded from all the video frames to be recorded and distributing the frame positioning information to the M-1 screenshot processes; and the third process distribution unit is used for distributing the frame positioning information of the last N- (M-1) K frames of video frames to be recorded in the video file to the Mth screenshot process.
Optionally, on the basis of the foregoing technical solution, the screenshot module 403 may include: a second parallel unit, configured to perform the following operations in parallel through each screenshot process: playing the video file; calling a preset image interface, and sequentially jumping the playing progress of the video file to a video position matched with each piece of allocated frame positioning information; and capturing a video frame to be recorded at the video position.
The video recording device provided by the embodiment of the disclosure can execute the video recording method provided by the embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method.
Referring now to fig. 5, a schematic diagram of an electronic device (e.g., a terminal device or a server) 500 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 501.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a video recording request, and determining a video file matched with the video recording request; establishing at least two screenshot processes, and distributing all video frames to be recorded corresponding to the video file to the at least two screenshot processes; performing screenshot on the distributed video frames to be recorded in a video file in parallel through at least two screenshot processes; and combining the screenshot images acquired by the at least two screenshot processes into a recorded video corresponding to the video file.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules and units described in the embodiments of the present disclosure may be implemented by software or hardware. For example, the request acquisition module may be further described as a "module for acquiring a video recording request and determining a video file matching the video recording request", and the first process establishing unit may be further described as a "unit for establishing a screenshot process that is consistent with the number of video frames to be recorded included in the video file, according to the number of video frames to be recorded included in the video file".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (6)

1. A method for video recording, comprising:
acquiring a video recording request, and determining a video file matched with the video recording request;
establishing at least two screenshot processes, and distributing all video frames to be recorded corresponding to the video file to the at least two screenshot processes, wherein the screenshot processes comprise: establishing a number M of screenshot processes; wherein, M is less than the number N of video frames to be recorded contained in the video file; calculating a downward rounding result K obtained by dividing the number N of the video frames to be recorded by the number M; acquiring frame positioning information of K frames of video frames to be recorded from all the video frames to be recorded in sequence, and respectively allocating the frame positioning information to M-1 screenshot processes, wherein the frame positioning information is interface information of a preset image interface of the video frames to be recorded; distributing frame positioning information of the last N- (M-1) K frames of video frames to be recorded in the video file to the Mth screenshot process;
and performing screenshot on the distributed video frames to be recorded in the video file in parallel through the at least two screenshot processes, wherein the following operations are performed in parallel through each screenshot process: playing the video file; calling a preset image interface, sequentially jumping the playing progress of the video file to a video position matched with each piece of distributed frame positioning information, and capturing a frame of video frame to be recorded at the video position;
and synthesizing the screenshot images acquired by the at least two screenshot processes into a recorded video corresponding to the video file.
2. The method of claim 1, wherein the video file is an animation file in a web page.
3. A video recording apparatus, comprising:
the request acquisition module is used for acquiring a video recording request and determining a video file matched with the video recording request;
the video frame distribution module is used for establishing at least two screenshot processes and distributing all video frames to be recorded corresponding to the video file to the at least two screenshot processes, and comprises the following steps: the second process establishing unit is used for establishing the number M of screenshot processes; wherein M is less than the number N of video frames to be recorded contained in the video file; the calculating unit is used for calculating a down rounding result K obtained by dividing the number N of the video frames to be recorded by the number M; the second process distribution unit is used for acquiring frame positioning information of K frames of video frames to be recorded from all the video frames to be recorded in sequence and distributing the frame positioning information to the M-1 screenshot processes respectively, wherein the frame positioning information is interface information of a preset image interface of the video frames to be recorded; the third process distribution unit is used for distributing the frame positioning information of the last N- (M-1) K frames of video frames to be recorded in the video file to the Mth screenshot process;
and the screenshot module is used for performing screenshot on the distributed video frames to be recorded in the video file in parallel through the at least two screenshot processes, and comprises the following steps: a second parallel unit, configured to perform the following operations in parallel through each screenshot process: playing the video file; calling a preset image interface, and sequentially jumping the playing progress of the video file to a video position matched with each piece of allocated frame positioning information; capturing a frame of video frame to be recorded at a video position;
and the video synthesis module is used for synthesizing the screenshot images acquired by the at least two screenshot processes into a recorded video corresponding to the video file.
4. The apparatus of claim 3, wherein the video file is an animation file in a web page.
5. An electronic device, characterized in that the electronic device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the video recording method of any of claims 1-2.
6. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the video recording method according to any one of claims 1-2.
CN201910100316.0A 2019-01-31 2019-01-31 Video recording method and device, electronic equipment and storage medium Active CN109788339B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910100316.0A CN109788339B (en) 2019-01-31 2019-01-31 Video recording method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910100316.0A CN109788339B (en) 2019-01-31 2019-01-31 Video recording method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109788339A CN109788339A (en) 2019-05-21
CN109788339B true CN109788339B (en) 2020-05-12

Family

ID=66504038

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910100316.0A Active CN109788339B (en) 2019-01-31 2019-01-31 Video recording method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109788339B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314777B (en) * 2019-12-06 2021-03-30 北京沃东天骏信息技术有限公司 Video generation method and device, computer storage medium and electronic equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102012818B (en) * 2010-12-01 2014-03-26 广东威创视讯科技股份有限公司 Screen recording method and device
CN103488371A (en) * 2012-06-11 2014-01-01 中兴通讯股份有限公司 Method for making animation on mobile terminal and mobile terminal
CN104035684A (en) * 2013-03-06 2014-09-10 腾讯科技(深圳)有限公司 Dynamic screen capture method and system applicable to mobile terminal
CN103974146A (en) * 2014-05-30 2014-08-06 深圳市同洲电子股份有限公司 Video processing method, client and system
CN104092920A (en) * 2014-07-16 2014-10-08 浙江航天长峰科技发展有限公司 Audio and video synchronizing method
CN105635613B (en) * 2015-12-16 2019-06-04 北京奇虎科技有限公司 A kind of record screen method and apparatus of mobile device
CN108933769B (en) * 2017-05-27 2021-05-28 武汉斗鱼网络科技有限公司 Streaming media screenshot system, method and device

Also Published As

Publication number Publication date
CN109788339A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
US11943486B2 (en) Live video broadcast method, live broadcast device and storage medium
WO2021008223A1 (en) Information determination method and apparatus, and electronic device
CN109769141B (en) Video generation method and device, electronic equipment and storage medium
CN112259062B (en) Special effect display method and device, electronic equipment and computer readable medium
CN111405173B (en) Image acquisition method and device, point reading equipment, electronic equipment and storage medium
US11785195B2 (en) Method and apparatus for processing three-dimensional video, readable storage medium and electronic device
CN109753332B (en) Method and device for displaying information
US11783865B2 (en) Method and apparatus for displaying video playback page, and electronic device and medium
CN110022493B (en) Playing progress display method and device, electronic equipment and storage medium
CN113839829A (en) Cloud game delay testing method, device and system and electronic equipment
CN109788339B (en) Video recording method and device, electronic equipment and storage medium
CN109640023B (en) Video recording method, device, server and storage medium
CN112734631A (en) Video image face changing method, device, equipment and medium based on fine adjustment model
US11750876B2 (en) Method and apparatus for determining object adding mode, electronic device and medium
CN114584709B (en) Method, device, equipment and storage medium for generating zooming special effects
CN116546229A (en) Interaction method, device, electronic equipment and computer readable medium
CN110177270A (en) Video head frame test method and device
JP2024528483A (en) Method, system and device for playing effects in live streaming rooms
CN111385638B (en) Video processing method and device
CN112822418B (en) Video processing method and device, storage medium and electronic equipment
CN110047520B (en) Audio playing control method and device, electronic equipment and computer readable storage medium
EP4435713A1 (en) Video texture migration method and apparatus, electronic device and storage medium
CN117492626A (en) Multi-device mouse control method, device, equipment and medium
CN117640989A (en) Video processing method and device
CN116668619A (en) Video processing method and device and electronic equipment

Legal Events

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