Creating Image with audio file and uploading to facebook - php

I have googled for image format that supports audio also. I came to know that gif won't support audio.We need to do it in flash. Is there any image format which holds audio also?
We can show image with audio in web page with little work around using audio and image tag in html5.
But we need to implement this in PHP(Forget about language now) to combine audio with Image and share to facebook ? Is this possible?

Upload to e.g soundcloud with image, that will give desired result, but its an audio file with image not vice versa, which is not possible.

Related

Way to show AVI uploaded video on webpage

I'm trying my first CodeIgniter E-learning project that a teacher can upload their video file, and show it on lesson page.
The problem I was thinking about is if our customer has AVI video files and wants to upload them and show them on webpage, but most browsers do not support an AVI file fromat.
So how can I solve this problem?
I tried videojs but it doesn't work, Is there any suggestion?
I'm thinking about 2 options
Is there any plugin/software that can display AVI video and embed it on webpage?
Create convert process to convert AVI to MP4 => I think it will more complicated.
I found another option to do that: Use Google Drive API to upload and generate preview link to show. It worked!! If you guys have another effective way please let me know!
I think for embedding avi video. That is previously answered in how to embed an .AVI in html?
As for converting video. I think you can use something like ffmpeg or avconv for converting video in the backend to convert it first and then embed it or do it in Flash or in html video tag

Create usable images for each Frame of an Animated GIF image using PHP

Goal
As part of the functionality of a bigger app I am building I need to allow my user to take an Animated GIF image and extract each Frame into it's own image to show the user.
The user can then select any of the Frame images which will then be saved and used as a non-animated cover image on my Animated GIF Player which functions similar to a movie by loading the cover image on page load and only downloading and showing the large file Animated GIF image after the user has clicked a Play button on the cover image.
My goal is to do this with PHP as my app will be released as a WordPress plugin so if I require some fancy server side software then it could limit my userbase.
So far the best PHP search results for this task have netted this library called GifFrameExtractor which is a single file PHP Class. I found a more advanced/updated version in this Forked copy here https://github.com/AbhasKr/GifFrameExtractor
The library has 1 option. Generate Transparent frame or not. I have made a demo below which takes my sample Animated GIF image and extracts each Frame into its own Image file using both versions (transparent and not).
Problem
Neither of the 2 sets of images generated with the GifFrameExtractor library meet my quality needs.
I then found an online cloud image processing service which I uploaded the sample GIF image to and it generates perfect Frame images like I need!
The service is http://cloudinary.com/
I can view each Frame of my animated GIF file that I uploaded here using this format of URL
http://res.cloudinary.com/apollo-web-studio/image/upload/pg_[FRAME_NUMBER_HERE]/Ladda-loader-buttons_qlpxbc.jpg
Replace the [FRAME_NUMBER_HERE] part with the Frame Number and it will show the Frame as an image.
Demos
Demo and Code URLs
Demo http://apollowebstudio.com/labs/gif_gen/demo.php
GitHub GIST Demo Source Code: https://gist.github.com/jasondavis/ab7c71fc1a007c3a31282bb9791cecff
Forked GifFrameExtractor PHP Library used: https://github.com/AbhasKr/GifFrameExtractor
Source Test Animated GIF Image: http://localhost/labs/php/GifFrameExtractor/Ladda-loader-buttons.gif
The demo shows 3 different processing results from my attempt to take an Animated GIF image and extract each Frame into a usable image using PHP
Columns 1 and 2
Using the PHP library GIFFrameExtractor which the results are both not perfect.
column 3
I used an online image processing cloud service called cloudinary.com
The images generated on Cloudinary.com use some different technique as each frame generated is flawless!
My goal is to generate images for each frame and have them turn out like the results from Cloudinary.com using PHP.
http://apollowebstudio.com/labs/gif_gen/demo.php
You may want to look at ImageMagick (which provides a PHP library) and specifically the "coalesce" functionality which produces a full-frame image out of each frame of a GIF animation (as opposed to only a partial frame content indicating changes from previous frame).
This can be used to generate a "film-strip" of an animated GIF, or in your case extract a separate complete image for each frame of the animated GIF.
Link here: http://www.imagemagick.org/Usage/anim_basics/#coalesce

Video.js-Could not get thumbnail image of video automatically

I am using "video.js" based HTML5 tag to display video on my browser.But It can not grab the first frame of the video and show as thumbnail of video before the start up.So can anyone suggest me how can i get image automatically without use of "poster" tag in the video tag and pass the thumbnail path in the argument.Is it necessary to generate thumbnail of the video to show it?
thanks in advance..and please provide you valuable suggestions
As far as I know, VideoJS does not automatically extract a poster image. However, Dynamically using the first frame as poster in HTML5 video? shows you, how this can easily be acieved using Popcorn.js.

How to trim image in the web-browser using js and save it on server then?

I'm looking for some jQuery plugin or smth similar.
For example, I need to crop a photo on website and to save the result on server.
I know that it is better to do it in Adobe Flash, but I really need to do in using JS.
Very few browsers support selecting an image with Javascript and manipulating it without first uploading it to a server. Instead, you'll need to:
Allow user to upload image to server
When upload is complete, resize the image (with PHP) to a manageable size for the browser for preview
Show the resized preview image in the browser in something like JCrop
After the user chooses the crop area, have them click "Save"
On Save, pass the coordinates of the cropped area to the server/PHP to have it crop the original image. You'll have to scale the coordinates for the preview to coordinates for the original image.
Save the new image to disk/S3/whatever with PHP
I managed to do this without ever using my server or having the image touch my server by using http://transloadit.com/. I use transloadit's Javascript upload form to upload to their server storage (S3) and use a template that saves the original and resizes for preview. Both the original and preview are stored in transloadit's temporary S3 account, not mine. I then use JCrop to show the user the preview. Once they select the crop area I then tell transloadit to crop the original photo but with my crop coordinates (scaled from the preview image to fit the original) using a template that also makes several thumbnail sizes. Transloadit then saves all the images to my S3 account and tells me the URL where it saved it.
Check out jCrop. It's perfect for this stuff.
You are looking for JCrop
Here are some demos.
Here is an example implementing in on PHP.

converting videos with php and ffmpeg

how can i upload and convert the video to mp4 behind the scene so that if user uploads a video than the user could work/visit on rest of site and once the video is converted it displays in the users control panel....!!
i want to do this without ffmpeg........
if there is no way out than i will want to use ffmpeg.....!!
See this SO question, or this one

Categories