vijayvee / video-captioning

This repository contains the code for a video captioning system inspired by Sequence to Sequence -- Video to Text. This system takes as input a video and generates a caption in English describing the video.
MIT License
165 stars 66 forks source link

RuntimeError: The ffmpeg plugin does not work on Python 2.x #23

Closed chldydgh4687 closed 4 years ago

chldydgh4687 commented 4 years ago

Hi !! refered to this, I'm student studying s2vt.

Using by text_files, I made it portion of video. ex) 'vid1547'

and I try to do 'extract_feats(portion_of_video.mp4, batch_size)'. but error is RuntimeError: The ffmpeg plugin does not work on Python 2.x... your repo spec is python 2.x, please, How to fix this problem..?

in extract_feats code

    for file in filenames:
 # maybe error is in imageio.get_reader
        vid = imageio.get_reader(file,'ffmpeg')
        curr_frames = []
        for frame in vid:
            frame = skimage.transform.resize(frame,[224,224])
            if len(frame.shape)<3:
                frame = np.repeat(frame,3).reshape([224,224,3])
            curr_frames.append(frame)
        curr_frames = np.array(curr_frames)
        print "Shape of frames: {0}".format(curr_frames.shape)
        idx = map(int,np.linspace(0,len(curr_frames)-1,80))
        curr_frames = curr_frames[idx,:,:,:]
        print "Captured 80 frames: {0}".format(curr_frames.shape)

error message is in here !

VGG Network loaded
Traceback (most recent call last):
  File "/home/ivcl/Desktop/git/video-captioning/s2vt_sample.py", line 30, in <module>
    extract_feats(video_path+'test_m.mp4',4)
  File "/home/ivcl/Desktop/git/video-captioning/Extract_Feats.py", line 34, in extract_feats
    vid = imageio.get_reader(file,'mkv')
  File "/home/ivcl/anaconda2/envs/ai/lib/python2.7/site-packages/imageio/core/functions.py", line 186, in get_reader
    return format.get_reader(request)
  File "/home/ivcl/anaconda2/envs/ai/lib/python2.7/site-packages/imageio/core/format.py", line 164, in get_reader
    return self.Reader(self, request)
  File "/home/ivcl/anaconda2/envs/ai/lib/python2.7/site-packages/imageio/core/format.py", line 214, in __init__
    self._open(**self.request.kwargs.copy())
  File "/home/ivcl/anaconda2/envs/ai/lib/python2.7/site-packages/imageio/plugins/ffmpeg.py", line 261, in _open
    self._ffmpeg_api = _get_ffmpeg_api()
  File "/home/ivcl/anaconda2/envs/ai/lib/python2.7/site-packages/imageio/plugins/ffmpeg.py", line 61, in _get_ffmpeg_api
    raise RuntimeError("The ffmpeg plugin does not work on Python 2.x")
RuntimeError: The ffmpeg plugin does not work on Python 2.x
chldydgh4687 commented 4 years ago

this error is wrong file_path..!