libVLC和模糊视频
libVLC and blur videos
我制作了qt快速应用程序,我需要制作一个带有视频的声明性小部件(我不想使用qt移动性)。就像,这不是问题。但我不知道如何模糊libVLC。有人知道如何用libVLC做模糊视频吗?
也许你可以在QImage上使用expoblur,并对模糊的视频进行重新编码。
http://www.qtcentre.org/archive/index.php/t-26534.html
static QImage blurred(const QImage& image, const QRect& rect, int radius, bool alphaOnly = false)
{
int tab[] = { 14, 10, 8, 6, 5, 5, 4, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2 };
int alpha = (radius < 1) ? 16 : (radius > 17) ? 1 : tab[radius-1];
QImage result = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
int r1 = rect.top();
int r2 = rect.bottom();
int c1 = rect.left();
int c2 = rect.right();
int bpl = result.bytesPerLine();
int rgba[4];
unsigned char* p;
int i1 = 0;
int i2 = 3;
if (alphaOnly)
i1 = i2 = (QSysInfo::ByteOrder == QSysInfo::BigEndian ? 0 : 3);
for (int col = c1; col <= c2; col++) {
p = result.scanLine(r1) + col * 4;
for (int i = i1; i <= i2; i++)
rgba[i] = p[i] << 4;
p += bpl;
for (int j = r1; j < r2; j++, p += bpl)
for (int i = i1; i <= i2; i++)
p[i] = (rgba[i] += ((p[i] << 4) - rgba[i]) * alpha / 16) >> 4;
}
for (int row = r1; row <= r2; row++) {
p = result.scanLine(row) + c1 * 4;
for (int i = i1; i <= i2; i++)
rgba[i] = p[i] << 4;
p += 4;
for (int j = c1; j < c2; j++, p += 4)
for (int i = i1; i <= i2; i++)
p[i] = (rgba[i] += ((p[i] << 4) - rgba[i]) * alpha / 16) >> 4;
}
for (int col = c1; col <= c2; col++) {
p = result.scanLine(r2) + col * 4;
for (int i = i1; i <= i2; i++)
rgba[i] = p[i] << 4;
p -= bpl;
for (int j = r1; j < r2; j++, p -= bpl)
for (int i = i1; i <= i2; i++)
p[i] = (rgba[i] += ((p[i] << 4) - rgba[i]) * alpha / 16) >> 4;
}
for (int row = r1; row <= r2; row++) {
p = result.scanLine(row) + c2 * 4;
for (int i = i1; i <= i2; i++)
rgba[i] = p[i] << 4;
p -= 4;
for (int j = c1; j < c2; j++, p -= 4)
for (int i = i1; i <= i2; i++)
p[i] = (rgba[i] += ((p[i] << 4) - rgba[i]) * alpha / 16) >> 4;
}
return result;
}
相关文章:
- 如何在c++中录制具有精确帧时间戳的视频
- 如何在QT中的自定义视频小工具t上绘制矩形
- 方便地对C++中的所有字符串文字进行模糊处理
- 如何使用OpenCV-C++编写*.mp4视频?
- 开放 CV 中的动态内存分配,用于视频处理
- 错误:(-210:不支持的格式或格式组合)功能'create'中的硬件视频解码器不支持视频源
- 想要检测图像中的模糊,但无法正确
- OpenCV QT,显示视频的帧(不使用while循环)
- FFmpeg——使用硬件加速进行视频解码
- 在 openCV 中手动停止视频
- 具有可分离内核的 2D 模糊卷积
- 强制Qt相机视频格式
- 在macOS Mojave上尝试OpenCV视频捕获时"Abort Trap: 6"
- 应用程序在打开的简历中捕获视频后没有响应
- 使用 IMFSinkWriter 编码的视频的播放速度会根据宽度而变化
- 如何在 c++ 中通过 http 发送大型视频文件?
- 在 QLabel 中显示视频
- OpenGL 调试上下文警告 -"将使用视频内存作为缓冲区异议的来源
- 这个工厂类在这个C++视频中的意义何在?
- libVLC和模糊视频