Results 1 to 2 of 2

Thread: How to Set up Video Codecs on Linux Server (PHP)

  1. #1

    Default How to Set up Video Codecs on Linux Server (PHP)

    Video sharing sites are now really hot. To build your own video sharing site is not so hard. Here we will guide you to use PHP to create a video hosting site on Linux Apache server step by step, and customize a Flash video player for this video sharing site.

    Who may need this article:

    If you have interest on running your video hosting services, you wanna create your own video sharing site on Linux server with thousands upon thousands of visitors and video clips hosted just like YouTube, iFilm, Break or other famous video sharing sites do, this tutorial will tell you how to make the first step.

    What’s needed:

    This is about:

    How to build a video hosting site with php

    Step1 Install Apache Server and PHP
    Install Apache Server
    Please download the Apache server from the Apache Software Foundation and follow this document to know how to install, configure and run Apache under Linux.
    Install PHP
    PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. Please download PHP from and follow the installation and configuration guide to know how to install and configure PHP.

    Step2 Setup Directories and Files
    1. Log on to your server with root account.
    2. Download Sothink Video Encoder Engine for Adobe Flash (Linux Version) from our Web site. You will get a file named "fvec.tar.gz".
    3. Download additional codecs from our Web site. You will get a file named "mencoder.tar.gz".
    4. Create a directory "fvec" under /usr/bin:

      # mkdir /usr/bin/fvec
    5. Extract all the files from fvec.tar.gz and mencoder.tar.gz to the directory /usr/bin/fvec.

      # tar xvfz fvec.tar.gz -C /usr/bin/fvec
      # tar xvfz mencoder.tar.gz -C /usr/bin/fvec
    6. Use the following command to assign execution permission to users:
      # chmod 755 /usr/bin/fvec -R
    7. Download the PHP source of the demo site from our Web site and you will get a file named "php-demo.tar.gz"; Extract all the files to a sub-folder under your www root, for example, /var/www/html/php-demo.

      ; Create the directory
      # mkdir /var/www/html/php-demo

      ; Extract the files
      # tar xvfz fvec-php-demo.tar.gz -C /var/www/html/php-demo

      ; Assign permissions
      # chmod 777 -R /var/www/html/php-demo
    8. To prevent users from uploading executable files to the directory "/var/www/html/php-demo/files" and executing them, please open the file httpd.conf in the conf folder of Apache and insert the following lines to deny the execution of files in this folder.

      # vi /etc/httpd/conf/httpd.conf

      <Directory /var/www/html/php-demo/files>
      php_flag engine off

    Step3 Configure PHP
    You should change some php.ini directives to make the demo site work properly. Generally, php.ini is in the directory /etc. The demo site uses some new functions availabe since PHP 4.3. If you use older versions, please upgrade to version 4.3 or later. Please check the PHP configuration document for details.
    ; Enable file uploading:
    file_uploads = On
    ; Setup the temporary directory used for storing files when doing file upload. The directory must be writable by whatever user PHP is running as.
    upload_tmp_dir = /var/tmp
    ; Maximum allowed size for uploaded files.upload_max_filesize = 20M
    ; Maximum size of POST data that PHP will accept. This value should be larger than upload_max_filesize because extra data will be posted while uploading.post_max_size = 30M
    Save php.ini and restart Apache to make the changes take effect.
    # /sbin/service httpd restart

    Step4 Setup MySQL Database
    1. Open the file in your browser: http://yourdomain/php-demo/installdb.php
    2. Input the server name, user name and password of the of MySQL server.
    3. Click install to start the setup process.
    If succeeded, a database named "fvec" and a table named "VIDEOS" will be created in MySQL. A file 'db.php' will also be created in the current directory (/var/www/html/php-demo).

    Step5 Test Your Web Site
    To test the site, please open your browser and navigate to "http://yourdomain/php-demo/upload.htm".
    If everything goes well, you can upload video files to your server and encode them now. To view our demo site, please visit

    Create a Flash video player

    Installation of Sothink Video Encoder for Adobe Flash
    After purchasing Sothink Video Encoder Engine for Adobe Flash (Linux Version), you can get Sothink Video Encoder for Adobe Flash Windows GUI version for free. With the Windows GUI version, you can make customized Flash Video Players for general use on your video hosting and sharing server.
    System Requirements: Windows 2000 / XP / 2003 / Vista

    How to install
    1. Download Sothink Video Encoder for Adobe Flash from our web site.
    2. Extract the ZIP file to your hard disk
    3. Run Setup.exe and follow the wizard to install the software.
    4. Launch Sothink Video Encoder for Adobe Flash by double-clicking the program icon on your desktop.
    5. Enter the registration key to register the software. If you have not get the registration key yet, please send your registration information of Sothink Video Encoder Engine for Adobe Flash (Linux Version) to and we will send you the registration key then.

    Create a Customized Flash Video Player
    1. Launch Sothink Video Encoder for Adobe Flash by double-clicking the program icon on your desktop.
    2. Select any video file and click "Next".
    3. In the "Encoding preferences" page, change the "Width" and "Height" to desired values, then click Next.
    4. In the "Select output folder and files" page, check "Generate SWF" and uncheck "Generate FLV", "Generate HTML" and "Generate thumbnail". Enter "player.swf" as the name of the output SWF file. Select "Get FLV path from a URL variable and play progressively" and enter "flv" as the name of the URL variable. You can also change the playback settings as you like. Click "Next" after done.
    5. In the "Select play control skin" page, check "Use a skin" and select a desired skin. You can also specify a color scheme for the skin and adjust the saturation of the color.
    6. Click "Next" and a file name "player.swf" will be created in the specified folder.
    Deploy the Flash Video Player
    1. Find the file "player.swf" created in the previous steps in Windows Explorer.
    2. Copy the file "player.swf" in to the folder of the PHP demo site and overwrite the old one.
    3. Now you can upload a video and test the created Flash Video player on your web site.

  2. #2
    Join Date
    Nov 2005
    Bristol uk
    Blog Entries


    Pound to a penny its a pimp, but I assume it is useful to penguins with propellor heads so I will leave it up.

Similar Threads

  1. Crap. Linux for a Pentium
    By Mihai in forum The Perfect Video Editing PC
    Replies: 2
    Last Post: 09-17-2005, 04:46 PM
  2. wtf is the video server and why only it works?
    By deph in forum General video editing software help and advice
    Replies: 0
    Last Post: 01-03-2005, 10:07 AM
  3. Premier 6 and TMPGenc and Video Server plugin Beta 2
    By oceanroad in forum Adobe Premiere, Premiere Elements, and After Effects
    Replies: 4
    Last Post: 11-19-2004, 12:27 AM
  4. Adobe Video Server Plug-in for DVD -MPEG-2 encoding
    By Complete Tool in forum Blu Ray, DVD, SVCD and VCD authoring
    Replies: 3
    Last Post: 06-22-2004, 06:09 PM
  5. Which codecs for importing fuji video clips to premiere pro?
    By viper61 in forum Adobe Premiere, Premiere Elements, and After Effects
    Replies: 1
    Last Post: 04-19-2004, 09:34 AM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts