cvondrick / vatic

Efficiently Scaling Up Video Annotation with Crowdsourced Marketplaces. IJCV 2012
http://mit.edu/vondrick/vatic/
MIT License
607 stars 255 forks source link

IOError: cannot identify image file '/tmp/pyvision-ffmpeg-7204250/1.jpg' #31

Open nishadhka opened 8 years ago

nishadhka commented 8 years ago

I am facing kind of serious error in running turkic extract /home/bee/Desktop/omnomstori_Dy5g5Vjl.mp4 /home/bee/Documents/VATIC/vatic

Besides giving the error as IOError: cannot identify image file '/tmp/pyvision-ffmpeg-7204250/1.jpg', seriousness is the command removes whole parent folder /home/bee/Documents/VATIC/vatic from the computer without trace. For instance the command removed the whole document folder from my computer when I ran the command as turkic extract /home/bee/Desktop/omnomstori_Dy5g5Vjl.mp4 /home/bee/Documents. Luckily I was trying to install in a fresh ubunut 14.04.3, there were not much importatnt files in it. I have another instance of Ubunut with vatic running perfectly, I followed all the steps done in that insatnce and is based on anaconda virtual environment containing following libs.

anaconda-client==1.1.2
clyent==1.0.0
Cython==0.20
munkres==1.0.7
MySQL-python==1.2.5
numpy==1.10.1
parsedatetime==1.2
PIL==1.1.7
Pillow==3.0.0
PyOpenGL==3.1.1a1
python-dateutil==2.4.2
pytz==2015.7
pyvision==0.3.1
PyYAML==3.11
requests==2.8.1
six==1.10.0
SQLAlchemy==1.0.9
turkic==0.2.5
wheel==0.26.0
wsgilog==0.3

Any help in this regard is requested, The complete log of the command is below

(vatic3)bee@beehive:~/Documents/vatic$ turkic extract /home/bee/Desktop/omnomstori_Dy5g5Vjl.mp4 /home/bee/Desktop/test/hi
ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib/x86_64-linux-gnu/ --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib/x86_64-linux-gnu/ --enable-runtime-cpudetect
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/bee/Desktop/omnomstori_Dy5g5Vjl.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.29.104
  Duration: 00:01:10.01, start: 0.000000, bitrate: 647 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360, 545 kb/s, 25 fps, 25 tbr, 50 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Please use -b:a or -b:v, -b is ambiguous
[swscaler @ 0x1a64f20] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/tmp/pyvision-ffmpeg-983757886/%d.jpg':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.25.101
    Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 640x360, q=2-31, 10000 kb/s, 25 fps, 25 tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc56.26.100 mjpeg
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
frame= 1750 fps= 65 q=1.6 Lsize=N/A time=00:01:10.00 bitrate=N/A    
video:61888kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Aborted. Cleaning up...
Traceback (most recent call last):
  File "/home/bee/anaconda/envs/vatic3/bin/turkic", line 4, in <module>
    __import__('pkg_resources').run_script('turkic==0.2.5', 'turkic')
  File "/home/bee/anaconda/envs/vatic3/lib/python2.7/site-packages/setuptools-18.4-py2.7.egg/pkg_resources/__init__.py", line 735, in run_script

  File "/home/bee/anaconda/envs/vatic3/lib/python2.7/site-packages/setuptools-18.4-py2.7.egg/pkg_resources/__init__.py", line 1652, in run_script

  File "/home/bee/anaconda/envs/vatic3/lib/python2.7/site-packages/turkic-0.2.5-py2.7.egg/EGG-INFO/scripts/turkic", line 16, in <module>
    turkic.cli.main()
  File "/home/bee/anaconda/envs/vatic3/lib/python2.7/site-packages/turkic-0.2.5-py2.7.egg/turkic/cli.py", line 147, in main
    handler(args[1:])
  File "/home/bee/anaconda/envs/vatic3/lib/python2.7/site-packages/turkic-0.2.5-py2.7.egg/turkic/cli.py", line 47, in __init__
    self(parser.parse_args(args))
  File "/home/bee/Documents/vatic/cli.py", line 48, in __call__
    for frame, image in enumerate(sequence):
  File "/home/bee/anaconda/envs/vatic3/lib/python2.7/site-packages/pyvision-0.3.1-py2.7-linux-x86_64.egg/vision/ffmpeg.py", line 44, in __iter__
    yield self[i]
  File "/home/bee/anaconda/envs/vatic3/lib/python2.7/site-packages/pyvision-0.3.1-py2.7-linux-x86_64.egg/vision/ffmpeg.py", line 30, in __getitem__
    return Image.open(self.getframepath(k))
  File "/home/bee/anaconda/envs/vatic3/lib/python2.7/site-packages/PIL/Image.py", line 2286, in open
    % (filename if filename else fp))
IOError: cannot identify image file '/tmp/pyvision-ffmpeg-983757886/1.jpg'
Vadman97 commented 8 years ago

I've been running into this when the input video file or output directory to the turkic extract command do not exists. Double check those arguments.

vxk5499 commented 8 years ago

I too have the same error and I am not able to resolve. I have double checked my arguments and they are correct. Could anyone guide me on what needs to be done?

@nishadhka : have your found a solution. Thanks

djr2015 commented 7 years ago

I also had this error for a bit, then it stopped occurring after I made sure I executed the turkic extract command with the vatic directory as my cwd and provided the full video and output directory paths as input arguments.

KTOC commented 7 years ago

I also ran into this problem. After running the extract command the folder /tmp/pyvision-ffmpeg-XXXX/ and /path/to/output/dorectory/ are removed without trace. I tried to run inside vatic folder and using absolute path to input file and output folder but no use.

KTOC commented 7 years ago

I just found the solution btw, change the line 4 in ffmpeg.py in pyvision/vision:

from import Image to from PIL import Image

then build and install pyvision again using: $(which python) setup.py build && $(which python) setup.py install