Online video converter script with ffmpeg [php]

Started on the old forum in December 2010 · view the original in the archive · old links redirect here

No replies · 3,574 views · started 15 years ago · 1 min read

akela Senior · 305 posts #1

please check this video converter with ffmpeg that works?

[QUOTE]<?php

function ffmpeg_convert($input_file, $to_format, $output_dir=null)

{
	$input_file = realpath($input_file);
	$output_dir = is_dir($output_dir) ? $output_dir : dirname($input_file);

	$output_file = $output_dir.'/'.pathinfo($input_file, 
PATHINFO_FILENAME).'.'.$to_format;
	
	
$cmd = sprintf('ffmpeg -y -i %s -f %s %s %s > /dev/null 2>&1',
		escapeshellcmd($input_file),
		$to_format,

		(($to_format=='avi'||1)?'-f avi -vcodec mpeg4 -b 175k -g 300 -bf 2 -acodec libmp3lame -ab 32k':''),
		
escapeshellcmd($output_file)
	);
echo $cmd;
	exec($cmd, $output, $status);
	
	$success = empty($status);
	
return $success ? $output_file : false;
}[/QUOTE]

External image (may be gone) Unlimited Web Hosting service. 99.99 $ uptime Guarantee. Free Trail Available for 30 days. Free Script | Null script| Php | Unlimited Web Hosting| Unlimited Space | Unlimited Bandwidth| Unlimited Domain| $3/m Unlimited Space | Unlimited Bandwidth|5 Domain| $2/m 10 GB Space | 100 GB Bandwidth| 1 Domain| $1/m FFMPEG| FREE SCRIPT | FREE SITE BUILDER |LIVE SUPPORT [Timewebhosting.com On Web Hosting| Unlimited Web Hosting](http://www…

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close