【问题标题】:nreco extract high quality thumbnailnreco 提取高质量缩略图
【发布时间】:2016-10-15 21:16:50
【问题描述】:

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

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

如何自定义选项?

【问题讨论】:

    标签: c# image


    【解决方案1】:

    GetVideoThumbnail 是一个辅助方法,它在内部使用 ConvertMedia 来执行对只有 1 帧的 MJPEG 输出的特殊转换。

    您可以使用以下代码 sn-p 而不是调用“GetVideoThumbnail”方法(并使用您需要的任何其他 ffmpeg 选项):

    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);
    

    【讨论】:

      猜你喜欢
      • 2014-04-07
      • 2012-02-21
      • 2011-10-11
      • 2011-10-11
      • 2020-06-12
      • 2021-07-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多