Ask Your Question

Iancoderfornew's profile - activity

2017-04-11 07:20:59 -0500 asked a question Non-ASCII character '\xa0' in file

Hi I am a starter in Python and Opencv. I have tried for this code blow for opening a avi file:


import cv
vidFile = cv.CaptureFromFile("C:\test1.avi")
nFrames = int(cv.GetCaptureProperty( vidFile, cv.CV_CAP_PROP_FRAME_COUNT ) )
fps = cv.GetCaptureProperty( vidFile, cv.CV_CAP_PROP_FPS )

waitPerFrameInMillisec = int( 1/fps * 1000/1 )

print 'Num. Frames = ', nFrames
print 'Frame Rate = ', fps, ' frames per sec'

for f in xrange( nFram`enter code here`es ):
frameImg = cv.QueryFrame( vidFile )
  cv.ShowImage( "My Video Window",  frameImg )
  cv.WaitKey( waitPerFrameInMillisec  )
cv.DestroyWindow( "My Video Window" )

While an error happens:

Non-ASCII character '\xa0' in file C:\ on line 5, but no encoding declared;

see for details

Could anybody help me for this please? Appreciate