Here is a section of the code where I am guessing the modification needs to be done. I just want to make sure I am in the right place.

I see the section that says:

$outExtn = '.flv';
$rand_flv_name = $rand_name . '.flv';

if ($file_extn == 'mp4')
{
$rand_flv_name = $rand_name . '.mp4';
$outExtn = '.mp4';
}

I am lost please help anyone.


PHP Code:
   $log_text '<h1>STARTING VIDEO CONVERSION (process_queue.id = ' $vid ')</h1>';
    
write_log($log_text$log_file_name$debug'html');
    
    
$sql "SELECT * FROM
           `process_queue` AS `process_queue`,
           `users` AS `users` WHERE
            process_queue.id=
$vid AND
            process_queue.user=users.user_name"
;
    
$result mysql_query($sql) or mysql_die($sql);
    
$download_info mysql_fetch_assoc($result);
    
$video_file_name $download_info['file'];
    
$re_process_vid $download_info['vid'];
    
    
$status $download_info['status'];
    
    if (
$status == 2)
    {
        
$sql "UPDATE `process_queue` SET
               `status`='4' WHERE
               `id`='
$vid'";
        
mysql_query($sql) or mysql_die($sql);
    }
    else
    {
        
$log_text '<h2>STOP: can only process when status = 2. Current status is: ' $status '</h2>';
        
write_log($log_text$log_file_name$debug'html');
        exit();
    }
    
    
$video_src VSHARE_DIR '/video/' $video_file_name;
    
    
$log_text '<p>File: ' $video_src '</p>';
    
write_log($log_text$log_file_name$debug'html');
    
    if (! 
file_exists($video_src))
    {
        
$log_text '<h2>ERROR: file not found - ' $video_src '</h2>';
        
write_log($log_text$log_file_name$debug'html');
        
$err 1;
    }
    else
    {
        
$pos strrpos($video_file_name'.');
        
$file_extn strtolower(substr($video_file_name$pos 1strlen($video_file_name) - $pos));
        
        
$log_text '<p>$file_extn = ' $file_extn '</p>';
        
write_log($log_text$log_file_name$debug'html');
        
        
$seo_name seo_name($download_info['title']);
        
$seo_name_org $seo_name;
        
$i 1;
        
        while (
check_field_exists($seo_name'video_seo_name''videos'))
        {
            
$seo_name $seo_name_org '-' $i;
            
$i ++;
        }
        
        if (
$re_process_vid == 0)
        {
            
            
$log_text '<p>$re_process_vid = ' $re_process_vid '</p>';
            
write_log($log_text$log_file_name$debug'html');
            
            
$rand1 $_SERVER['REQUEST_TIME'];
            
$rand2 mt_rand();
            
$rand_name $rand1 $rand2;
            
            
$outExtn '.flv';
            
$rand_flv_name $rand_name '.flv';
            
            if (
$file_extn == 'mp4')
            {
                
$rand_flv_name $rand_name '.mp4';
                
$outExtn '.mp4';
            }
            
            while (
check_field_exists($rand_flv_name'video_flv_name''videos') == 1)
            {
                
$rand1 time();
                
$rand2 mt_rand();
                
$rand_name $rand1 $rand2;
                
$rand_flv_name $rand_name $outExtn;
            }
            
            
$log_text '<p>$rand_flv_name = ' $rand_flv_name '</p>';
            
write_log($log_text$log_file_name$debug'html');
            
            
$video_folder floor($convert_vid 1000) + 1;
            
$video_folder md5($video_folder);
            
$video_folder substr($video_folder110);
            
$video_folder trim($video_folder);
            
$video_folder .= '/';
            
            if (! 
is_dir(VSHARE_DIR '/flvideo/' $video_folder))
            {
                
mkdir(VSHARE_DIR '/flvideo/' $video_folder);
            }