opencv 中视频保存,及与音频同步问题

dqq1019 2010-10-08 10:17:46

opencv 中压缩视频保存视频

writer=cvCreateVideoWriter("out4.avi",fourcc, fps, cvSize( DispImage->width, DispImage->height), 1 );


用cvCreateVideoWriter 函数 中的参数 fourcc 和fps 分别选择什么样的数值。可以保证录像时间五分钟,最后的保存时间也是5分钟? 谢谢了



加: 当fourcc 选1,-1,2 都可以生成avi 文件, 当fourcc 选CV_FOURCC('P','I','M','1'),没法生成avi 为何? 谢谢啦
...全文
1672 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
dqq1019 2010-10-08
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 xq830210 的回复:]
C/C++ code
public:
static IntPtr cvCreateVideoWriter(
String^ filename,
int fourcc,
double fps,
Size frameSize,
bool isColor
)

Parameters
filename
String
Name of ……
[/Quote]

看了,但是不明白。压缩是什么样的意义呢? 我试了好多种方法,都没有办法同步啊 郁闷。
Normandie007 2010-10-08
  • 打赏
  • 举报
回复
public:
static IntPtr cvCreateVideoWriter(
String^ filename,
int fourcc,
double fps,
Size frameSize,
bool isColor
)

Parameters
filename
String
Name of the output video file.
fourcc
Int32
4-character code of codec used to compress the frames. For example, CV_FOURCC('P','I','M','1') is MPEG-1 codec, CV_FOURCC('M','J','P','G') is motion-jpeg codec etc.
fps
Double
Framerate of the created video stream.
frameSize
Size
Size of video frames.
isColor
Boolean
If it is true, the encoder will expect and encode color frames, otherwise it will work with grayscale frames
Return Value
The video writer


先看看接口说明
dqq1019 2010-10-08
  • 打赏
  • 举报
回复
顶顶 老大们 大侠们 这个问题 怎么解决啊 老板 催着交东西( ⊙ o ⊙ )啊!
dqq1019 2010-10-08
  • 打赏
  • 举报
回复
fourcc 选-1 ,及 fps =30 的时候,感觉最后生成的视频avi播放时间,比原来录制的少了好久。怎么办?
fengbingchun 2010-10-08
  • 打赏
  • 举报
回复
可以去看看此函数的源代码
dqq1019 2010-10-08
  • 打赏
  • 举报
回复
各位大侠 救命( ⊙ o ⊙ )啊!

19,469

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