CN113766241A - Video recording method, device, storage medium and terminal equipment - Google Patents

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

Info

Publication number
CN113766241A
CN113766241A CN202111202831.3A CN202111202831A CN113766241A CN 113766241 A CN113766241 A CN 113766241A CN 202111202831 A CN202111202831 A CN 202111202831A CN 113766241 A CN113766241 A CN 113766241A
Authority
CN
China
Prior art keywords
video
state
window
file
focus
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.)
Pending
Application number
CN202111202831.3A
Other languages
Chinese (zh)
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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202111202831.3A priority Critical patent/CN113766241A/en
Publication of CN113766241A publication Critical patent/CN113766241A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The embodiment of the application discloses a video recording method, a video recording device, a storage medium and terminal equipment, and belongs to the field of network communication. The method comprises the following steps: when a video recording starting instruction for a video playing page is received, detecting the state of a video window in the video playing page; the video window is used for playing video stream data; if the state of the video window is the state of obtaining the focus, extracting a video frame from video stream data by using a video decoder; converting the video frame into a video image; converting the video image into byte codes; the bytecode is written into a video file. According to the method and the device, the video file with the same content as the original video is obtained from the bottom layer by extracting the video frame of the video decoder, so that the user operation is prevented from being recorded, and the user experience is improved.

Description

