Jetson Linux API 参考文档

32.7.4 版本
视频读取/写入

详细描述

用于从文件读取视频帧到缓冲区结构以及从缓冲区结构写入到文件的实用函数。

函数

int read_video_frame (std::ifstream *stream, NvBuffer &buffer)
 从文件读取视频帧到缓冲区结构。 更多...
 
int write_video_frame (std::ofstream *stream, NvBuffer &buffer)
 将视频帧从缓冲区结构写入到文件。 更多...
 
int read_dmabuf (int dmabuf_fd, unsigned int plane, std::ifstream *stream)
 从文件读取数据平面到缓冲区。 更多...
 
int dump_dmabuf (int dmabuf_fd, unsigned int plane, std::ofstream *stream)
 将数据平面从缓冲区写入到文件。 更多...
 
int parse_csv_recon_file (std::ifstream *stream, std::string *recon_params)
 解析参考重建文件以写入 Y、U 和 V 校验和。 更多...
 

函数文档

◆ dump_dmabuf()

int dump_dmabuf ( int  dmabuf_fd,
unsigned int  plane,
std::ofstream *  stream 
)

将数据平面从缓冲区写入到文件。

参数
[in]dmabuf_fd缓冲区的 DMABUF 文件描述符。
[in]plane视频帧平面的索引。
[in]stream指向输出文件流的指针。
返回值
成功时返回 0,否则返回 -1。

◆ parse_csv_recon_file()

int parse_csv_recon_file ( std::ifstream *  stream,
std::string *  recon_params 
)

解析参考重建文件以写入 Y、U 和 V 校验和。

此函数从参考重建文件解析 Y、U 和 V 校验和。

参数
[in]stream指向输入重建文件流的指针。
[in]recon_params指向数组的指针,用于存储解析后的 Y、U 和 V 字符串。
返回值
成功返回 0,否则返回 -1。

◆ read_dmabuf()

int read_dmabuf ( int  dmabuf_fd,
unsigned int  plane,
std::ifstream *  stream 
)

从文件读取数据平面到缓冲区。

参数
[in]dmabuf_fd缓冲区的 DMABUF 文件描述符。
[in]plane视频帧平面的索引。
[in]stream指向输入文件流的指针。
返回值
成功时返回 0,否则返回 -1。

◆ read_video_frame()

int read_video_frame ( std::ifstream *  stream,
NvBuffer buffer 
)

从文件读取视频帧到缓冲区结构。

此函数从文件读取数据到缓冲区,一次读取一个数据平面。对于每个数据平面,读取的字节数为

stride * height

width * height * bytes_per_pixel
参数
[in]stream指向输入文件流的指针。
[in]buffer对要将数据读入的缓冲区对象的引用。
返回值
成功时返回 0,否则返回 -1。

◆ write_video_frame()

int write_video_frame ( std::ofstream *  stream,
NvBuffer buffer 
)

将视频帧从缓冲区结构写入到文件。

此函数从缓冲区写入数据到文件,一次写入一个平面。对于每个数据平面,写入的字节数为

stride * height

width * height * bytes_per_pixel
参数
[in]stream指向输出文件流的指针。
[in]buffer对从中写入数据的缓冲区对象的引用。
返回值
成功时返回 0,否则返回 -1。
. All rights reserved.