question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FFMPEG reader fails after KeyboardInterrupt

See original GitHub issue

After a manual KeyboardInterrupt ([Ctrl]+[c]), reading a frame with (index > 0) causes an FFMPEG error.

import imageio
reader = imageio.get_reader("imageio:cockatoo.mp4",format="ffmpeg")

#reader.get_data(2) #Initializing the reader by reading some frame here will cause the error to go away

try:
    input("Do a manual KeyboardInterrupt [Ctrl]+[c] (raising an error with code won't trigger the error)")
except:
    print(reader.get_data(1)) #Reading some frame, n>0 fails.
    print(reader.get_data(0)) #Reading frame 0 works fine.

System: Imageio 2.4.1 Python 3.6.5 FFMPEG 3.2.4 Linux 64bit

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
almarkleincommented, Feb 17, 2020

Looking into this now and having a facepalm moment when I realized it’s the ffmpeg process stopping because the interrupt propagates to the subprocesses 🤦‍♂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parent process receives KeyboardInterrupt on subsequent ...
The problem I am having is that immediately upon the execution of subprocess.run() , Python issues a KeyboardInterrupt, and the Pool child ...
Read more >
ffmpeg never finishes encoding, instead starts dropping ...
ffmpeg never finishes encoding, instead starts dropping frames indefinitely after reaching the -vframes limit.
Read more >
VideoFileClip instance has no attribute 'reader' #512 - GitHub
I am trying just a simple program to read in a video file: from moviepy.editor import VideoFileClip, concatenate_videoclips from ...
Read more >
Make Ctrl+C work on a script with concurrent.futures workers ...
Ctrl + C causes your program to throw the KeyboardInterrupt exception at whatever line it is at. It doesn't have anything to do...
Read more >
raspbian - Interrupting a Program with a Button
Currently tying to stop the middle of a command if the user presses a certain button. I tried this bit of code below...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found