Video recording method, device, storage medium and terminal equipment
Technical Field
The present application relates to the field of computers, and in particular, to a video recording method, apparatus, storage medium, and terminal device.
Background
With the development of streaming media technology, video content is more and more abundant, and a user has a video recording demand, and a current video recording mode adopts a screen recording plug-in to record a video picture on a screen to obtain a video file, however, such recording can cause the user to operate on the screen, for example: window enlarging operation, cursor moving operation or other window moving operation, etc., and the video file with the same content as the original video content cannot be recorded.
Disclosure of Invention
In order to solve the above technical problems, the present application provides a video recording method, an apparatus, a storage medium, and a terminal device, which solve the problem in the prior art that a user operation is attached when video recording is performed on video stream data.
In a first aspect, the present application provides a video recording method, including:
when a video recording starting instruction for a video playing page is received, detecting the state of a video window in the video playing page; the video window is used for playing video stream data;
if the state of the video window is the state of obtaining a focus, extracting a video frame from the video stream data by using a video decoder;
converting the video frame into a video image;
converting the video image into a bytecode;
writing the bytecode into a video file.
In one possible design, the detecting a state of a video window in the video playback page includes:
acquiring stack data positioned at the top of a stack in a stack corresponding to the video playing page;
and if the stack data is associated with the video window, the video window is in a focus obtaining state.
In one possible design, the writing the bytecode to a video file includes:
setting a file lock for the video file;
and writing the byte codes into the video file in a file stream mode.
In one possible design, the converting the video image into byte code includes:
acquiring the file size of the video image;
applying for a storage space in a memory according to the file size;
and calling a Java virtual machine to convert the video image into byte codes and temporarily storing the byte codes into the storage space.
In one possible design, further comprising:
in the video recording process, if the state of the video window is detected to be switched from the state of obtaining the focus to the state of losing the focus, the video frame is suspended from being extracted, and the position information of the current video frame is recorded.
In one possible design, after the recording the position information of the current video frame, the method further includes:
and if the state of the video window is detected to be switched from the state of losing the focus to the state of obtaining the focus, acquiring the position information of the pre-stored video frame, taking the video frame indicated by the acquired position information as an initial video frame, and continuously extracting the video frame.
In one possible design, further comprising:
and when receiving a video recording end instruction aiming at the video playing page or finishing playing of the video stream data, stopping extracting video frames and carrying out persistent storage on the video file.
In a second aspect, the present application provides an apparatus for accessing a resource, comprising:
the device comprises a detection unit, a processing unit and a display unit, wherein the detection unit is used for detecting the state of a video window in a video playing page when receiving a video recording starting instruction aiming at the video playing page; the video window is used for playing video stream data;
an extracting unit, configured to extract a video frame from the video stream data by using a video decoder if the state of the video window is the focus state;
a conversion unit for converting the video frame into a video image; and converting the video image into a bytecode;
and the writing unit is used for writing the byte codes into a video file.
In yet another aspect, the present application provides an apparatus that may implement the method of the first aspect. The apparatus may be a chip or a terminal device, for example. The above-described method may be implemented by software, hardware, or by executing corresponding software by hardware.
In one possible implementation manner, the structure of the apparatus includes a processor, a memory; the processor is configured to support the apparatus to perform the corresponding functions in the above-described method. The memory is used for coupling with the processor, which holds the necessary programs (instructions) and/or data for the device. Optionally, the apparatus may further include a communication interface for supporting communication between the apparatus and other network elements.
In another possible implementation manner, the apparatus may include unit modules for performing corresponding actions in the above-described method.
In yet another possible implementation, the wireless communication device includes a processor and a transceiver, the processor is coupled to the transceiver, and the processor is configured to execute a computer program or instructions to control the transceiver to receive and transmit information; the processor is further configured to implement the above-described method when the processor executes the computer program or instructions.
Another aspect of the present application provides a terminal device, including: a memory and a processor; wherein the memory stores a set of program codes, and the processor is configured to call the program codes stored in the memory and execute the method of the aspects. The terminal equipment can be terminal equipment, and the terminal equipment can be a mobile phone, a tablet personal computer or wearable equipment and the like.
Yet another aspect of the present application provides a computer-readable storage medium having stored therein instructions, which when executed on a computer, cause the computer to perform the method of the above-described aspects.
Yet another aspect of the present application provides a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of the above-described aspects.
According to the above embodiment, when a video needs to be recorded on video stream data, a video decoder decodes the video stream data to obtain continuous video frames, then extracts the video frames from the decoding result, converts the video frames into video images, and converts the video images into byte codes to be written into a video file.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram of a network architecture provided by an embodiment of the present application;
fig. 2 is a schematic flowchart of a video recording method according to an embodiment of the present application;
fig. 3 is another schematic flowchart of a video recording method according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of an apparatus provided in an embodiment of the present application;
fig. 5 is another schematic structural diagram of an apparatus provided herein.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance. It will be apparent to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
Fig. 1 shows an exemplary system architecture that can be applied to the video recording method or video recording apparatus of the present application.
As shown in fig. 1, the system architecture may include a terminal device 1 and a media server 2. The media server 2 pushes media stream data to the terminal device, the media stream data comprises video stream data and audio stream data, after the terminal device receives the media stream data, the video decoder is used for decoding the video stream data and then playing a video picture in a video window of the display unit, and the audio decoder is used for decoding the audio stream data and then synchronously outputting sound in the audio unit. The terminal device 1 and the media server 2 communicate with each other via a network (not shown in fig. 1), which is a medium for providing a communication link. The network may include various types of wired or wireless communication links, such as: the wired communication link includes an optical fiber, a twisted pair wire, or a coaxial cable, and the WIreless communication link includes a bluetooth communication link, a WIreless-FIdelity (Wi-Fi) communication link, or a microwave communication link, etc.
The user can use the terminal device 1 to receive service data or control data from the media server 2 or transmit control data to the media server 2 by interacting with the media server 2. Various internet applications may be installed on the terminal device 1, such as: video recording application, video playing application, voice interaction application, search application, instant messaging tool, mailbox client, social platform software, etc.
The terminal device 1 may further be installed with a display device, and the display may be various devices capable of implementing a display function, for example: a Cathode ray tube (CR) display, a Light-emitting diode (LED) display, an electronic ink panel, a Liquid Crystal Display (LCD), a Plasma Display Panel (PDP), and the like. The user can view information such as displayed characters, pictures, videos, and the like by using the display device on the terminal device 1.
It should be noted that the video recording method provided in the embodiment of the present application is generally executed by the terminal device 1, and accordingly, the video recording apparatus is generally disposed in the terminal device 1.
The media server 2 may be hardware or software. When the media server 2 is hardware, it may be implemented as a distributed server cluster composed of multiple servers, or may be implemented as a single server. When the media server 2 is software, it may be implemented as a plurality of software or software modules (for example, to provide distributed services), or may be implemented as a single software or software module, and is not limited in particular herein.
It should be understood that the number of terminal devices and media servers in fig. 1 is merely illustrative. Any number of terminal devices and media servers may be used, as desired for implementation.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Referring to fig. 2, fig. 2 is a schematic flowchart of a method for accessing a resource according to an embodiment of the present application, where the method includes:
s201, when a video recording starting instruction for a video playing page is received, detecting the state of a video window in the video playing page.
The method comprises the steps that a terminal device opens a page through a browser or an APP (application), whether a video link address exists in the page is detected, if yes, the page is determined to be a video playing page, the video playing page comprises a video window, the video window is an area for playing video stream data, the video stream data come from a media server, the media server is deployed in the internet or a local area network, a video decoder decodes the video stream data, and then a video picture is played in the video window. The terminal device displays a video recording control panel in a video playing page, for example: show the video and record control panel in the upper right side of video window, the video is recorded control panel and is included a plurality of widgets, and the widget is human-computer interaction's interface, and a plurality of widgets include: the video recording system comprises a starting control, an ending control and a parameter setting control, wherein the starting control is used for starting video recording, the ending control is used for ending video recording, and the parameter setting control is used for setting parameters of video recording, such as: resolution, storage path and recording area of the video file, etc. When detecting that the user triggers the operation on the start control through the preset of the input device, the input device sends a video recording start operation to the processor, and the input device may be a keyboard, a mouse, a touch screen, or the like, for example: when the input device is a touch screen, the preset trigger operation is a single-point touch operation.
S202, if the state of the video window is the state of obtaining the focus, extracting a video frame from the video stream data by using a video decoder.
After receiving a video recording starting instruction, the terminal device detects the state of a video window, if the video window is in a focus obtaining state, the video window plays video in a foreground under the focus obtaining state, a video decoder is used for extracting each data frame from video stream data, if the video window is in a focus losing state, the video window stops playing video under the focus losing state or plays video in a background, the state of the video window is continuously detected, and the video frame extraction is started until the state of the video window is in the focus obtaining state. The video decoder decodes the video stream data to obtain video frames, the video frames obtained by decoding are divided into two paths, one path of video frames is sent to a video window in a video playing page to be played to form a video picture, and the other path of video frames is extracted independently to form a local video file to be stored.
And S203, converting the video frame into a video image.
The video frames extracted by the video decoder are generally subjected to compression processing, for example: intraframe compression or interframe compression, if the video frame adopts intraframe compression, the terminal equipment directly decompresses the video frame to obtain a video image; if the video frame adopts interframe compression, the video image is obtained by decompressing the related video frame of the video frame.
And S204, converting the video image into byte codes.
A byte-code is a binary file containing an executable program, consisting of a sequence of operation code/data pairs, which is an intermediate code. The process of converting the video image into the byte code includes: the method comprises the steps of obtaining the file size of a video image, applying for a storage space in a memory according to the file size, calling a java virtual machine to read data of the video image, sequentially converting the data into byte codes, and temporarily storing the converted byte codes into the applied storage space.
And S205, writing the byte code into the video file.
The terminal device creates a video file, and writes the bytecode into the video file, where the writing mode may be that each converted bytecode is written into the video file through a file stream FileInputStream in a first-come first-write mode, and the encapsulation format of the video file is not limited in this application. When the video window is in a playing state, the terminal device continuously extracts the video frame, converts the video image, converts the byte code and writes the byte code in the background based on the steps of S202 to S205 until the video stream data finishes playing or receives a video recording end instruction for a video playing page, the video stream data end playing means that the video stream data reaches the end time, and when the method for detecting the video stream data end playing detects that the video frame is the end video frame, the video stream data end playing is determined.
In one or more possible embodiments, the present application supports a function of breakpoint resume, and in a video recording process, if it is detected that a state of a video window is switched from an acquired focus state to an lost focus state, that is, when background play or pause play is switched from foreground play to background play, the video frame is paused to be extracted, and position information of a current video frame is recorded, where the position information may be represented by a sequence number or play time of the video frame. Further, if the state of the video window is detected to be switched from the focus losing state to the focus obtaining state, that is, the background playing or the pause playing is switched to the foreground playing, the position information of the pre-stored video frame is obtained, the video frame indicated by the position information is used as the initial video frame, the video frame is continuously extracted, and the byte code is added on the basis of the previous video file, so that the function of breakpoint resuming is realized, and the video recording efficiency is improved.
By implementing the embodiment of the application, when video recording of video stream data is needed, the video decoder decodes the video stream data to obtain continuous video frames, then extracts the video frames from the decoding result, converts the video frames into video images, and converts the video images into byte codes to be written into the video files.
Referring to fig. 3, another schematic flow chart of a video recording method according to an embodiment of the present application is shown, where in the embodiment of the present application, the method includes:
s301, receiving a video recording starting instruction aiming at a video playing page.
The terminal device displays a page and detects whether the page is a video playing page, wherein the detection method can be that whether the video playing page comprises a video window, and the video window is used for playing video stream data from a media server. When the page is detected to be a video playing page, a video recording control panel is displayed on the video playing page, and the video recording control panel can be interactively operated based on the input device to control the start or the end of video recording and the like. The video recording control panel comprises a starting control, an ending control and a parameter setting control, and a video recording starting instruction is generated by detecting the triggering operation of a user on the starting control.
S302, stack data on the top of a stack in a stack corresponding to the video playing page is obtained.
The video playing page comprises a plurality of controls, a video window belongs to one of the controls, the video playing page is provided with a stack, the stack is a data structure which enters first and then exits, the stack comprises a plurality of stack data, the stack data comprises attribute information such as identification, state and position of the controls, each control corresponds to one stack data, and the terminal equipment acquires the stack data positioned at the top of the stack.
S303, judging whether the stack data at the top of the stack corresponds to a video window.
If the determination result is yes, S304 is executed, and if the determination result is no, the state of the video window is the focus lost state, and the video window may be in a state of playing the video in the background or pausing the playing of the video.
S304, determining the state of the video window as an acquisition focus state.
When the stack data of the video window is located at the top of the stack, the state of the video window is the state of acquiring the focus, namely the video window plays a video in the foreground.
S305, extracting a video frame from the video stream data by using a video decoder.
The video decoder decodes video stream data to obtain video frames, the video frames obtained by decoding are divided into two paths, one path of the video frames is sent to a video window in a video playing page to be played to form a video picture, and the other path of the video frames is extracted independently to form a local video file to be stored.
S306, converting the video frame into a video image.
The specific process of S306 may refer to the description of S203 in fig. 2, and is not described herein again.
S307, acquiring the file size of the video image.
And S308, applying for a storage space in the memory according to the file size.
S309, calling the Java virtual machine to convert the video image into byte codes and temporarily storing the byte codes into a storage space.
S310, setting a file lock for the video file, and writing the byte code into the video file in a file stream mode.
The file lock is used for ensuring that the video file can only be written by the appointed process, and other processes can only read the data of the video file, so that the data in the video file can be prevented from being illegally tampered or deleted by other processes. The terminal device detects whether a video file exists, if not, creates the video file, and writes the byte codes into the video file, where the writing mode may be that each converted byte code is written into the video file through a file stream FileInputStream in a first-come first-write mode, and the encapsulation format of the video file is not limited in the present application.
S310, when a video recording ending instruction aiming at a video playing page or video stream data ending playing is received, stopping extracting video frames, and performing persistence processing on a video file.
When the terminal device detects that a user triggers an ending control on a video recording control panel, a video recording ending instruction is generated, or the terminal device detects the type of each extracted video frame, when the video frame is an ending video frame, it is determined that the streaming media data is finished being played, the video frame is stopped being extracted, and the video file is stored persistently.
By implementing the embodiment of the application, when video recording of video stream data is needed, the video decoder decodes the video stream data to obtain continuous video frames, then extracts the video frames from the decoding result, converts the video frames into video images, and converts the video images into byte codes to be written into the video files.
The above-mentioned video recording method is explained in detail in fig. 2 to 3. Correspondingly, the structure of a device in the embodiment of the application is schematically shown.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an apparatus 4 according to an embodiment of the present application, where the apparatus 4 is a video recording apparatus and may be disposed in the terminal device of fig. 1, and the apparatus 4 includes: a detection unit 401, an extraction unit 402, a conversion unit 403, and a writing unit 404.
A detecting unit 401, configured to detect a state of a video window in a video playing page when receiving a video recording start instruction for the video playing page; the video window is used for playing video stream data;
an extracting unit 402, configured to extract a video frame from the video stream data by using a video decoder if the state of the video window is the focus state;
a conversion unit 403, configured to convert the video frame into a video image; and converting the video image into a bytecode;
a writing unit 404, configured to write the bytecode into a video file.
In one or more possible embodiments, the detecting a state of a video window in the video playback page includes:
acquiring stack data positioned at the top of a stack in a stack corresponding to the video playing page;
and if the stack data is associated with the video window, the video window is in a focus obtaining state.
In one or more possible embodiments, the writing the bytecode into a video file includes:
setting a file lock for the video file;
and writing the byte codes into the video file in a file stream mode.
In one or more possible embodiments, the converting the video image into a bytecode includes:
acquiring the file size of the video image;
applying for a storage space in a memory according to the file size;
and calling a Java virtual machine to convert the video image into byte codes and temporarily storing the byte codes into the storage space.
In one or more possible embodiments, the method further comprises:
and the recording unit is used for pausing the extraction of the video frame and recording the position information of the current video frame if the state of the video window is detected to be switched from the state of obtaining the focus to the state of losing the focus in the video recording process.
In one or more possible embodiments, after the recording the position information of the current video frame, the method further includes:
and the power-off continuous storage unit is used for acquiring the position information of the pre-stored video frame if the state of the video window is detected to be switched from the focus losing state to the focus obtaining state, taking the video frame indicated by the acquired position information as an initial video frame, and continuously extracting the video frame.
In one or more possible embodiments, the method further comprises:
and the persistence unit is used for stopping extracting the video frames and performing persistent storage on the video files when receiving a video recording end instruction aiming at the video playing page or the video stream data finishes playing.
The embodiment of the present application and the method embodiments of fig. 2 to 3 are based on the same concept, and the technical effects brought by the embodiment are also the same, and the specific process may refer to the description of the method embodiments of fig. 2 to 3, and will not be described again here.
The device 4 may be a terminal device, and the device 4 may also be a field-programmable gate array (FPGA), an application-specific integrated chip (asic), a system on chip (SoC), a Central Processing Unit (CPU), a Network Processor (NP), a digital signal processing circuit, a Micro Controller Unit (MCU), or a Programmable Logic Device (PLD) or other integrated chips.
Fig. 5 is a schematic structural diagram of an apparatus provided in an embodiment of the present application, which is hereinafter referred to as an apparatus 5, where the apparatus 5 may be integrated in a terminal device, as shown in fig. 5, where the apparatus 5 includes: memory 502, processor 501, and transceiver 503.
The memory 502 may be a separate physical unit, which may be connected to the processor 501 and the transceiver 503 by a bus. The memory 502, the processor 1501, and the transceiver 503 may also be integrated, implemented by hardware, and the like.
The memory 502 is used for storing a program for implementing the above method embodiment, or various modules of the apparatus embodiment, and the processor 501 calls the program to perform the operation of the above method embodiment.
Optionally, the device 5 further comprises an input device and an output device, the input device including but not limited to a keyboard, a mouse, a touch panel, a camera and a microphone; the output device includes, but is not limited to, a display screen.
Communication interfaces are used to send and receive various types of messages and include, but are not limited to, wireless interfaces or wired interfaces.
Alternatively, when part or all of the method for accessing resources of the above embodiments is implemented by software, the apparatus may also include only the processor. The memory for storing the program is located outside the device and the processor is connected to the memory by means of circuits/wires for reading and executing the program stored in the memory.
The processor may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP.
The processor may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
The memory may include volatile memory (volatile memory), such as random-access memory (RAM); the memory may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a Hard Disk Drive (HDD) or a solid-state drive (SSD); the memory may also comprise a combination of memories of the kind described above.
The embodiment of the application also provides a computer storage medium, which stores a computer program, and the computer program is used for executing the video recording method provided by the embodiment.
Embodiments of the present application further provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the video recording method provided by the above embodiments.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

