The question is similar to: Is there any way to create a video thumbnail through PHP without ffmpeg?
However, that thread is 6-year old and technologies have evolved since then.
Any way to extract a thumbnail from uploaded MP4 file using PHP?
Ffmpeg is great, but unfortunately unsupported on shared hosting accounts, requiring a dedicated server. And it's a kinda overkill to use ffmpeg's power just to generate a video preview picture.
Any other simple solution?
Related
I've got problem with rotating video and adding watermark during the same request. My system can get video from mobile devices and has to reformat it for HTML5. so I'm making mp4,webm and ogv formats. Everything works fine, I've figured out how to get video rotation using Mediainfo. I have only one problem. When I want add watermark and rotation to video during the same request I've got only video with watermark (in proper resolution and format) but without rotation. I've read that it is possible to achieve using complex-filter. Has anyone expirience how to make it possible using PHP-ffmpeg? It is very simple to use library, and works for me so it would be really cool if it will start to work.
Ok I've found the solution working well with PHP-ffmpeg wrapper. The solution was building from sources ffmpeg according to manual which is available on ffmpeg website. After this operation everything is working like a charm :)
I am scratching my head with this one, how can you get a screenshot or a thumbnail of a PDF? I am developing a social feed on a web server I have no control over, there is a PDF class but I cant narrow down what it is, and theres no function in there for this task.
To do this serverside, you could use ImageMagick. This allows PDF's to be converted into images on the server, not having to depend on the client's browser to have certain software.
You do need to be able to install ImageMagick on the server though.
A link to a guide can be found here
You can use google docs
https://docs.google.com/viewer?a=bi&pagenumber=1&url=http://url-of-your-pdf.pdf
It returns a png of the first page, you can then edit it using Imagemagick or similiar
Idea from: How to create thumbnails/screenshots out of PDF files on my Linux server?
I'm developing a PHP application that uses FFMPEG-PHP to split videos and convert them to FLV. And I ran into this problem :
FFMPEG does not support G2M3 or G2M2 encoded videos, and I have to make the process of splitting and converting videos effortless for the client, I don't want him to convert the video locally before uploading to the server.
All I want to do is to find a way to convert the G2M3 encoded videos online to FLV or to any other video type that FFMPEG supports.
So, is there any way I can do that?
Can MEncoder handle this type of videos?
I tried doing something similar and could not find a solution. The only workaround I could get together was to use an older version of Windows Media Encoder (think it was version 9), which would let you convert to a different format.
The big hassle was that the GotoMeeting codec was only available on Windows (and maybe Mac). A possible workaround could be to setup GotoMeeting to record using standard WMV, which is not the default setting.
G2M3 is a proprietary codec, see this link on vlc-forum. As the thread says, you will not find a open-src implementation of it.
Google gives me this link for a conversion howto
I have my own video sharing app,
My question is... is there any library,script or something else, to help me in rotating videos whatever their file extension is?
Many peoples are uploading videos but sometimes i found video (guessing shared with iphones or mobile phones) and i see them horizontally instead of vertically...
Does anyone have any ideas how to rotate them dynamically?
Im not familiar with any "libraries" that will do that. I think your better bet would be to find a command-prompt-enabled video software package (like Any Video Converter [See Q7]) that PHP can execute via command prompt on the fly.
PHP doesn't do that, and there are no extensions that I know off, made for that purpose.
You can use ffmpeg to manipulate videos, by calling it from your scripts (see shell_execute() and such functions). Reading the ffmpeg documentation will help you figure what can (and can't) be done with that powerful tool.
I'm making a video gallery and would like to pull some info about the video for displaying. Does anyone know how I would go about retrieving the video duration using ffmpeg? Is it possible to get this info using HTML5?
Thanks.
What I do (on Linux) is this:
tcprobe -i $FILE | tail -n1 | cut -d '=' -f3
tcprobe is from the transcode Debian package.
If you're on Windows there's a tool called MediaInfo, but I haven't tried it so I can't remark on its effectiveness.
Use exec function in php
http://www.longtailvideo.com/support/forums/jw-player/setup-issues-and-embedding/9448/how-to-get-video-duration-with-ffmpeg-and-php
I would recommend PHPVideoToolkit...
This class is a wrapper around the
FFmpeg, FLVTools2 and Mencoder
programs to allow PHP developers to
manipulate and convert video files in
any easy to use object oriented way.
It also currently provides FFmpeg-PHP
emulation in pure PHP so you wouldn't
need to compile and install the
module. Note, it isn't intended as a
FFmpeg-PHP replacement, only an
alternative solution and it is
recommended that if you make heavy use
of the FFmpeg-PHP functionality you
should install the module as it is
more efficient.
PHPVideoToolkit is pretty much the
only video/audio class that you will
need from now on. It performs several
types of manipulation operations that
include video format conversion,
extract video frames into separate
image files, assemble a video stream
from a set of separate video images,
extract audio from video, watermark
videos and extracted frames. Several
parameters can also be configured like
the output video file format (which
can be Flash video or any other
supported by ffmpeg), video and audio
bit rate and sample rate, video
dimensions and aspect ratio. It can
also retrieve information about the
media file, such as duration, bitrate,
framerate, format, dimensions, display
aspect ratio, pixel aspect ratio,
audio stereo, audio frequency and
audio format, without any other
additional library such as ffmpeg-php.
Note, I wrote it so ask any questions you want about using it.