Search code examples
python-3.xffmpegimagemagick64-bittrackpy

Python Windows 10 64bit - FFMPEG for trackpy


Similar problem to 'Python Moviepy installation problems (windows 7x64)' except the solution provided did not work.

I have windows 10, 64bit. Every time I attempt to run the following line of code:

frames = pims.Video('exp9_short.avi')

I get the blue Windows 10 error: This app can't run on your PC

as well as the Python error:

OSError: Could not load meta information
=== stderr ===

Access is denied.

I have tried multiple versions from 'https://ffmpeg.zeranoe.com/builds/' to no avail.

I don't know if other image processing tools will work with trackpy, or if there are any alternatives to trackpy.

I would really appreciate some advice.


Solution

  • I solved this problem by processing each image with OpenCV2

    vid0 = cv2.VideoCapture('exp9_short.avi')
    
    numfr = int(vid0.get(cv2.CAP_PROP_FRAME_COUNT))
    
    for n1 in range(0,numfr-1):
        success,img = vid0.read(n1)         #read video frame by frame
    
        if n1==0:
            h, w, cols = img.shape          #image size
            fr=np.zeros([h,w,3,numfr-1])    #frames
            frgr=np.zeros([h,w,numfr-1])    #grayscale fr
            frgrbi=frgr                     #binarized frgr
    
        fr[:,:,:,n1]=img
        frgr[:,:,n1]=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)