Claims (10)

1. A method for video recording, comprising:
when a video recording starting instruction for a video playing page is received, detecting the state of a video window in the video playing page; the video window is used for playing video stream data;
if the state of the video window is the state of obtaining a focus, extracting a video frame from the video stream data by using a video decoder;
converting the video frame into a video image;
converting the video image into a bytecode;
writing the bytecode into a video file.
2. The method of claim 1, wherein the detecting the state of the video window in the video playback page comprises:
acquiring stack data positioned at the top of a stack in a stack corresponding to the video playing page;
and if the stack data is associated with the video window, the video window is in a focus obtaining state.
3. The method according to claim 1 or 2, wherein said writing said bytecode into a video file comprises:
setting a file lock for the video file;
and writing the byte codes into the video file in a file stream mode.
4. The method of claim 3, wherein converting the video image into byte code comprises:
acquiring the file size of the video image;
applying for a storage space in a memory according to the file size;
and calling a Java virtual machine to convert the video image into byte codes and temporarily storing the byte codes into the storage space.
5. The method of claim 1, 2 or 4, further comprising:
in the video recording process, if the state of the video window is detected to be switched from the state of obtaining the focus to the state of losing the focus, the video frame is suspended from being extracted, and the position information of the current video frame is recorded.
6. The method of claim 5, wherein after recording the location information of the current video frame, further comprising:
and if the state of the video window is detected to be switched from the state of losing the focus to the state of obtaining the focus, acquiring the position information of the pre-stored video frame, taking the video frame indicated by the acquired position information as an initial video frame, and continuously extracting the video frame.
7. The method of claim 6, further comprising:
and when receiving a video recording end instruction aiming at the video playing page or finishing playing of the video stream data, stopping extracting video frames and carrying out persistent storage on the video file.
8. A video recording apparatus, comprising:
the device comprises a detection unit, a processing unit and a display unit, wherein the detection unit is used for detecting the state of a video window in a video playing page when receiving a video recording starting instruction aiming at the video playing page; the video window is used for playing video stream data;
an extracting unit, configured to extract a video frame from the video stream data by using a video decoder if the state of the video window is the focus state;
a conversion unit for converting the video frame into a video image; and converting the video image into a bytecode;
and the writing unit is used for writing the byte codes into a video file.
9. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to carry out the method steps according to any one of claims 1 to 7.
10. A terminal device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1 to 7.
CN202111202831.3A 2021-10-15 2021-10-15 Video recording method, device, storage medium and terminal equipment Pending CN113766241A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111202831.3A CN113766241A (en) 2021-10-15 2021-10-15 Video recording method, device, storage medium and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111202831.3A CN113766241A (en) 2021-10-15 2021-10-15 Video recording method, device, storage medium and terminal equipment

