getting ValueError: I/O operation on closed file on MacOSX yosemite and python2.7

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

getting ValueError: I/O operation on closed file on MacOSX yosemite and python2.7

Sudeep Maheshwari - TNW
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


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

code1.py (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: getting ValueError: I/O operation on closed file on MacOSX yosemite and python2.7

Lou-2
On Thu, Apr 13, 2017, at 05:45 AM, Sudeep Maheshwari - TNW wrote:
> 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

I see no ffmpeg errors, and we do not provide help for scripts here.

> I am using FFMpeg on MacOSX and this is the latest version
>
> ffmpeg version N-78810-g4e05a12 Copyright (c) 2000-2016 the FFmpeg
> developers

This is old. macOS users can download recent builds from:
https://evermeet.cx/ffmpeg/

> built with Apple LLVM version 6.1.0 (clang-602.0.51) (based on LLVM
> 3.6.0svn)
>
> configuration: --disable-yasm

--disable-yasm is not recommended. It can result in slowness.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: getting ValueError: I/O operation on closed file on MacOSX yosemite and python2.7

Kieran O Leary
In reply to this post by Sudeep Maheshwari - TNW
Hi,

On Thu, Apr 13, 2017 at 2:45 PM, Sudeep Maheshwari - TNW <
[hidden email]> wrote:

> Dear all
>
>
> Please tell me what is the work around to this
> I am using FFMpeg on MacOSX and this is the latest version
>
>
Have you tried raising an issue with matplotlib? Looking at their
animation.py, they are using -loglevel quiet in ffmpeg, so we can't see any
ffmpeg errors and therefore diagnose the issue. Looking at your terminal
output, there doesn't seem to be anything to suggest that the issue is with
ffmpeg.

-K
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Loading...