Thursday, August 5, 2010

Why clipbucket or ffmpeg is unable convert video files using ffmpeg on linux machine?

Guys,

I have tired to upload the video files in the clipbucket script enabled site but every time it's not converting the video file to flv file. I logged in the admin area and saw the conversion log(Did't get any server log). The -vf option of ffmpeg was causing to convert the mp4 file to flv file for my case. I have checked the issue as per the basic concept. What I actually did I searched the exact file which was uploading the video file(upload.php). I had conception like some file or code in a file which was converting the video. So, I started to get my clue from upload.php and got another included file(./includes/classes/conversion/ffmpeg.class.php). This contains ffmpeg conversion procedures where -vf option has implemented. So, I searched the particular line and commented the -vf enabled logic.


I wanted to go beyond that. I manually uploaded one .mp4 file and tried to convert it to .flv using the ffmpeg binary(via command prompt). I got same error messages. So, I assured myself that I have to disable the -vf option since it was successfully converting without -vf or padding option(I dont' know how the developers think here!).


Here are those codes I commented.

============
# video size, aspect and padding

$this->calculate_size_padding( $p, $i, $width, $height, $ratio, $pad_top, $pad_bottom, $pad_left, $pad_right );
# $use_vf = config('use_ffmpeg_vf');
$use_vf='no';
if($use_vf=='no')
{
$opt_av .= " -s {$width}x{$height} -aspect $ratio -padcolor 000000 -padtop $pad_top -padbottom $pad_bottom -padleft $pad_left -padright $pad_right ";
}else
{
$opt_av .= "-s {$width}x{$height} -aspect $ratio -vf 'pad=0:0:0:0:black'";
}
============

Following is the exact command to convert the video file(mp4 to flv) via backend :

====
root@starslite [~]# ffmpeg -i vdosong.mp4 -f flv -vcodec flv -r 30 -b 512000 -s 400x300 -aspect 1.33333333333 -acodec libmp3lame -ab 128000 -ar 22050 -map_meta_data /home/me/public_html/files/videos/testme.flv:/home/me/vdosong.mp4 /home/me/public_html/files/videos/testme.flv
====

Here /home/me/public_html/files/videos/testme.flv is path of output file.

Note error message that I got :
====
-------------------------
Unrecognized option 'vf'
ERROR: No such file or directory - /home/sucess/public_html/files/videos/1282138755d3fab.flv
ERROR: /usr/lib/ruby/site_ruby/1.8/flvtool2/base.rb:259:in `initialize'
ERROR: /usr/lib/ruby/site_ruby/1.8/flvtool2/base.rb:259:in `open'
====

PS: I would like you to always try to find the solution from the basic concept and error messages :)

2 comments:

  1. We have had endless trouble with this software, on a dedicated server with all the bells and whistles. At the same time, a new client requested a social networking site. After much research, I decided to give Boonex Dolphin a try. To convert files in dolphin, the server needs to be loaded with Ray Media Server, and a simple cron task. I was able to do this in an afternoon, without much more than a couple tickets to my host. It should be noted, Dolphin, right out of the box (after installing a few included modules), is capable of videos, music, and even video chat features.
    We have been paying for support from clip-bucket to resolve our video encoding issues, and they have yet to produce ANY results. We're into the second month of paying for their support for absolutely NOTHING.

    ReplyDelete
  2. Thanks Christopher, Yes Boonex Dolphin is too good. I had also experience with it. yes it needs any RMS /RED server to convert files to flash one.

    ReplyDelete