New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract images from a video as numpy #63
Comments
If you run Check this code from the tests. Note that a p = subprocess.Popen(out.compile(), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output = p.stdout.read() You may also want to check this out. |
Sure thank you.Will check this and get back to you. |
Between is it possible to mention image format as "jpg" or "png" in ffmpeg in extraction step? |
I am able to pipe the images but the image size(file size) in RAM is more than the jpg extraction.I will be reading thousands of files so I need in compressed format like jpg.Any thoughts on this? |
You should check the ffmpeg documentation. I'm pretty sure there's an encoder for jpeg but I don't remember how it works off the top of my head. |
If you want to read individual frames as jpg: def read_frame_as_jpg(in_filename, frame_num):
out, err = (
ffmpeg
.input(in_filename)
.filter_('select', 'gte(n,{})'.format(frame_num))
.output('pipe:', vframes=1, format='image2', vcodec='mjpeg')
.run(capture_stdout=True)
)
return out |
Hello kkroening,
Is it possible to use ffmpeg extracted frames in jpg to numpy using ffmpeg-python?
The text was updated successfully, but these errors were encountered: