我正在尝试处理视频流中的帧,并将其作为新视频。
这就是我要做的:
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('Videos/output.mp4',fourcc, fps, (1080,1080))
我一直在想:
OpenCV: FFMPEG: tag 0x44495658/'XVID' is not supported with codec id 13 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV:
我在Python中有一个脚本,它读取我的摄像头并在窗口中显示它。现在我想存储结果,因此在之后,我编写了以下代码:
import cv2
import imutils
camera = cv2.VideoCapture(0)
# Define the codec and create VideoWriter object to save the video
fourcc = cv2.VideoWriter_fourcc(*'XVID')
video_writer = cv2.VideoWriter('output.avi', fourcc, 20.0, (640
我试图导出来自热相机的数据,但是我得到了一条错误消息,上面写着
error: /build/opencv-ISmtkH/opencv-2.4.9.1+dfsg/modules/highgui/src/cap_ffmpeg.cpp:238: error: (-215) image->depth == 8 in function writeFrame
有人能看看我在做什么然后告诉我我做错了什么吗?我非常密切地跟随和举例,所以我不明白这个错误意味着什么,也不明白它为什么会发生。
o = camera.add_overlay(np.getbuffer(a), size=(320,240), la
在OSX上,我可以用我的摄像头记录并用以下简单的脚本编写一个视频文件:
import cv2
camera = cv2.VideoCapture(0)
# Define the codec and create VideoWriter object to save the video
fourcc = cv2.VideoWriter_fourcc(*'XVID')
video_writer = cv2.VideoWriter('output.avi', fourcc, 25.0, (640, 480))
while True:
try:
我正在尝试使用openCV将帧组合成视频,使用以下代码。然而,png格式的帧的总大小超过500兆字节,而输出的视频只有360千字节。没有任何压缩怎么写出视频?
#setting fourcc
fourcc = cv2.VideoWriter_fourcc(*'XVID')
#creating the writer object
writer=cv2.VideoWriter('Screen1.avi', fourcc, 30, (unitWidth, unitHeight), True)
#writing out the frames into video
for
我可以在windows中使用Matlab阅读一段视频,但无法在ubuntu 14.04中从Matlab中读取相同的视频。错误如下:
>> aa = VideoReader('s12_32_xvid.avi');
Error using VideoReader/init (line 619)
Could not read file due to an unexpected error. Reason: Unable to initialize the video obtain properties
Error in VideoReader (line 172)
我正在学习如何使用Python3和OpenCV显示视频。我使用PyCharm作为我的集成开发环境。当我运行代码来显示来自我的网络摄像头的连续视频时,它只给我一个被阻止的网络摄像头的符号。后来,那个“视频”的保存文件在我的文档中,但没有用。我是否只需要在某个地方更改相机设置?
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
# Define the codec and create VideoWriter object
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out =
我正在尝试在Ubuntu16.4上使用Python中的OpenCV录制视频。我用的是Logitec920摄像头。我的问题是,当我改变房间照明(从白光到红光)或改变帧速率时,录制的视频的持续时间会根据情况而变得更快或更慢。这是我使用的代码:
import numpy as np
import cv2
import time
cam = cv2.VideoCapture(0) # select the camera
# Define the codec and create VideoWriter object
fourcc = cv2.VideoWriter_fourcc(*
我尝试过许多编解码器,除了最后一个产生0字节的视频,最后一个编解码器确实会产生一个视频文件,但是它不能播放。这个问题快把我逼疯了,我使用的代码是由工作中的其他用户测试的。我已经将opencv_ffmpeg310_64.dll文件复制到c:\python2.7文件夹中。我在windows 10和opencv 3.1.0上,我尝试了所有类型的编解码器,都没有工作。
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
# Define the codec and create VideoWriter object
# D