在C ++中另存为Flash [英] Saving as Flash in C++

查看:194
本文介绍了在C ++中另存为Flash的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将OpenCV的 IPLImage 保存为Flash文件?

How to save an IPLImage of OpenCV as a Flash file? Maybe there is a library that does that?

推荐答案

如果您的意思是将输出存储为Flash视频ffmpeg(libavcodec / libavformat)。它是跨平台并支持.flv格式(除了大量的其他人),应该很容易做到。您也可以嵌入音频。

If you mean storing your output as a flash video (.flv) just use ffmpeg (libavcodec/libavformat). It is cross platform and supports the .flv format (besides a massive amout of others) and should be quite easy to do. You can embed audio too.

注意:ffmpeg部分包含在opencv(取决于您的构建)作为视频编码器/解码器,我不知道如果你可以强制它写作.flv(通过选择正确的编解码器字符串)从opencv内。无论如何,将IplImage转换为ffmpeg缓冲区并进行存储并不难。

As a note: ffmpeg is partially included in opencv (depending on your build) as a video coder/decoder, i don't know though if you can force it to write as .flv (by choosing the right codec string) from within opencv. Anyways it's not too hard to convert IplImage to a ffmpeg buffer and store from there.

您可能遇到的一个问题是,最新的opencv(2.1)使用ffmpeg支持或者是针对你不想要的某些ffmpeg版本构建的。但是如上所述,你不需要通过opencv 2.1 api使用ffmpeg,因为你可以使用ffmpeg api直接使用它。

A problem you might have is that latest opencv (2.1) has trouble to build with ffmpeg support or is build against some ffmpeg version you don't want. But as mentioned above you don't need to use ffmpeg via the opencv 2.1 api, since you can use it directly by using the ffmpeg api.

查找例子libavcodec如何写一个视频,并检查opencv源如何从IplImage转换为AVPacket / AVFrame。我以前做过,它是相当
容易做。

Look for the examples in libavcodec on how to write a video, and check the opencv source on how to convert from IplImage to AVPacket/AVFrame. I've done this before and it was quite easy to do.

这篇关于在C ++中另存为Flash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