49859

Video upload check “Only 30 second video will upload”

Question:

I am working with PHP. I want to find a way to upload a maximum of 30 second video clips on upload. How to check that the uploaded video duration is only 30 seconds long?

Also, I want to find a way with PHP to convert a video in other formats such as MP4.

Please suggest us.

Answer1:

You can get the ID3 information of the file and probably do a check later:

$getID3 = new getID3; $file = $getID3->analyze($filename); // Access duration and dimensions $duration = $file['playtime_string']; $dimensions = $file['filesize'];

If you want to convert it in other formats there is this package <a href="https://github.com/PHP-FFMpeg/PHP-FFMpeg" rel="nofollow">PHP-FFMpeg</a>.

Also check these resources:

<ul><li>

<a href="http://getid3.sourceforge.net/" rel="nofollow">http://getid3.sourceforge.net/</a>

</li> <li>

<a href="http://ffmpeg.org/" rel="nofollow">http://ffmpeg.org/</a>

</li> <li>

Similar question: <a href="https://stackoverflow.com/questions/4847752/how-to-get-video-duration-dimension-and-size-in-php" rel="nofollow">How to get video duration, dimension and size in PHP?</a>

</li> </ul>

Recommend

  • AltBeacon not detect beacon when app is closed
  • Use Python to manipulate txt file presentation of key-value grouping
  • Best way to create Combination of records (Order does not matter, no repetition allowed) in mySQL ta
  • Whats the best way of sending a lot of parameters between pages?
  • replacing values in pig latin
  • python id3 tag unicode
  • JQuery: how to name click functions?
  • MongoDB Count() vs. Aggregation
  • width returns 0 for IE and Chrome
  • How to encode h.264 live stream to RTP packet with Java
  • DataFrame transformation in Spark, Java
  • multidimensional array
  • read / write mp4 id3 tags with PHP
  • Python - how to read Windows “Media Created” date (not file creation date)
  • How to remove special characters in file names?
  • How to save a large fractal image with the least possible memory footprint?
  • Embed multiple jpeg images into EXCEL programmatically?
  • How to use java.time.LocalDate on a Play Framework JSON Rest?
  • iOS Date formatting
  • HTML5 video only works in IE. The other browsers shows the black screen
  • Convert SQLite database to XML
  • WPF Visiblity Binding to Boolean Expression with multiple Variables
  • Conversion from string “a” to type 'Boolean' is not valid
  • print() is showing quotation marks in results
  • Content-Length header not returned from Pylons response
  • Play WS (2.2.1): post/put large request
  • Q promise. Difference between .when and .then
  • How to access EntityManager inside Entity class in EJB3
  • Illegal mix of collations for operation for date/time comparison
  • Deselecting radio buttons while keeping the View Model in synch
  • vba code to select only visible cells in specific column except heading
  • Web-crawler for facebook in python
  • How can I estimate amount of memory left with calling System.gc()?
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • Arrays break string types in Julia
  • retrieve vertices with no linked edge in arangodb
  • Unit Testing MVC Web Application in Visual Studio and Problem with QTAgent
  • Load html files in TinyMce
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • coudnt use logback because of log4j