write a Image object into std.in buffer
See original GitHub issueI’m working on streaming image sequences into ffmpeg. Roughly, this is my code:
image_original = pyvips.Image.new_from_file(self.file_path)
p = Popen(['/usr/local/bin/ffmpeg', '-y', '-f', 'image2pipe', '-vcodec', 'mjpeg', '-r', self.fps, '-i', '-', '-r', self.fps, '-f', 'mp4', '-vcodec', 'libx264', '-crf', '26', 'output/{}.mp4'.format(self.animation_name)], stdin=PIPE)
for image in images:
image.smartcrop(self.output_raster_width, self.output_raster_height)
image.jpegsave(p.stdin, profile='JPEG')
p.stdin.close()
p.wait()
This yields an error, but I suspect I’m not using the right method to do the sdtin write. Is there a good way to handle this use case?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
how to get buffer from Imagemagick image in c++
I am only able to write in file. Tried using Magick::Blob but still of no use. Following code is used to load, convert...
Read more >Python PIL | Image.frombuffer() method - GeeksforGeeks
PIL.Image.frombuffer() Creates an image memory referencing pixel data in a byte buffer. Note that this function decodes pixel data only, not ...
Read more >Import Pixel Buffer Into an Image — v5.3.0 - ITK examples
Here we create a synthetic image with a centered sphere in a locally allocated buffer and pass this block of memory to the...
Read more >ImageOutput: Writing Images - Read the Docs
Here is the simplest sequence required to write the pixels of a 2D image to a file: ... std::unique_ptr<ImageOutput> out = ImageOutput::create (filename);....
Read more >IO extensions - Boost.GIL documentation
std ::string filename( "image.tif" ); rgb8_image_t img( 640, 480 ); // write ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi again, do you mind if I close this issue? It’s confusing having two open for almost the same thing. Let’s continue discussion in the other one.
Hey John, just played off this in the other thread 😃