Bonjour,
J'essaye d'utiliser ffmpeg pour simplement pour obtenir la duré de fichier, pour l'installation j'ai mis ffmpeg.exe dans mon system32 et sa a l'air de fonctionner en ligne de commande

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
C:\Users\xxx>ffmpeg.exe -i C:\\wamp\\www\\1.avi
ffmpeg version N-49746-gda726a8-Sherpya Copyright (c) 2000-2013 the FFmpeg devel
opers
  built on Feb  9 2013 16:31:31 with gcc 4.6 (GCC)
  configuration: --cross-prefix=i686-w64-mingw32- --arch=x86 --target-os=mingw32
 --enable-cross-compile --extra-version=Sherpya --enable-gpl --enable-version3 -
-disable-ffplay --disable-ffserver --enable-postproc --enable-avfilter --enable-
pthreads --enable-runtime-cpudetect --enable-hardcoded-tables --enable-memalign-
hack --enable-avisynth --enable-libopencore-amrnb --enable-libopencore-amrwb --e
nable-libtheora --enable-libfreetype --enable-libmp3lame --enable-libtwolame --e
nable-libvorbis --enable-zlib --enable-bzlib --enable-libxvid --enable-libx264 -
-enable-libspeex --enable-libfaac --enable-libvpx
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.102 / 54. 91.102
  libavformat    54. 61.104 / 54. 61.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 36.100 /  3. 36.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, avi, from 'C:\\wamp\\www\\1.avi':
  Metadata:
    encoder         : MEncoder 1.0rc2-4.2.4
  Duration: 00:42:31.32, start: 0.000000, bitrate: 1337 kb/s
    Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 640
x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 112 k
b/s
At least one output file must be specified
Maintenant pour l'utiliser avec php je n'y arrive pas :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
echo var_dump(exec('ffmpeg.exe -i C:\\wamp\\www\\1.avi',$output,$var));
 
echo var_dump($output); // Retourne rien
echo '<br>';
echo var_dump($var); // Retourne 1