Home - HostFLV.com :: FFMPEG Web Hosting with Streaming Video Support

 


Videos are not Converting to FLV or Not generating Thumbnails

If you have scripts that upload videos and convert videos, or create thumbnails, it may be due to the script isn't properly coded.

We have found that scripts like ClipShare have variables like:

exec("$config[phppath] $config[BASE_DIR]/convert.php $vdoname $vid $ff >/dev/null &");

This is an incorrect way to make this process run in the background.

Just replace this line to look like:

exec("env -i $config[phppath] $config[BASE_DIR]/convert.php $vdoname $vid $ff &>/dev/null &");

Please notice the "env -i" in the beginning, this is to fork the process in a clean environment, also notice in the end it looks like "&>/dev/null &" , as ">/dev/null &" is an incorrect way to send a process to the background to be processed.

The above code was just an example, as we saw in ClipShare, we do see other scripts that have the similar code structure like:

exec("$config[phppath] $config[basedir]/bgconversion.php $original $videoid $videor> /dev/null &");

This again is another example, if we change it to:

exec("env -i $config[phppath] $config[basedir]/bgconversion.php $original $videoid $videor &>/dev/null &");

It will function afterwards.

For the PHPMotion, it require modification to the uploader_finished.php with this line:

exec("$path_to_php $convertor $uploaded_file_name> /dev/null &");

It should be changed to this:

exec("env -i $path_to_php $convertor $uploaded_file_name> /dev/null &");/

Usually we find this piece of code within filenames that call it after the script uploads it, like upload.php or uploadvideo.php, etc, just look for the exec() that is attempting to run in the background.

Please make sure you are using the CLI version of PHP in your $config[phppath] paths, in our servers the CLI version of PHP is :

/usr/local/bin/php

Also, with the new updated mencoder on our servers, please refer to this section:

Scripts such as phpmotion, clipshare, vshare etc use mencoder to convert them to .flv format and then they are displayed on your website.

If you have installed your script and the script is not converting your videos to be displayed online, here are few things that you need to check to debug the issue.

1) Ensure the correct paths to ffmpeg and mencoder are configured fine in your script. All our servers have ffmpeg and related modules configured with following paths :

FFmpeg :
/usr/bin/ffmpeg

Mplayer :
/usr/bin/mplayer

Mencoder :
/usr/bin/mencoder

Flvtool2 :
/usr/bin/flvtool2

Php :
/usr/local/bin/php

2) Majority of the youtube clone scripts have a file that consists of mencoder command to convert videos. Below is the name of those files for Phpmotion and Clipshare :

Phpmotion convertor file : convertor.php

Clipshare convertor file : convert.php

If your script is not converting videos for any reason, you might need to edit the file responsible for converting videos as follows :

a) For PHPmotion : Take a backup of your existing convertor.php
Open the existing convertor.php using your favorite text editor and search for the following phrase :

-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -vop

Simply replace the above phrase with the new phrase as follows :

-ofps 24 -vf

*Note : There will be two instances of "-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames" and you need to replace both of them with "-ofps 24"

b) For Clipshare : Take a backup of your existing convert.php
Open the existing convertor.php using your favorite text editor and search for the following phrase :

-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -vop

Simply replace the above phrase with the new phrase as follows :

-ofps 24 -vf

*Note : There will be two instances of "-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames" and you need to replace both of them with "-ofps 24"

c) For any other script such as vshare, etc, you need to find the respective convertor file which comes along with their installation. If you are not sure about the file, you can contact us at support department or contact the script developer to know the exact file name.



Was this answer helpful?

Add to Favourites
Print this Article

Powered by WHMCompleteSolution

Language:
HostFLV.com :: FFMPEG Hosting