I currently have an API route in nodeJS generating images from given inputs and then creating and returning a GIF from these images. I'm using gifencoder and canvas to do these operations.
I need to generate a mp4 video instead of a GIF for this route, so I've looked at different solutions, but none suited me:
Converting the GIF to an mp4 with an ffmpeg, seems a little "heavy" and ffmepg need an image path on input to perform this.
Using the image data from canvas to directly feed the videoshow module, less heavy, but it still need images path.
I'd like to not save temporary images for this operation and having a straightforward process like :
"Informations > ImageData > Video".
Do you think it is doable ?
Related
I'm doing a custom game which I'd like to change the background and a character picture according to a file they upload.
The input file is outside phaser. If possible, I'd like to show the picture directly without uploading to the server.
If you use a file loader to get the base64 encoding of the image, you can use this.textures.addBase64 to load the image into the texture manager, after that loads you can create new objects with that image tag, or set existing images to that texture.
Working Example =>
https://stackblitz.com/edit/phaser-use-uploaded-image
How do I actually crop and compress (resize to snippet size) the image on back-end?
I'm using croppie on front-end: https://foliotek.github.io/Croppie/
I'm completely lost, small guidance would be very helpful.
Thanks!
Why do you want crop your pic on back-end? This operation should have be done in browser. When you use result({ type, size, format, quality, circle }) function, you can get data of cropped pic. If type is base64, you can save the data to file after base64_decode it.
I'm new to opencv .My requirement is that in a video by giving an input image it should tag every occurence of the image in the video using opencv. Any help would be much appreciated.
You can try with OpenCV Template Matching
where you have to extract each frame your video and apply Template Matching.
You can see OpenCV video tutorial here. Also see OpenCV documentation Reading and Writing Images and Video.
Load the input image in a global cv:Mat.
Scale this image appropriately, make this the template image(or Mat).
First load the video, then extract each frame out of it and store in a local cv::Mat.
Run template matching as suggested in the tutorial given by Harris with the local frame.
If match found, mark the frame and position using some GUI or color whatever.
Repeat process for next frame.
I am inspecting a portal's page for loading of images ,its loading very slow.
We pick images from a filesystem , images name from database and read them, create a list and show results using a4j:mediaOutput tag. but the images are being loaded very slowly.
http://www.easyrenting.com/list-detail/3bhk-ardee-city-sector-52/6263
The first problem I see is that all your pictures are high-res (1800px x 2400px).
You really should create thumbnails server side to meet your view requirement and load images according of the size you want to show on the client size.
Have you only verified that your web page weight about 6.5MB including all images? (Check with Firebug).
I would recommand you a custom servlet like this one FileServlet supporting resume and caching with GZIP, and create a URL pattern according to load full res or thumbnail depending of the requirement.
There is no problem using the a4j:mediaOutput tag.
The images are getting loaded slowly because the size is too large, you need to find out a way to optimize the image size. Probably you can re-size the images before saving it to your file system.
Unless you are giving the zoom functionality, you do not need these big images.
That should help!
I'm building functionality that allows users to upload an image, then crop it to a square (for profile pictures etc...)
Currently, the process works like this:
User selects image from hd
Image is uploaded to S3
S3 Path is sent back to view, and image with jCrop is shown
On submit button being clicked, my controller action gets the coords set above
Now I'd like to crop this image to the given coords (note- I'm using lpatters fork of node-imagemagick as it contains 'offset'
Unfortunately, .crop only accepts a path - which we don't have, since it's hosted on S3 at this point.
Is there any workaround?
I saw tmp, but this may be a little overkill?
What about using some of the other entry points such as "resize" that then allow you to provide the custom arguments? I'm using streams in this code: https://github.com/jeffwilcox/4th-cloud/blob/master/lib/webserver.js#L542