Ask Your Question

nhqazi's profile - activity

2015-02-05 00:58:19 -0500 received badge  Famous Question (source)
2014-03-30 22:41:09 -0500 received badge  Notable Question (source)
2013-12-15 07:04:27 -0500 received badge  Popular Question (source)
2013-08-31 12:41:20 -0500 asked a question opencv manager

hi I am very new to opencv and android. I wish to know how to install opencv manager on emulator. should i use sdk manager ? Also is there any tutorial to assist me using opencv in android for basic imagae processing operation.

2013-03-20 08:11:07 -0500 commented answer Mp4 reading

actually i also used open method and checked it it returns false, here is the code: import cv2 import cv2.cv as cv cap=cv2.VideoCapture() cap.set(cv.CV_CAP_PROP_FOURCC, cv.CV_FOURCC('D','I','V','4')) cwi=cap.open("f:\aviwork\Example2.Mp4") print "cwi",cwi

2013-03-20 07:57:02 -0500 commented answer Mp4 reading

Following ur suggestion i run this code without any success as it returns false import cv2 import cv2.cv as cv cap=cv2.VideoCapture() cap.set(cv.CV_CAP_PROP_FOURCC, cv.CV_FOURCC('M','P','4','2')) c= cv2.VideoCapture("f:\aviwork\Example2.Mp4") print c.grab() , i did nt use open method assuming its C code.

2013-03-20 05:36:12 -0500 commented answer Mp4 reading

thank you i got it. i did nt set this code i have just read this property using the get method. however please excuse my limited knowledge in this field. what code should i give when i want the pencv should read mp4

2013-03-20 05:01:03 -0500 commented answer Mp4 reading

can u pass me ur email so that i can pass u the video as i do nt find any upload link here. secondly can u please also write more how to incorporate the decoding option while reading the frame. i will check how it is done in python.

2013-03-20 04:48:10 -0500 commented answer Mp4 reading

thanks. however i checked Mat type is not supported in python 2.7 i think with the above line u want to redirect cap to the frame. may i ask what actually u want to check.

2013-03-20 03:49:11 -0500 commented answer Mp4 reading

Thanks for the reply. I checked the file , i can play it with media player or vlc player installed on my system.do i need to install any other thing inorder to run it from my code.how can i check if my opencv support for codec.

2013-03-20 03:09:52 -0500 asked a question Mp4 reading

hi I am new o opencv with python. I have installed OpenCV 2.4.1 and python 2.7 . I also make a short program that reads the avi file successfully. However it fails to read mp4 file. Below is my program . Will appreciate any suggestion.

import cv2
import cv2.cv as cv
c= cv2.VideoCapture("f:\\aviwork\\Example2.Mp4")
print c.grab() // returns false. however returns true if use avi file.

cap = cv.CaptureFromFile("f:\\aviwork\\Example2.Mp4")

nframes=int(cv.GetCaptureProperty(cap,cv.CV_CAP_PROP_FRAME_COUNT))
fps= int(cv.GetCaptureProperty(cap,cv.CV_CAP_PROP_FPS))
print "total frame",cv.GetCaptureProperty(cap,cv.CV_CAP_PROP_FRAME_COUNT)
print "fps" ,fps
print " currpos of videofile",cv.GetCaptureProperty(cap,cv.CV_CAP_PROP_POS_MSEC)
waitpermillisecond=int(1*1000/fps)
print "waitpermillisecond",waitpermillisecond
print cv.GetCaptureProperty(cap,cv.CV_CAP_PROP_FOURCC)

for f in xrange(nframes):
    frameimg=cv.QueryFrame(cap)
    print " currpos of videofile",cv.GetCaptureProperty(cap,cv.CV_CAP_PROP_POS_MSEC)
    print " index of frame",cv.GetCaptureProperty(cap,cv.CV_CAP_PROP_POS_FRAMES)
    cv.ShowImage("hcq",frameimg)
    cv.WaitKey(1)

cv.DestroyAllWindows("hcq")