FFmpeg/avconv rotate video with watermark adding using PHP-FFmpeg - php

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 :)

Related

Extract video thumbnail using PHP without ffmpeg

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?

PDF Thumbnailer

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?

How to create a video thumbnail without ffmpeg or HTML5 video canvas? [duplicate]

I'm stuck for ideas on this one.
I'm working on a CMS that uses a file-browser to store all media file in an S3 bucket.
I have 4 options for thumbnail sizes which generate new thumbnail images from original image. If I'm doing this server-side in PHP it's fine - I'm just at loss as to how to do this if all the original files are stored on the bucket (I want the thumbnails to be as well).
Does any have have any ideas? I'm using PHP5.
Your script'll need to pull the image down, manipulate it, and upload the manipulated version back to the bucket using the S3 API.
Use imagemagick for manipulating your images. Its free and great tool.

PHP rotate video

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.

PHP: get frame from SWF to JPEG or GIF

How get frame from animate SWF to JPEG(or better animate GIF), using PHP. Possible using ffmpeg? Thanks.
This is not really possible without using a Windows box to open the file and capture a screenshot of the file. If you can convert the .swf to .flv then you can use ffmpeg to pull a frame, but if it is something like a game, well yea you are sort of out of luck unless you can setup (or are on) a Windows box.
I will try and find my code I used for windows to capture a screenshot, which worked in Windows 7 and XP and post it here, will have to wait till later as I do not have access to my backup files right now.
You might also take a look at this thread: Website screenshots using PHP

Categories