Ffmpeg en Mencoder

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Tom Swinkels

Tom Swinkels

20/07/2010 00:12:30
Quote Anchor link
Beste Scripts,

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)
PHP script in nieuw venster Selecteer het PHP script
1
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
 
?>
 
PHP hulp

PHP hulp

23/04/2024 19:53:18
 
P Lekensteyn

P Lekensteyn

20/07/2010 10:31:43
Quote Anchor link
Ik weet niet of je ervaring hebt met *nix systemen, maar probeer altijd eens 'man commando':
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?
 
Tom Swinkels

Tom Swinkels

20/07/2010 11:44:25
Quote Anchor link
Ik voer nu het volgende script uit:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
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);
?>


De informatie die ik nu terug krijg is:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
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) )
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.