[FFmpeg-user] getting ValueError: I/O operation on closed file on MacOSX yosemite and python2.7

Sudeep Maheshwari - TNW S.Maheshwari at tudelft.nl
Thu Apr 13 16:45:38 EEST 2017


Dear all

I am trying to create a movie file of a monte carlo simulation at each time step from the plot of matplotlib in python2.7.
The movie creation using ffmpeg is giving following error


Traceback (most recent call last):

  File "code1.py", line 99, in <module>

    print simulate(side, time, density)

  File "code1.py", line 94, in simulate

    t+=1

  File "/Users/smaheshwari/anaconda2/lib/python2.7/contextlib.py", line 35, in __exit__

    self.gen.throw(type, value, traceback)

  File "/Users/smaheshwari/anaconda2/lib/python2.7/site-packages/matplotlib/animation.py", line 256, in saving

    self.finish()

  File "/Users/smaheshwari/anaconda2/lib/python2.7/site-packages/matplotlib/animation.py", line 276, in finish

    self.cleanup()

  File "/Users/smaheshwari/anaconda2/lib/python2.7/site-packages/matplotlib/animation.py", line 311, in cleanup

    out, err = self._proc.communicate()

  File "/Users/smaheshwari/anaconda2/lib/python2.7/site-packages/subprocess32.py", line 927, in communicate

    stdout, stderr = self._communicate(input, endtime, timeout)

  File "/Users/smaheshwari/anaconda2/lib/python2.7/site-packages/subprocess32.py", line 1713, in _communicate

    orig_timeout)

  File "/Users/smaheshwari/anaconda2/lib/python2.7/site-packages/subprocess32.py", line 1769, in _communicate_with_poll

    register_and_append(self.stdout, select_POLLIN_POLLPRI)

  File "/Users/smaheshwari/anaconda2/lib/python2.7/site-packages/subprocess32.py", line 1748, in register_and_append

    poller.register(file_obj.fileno(), eventmask)

ValueError: I/O operation on closed file

Please tell me what is the work around to this
I am using FFMpeg on MacOSX and this is the latest version


ffmpeg version N-78810-g4e05a12 Copyright (c) 2000-2016 the FFmpeg developers

built with Apple LLVM version 6.1.0 (clang-602.0.51) (based on LLVM 3.6.0svn)

configuration: --disable-yasm

libavutil      55. 19.100 / 55. 19.100

libavcodec     57. 27.101 / 57. 27.101

libavformat    57. 26.100 / 57. 26.100

libavdevice    57.  0.101 / 57.  0.101

libavfilter     6. 37.100 /  6. 37.100

libswscale      4.  0.100 /  4.  0.100

libswresample   2.  0.101 /  2.  0.101


My code is attached


sudeep

-------------- next part --------------
A non-text attachment was scrubbed...
Name: code1.py
Type: text/x-python-script
Size: 2551 bytes
Desc: code1.py
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20170413/dccf1e92/attachment.bin>


More information about the ffmpeg-user mailing list