Publications (1)

Publication Number Publication Date
CN113766241A true CN113766241A (en) 2021-12-07

Family

ID=78799572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111202831.3A Pending CN113766241A (en) 2021-10-15 2021-10-15 Video recording method, device, storage medium and terminal equipment

Country Status (1)

Country Link
CN (1) CN113766241A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102724466A (en) * 2012-05-25 2012-10-10 深圳市万兴软件有限公司 Video recording method and device
CN108235107A (en) * 2016-12-15 2018-06-29 广州市动景计算机科技有限公司 Video recording method, device and electric terminal
CN110012251A (en) * 2018-01-04 2019-07-12 腾讯科技(深圳)有限公司 Video recording method, device and readable storage medium storing program for executing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102724466A (en) * 2012-05-25 2012-10-10 深圳市万兴软件有限公司 Video recording method and device
CN108235107A (en) * 2016-12-15 2018-06-29 广州市动景计算机科技有限公司 Video recording method, device and electric terminal
CN110012251A (en) * 2018-01-04 2019-07-12 腾讯科技(深圳)有限公司 Video recording method, device and readable storage medium storing program for executing

Similar Documents

Publication Publication Date Title
CN109640188B (en) Video preview method and device, electronic equipment and computer readable storage medium
CN109618177B (en) Video processing method and device, electronic equipment and computer readable storage medium
US11023716B2 (en) Method and device for generating stickers
WO2020233142A1 (en) Multimedia file playback method and apparatus, electronic device, and storage medium
CN113542757B (en) Image transmission method and device for cloud application, server and storage medium
US10271105B2 (en) Method for playing video, client, and computer storage medium
RU2619089C2 (en) Method and device for multiple videos reproduction
CN110708343B (en) Account login method, device, equipment and storage medium
US20220394333A1 (en) Video processing method and apparatus, storage medium, and electronic device
CN111629253A (en) Video processing method and device, computer readable storage medium and electronic equipment
WO2021218981A1 (en) Method and apparatus for generating interaction record, and device and medium
CN112667184A (en) Display device
CN110413347A (en) The processing method of advertisement, device, storage medium and terminal in application program
US20230185444A1 (en) Multimedia information playback and apparatus, electronic device, and computer storage medium
CN107038024B (en) Operation configuration method and equipment thereof
CN113556568B (en) Cloud application running method, system, device and storage medium
US11936928B2 (en) Method, system and device for sharing contents
CN114051120A (en) Video alarm method, device, storage medium and electronic equipment
CN114040189A (en) Multimedia test method, device, storage medium and electronic equipment
CN113766241A (en) Video recording method, device, storage medium and terminal equipment
CN112926420B (en) Display device and menu character recognition method
CN112749033B (en) Display device and system notification calling method
CN114339308A (en) Video stream loading method, electronic equipment and storage medium
CN109640023B (en) Video recording method, device, server and storage medium
JPWO2014024255A1 (en) Terminal and video playback program

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20211207

RJ01 Rejection of invention patent application after publication