How to compress upload video using PHP in the backend?

Asked

Viewed 244 times

-1

I have an application where it is possible to upload videos, and when uploading the video in the application, I need to compress it, before it is saved in the database. I need to compress videos before it is uploaded to my application, because uploading videos from 50MB would not be feasible. Is there any alternative to that? I searched for JS libs that could do this but I didn’t get any

  • Good afternoon, have you thought about hosting on VIMEO or Youtube? I don’t know any other way to decrease resolution than rendering again in a web format.

  • The issue is that it is user upload, so it would not be possible so :/

  • Take a look at this service, maybe solve... use it for photos.. but never used for videos. https://cloudinary.com/documentation/video_manipulation_and_delivery

  • Are you using some backend, such as Nodejs? Or just frontend with pure HTML, CSS and Javascript?

  • @THIAGODEBONIS to using Codeigniter

  • @Gustavofritola, Codeigniter is a Framework for PHP. So you are using PHP in your backend.

  • yes @THIAGODEBONIS, I forgot to mention this. Know something that could help?

Show 2 more comments

1 answer

0


In NATIVE PHP there is nothing related to. But you can use one library so-called PHP-Ffmpeg.

PHP-Ffmpeg

Is a object-oriented library for convert video/audio files with the Ffmpeg/Avconv. This library requires an installation of the Ffmpeg in operation. You will need Ffmpeg and Ffprobe binaries to use it. Make sure that these binaries may be located with the PATH of system for obtain the benefit of binary detection, otherwise, you must explicitly provide the path of the binaries in the load.

More information you can access official library repository.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.