Skip to content

读取当前帧 - ReadCurrentFrame

函数简介

读取当前帧(不移动位置)。

接口名称

ReadCurrentFrame

DLL调用

c
int64_t ReadCurrentFrame(int64_t instance, int64_t videoHandle);

参数说明

参数名类型说明
instance长整数型OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。
videoHandle长整数型视频句柄。

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
long video = ola.OpenVideo("videos/demo.mp4");
long framePtr = ola.ReadCurrentFrame(video);
csharp
using OLAPlug;

var ola = new OLAPlugServer();
long video = ola.OpenVideo("videos/demo.mp4");
long framePtr = ola.ReadCurrentFrame(video);
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
video = ola.OpenVideo("videos/demo.mp4")
framePtr = ola.ReadCurrentFrame(video)
java
import com.olaplug.OLAPlugServer;

OLAPlugServer ola = new OLAPlugServer();
long video = ola.OpenVideo("videos/demo.mp4");
long framePtr = ola.ReadCurrentFrame(video);
cpp
var ola = com("OlaPlug.OlaSoft")
var video = ola.OpenVideo("videos/demo.mp4")
var framePtr = ola.ReadCurrentFrame(video)
vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
video = ola.OpenVideo("videos/demo.mp4")
framePtr = ola.ReadCurrentFrame(video)
text
.局部变量 ola, OLAPlug
ola.创建 ()
video = ola.OpenVideo(“videos/demo.mp4“)
framePtr = ola.ReadCurrentFrame(video)
aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var video = ola.OpenVideo("videos/demo.mp4");
var framePtr = ola.ReadCurrentFrame(video);
text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
长整数 video = ola.OpenVideo("videos/demo.mp4")
长整数 framePtr = ola.ReadCurrentFrame(video)
cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
long video = ola.OpenVideo("videos/demo.mp4");
long framePtr = ola.ReadCurrentFrame(video);

原生 DLL 调用

cpp
long instance = CreateCOLAPlugInterFace();
long video = OpenVideo(instance, "videos/demo.mp4");
long framePtr = ReadCurrentFrame(instance, video);
csharp
long instance = CreateCOLAPlugInterFace();
long video = OpenVideo(instance, "videos/demo.mp4");
long framePtr = ReadCurrentFrame(instance, video);
python
from ctypes import CDLL, c_int, c_int64, create_string_buffer

ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
instance = ola.CreateCOLAPlugInterFace()
video = OpenVideo(instance, "videos/demo.mp4")
framePtr = ReadCurrentFrame(instance, video)

返回值

返回值说明
(返回值)长整数型:图像句柄(BGRA格式),失败返回 0。

注意事项

项目说明
释放内存返回的图像句柄由内部管理,不需要手动释放。
此函数不会改变视频的当前位置此函数不会改变视频的当前位置。