CN113411661B - Method, apparatus, device, storage medium and program product for recording information - Google Patents

Method, apparatus, device, storage medium and program product for recording information Download PDF

Info

Publication number
CN113411661B
CN113411661B CN202110659679.5A CN202110659679A CN113411661B CN 113411661 B CN113411661 B CN 113411661B CN 202110659679 A CN202110659679 A CN 202110659679A CN 113411661 B CN113411661 B CN 113411661B
Authority
CN
China
Prior art keywords
data
video
audio
recording
frame
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
CN202110659679.5A
Other languages
Chinese (zh)
Other versions
CN113411661A (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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110659679.5A priority Critical patent/CN113411661B/en
Publication of CN113411661A publication Critical patent/CN113411661A/en
Application granted granted Critical
Publication of CN113411661B publication Critical patent/CN113411661B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • H04N21/4394Processing of audio elementary streams involving operations for analysing the audio stream, e.g. detecting features or characteristics in audio streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream

Landscapes

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

Abstract

本公开提供了用于记录信息的方法、装置、电子设备、存储介质及计算机程序产品,涉及媒体云技术领域。方法的一具体实施方式包括:在播放目标数据的过程中,通过开放式图形库和视频显示控件获取目标数据中所要播放的视频帧和音频帧;接收表征记录目标数据中的至少部分数据的记录操作,并根据记录操作记录至少部分数据;合并至少部分数据中的视频帧和音频帧,得到记录信息。本公开基于开放式图形库和视频显示控件可实时获取目标数据中的视频帧和音频帧,在记录时,不必依赖于关键帧的位置,避免了因关键帧丢失而造成的花屏问题,可以根据用户的录制操作实时进行音视频数据的记录。

Figure 202110659679

The disclosure provides a method, device, electronic equipment, storage medium and computer program product for recording information, and relates to the technical field of media cloud. A specific embodiment of the method includes: during the process of playing the target data, acquiring the video frame and audio frame to be played in the target data through the open graphics library and the video display control; receiving a record representing and recording at least part of the data in the target data operation, and record at least part of the data according to the recording operation; combine video frames and audio frames in at least part of the data to obtain recording information. Based on the open graphics library and the video display control, this disclosure can obtain the video frame and audio frame in the target data in real time. When recording, it does not need to depend on the position of the key frame, and avoids the blurred screen problem caused by the loss of the key frame. According to The user's recording operation records audio and video data in real time.

Figure 202110659679

Description

用于记录信息的方法、装置、设备、存储介质及程序产品Method, device, device, storage medium and program product for recording information

技术领域technical field

本公开涉及云计算技术领域,进一步涉及媒体云技术领域,尤其涉及用于记录信息的方法、装置、电子设备、存储介质以及计算机程序产品。The present disclosure relates to the technical field of cloud computing, further to the technical field of media cloud, and in particular to a method, device, electronic device, storage medium and computer program product for recording information.

背景技术Background technique

在一些情况下,用户在播放音频视频的过程中有记录所播放的音视频数据的需求。例如,审查员、监控员、直播房管等用户需要在观看视频时,对看到的视频进行实时录制。目前,一般合并所获取的未解码的音视频源数据,进行信息的记录保存。该方式下得到的记录信息的媒体音视频编码格式及分辨率等依赖原始媒体流,录制开始时间依赖于关键帧位置。In some cases, the user needs to record the played audio and video data during the playback of the audio and video. For example, users such as inspectors, monitors, and live room management need to record the video they see in real time while watching the video. At present, the obtained undecoded audio and video source data are generally combined to record and save the information. The media audio and video encoding format and resolution of the recorded information obtained in this way depend on the original media stream, and the recording start time depends on the key frame position.

发明内容Contents of the invention

本公开提供了一种用于记录信息的方法、装置、电子设备、存储介质以及计算机程序产品。The present disclosure provides a method, apparatus, electronic equipment, storage medium, and computer program product for recording information.

根据第一方面,提供了一种用于记录信息的方法,包括:在播放目标数据的过程中,通过开放式图形库和视频显示控件获取目标数据中所要播放的视频帧和音频帧;接收表征记录目标数据中的至少部分数据的记录操作,并根据记录操作记录至少部分数据;合并至少部分数据中的视频帧和音频帧,得到记录信息。According to the first aspect, there is provided a method for recording information, including: in the process of playing the target data, obtaining the video frame and audio frame to be played in the target data through the open graphics library and the video display control; receiving the characterization Recording the recording operation of at least part of the data in the target data, and recording at least part of the data according to the recording operation; combining video frames and audio frames in at least part of the data to obtain recording information.

根据第二方面,提供了一种用于记录信息的装置,包括:获取单元,被配置成在播放目标数据的过程中,通过开放式图形库和视频显示控件获取目标数据中所要播放的视频帧和音频帧;记录单元,被配置成接收表征记录目标数据中的至少部分数据的记录操作,并根据记录操作记录至少部分数据;合并单元,被配置成合并至少部分数据中的视频帧和音频帧,得到记录信息。According to the second aspect, there is provided a device for recording information, including: an acquisition unit configured to acquire video frames to be played in the target data through an open graphics library and a video display control during the process of playing the target data and an audio frame; a recording unit configured to receive a recording operation representing at least part of the data in the recording target data, and record at least part of the data according to the recording operation; a merging unit configured to merge at least a video frame and an audio frame in the at least part of the data , get record information.

根据第三方面,提供了一种电子设备,包括:至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行如第一方面任一实现方式描述的方法。According to a third aspect, there is provided an electronic device, comprising: at least one processor; and a memory communicatively connected to at least one processor; wherein, the memory stores instructions executable by at least one processor, and the instructions are processed by at least one processor executed by a processor, so that at least one processor can execute the method described in any implementation manner of the first aspect.

根据第四方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,计算机指令用于使计算机执行如第一方面任一实现方式描述的方法。According to a fourth aspect, there is provided a non-transitory computer-readable storage medium storing computer instructions, the computer instructions are used to cause a computer to execute the method described in any implementation manner of the first aspect.

根据第五方面,提供了一种计算机程序产品,包括:计算机程序,计算机程序在被处理器执行时实现如第一方面任一实现方式描述的方法。According to a fifth aspect, a computer program product is provided, including: a computer program, and when the computer program is executed by a processor, the method described in any implementation manner of the first aspect is implemented.

根据本公开的技术,基于开放式图形库和视频显示控件可实时获取目标数据中的视频帧和音频帧,在记录时,不必依赖于关键帧的位置,避免了因关键帧丢失而造成的花屏问题,可以根据用户的录制操作实时进行音视频数据的记录。According to the technology of the present disclosure, the video frame and audio frame in the target data can be obtained in real time based on the open graphics library and the video display control. When recording, it does not need to depend on the position of the key frame, avoiding the blurred screen caused by the loss of the key frame Question, audio and video data can be recorded in real time according to the user's recording operation.

应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will be readily understood through the following description.

附图说明Description of drawings

附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used to better understand the present solution, and do not constitute a limitation to the present disclosure. in:

图1是根据本公开的一个实施例可以应用于其中的示例性系统架构图;FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present disclosure can be applied;

图2是根据本公开的用于记录信息的方法的一个实施例的流程图;Figure 2 is a flowchart of one embodiment of a method for recording information according to the present disclosure;

图3是根据本实施例的用于记录信息的方法的应用场景的示意图;FIG. 3 is a schematic diagram of an application scenario of a method for recording information according to this embodiment;

图4是根据本公开的用于记录信息的方法的又一个实施例的流程图;FIG. 4 is a flowchart of another embodiment of a method for recording information according to the present disclosure;

图5是根据本公开的用于记录信息的方法的又一个实施例的结构示意图;Fig. 5 is a schematic structural diagram of another embodiment of a method for recording information according to the present disclosure;

图6是根据本公开的用于记录信息的装置的一个实施例的结构图;Fig. 6 is a structural diagram of an embodiment of a device for recording information according to the present disclosure;

图7是适于用来实现本公开实施例的计算机系统的结构示意图。FIG. 7 is a schematic structural diagram of a computer system suitable for implementing the embodiments of the present disclosure.

具体实施方式Detailed ways

以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

本公开的技术方案中,所涉及的用户个人信息的获取,存储和应用等,均符合相关法律法规的规定,采取了必要的保密措施,且不违背公序良俗。In the disclosed technical solution, the acquisition, storage, and application of user personal information involved are in compliance with relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good customs.

图1示出了可以应用本公开的用于记录信息的方法及装置的示例性架构100。FIG. 1 shows an exemplary architecture 100 to which the method and apparatus for recording information of the present disclosure can be applied.

如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。终端设备101、102、103之间通信连接构成拓扑网络,网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 1 , a system architecture 100 may include terminal devices 101 , 102 , 103 , a network 104 and a server 105 . The communication connections between the terminal devices 101 , 102 , and 103 constitute a topological network, and the network 104 is used to provide a communication link medium between the terminal devices 101 , 102 , 103 and the server 105 . Network 104 may include various connection types, such as wires, wireless communication links, or fiber optic cables, among others.

终端设备101、102、103可以是支持网络连接从而进行数据交互和数据处理的硬件设备或软件。当终端设备101、102、103为硬件时,其可以是支持网络连接,信息获取、交互、显示、处理等功能的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、膝上型便携计算机和台式计算机等等。当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中。其可以实现成例如用来提供分布式服务的多个软件或软件模块,也可以实现成单个软件或软件模块。在此不做具体限定。The terminal devices 101, 102, and 103 may be hardware devices or software that support network connections for data interaction and data processing. When the terminal devices 101, 102, 103 are hardware, they can be various electronic devices that support network connection, information acquisition, interaction, display, processing and other functions, including but not limited to smartphones, tablet computers, e-book readers, Laptops and desktop computers and more. When the terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented, for example, as a plurality of software or software modules for providing distributed services, or as a single software or software module. No specific limitation is made here.

服务器105可以是提供各种服务的服务器,例如在终端设备101、102、103播放目标数据的过程中,实时获取所播放的视频帧和音频帧,并进行音视频录制的后台处理服务器。作为示例,服务器105可以是云端服务器。The server 105 may be a server that provides various services, such as a background processing server that obtains the played video frames and audio frames in real time and performs audio and video recording during the process of playing target data by the terminal devices 101 , 102 , and 103 . As an example, server 105 may be a cloud server.

需要说明的是,服务器可以是硬件,也可以是软件。当服务器为硬件时,可以实现成多个服务器组成的分布式服务器集群,也可以实现成单个服务器。当服务器为软件时,可以实现成多个软件或软件模块(例如用来提供分布式服务的软件或软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。It should be noted that the server may be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software or software modules (such as software or software modules for providing distributed services), or as a single software or software module. No specific limitation is made here.

还需要说明的是,本公开的实施例所提供的用于记录信息的方法可以由服务器执行,也可以由终端设备执行,还可以由服务器和终端设备彼此配合执行。相应地,用于记录信息的装置包括的各个部分(例如各个单元)可以全部设置于服务器中,也可以全部设置于终端设备中,还可以分别设置于服务器和终端设备中。It should also be noted that the method for recording information provided by the embodiments of the present disclosure may be executed by a server, may also be executed by a terminal device, and may also be executed by the server and the terminal device in cooperation with each other. Correspondingly, each part (for example, each unit) included in the apparatus for recording information may be all set in the server, all may be set in the terminal device, or may be respectively set in the server and the terminal device.

应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。当用于记录信息的方法运行于其上的电子设备不需要与其他电子设备进行数据传输时,该系统架构可以仅包括用于记录信息的方法运行于其上的电子设备(例如服务器或终端设备)。It should be understood that the numbers of terminal devices, networks and servers in Fig. 1 are only illustrative. According to the implementation needs, there can be any number of terminal devices, networks and servers. When the electronic device on which the method for recording information operates does not need to perform data transmission with other electronic devices, the system architecture may only include the electronic device on which the method for recording information operates (such as a server or terminal device) ).

请参考图2,图2为本公开实施例提供的一种用于记录信息的方法的流程图,其中,流程200包括以下步骤:Please refer to FIG. 2. FIG. 2 is a flow chart of a method for recording information provided by an embodiment of the present disclosure, wherein the process 200 includes the following steps:

步骤201,在播放目标数据的过程中,通过开放式图形库和视频显示控件获取目标数据中所要播放的视频帧和音频帧。Step 201 , during the process of playing the target data, the video frame and audio frame to be played in the target data are obtained through the open graphics library and the video display control.

本实施例中,用于记录信息的方法的执行主体(例如,图1中的终端设备或服务器)可以在播放目标数据的过程中,通过开放式图形库和视频显示控件获取目标数据中所要播放的视频帧和音频帧。In this embodiment, the execution subject of the method for recording information (for example, the terminal device or server in Figure 1) can obtain the target data to be played through the open graphics library and the video display control during the process of playing the target data. video frames and audio frames.

目标数据可以是包括任意内容的媒体数据,包括对应的视频数据和音频数据。作为示例,目标数据可以是电影、电视剧、直播视频、网络短视频等媒体数据。The target data may be media data including arbitrary content, including corresponding video data and audio data. As an example, the target data may be media data such as movies, TV dramas, live videos, and short online videos.

OpenGL(Open Graphics Library,开放式图形库)是用于渲染2D(二维)、3D(三维)矢量图形的跨语言、跨平台的应用程序编程接口。在目标数据的播放过程中,可以对每个视频帧对应的视频帧数据进行渲染,得到对应的视频帧图像。OpenGL (Open Graphics Library, Open Graphics Library) is a cross-language, cross-platform application programming interface for rendering 2D (two-dimensional) and 3D (three-dimensional) vector graphics. During the playing process of the target data, the video frame data corresponding to each video frame may be rendered to obtain the corresponding video frame image.

视频显示控件是用于播放媒体信息的UI(User Interface,用户界面)控件。在目标数据的播放过程中,用于显示视频帧数据。作为示例,视频显示控件可以是TextureView控件、SurfaceView控件。The video display control is a UI (User Interface, user interface) control for playing media information. During the playback of target data, it is used to display video frame data. As an example, the video display control may be a TextureView control or a SurfaceView control.

在获取到音视频的源数据后,首先,上述执行主体可以基于软解码、硬解码等解码方式对源数据进行解码,得到YUV(Y表示明亮度,U、V表示色度)格式的视频数据和PCM(Pulse Code Modulation,脉冲编码调制)格式的音频数据。然后,通过开放式图形库渲染每个视频帧对应的PCM格式的视频帧数据,通过视频显示控件进行视频帧的显示,并通过AudioTrack(管理和播放音频数据的类)播放PCM格式的音频数据。After obtaining the source data of audio and video, firstly, the above-mentioned executive body can decode the source data based on decoding methods such as soft decoding and hard decoding, and obtain video data in YUV (Y represents brightness, U and V represent chroma) format and audio data in PCM (Pulse Code Modulation, Pulse Code Modulation) format. Then, render the video frame data in PCM format corresponding to each video frame through the open graphics library, display the video frame through the video display control, and play the audio data in PCM format through AudioTrack (the class that manages and plays audio data).

步骤202,接收表征记录目标数据中的至少部分数据的记录操作,并根据记录操作记录至少部分数据。Step 202, receiving a recording operation representing at least part of the data in the recording target data, and recording at least part of the data according to the recording operation.

本实施例中,上述执行主体接收表征记录目标数据中的至少部分数据的记录操作,并根据记录操作记录至少部分数据。In this embodiment, the execution subject receives a recording operation representing at least part of the data in the recording target data, and records at least part of the data according to the recording operation.

其中,记录操作可以是用户基于语音或行为动作发出的记录指令。作为示例,当用户点击显示目标数据的屏幕中显示“开始录制”的虚拟按钮,上述执行主体开始录制音视频数据;当用户点击屏幕中显示的“停止录制”的虚拟按钮,上述执行主体停止录制音视频数据。Wherein, the recording operation may be a recording instruction issued by the user based on voice or behavior. As an example, when the user clicks the virtual button of "Start Recording" displayed on the screen displaying the target data, the above-mentioned execution subject starts recording audio and video data; when the user clicks the virtual button of "Stop Recording" displayed on the screen, the above-mentioned execution subject stops recording Audio and video data.

步骤203,合并至少部分数据中的视频帧和音频帧,得到记录信息。Step 203, combining video frames and audio frames in at least part of the data to obtain recording information.

本实施例中,上述执行主体可以合并至少部分数据中的视频帧和音频帧,得到记录信息。In this embodiment, the execution subject may combine video frames and audio frames in at least part of the data to obtain record information.

作为示例,上述执行主体可以通过Muxer(视频复用器)将所记录的至少部分数据中的、一一对应的视频帧和音频帧进行合并,得到记录信息。As an example, the execution subject may use a Muxer (video multiplexer) to combine the one-to-one corresponding video frames and audio frames in at least part of the recorded data to obtain the recording information.

继续参见图3,图3是根据本实施例的用于记录信息的方法的应用场景的一个示意图300。在图3的应用场景中,用户301通过终端设备302获取源数据后,要播放源数据表征的媒体数据。在播放媒体数据的过程中,通过开放式图形库303渲染媒体数据中的每个视频帧对应的视频帧数据,并通过视频显示控件304播放视频帧数据和音频帧数据,从而开放式图形库303和视频显示控件304获取了目标数据中所要播放的视频帧和音频帧。播放期间,用户301产生了对媒体数据进行记录的需求,向终端设备发出了记录请求。终端设备302接收表征用户记录目标数据中的至少部分数据的记录操作,并根据记录请求所表征的记录操作记录至少部分数据。合并至少部分数据中的视频帧和音频帧,得到记录信息。Continue referring to FIG. 3 , which is a schematic diagram 300 of an application scenario of the method for recording information according to this embodiment. In the application scenario of FIG. 3 , after the user 301 obtains the source data through the terminal device 302 , he wants to play the media data represented by the source data. In the process of playing media data, the video frame data corresponding to each video frame in the media data is rendered by the open graphics library 303, and the video frame data and audio frame data are played by the video display control 304, so that the open graphics library 303 And the video display control 304 obtains the video frame and audio frame to be played in the target data. During playing, the user 301 generates a demand for recording media data, and sends a recording request to the terminal device. The terminal device 302 receives a recording operation representing at least part of the data in the user's recording target data, and records at least part of the data according to the recording operation represented by the recording request. Combining video frames and audio frames in at least part of the data to obtain recording information.

本实施例中,基于开放式图形库和视频显示控件可实时获取目标数据中的视频帧和音频帧,在记录时,不必依赖于关键帧的位置,避免了因关键帧丢失而造成的花屏问题,可以根据用户的录制操作实时进行音视频数据的记录。In this embodiment, based on the open graphics library and the video display control, the video frame and audio frame in the target data can be obtained in real time. When recording, it does not need to depend on the position of the key frame, which avoids the blurred screen problem caused by the loss of the key frame , audio and video data can be recorded in real time according to the user's recording operation.

在本实施例的一些可选的实现方式中,上述执行主体可以通过如下方式执行上述步骤201:In some optional implementation manners of this embodiment, the above execution subject may perform the above step 201 in the following manner:

第一,响应于播放目标数据,监听视频显示控件。First, the video display controls are listened for in response to playing object data.

本实现方式中,以视频显示控件TextureView为例。TextureView有两个相关类SurfaceTexture控件和Surface控件。Surface控件,本质是是内存中的一段绘图缓冲区。SurfaceTexture控件用于捕获视频流中的图像帧,视频流可以是相机预览或者视频解码数据。SurfaceTexture可以作为android.hardware.camera2,MediaCodec,MediaPlayer这些类的目标视频数据输出对象,可以调用updateTexImage()方法从视频流数据中更新当前帧。In this implementation manner, the video display control TextureView is taken as an example. TextureView has two related classes SurfaceTexture control and Surface control. The Surface control is essentially a drawing buffer in memory. The SurfaceTexture control is used to capture image frames in a video stream, which can be camera preview or video decoding data. SurfaceTexture can be used as the target video data output object of android.hardware.camera2, MediaCodec, and MediaPlayer, and the updateTexImage() method can be called to update the current frame from the video stream data.

TextureView中自带SurfaceTexture控件,但是自带的SurfaceTexture控件无法获取到视频帧的刷新回调,也无法获取到视频帧以进行操作,因此,设置TextureView的SurfaceTextureListener监听器,响应于播放目标数据的Activity(APP的界面活动)产生,监听TextureView的生命周期,以创建新的SurfaceTexture控件。TextureView comes with a SurfaceTexture control, but the built-in SurfaceTexture control cannot obtain the refresh callback of the video frame, nor can it obtain the video frame for operation. Therefore, the SurfaceTextureListener listener of TextureView is set to respond to the Activity (APP Interface activity) generated, monitor the life cycle of TextureView to create a new SurfaceTexture control.

通过setSurfaceTextureListener监听TextureView的生命周期包括:The life cycle of listening to TextureView through setSurfaceTextureListener includes:

onSurfaceTextureAvailable,表征TextureView可用;onSurfaceTextureAvailable, indicating that TextureView is available;

onSurfaceTextureSizeChanged,表征TextureView大小发生了变化;onSurfaceTextureSizeChanged, indicating that the size of TextureView has changed;

onSurfaceTextureUpdated,表征TextureView有视图数据进行了更新;onSurfaceTextureUpdated, indicating that TextureView has view data updated;

onSurfaceTextureDestroyed,表征TextureView销毁;onSurfaceTextureDestroyed, which represents the destruction of TextureView;

setOnFrameAvailableListener,表征监听TextureView绘制每一帧视频帧结束后的回调。setOnFrameAvailableListener, which represents the callback after listening to TextureView drawing each frame of video frame.

第二,响应于确定视频显示控件可用,初始化开放式图形库的环境信息。Second, in response to determining that the video display control is available, environment information for the Open Graphics Library is initialized.

本实施例中,在SurfaceTextureListener.onSurfaceTextureAvailable()回调中初始化OpenGL的环境信息。环境信息包括创建EGLContext(Enterprise GenerationLanguage Context,业务编程语言上下文),加载Shader(着色器),创建新的TextureID(Texture Identity Document,纹理标识)。在SurfaceTextureListener.onSurfaceTextureSizeChanged()回调中更新SurfaceTexture的宽高。In this embodiment, the OpenGL environment information is initialized in the SurfaceTextureListener.onSurfaceTextureAvailable() callback. Environmental information includes creating EGLContext (Enterprise Generation Language Context, business programming language context), loading Shader (shader), and creating a new TextureID (Texture Identity Document, texture identification). Update the width and height of SurfaceTexture in SurfaceTextureListener.onSurfaceTextureSizeChanged() callback.

第三,根据环境信息中的纹理标识,在视频显示控件中创建表面纹理控件和第一绘图表面控件。Thirdly, create a surface texture control and a first drawing surface control in the video display control according to the texture identification in the environment information.

本实现方式中,上述执行主体通过环境信息中的纹理标识,创建新的SurfaceTexture控件(表面纹理控件),并设置SurfaceTexture控件的OnFrameAvailableListener监听器,以监听TextureView绘制每一帧视频帧结束后的回调;并通过SurfaceTexture控件新建第一Surface控件(第一绘图表面控件)。新建的表面纹理控件替换TextureView中自带的表面纹理控件。In this implementation mode, the above-mentioned execution subject creates a new SurfaceTexture control (surface texture control) through the texture identification in the environment information, and sets the OnFrameAvailableListener listener of the SurfaceTexture control to monitor the callback after the TextureView draws each frame of video frame; And create a first Surface control (first drawing surface control) through the SurfaceTexture control. The new surface texture control replaces the surface texture control that comes with TextureView.

第四,在播放目标数据的过程中,将目标数据中解码后的视频帧数据传入第一绘图表面控件,并通过开放式图形库对所要播放的视频帧对应的视频帧数据进行绘制。Fourth, in the process of playing the target data, the decoded video frame data in the target data is transferred to the first drawing surface control, and the video frame data corresponding to the video frame to be played is drawn through the open graphics library.

本实现方式中,将通过SurfaceTexture控件新建的Surface控件通过JNI(JavaNative Interface,Java本地接口)传入c/c++层的player(播放器),player中读取到视频源数据后,将视频源数据解码得到YUV格式的视频数据,并将YUV格式的视频数据填入该新建的Surface控件(第一绘图表面控件),第一绘图表面控件中每一视频帧的更新会回调OnFrameAvailableListener监听器的onFrameAvailable()方法,然后在该回调中,调用OpenGL绘制YUV格式的视频数据。In this implementation mode, the Surface control newly created by the SurfaceTexture control is passed to the player (player) of the c/c++ layer through JNI (JavaNative Interface, Java local interface). After the video source data is read in the player, the video source data is The video data in YUV format is decoded, and the video data in YUV format is filled into the new Surface control (the first drawing surface control). The update of each video frame in the first drawing surface control will call back the onFrameAvailable( ) method, and then in the callback, call OpenGL to draw the video data in YUV format.

第五,在播放目标数据中的音频帧的同时,通过视频显示控件的音频回调接口,将所要播放的音频帧对应的音频帧数据传入音频编码器。Fifth, while playing the audio frame in the target data, the audio frame data corresponding to the audio frame to be played is transmitted to the audio encoder through the audio callback interface of the video display control.

本实现方式中,视频显示控件的音频回调接口OnReceiveAudioDataCallback通过JNI注册到c/c++层的player。player中读取到的解码后的音频PCM源数据,在写入系统AudioTrack播放音频数据额同时,通过OnReceiveAudioDataCallback接口,将音频PCM源数据回调传入音频编码器。In this implementation, the audio callback interface OnReceiveAudioDataCallback of the video display control is registered to the player of the c/c++ layer through JNI. The decoded audio PCM source data read in the player is written into the system AudioTrack to play the audio data, and at the same time, the audio PCM source data is called back to the audio encoder through the OnReceiveAudioDataCallback interface.

本实现方式中,一种通过开放式图形库和视频显示控件获取目标数据中所要播放的视频帧和音频帧的具体方式,可在播放音视频数据的同时,实时得到原始的音视频数据。In this implementation mode, a specific method of obtaining the video frame and audio frame to be played in the target data through the open graphics library and the video display control can obtain the original audio and video data in real time while playing the audio and video data.

在本实施例的一些可选的实现方式中,上述执行主体通过如下方式执行上述步骤202:In some optional implementation manners of this embodiment, the above execution subject executes the above step 202 in the following manner:

响应于开始进行记录操作,在通过开放式图形库对所要播放的视频帧对应的视频帧数据进行绘制的同时,在视频编码器对应的第二绘图表面控件上绘制视频帧数据,并通过视频编码器对绘制后的视频帧数据编码,进行视频帧的记录;通过音频编码器对所接收到的音频帧数据编码,进行音频帧的记录。In response to starting the recording operation, while drawing the video frame data corresponding to the video frame to be played through the open graphics library, draw the video frame data on the second drawing surface control corresponding to the video encoder, and pass the video encoding The device encodes the drawn video frame data to record the video frame; the audio encoder encodes the received audio frame data to record the audio frame.

视频播放时,需要在视频预览对应的Surface控件上绘制预览框;当开始录制音视频数据后,同时在MediaCodec(一种系统API)的Surface控件上离屏绘制与预览框画面相同的视频数据。When the video is playing, it is necessary to draw a preview frame on the Surface control corresponding to the video preview; when recording audio and video data, at the same time draw the same video data as the preview frame off-screen on the Surface control of MediaCodec (a system API).

视频编码器和音频编码器得到视频帧数据和音频帧数据后,进行音视频帧的编码。具体的,视频编码器线程运行如下:dequeueOutputBuffer()→getOutputBuffer();同时,音频编码器线程运行如下:dequeueInputBuffer()→queueInputBuffer()→dequeueOutputBuffer()→getOutputBuffer()。After the video encoder and the audio encoder obtain the video frame data and the audio frame data, they encode the audio and video frames. Specifically, the video encoder thread operates as follows: dequeueOutputBuffer()→getOutputBuffer(); meanwhile, the audio encoder thread operates as follows: dequeueInputBuffer()→queueInputBuffer()→dequeueOutputBuffer()→getOutputBuffer().

本实现方式中,提供了一种针对音视频数据的具体的记录方式,提高了对音视频数据记录的便捷性。In this implementation manner, a specific recording method for audio and video data is provided, which improves the convenience of recording audio and video data.

在本实施例的一些可选的实现方式中,上述执行主体可以通过如下方式执行上述步骤203:合并至少部分数据中的视频帧和音频帧,得到预设格式的记录信息。In some optional implementations of this embodiment, the execution subject may perform the above step 203 in the following manner: combine video frames and audio frames in at least part of the data to obtain record information in a preset format.

其中,预设格式可以是任意格式的文件。作为示例,预设格式包括MP4(MediaPortable 4,便携式媒体4)、RMVB(RealMedia Variable Bitrate,可变比特率)、MKV(Multimedia Container,多媒体容器)、AVI(Audio Video Interleaved,音频视频交错)。Wherein, the preset format may be a file of any format. As an example, the preset format includes MP4 (MediaPortable 4, portable media 4), RMVB (RealMedia Variable Bitrate, variable bit rate), MKV (Multimedia Container, multimedia container), AVI (Audio Video Interleaved, audio and video interleaving).

本实现方式中,记录得到的音视频数据是原始帧数据,可对原始帧数据进行格式处理,得到预设格式的文件,提高了生成记录信息的灵活性。In this implementation, the recorded audio and video data is the original frame data, and the original frame data can be format-processed to obtain a file with a preset format, which improves the flexibility of generating record information.

在本实施例的一些可选的实现方式中,上述执行主体在得到记录信息后,还可以对至少部分数据进行数据处理,得到处理后的至少部分数据。In some optional implementation manners of this embodiment, after obtaining the record information, the execution subject may further perform data processing on at least part of the data to obtain at least part of the processed data.

本实现方式中,可以通过任意数据处理方式处理所记录的至少部分数据,包括但不限于增加水印、滤镜等数据处理方式。本实现方式中,可以灵活处理所记录的至少部分数据,得到所需的记录信息,提高了所得到的记录信息的多样性。In this implementation, at least part of the recorded data may be processed by any data processing method, including but not limited to adding watermarks, filters and other data processing methods. In this implementation manner, at least part of the recorded data can be flexibly processed to obtain required record information, which increases the diversity of the obtained record information.

继续参考图4,示出了根据本公开的方法的一个用于记录信息的方法实施例的示意性流程400,包括以下步骤:Continuing to refer to FIG. 4 , it shows a schematic flow 400 of an embodiment of a method for recording information according to the method of the present disclosure, including the following steps:

步骤401,响应于播放目标数据,监听视频显示控件。Step 401, monitor the video display control in response to the playing target data.

步骤402,响应于确定视频显示控件可用,初始化开放式图形库的环境信息。Step 402, in response to determining that the video display control is available, initialize the environment information of the open graphics library.

步骤403,根据环境信息中的纹理标识,在视频显示控件中创建表面纹理控件和第一绘图表面控件。Step 403, according to the texture identifier in the environment information, create a surface texture control and a first drawing surface control in the video display control.

步骤404,在播放目标数据的过程中,将目标数据中解码后的视频帧数据传入第一绘图表面控件,并通过开放式图形库对所要播放的视频帧对应的视频帧数据进行绘制。Step 404, in the process of playing the target data, transfer the decoded video frame data in the target data to the first drawing surface control, and use the open graphics library to draw the video frame data corresponding to the video frame to be played.

步骤405,在播放目标数据中的音频帧的同时,通过视频显示控件的音频回调接口,将所要播放的音频帧对应的音频帧数据传入音频编码器。Step 405, while playing the audio frame in the target data, transmit the audio frame data corresponding to the audio frame to be played to the audio encoder through the audio callback interface of the video display control.

步骤406,响应于开始进行记录操作,在通过开放式图形库对所要播放的视频帧对应的视频帧数据进行绘制的同时,在视频编码器对应的第二绘图表面控件上绘制视频帧数据,并通过视频编码器对绘制后的视频帧数据编码,进行视频帧的记录。Step 406, in response to starting the recording operation, draw the video frame data on the second drawing surface control corresponding to the video encoder while using the open graphics library to draw the video frame data corresponding to the video frame to be played, and The video frame data after rendering is encoded by a video encoder to record the video frame.

步骤407,通过音频编码器对所接收到的音频帧数据编码,进行音频帧的记录。Step 407: Encode the received audio frame data by an audio encoder to record the audio frame.

步骤408,对至少部分数据进行数据处理,得到处理后的至少部分数据。Step 408, performing data processing on at least part of the data to obtain at least part of the data after processing.

步骤409,合并至少部分数据中的视频帧和音频帧,得到预设格式的记录信息。Step 409, combining video frames and audio frames in at least part of the data to obtain record information in a preset format.

从本实施例中可以看出,与图2对应的实施例相比,本实施例中的用于记录信息的方法的流程400具体说明了音视频帧的获取过程,信息的记录过程,以及所记载的至少部分数据的处理过程,提高了信息记录的灵活性、便捷性和多样性。It can be seen from this embodiment that, compared with the embodiment corresponding to FIG. 2 , the flow 400 of the method for recording information in this embodiment specifically illustrates the acquisition process of audio and video frames, the recording process of information, and all The processing process of at least part of the recorded data improves the flexibility, convenience and diversity of information recording.

继续参见图5,为进一步说明本公开的用于记录信息的方法,对以具体实施500说明如下:Continuing to refer to FIG. 5, in order to further illustrate the method for recording information of the present disclosure, the specific implementation 500 is described as follows:

1、获取包括源视频501和源音频502的源媒体数据;在C/C++层下的player中,对于源视频501,通过硬解码或软解码方式进行解码,得到YUV格式的视频数据;对于源音频502,通过软解码方式进行解码,得到PCM格式的音频数据,以在播放视频数据的同时,通过audiotrack播放音频数据。1. Obtain source media data including source video 501 and source audio 502; in the player under the C/C++ layer, for source video 501, decode through hard decoding or soft decoding to obtain video data in YUV format; for source Audio 502 is decoded by soft decoding to obtain audio data in PCM format, so as to play audio data through audiotrack while playing video data.

2、响应于播放源视频501的Activity,通过setSurfaceTextureListener监听器503监听TextureView控件504的生命周期,在SurfaceTextureListener.onSurfaceTextureAvailable()回调中初始化OpenGL505的环境信息。2. In response to the Activity playing the source video 501, monitor the life cycle of the TextureView control 504 through the setSurfaceTextureListener listener 503, and initialize the environment information of the OpenGL 505 in the SurfaceTextureListener.onSurfaceTextureAvailable() callback.

3、根据OpenGL 505的环境信息中的纹理标识TextureID,创建新的SurfaceTexture控件506,并通过SurfaceTexture控件506新建Surface控件507。创建的SurfaceTexture控件506、Surface控件507替换TextureView控件504中自带的SurfaceTexture控件、Surface控件。3. Create a new SurfaceTexture control 506 according to the texture identifier TextureID in the environment information of the OpenGL 505 , and create a new Surface control 507 through the SurfaceTexture control 506 . The created SurfaceTexture control 506 and Surface control 507 replace the SurfaceTexture control and Surface control in the TextureView control 504 .

4、将Surface控件507通过JNI传入c/c++层的player,player中读取到YUV视频数据后,将YUV视频数据填入该Surface控件507,Surface控件507中每一视频帧的更新会回调OnFrameAvailableListener监听器508的onFrameAvailable()方法,然后,在该回调中,调用OpenGL 505绘制YUV视频数据的预览框,并在OpenGL505中绘制视频YUV数据。4. Pass the Surface control 507 into the player of the c/c++ layer through JNI. After the YUV video data is read in the player, fill the YUV video data into the Surface control 507, and the update of each video frame in the Surface control 507 will be called back The onFrameAvailable() method of the OnFrameAvailableListener listener 508, and then, in the callback, call OpenGL 505 to draw the preview frame of the YUV video data, and draw the video YUV data in OpenGL 505 .

5、响应于接收用户的记录操作,获取视频编码器对应的surface控件509,通过MediaCodec在Surface509上离屏绘制与预览框画面相同的视频帧数据,并将视频帧数据传输至video track通道。5. In response to receiving the user's recording operation, obtain the surface control 509 corresponding to the video encoder, draw the same video frame data as the preview frame on the Surface 509 off-screen through MediaCodec, and transmit the video frame data to the video track channel.

6、同时,通过音频编码器对所接收到的音频帧数据编码,进行音频帧的记录,并将视频帧数据传输至audio track通道。6. At the same time, the received audio frame data is encoded by the audio encoder, the audio frame is recorded, and the video frame data is transmitted to the audio track channel.

7、最终,Muxer合并video track通道中的视频帧数据和audio track通道中的音频帧数据,得到合并后的记录信息。7. Finally, the Muxer merges the video frame data in the video track channel and the audio frame data in the audio track channel to obtain the combined record information.

继续参考图6,作为对上述各图所示方法的实现,本公开提供了一种用于记录信息的装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。Continuing to refer to FIG. 6 , as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for recording information, which corresponds to the method embodiment shown in FIG. 2 . The device can be specifically applied to various electronic devices.

如图6所示,用于记录信息的装置包括:获取单元601,被配置成在播放目标数据的过程中,通过开放式图形库和视频显示控件获取目标数据中所要播放的视频帧和音频帧;记录单元602,被配置成接收表征记录目标数据中的至少部分数据的记录操作,并根据记录操作记录至少部分数据;合并单元603,被配置成合并至少部分数据中的视频帧和音频帧,得到记录信息。As shown in Figure 6, the device for recording information includes: an acquisition unit 601 configured to acquire the video frame and audio frame to be played in the target data through the open graphics library and the video display control during the process of playing the target data The recording unit 602 is configured to receive a recording operation representing at least part of the data in the recording target data, and record at least part of the data according to the recording operation; the merging unit 603 is configured to merge video frames and audio frames in at least part of the data, Get record information.

在本实施例的一些可选的实现方式中,获取单元601,进一步被配置成:响应于播放目标数据,监听视频显示控件;响应于确定视频显示控件可用,初始化开放式图形库的环境信息;根据环境信息中的纹理标识,在视频显示控件中创建表面纹理控件和第一绘图表面控件;在播放目标数据的过程中,将目标数据中解码后的视频帧数据传入第一绘图表面控件,并通过开放式图形库对所要播放的视频帧对应的视频帧数据进行绘制;在播放目标数据中的音频帧的同时,通过视频显示控件的音频回调接口,将所要播放的音频帧对应的音频帧数据传入音频编码器。In some optional implementations of this embodiment, the acquiring unit 601 is further configured to: monitor the video display control in response to the playing target data; and initialize the environment information of the open graphics library in response to determining that the video display control is available; According to the texture identification in the environment information, create a surface texture control and a first drawing surface control in the video display control; in the process of playing the target data, transfer the decoded video frame data in the target data to the first drawing surface control, And use the open graphics library to draw the video frame data corresponding to the video frame to be played; while playing the audio frame in the target data, through the audio callback interface of the video display control, the audio frame corresponding to the audio frame to be played Data is passed into the audio encoder.

在本实施例的一些可选的实现方式中,记录单元602,进一步被配置成:响应于开始进行记录操作,在通过开放式图形库对所要播放的视频帧对应的视频帧数据进行绘制的同时,在视频编码器对应的第二绘图表面控件上绘制视频帧数据,并通过视频编码器对绘制后的视频帧数据编码,进行视频帧的记录;通过音频编码器对所接收到的音频帧数据编码,进行音频帧的记录。In some optional implementations of this embodiment, the recording unit 602 is further configured to: in response to starting the recording operation, draw the video frame data corresponding to the video frame to be played through the open graphics library , draw the video frame data on the second drawing surface control corresponding to the video encoder, and encode the drawn video frame data through the video encoder to record the video frame; use the audio encoder to encode the received audio frame data Encoding to record audio frames.

在本实施例的一些可选的实现方式中,合并单元603,进一步被配置成:合并至少部分数据中的视频帧和音频帧,得到预设格式的记录信息。In some optional implementation manners of this embodiment, the combining unit 603 is further configured to: combine video frames and audio frames in at least part of the data to obtain record information in a preset format.

在本实施例的一些可选的实现方式中,上述装置还包括:处理单元(图中未示出),被配置成对至少部分数据进行数据处理,得到处理后的至少部分数据。In some optional implementation manners of this embodiment, the foregoing apparatus further includes: a processing unit (not shown in the figure), configured to perform data processing on at least part of the data, to obtain at least part of the processed data.

本实施例中,基于开放式图形库和视频显示控件可实时获取目标数据中的视频帧和音频帧,在记录时,不必依赖于关键帧的位置,避免了因关键帧丢失而造成的花屏问题,可以根据用户的录制操作实时进行音视频数据的记录。In this embodiment, based on the open graphics library and the video display control, the video frame and audio frame in the target data can be obtained in real time. When recording, it does not need to depend on the position of the key frame, which avoids the blurred screen problem caused by the loss of the key frame , audio and video data can be recorded in real time according to the user's recording operation.

根据本公开的实施例,本公开还提供了一种电子设备,该电子设备包括:至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,该指令被至少一个处理器执行,以使至少一个处理器执行时能够实现上述任意实施例所描述的用于记录信息的方法。According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, the electronic device includes: at least one processor; and a memory connected in communication with the at least one processor; wherein, the memory stores information executable by the at least one processor. An instruction, the instruction is executed by at least one processor, so that the at least one processor can implement the method for recording information described in any of the above embodiments when executed.

根据本公开的实施例,本公开还提供了一种可读存储介质,该可读存储介质存储有计算机指令,该计算机指令用于使计算机执行时能够实现上述任意实施例所描述的用于记录信息的方法。According to an embodiment of the present disclosure, the present disclosure also provides a readable storage medium, where computer instructions are stored in the readable storage medium, and the computer instructions are used to enable a computer to implement the method described in any of the above-mentioned embodiments for recording method of information.

本公开实施例提供了一种计算机程序产品,该计算机程序在被处理器执行时能够实现上述任意实施例所描述的用于记录信息的方法。An embodiment of the present disclosure provides a computer program product. When the computer program is executed by a processor, the method for recording information described in any of the foregoing embodiments can be implemented.

图7示出了可以用来实施本公开的实施例的示例电子设备700的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。FIG. 7 shows a schematic block diagram of an example electronic device 700 that may be used to implement embodiments of the present disclosure. Electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are by way of example only, and are not intended to limit implementations of the disclosure described and/or claimed herein.

如图7所示,设备700包括计算单元701,其可以根据存储在只读存储器(ROM)702中的计算机程序或者从存储单元708加载到随机访问存储器(RAM)703中的计算机程序,来执行各种适当的动作和处理。在RAM703中,还可存储设备700操作所需的各种程序和数据。计算单元701、ROM 702以及RAM 703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。As shown in FIG. 7, the device 700 includes a computing unit 701 that can execute according to a computer program stored in a read-only memory (ROM) 702 or loaded from a storage unit 708 into a random-access memory (RAM) 703. Various appropriate actions and treatments. In the RAM 703, various programs and data necessary for the operation of the device 700 can also be stored. The computing unit 701 , ROM 702 , and RAM 703 are connected to each other through a bus 704 . An input/output (I/O) interface 705 is also connected to the bus 704 .

设备700中的多个部件连接至I/O接口705,包括:输入单元706,例如键盘、鼠标等;输出单元707,例如各种类型的显示器、扬声器等;存储单元708,例如磁盘、光盘等;以及通信单元709,例如网卡、调制解调器、无线通信收发机等。通信单元709允许设备700通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Multiple components in the device 700 are connected to the I/O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a magnetic disk, an optical disk, etc. ; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 709 allows the device 700 to exchange information/data with other devices over a computer network such as the Internet and/or various telecommunication networks.

计算单元701可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元701的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元701执行上文所描述的各个方法和处理,例如用于记录信息的方法。例如,在一些实施例中,用于记录信息的方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元708。在一些实施例中,计算机程序的部分或者全部可以经由ROM702和/或通信单元709而被载入和/或安装到设备700上。当计算机程序加载到RAM 703并由计算单元701执行时,可以执行上文描述的用于记录信息的方法的一个或多个步骤。备选地,在其他实施例中,计算单元701可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行用于记录信息的方法。The computing unit 701 may be various general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of computing units 701 include, but are not limited to, central processing units (CPUs), graphics processing units (GPUs), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processing processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 executes the various methods and processes described above, such as a method for recording information. For example, in some embodiments, the method for recording information may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 708 . In some embodiments, part or all of the computer program may be loaded and/or installed on the device 700 via the ROM 702 and/or the communication unit 709 . When the computer program is loaded into RAM 703 and executed by computing unit 701, one or more steps of the method for recording information described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured in any other appropriate way (for example, by means of firmware) to execute the method for recording information.

本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips Implemented in a system of systems (SOC), load programmable logic device (CPLD), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor Can be special-purpose or general-purpose programmable processor, can receive data and instruction from storage system, at least one input device, and at least one output device, and transmit data and instruction to this storage system, this at least one input device, and this at least one output device an output device.

用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program codes for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special purpose computer, or other programmable data processing devices, so that the program codes, when executed by the processor or controller, make the functions/functions specified in the flow diagrams and/or block diagrams Action is implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.

在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.

为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide for interaction with the user, the systems and techniques described herein can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user. ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and can be in any form (including Acoustic input, speech input or, tactile input) to receive input from the user.

可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., as a a user computer having a graphical user interface or web browser through which a user can interact with embodiments of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system. The components of the system can be interconnected by any form or medium of digital data communication, eg, a communication network. Examples of communication networks include: Local Area Network (LAN), Wide Area Network (WAN) and the Internet.

计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决传统物理主机与虚拟专用服务器(VPS,Virtual Private Server)服务中存在的管理难度大,业务扩展性弱的缺陷。A computer system may include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the management difficulties existing in traditional physical host and virtual private server (VPS, Virtual Private Server) services Large and weak business expansion.

根据本公开实施例的技术方案,基于开放式图形库和视频显示控件可实时获取目标数据中的视频帧和音频帧,在记录时,不必依赖于关键帧的位置,避免了因关键帧丢失而造成的花屏问题,可以根据用户的录制操作实时进行音视频数据的记录。According to the technical solution of the embodiment of the present disclosure, the video frame and audio frame in the target data can be obtained in real time based on the open graphics library and the video display control. When recording, it does not need to depend on the position of the key frame, avoiding the loss of the key frame For the blurry screen problem caused, the audio and video data can be recorded in real time according to the user's recording operation.

应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开提供的技术方案所期望的结果,本文在此不进行限制。It should be understood that steps may be reordered, added or deleted using the various forms of flow shown above. For example, each step described in the present disclosure may be executed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution provided by the present disclosure can be achieved, no limitation is imposed herein.

上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。The specific implementation manners described above do not limit the protection scope of the present disclosure. It should be apparent to those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present disclosure shall be included within the protection scope of the present disclosure.

Claims (8)

1. A method for recording information, comprising:
in the process of playing the target data, acquiring a video frame and an audio frame to be played in the target data through an open graphic library and a video display control, wherein the process comprises the following steps: monitoring the video display control in response to playing the target data; initializing environmental information of the open graphics library in response to determining that the video display control is available; according to the texture identification in the environment information, a surface texture control and a first drawing surface control are established in the video display control, and the surface texture control and the drawing surface control which are carried in the video display control are replaced; in the process of playing the target data, transmitting the decoded video frame data in the target data into the first drawing surface control, and drawing the video frame data corresponding to the video frame to be played through the open graphic library; transmitting audio frame data corresponding to the audio frame to be played into an audio encoder through an audio callback interface of the video display control while playing the audio frame in the target data;
receiving a recording operation for recording at least part of data in the target data in a characterizing way, and recording the at least part of data according to the recording operation, wherein the recording operation comprises the following steps: in response to the start of recording operation, drawing video frame data corresponding to a video frame to be played through the open graphics library, simultaneously drawing the video frame data on a second drawing surface control corresponding to a video encoder, encoding the drawn video frame data through the video encoder, and recording the video frame; coding the received audio frame data through the audio coder, and recording the audio frame;
and combining the video frame and the audio frame in at least part of data to obtain the recorded information.
2. The method of claim 1, wherein said merging the video frames and the audio frames in the at least part of the data to obtain the recorded information comprises:
and combining the video frame and the audio frame in at least part of the data to obtain the recording information with a preset format.
3. The method of claim 1, wherein after said recording said at least part of data according to said recording operation, further comprising:
and carrying out data processing on at least part of data to obtain at least part of processed data.
4. An apparatus for recording information, comprising:
the acquiring unit is configured to acquire a video frame and an audio frame to be played in target data through an open graphics library and a video display control in the process of playing the target data, and comprises: monitoring the video display control in response to playing the target data; initializing environmental information of the open graphics library in response to determining that the video display control is available; according to the texture identification in the environment information, a surface texture control and a first drawing surface control are established in the video display control, and the surface texture control and the drawing surface control which are carried in the video display control are replaced; in the process of playing the target data, transmitting the video frame data decoded from the target data into the first drawing surface control, and drawing the video frame data corresponding to the video frame to be played through the open graphic library; when the audio frame in the target data is played, transmitting audio frame data corresponding to the audio frame to be played into an audio encoder through an audio callback interface of the video display control;
a recording unit configured to receive a recording operation characterizing at least a part of the target data, and record the at least a part of the data according to the recording operation, including: in response to the start of recording operation, drawing video frame data corresponding to a video frame to be played through the open graphics library, simultaneously drawing the video frame data on a second drawing surface control corresponding to a video encoder, encoding the drawn video frame data through the video encoder, and recording the video frame; coding the received audio frame data through the audio coder, and recording the audio frame;
and the merging unit is configured to merge the video frame and the audio frame in the at least part of data to obtain the recording information.
5. The apparatus of claim 4, wherein the merging unit is further configured to:
and combining the video frame and the audio frame in at least part of the data to obtain the recording information with a preset format.
6. The apparatus of claim 4, further comprising:
and the processing unit is configured to perform data processing on the at least part of data to obtain processed at least part of data.
7. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-3.
8. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-3.
CN202110659679.5A 2021-06-11 2021-06-11 Method, apparatus, device, storage medium and program product for recording information Active CN113411661B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110659679.5A CN113411661B (en) 2021-06-11 2021-06-11 Method, apparatus, device, storage medium and program product for recording information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110659679.5A CN113411661B (en) 2021-06-11 2021-06-11 Method, apparatus, device, storage medium and program product for recording information

Publications (2)

Publication Number Publication Date
CN113411661A CN113411661A (en) 2021-09-17
CN113411661B true CN113411661B (en) 2023-01-31

Family

ID=77683848

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110659679.5A Active CN113411661B (en) 2021-06-11 2021-06-11 Method, apparatus, device, storage medium and program product for recording information

Country Status (1)

Country Link
CN (1) CN113411661B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114666516B (en) * 2022-02-17 2024-12-03 海信视像科技股份有限公司 Display device and streaming media file synthesis method
CN114882915B (en) * 2022-04-13 2024-01-12 Oppo广东移动通信有限公司 Information recording method and device and electronic equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106303329A (en) * 2016-08-11 2017-01-04 广州爱九游信息技术有限公司 Record screen live broadcasting method and device, mobile device and live broadcast system
CN106851385B (en) * 2017-02-20 2019-12-27 北京乐我无限科技有限责任公司 Video recording method and device and electronic equipment
CN109168014B (en) * 2018-09-26 2021-05-28 广州虎牙信息科技有限公司 Live broadcast method, device, equipment and storage medium
CN109922360B (en) * 2019-03-07 2022-02-11 腾讯科技(深圳)有限公司 Video processing method, device and storage medium
CN112004041B (en) * 2019-05-27 2022-06-10 腾讯科技(深圳)有限公司 Video recording method, device, terminal and storage medium
CN111225271A (en) * 2020-01-19 2020-06-02 上海小麦互动企业发展有限公司 Multi-engine image capturing and screen recording method based on android set top box platform

Also Published As

Publication number Publication date
CN113411661A (en) 2021-09-17

Similar Documents

Publication Publication Date Title
CN111669646A (en) Playing method, device, device and medium of transparent video
WO2022257699A1 (en) Image picture display method and apparatus, device, storage medium and program product
US11689749B1 (en) Centralized streaming video composition
CN113411660B (en) Video data processing method and device and electronic equipment
CN105791892A (en) Video redirecting method based on desktop cloud, cloud server and video redirecting system
US20220076476A1 (en) Method for generating user avatar, related apparatus and computer program product
CN113453073B (en) Image rendering method, device, electronic equipment and storage medium
CN115022679B (en) Video processing method, device, electronic device and medium
CN113365146B (en) Method, apparatus, device, medium and article of manufacture for processing video
CN113411661B (en) Method, apparatus, device, storage medium and program product for recording information
CN111464828A (en) Virtual special effect display method, device, terminal and storage medium
CN111343503A (en) Video transcoding method and device, electronic equipment and storage medium
CN114071190B (en) Cloud application video stream processing method, related devices and computer program products
CN110290398B (en) Video issuing method and device, storage medium and electronic equipment
CN112714357B (en) Video playback method, video playback device, electronic equipment and storage medium
CN113766270A (en) Video playback method, system, server, terminal device, and electronic device
CN115988265A (en) A display screen rendering method, device and terminal equipment
CN116055540B (en) Virtual content display system, method, apparatus and computer readable medium
CN118075562A (en) Multimedia decoding method, playing method, device, electronic equipment and storage medium
CN117915124A (en) Live broadcast recording method, live broadcast recording device, storage medium, electronic device and program product
CN117425048A (en) Video playing method, device, equipment and storage medium
CN111866508B (en) Video processing method, device, medium and electronic equipment
CN116074576A (en) Video generation method, device, electronic device and storage medium
CN111860367A (en) Video repetition identification method, electronic device and computer-readable storage medium
CN114071185B (en) Method for video stream delivery, related device and computer program product

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