Method, device and equipment for acquiring video screenshot and storage medium

文档序号:1415849 发布日期:2020-03-10 浏览:7次 中文

阅读说明:本技术 视频截图的获取方法、装置、设备及存储介质 (Method, device and equipment for acquiring video screenshot and storage medium ) 是由 雷露 于 2018-08-31 设计创作,主要内容包括:本发明实施例公开了一种视频截图的获取方法、装置、设备及存储介质。该方法包括:接收到截图指令时,获取视频流缓存队列中的目标帧数据;将所述目标帧数据转换为RGB数据;根据所述RGB数据获得视频截图。本发明实施例提供的视频截图的获取方法,通过将视频流缓存队列中的目标帧数据转化为RGB数据来获得视频截图,使得获取到的截图质量不受智能终端像素或者当前播放视频的像素的影响,可以提高视频截图的分辨率,从而提高截图的质量。(The embodiment of the invention discloses a method, a device, equipment and a storage medium for acquiring a video screenshot. The method comprises the following steps: when a screenshot command is received, acquiring target frame data in a video stream cache queue; converting the target frame data into RGB data; and obtaining a video screenshot according to the RGB data. According to the method for acquiring the video screenshot, the video screenshot is acquired by converting the target frame data in the video stream cache queue into the RGB data, so that the acquired screenshot quality is not influenced by the pixels of the intelligent terminal or the pixels of the currently played video, the resolution of the video screenshot can be improved, and the screenshot quality is improved.)

1. A method for acquiring a video screenshot is characterized by comprising the following steps:

when a screenshot command is received, acquiring target frame data in a video stream cache queue;

converting the target frame data into RGB data;

and obtaining a video screenshot according to the RGB data.

2. The method of claim 1, wherein converting the target frame data into RGB data comprises:

converting the target frame data into YUV data;

and converting the YUV data into RGB data.

3. The method of claim 2, wherein converting the target frame data into YUV data comprises:

converting the target frame data into YUV data by adopting a set color coding method;

converting the YUV data into RGB data, comprising:

and converting the YUV data into RGB data by adopting a set conversion algorithm.

4. The method of claim 1, wherein obtaining target frame data in a video stream buffer queue comprises:

and acquiring the frame data which enters the video stream buffer queue at the earliest time, and determining the frame data as target frame data.

5. The method of claim 1, wherein obtaining target frame data in a video stream buffer queue comprises:

acquiring a time stamp of the screenshot instruction;

and acquiring target frame data in the video stream buffer queue according to the timestamp.

6. The method of claim 1, wherein obtaining a video screenshot from the RGB data comprises:

packaging the RGB data into a bitmap file;

and rendering the bitmap file to obtain a video screenshot.

7. The method of any one of claims 1-6, wherein obtaining target frame data in a video stream buffer queue comprises:

acquiring the earliest frame of AVFrame data in VideoQueue at a native layer;

converting the target frame data into RGB data, comprising:

converting the AVFrame data into RGB data at a java layer;

obtaining a video screenshot according to the RGB data, comprising:

and packaging the RGB data into a Bitmap file in a java layer, and rendering the Bitmap file to obtain a video screenshot.

8. An apparatus for acquiring a video screenshot, comprising:

the target frame data acquisition module is used for acquiring target frame data in a video stream cache queue when receiving the screenshot command;

the RGB data conversion module is used for converting the target frame data into RGB data;

and the video screenshot obtaining module is used for obtaining a video screenshot according to the RGB data.

9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-7 when executing the program.

10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.

Technical Field

The embodiment of the invention relates to the technical field of videos, in particular to a method, a device, equipment and a storage medium for acquiring a video screenshot.

Background

With the rapid development of multimedia technology, intelligent terminals (such as smart phones and tablet computers) have become one of the indispensable tools in people's life and work. When a user sees a beautiful picture or a favorite scene during watching a video, the user wants to save the picture through the screenshot.

Disclosure of Invention

The embodiment of the invention provides a method, a device, equipment and a storage medium for acquiring a video screenshot, which can improve the resolution of the video screenshot so as to improve the screenshot quality.

In a first aspect, an embodiment of the present invention provides a method for acquiring a video screenshot, where the method includes:

when a screenshot command is received, acquiring target frame data in a video stream cache queue;

converting the target frame data into RGB data;

and obtaining a video screenshot according to the RGB data.

Further, converting the target frame data into RGB data, including:

converting the target frame data into YUV data;

and converting the YUV data into RGB data.

Further, converting the target frame data into YUV data, including:

converting the target frame data into YUV data by adopting a set color coding method;

converting the YUV data into RGB data, comprising:

and converting the YUV data into RGB data by adopting a set conversion algorithm.

Further, acquiring target frame data in the video stream buffer queue, including:

and acquiring the frame data which enters the video stream buffer queue at the earliest time, and determining the frame data as target frame data.

Further, acquiring target frame data in the video stream buffer queue, including:

acquiring a time stamp of the screenshot instruction;

and acquiring target frame data in the video stream buffer queue according to the timestamp.

Further, obtaining a video screenshot according to the RGB data includes:

packaging the RGB data into a bitmap file;

and rendering the bitmap file to obtain a video screenshot.

Further, acquiring target frame data in the video stream buffer queue, including:

acquiring the latest frame of AVFrame data in the VideoQueue at a native layer;

converting the target frame data into RGB data, comprising:

converting the AVFrame data into RGB data at a java layer;

obtaining a video screenshot according to the RGB data, comprising:

and packaging the RGB data into a Bitmap file in a java layer, and rendering the Bitmap file to obtain a video screenshot.

In a second aspect, an embodiment of the present invention further provides an apparatus for acquiring a video screenshot, where the apparatus includes:

the target frame data acquisition module is used for acquiring target frame data in a video stream cache queue when receiving the screenshot command;

the RGB data conversion module is used for converting the target frame data into RGB data;

and the video screenshot obtaining module is used for obtaining a video screenshot according to the RGB data. :

in a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the method for acquiring a video screenshot according to the embodiment of the present invention when executing the program.

In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for acquiring a video screenshot according to the embodiment of the present invention.

According to the embodiment of the invention, when a screenshot command is received, target frame data in a video stream cache queue is firstly obtained, then the target frame data is converted into RGB data, and finally a video screenshot is obtained according to the RGB data. According to the method for acquiring the video screenshot, the video screenshot is acquired by converting the target frame data in the video stream cache queue into the RGB data, so that the acquired screenshot quality is not influenced by the pixels of the intelligent terminal or the pixels of the currently played video, the resolution of the video screenshot can be improved, and the screenshot quality is improved.

Drawings

Fig. 1 is a flowchart of a method for acquiring a video screenshot in a first embodiment of the present invention;

FIG. 2 is a flowchart of another method for acquiring a video screenshot according to a first embodiment of the present invention;

fig. 3 is a schematic structural diagram of an apparatus for acquiring a video screenshot in the second embodiment of the present invention;

fig. 4 is a schematic structural diagram of a mobile device in a third embodiment of the present invention.

Detailed Description

The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:内容分发系统、处理方法以及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类