Latest Register Log In

+ Advanced Search

Convert videos to MP4

Convert videos to MP4
By
02/06/07 (Edited 11/30/18)

If your directory involves video content you may wish to convert it to MP4 (previously we used FLV but Flash is pretty much defunct now), to be embedded in a player. The current player is an HTML5 player called Flow Player -- previously there was a player using Adobe's Flash plugin. Technically HTML5 <video> players can handle MP4, WebM or OGG but to keep things simple WSN just uses MP4.

You have a switch in your switches to convert to MP4 (it handles mpg mpeg flv mov avi divx webm ogg mjpeg wmv 3gp), but you need to install some software and verify settings on your server first:
  • PHP's shell_exec function must be enabled. Some shared hosts disable it.
  • The upload_max_filesize and max_post_size values in php.ini must be set to something larger than the largest video file size you want to allow people to upload.
  • lame must be installed
  • ffmpeg must be installed

Ask your web host to do the above for you or give you instructions. Dreamhost has ffmpeg instructions here.

Once you have everything installed you'll be able to convert files to MP4 automatically on upload (when the switch is on). You can control the size of the resulting movies at Admin -> Listings ->Listing Settings with the video resolution option there. Note the width and height must be multiples of 2 or ffmpeg will refuse to process it.

You'll find the flow player embed details are already in your default listing details template, so you won't need to change anything to get videos playing. You may copy the flow player HTML from the listing details template to other places (such as attachment toplists) if you wish. You may also use direct HTML5 video tag embedding without flowplayer if you prefer.

Thumbnails for converted videos work the same as for images (use {ATTACHTHUMBIMAGE}). There's also a full-size preview image available which you can access via {ATTACHFLVPREVIEW}.




Description Display video files in an HTML5 video player
Rating
Views 4829 views. Averaging 1 view per day.