Ffmpeg en Mencoder
Ik wil graag Ffmpeg en Moncoder een commando geven via php, helaas lukt dit niet.
Ffmpeg en Mencoder zijn op de server geinstalleert.
Ik probeer het volgend script werkend te krijgen alleen is er wijnig te vinden op internet over een commando in php naar ffmpeg te krijgen..
Zijn er soms mensen op phphulp die wel weten waar ze over praten? En die mij kunnen helpen met een oplossing?
Code (php)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
<?php
define('FFMPEG_LIBRARY', '/usr/bin/mencoder');
$exec_string = FFMPEG_LIBRARY.' mencoder mf:////home/sites/www.siris.nl/test.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o /home/sites/www.siris.nl/video.avi';
exec($exec_string); //where exxc is the command used to execute shell command in php
define('FFMPEG_LIBRARY', '/usr/bin/ffmpeg');
$exec_string = FFMPEG_LIBRARY.' ffmpeg -y -i /home/sites/www.siris.nl/audio.mp3 -vn -acodec copy -i video.avi -an -vcodec copy -map 0:1 -map 1:0 -b 2500 /home/sites/www.siris.nl/video.avi';
exec($exec_string); //where exxc is the command used to execute shell command in php
?>
define('FFMPEG_LIBRARY', '/usr/bin/mencoder');
$exec_string = FFMPEG_LIBRARY.' mencoder mf:////home/sites/www.siris.nl/test.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o /home/sites/www.siris.nl/video.avi';
exec($exec_string); //where exxc is the command used to execute shell command in php
define('FFMPEG_LIBRARY', '/usr/bin/ffmpeg');
$exec_string = FFMPEG_LIBRARY.' ffmpeg -y -i /home/sites/www.siris.nl/audio.mp3 -vn -acodec copy -i video.avi -an -vcodec copy -map 0:1 -map 1:0 -b 2500 /home/sites/www.siris.nl/video.avi';
exec($exec_string); //where exxc is the command used to execute shell command in php
?>
Dit kreeg ik voor 'man ffmpeg':
http://swoolley.org/man.cgi/1/ffmpeg
Je doet daar wel iets vreemds.
Als ffmpeg in /usr/bin staat, dan moet je daaronder ' ffmpeg' weghalen.
Hetzelfde geldt voor mencoder, haal in exec_string ' mencoder' eens weg?
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
define('FFMPEG_LIBRARY', '/usr/bin/mencoder');
$exec_string = FFMPEG_LIBRARY.' mf:////home/sites/www.siris.nl/test.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o /home/sites/www.siris.nl/video.avi';
exec($exec_string, $command_output); //where exxc is the command used to execute shell command in php
define('FFMPEG_LIBRARY', '/usr/bin/ffmpeg');
$exec_string = FFMPEG_LIBRARY.' -y -i /home/sites/www.siris.nl/audio.mp3 -vn -acodec copy -i video.avi -an -vcodec copy -map 0:1 -map 1:0 -b 2500 /home/sites/www.siris.nl/video.avi';
exec($exec_string, $command_output2); //where exxc is the command used to execute shell command in php
print_r($command_output);
echo '<br /><br />';
print_r($command_output2);
?>
define('FFMPEG_LIBRARY', '/usr/bin/mencoder');
$exec_string = FFMPEG_LIBRARY.' mf:////home/sites/www.siris.nl/test.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o /home/sites/www.siris.nl/video.avi';
exec($exec_string, $command_output); //where exxc is the command used to execute shell command in php
define('FFMPEG_LIBRARY', '/usr/bin/ffmpeg');
$exec_string = FFMPEG_LIBRARY.' -y -i /home/sites/www.siris.nl/audio.mp3 -vn -acodec copy -i video.avi -an -vcodec copy -map 0:1 -map 1:0 -b 2500 /home/sites/www.siris.nl/video.avi';
exec($exec_string, $command_output2); //where exxc is the command used to execute shell command in php
print_r($command_output);
echo '<br /><br />';
print_r($command_output2);
?>
De informatie die ik nu terug krijg is:
Code (php)
1
2
3
2
3
Array ( [0] => MEncoder 2:1.0~rc2-0ubuntu13.1 (C) 2000-2007 MPlayer Team [1] => CPU: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz (Family: 6, Model: 15, Stepping: 11) [2] => CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 [3] => Compiled with runtime CPU detection. [4] => success: format: 16 data: 0x0 - 0x0 [5] => MF file format detected. [6] => [mf] search expr: //home/sites/www.siris.nl/test.jpg* [7] => [mf] number of files: 1 (8) [8] => VIDEO: [IJPG] 800x600 24bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s) [9] => [V] filefmt:16 fourcc:0x47504A49 size:800x600 fps:25.00 ftime:=0.0400 [10] => [11] => Exiting... )
Array ( [0] => MEncoder 2:1.0~rc2-0ubuntu13.1 (C) 2000-2007 MPlayer Team [1] => CPU: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz (Family: 6, Model: 15, Stepping: 11) [2] => CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 [3] => Compiled with runtime CPU detection. [4] => [5] => Exiting... (error parsing command line) )
Array ( [0] => MEncoder 2:1.0~rc2-0ubuntu13.1 (C) 2000-2007 MPlayer Team [1] => CPU: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz (Family: 6, Model: 15, Stepping: 11) [2] => CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 [3] => Compiled with runtime CPU detection. [4] => [5] => Exiting... (error parsing command line) )