本文介绍了nreco提取高质量缩略图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Nreco框架.我调用GetVideoThumbnail方法,它会提取默认分辨率的图像

I use Nreco framwork. i call GetVideoThumbnail method, it extracts default resolution image

var ffMpeg = new NReco.VideoConverter.FFMpegConverter();
ffMpeg.GetVideoThumbnail(pathToVideoFile, "video_thumbnail.jpg");

如何自定义选项?

推荐答案

GetVideoThumbnail是一个辅助方法,该方法内部使用ConvertMedia仅对一帧进行MJPEG输出的特殊转换.

GetVideoThumbnail is a helper method that internally uses ConvertMedia to perform special conversion to the MJPEG output with only 1 frame.

您可以使用以下代码段代替调用"GetVideoThumbnail"方法(并使用所需的任何其他ffmpeg选项):

You may use the following code snippet instead of calling "GetVideoThumbnail" method (and use any additional ffmpeg options you need):

Stream jpegOutputStream; // stream for thumbnail jpeg image output
var thumbSettings = new ConvertSettings() {
              VideoFrameRate = 1,   VideoFrameCount = 1, // extract exactly 1 frame
              Seek = 0, // frame position in seconds
              CustomOutputArgs = "" // any ffmpeg arguments that goes before output param
};
ffMpeg.ConvertMedia(pathToVideoFile, null, jpegOutputStream, "mjpeg", thumbSettings);

这篇关于nreco提取高质量缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 07:06