Recherche avancée

Médias (1)

Mot : - Tags -/biographie

Autres articles (48)

  • Changer son thème graphique

    22 février 2011, par

    Le thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
    Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
    Modifier le thème graphique utilisé
    Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
    Il suffit ensuite de se rendre dans l’espace de configuration du (...)

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

Sur d’autres sites (3949)

  • Converting a video to .mp4 after upload [on hold]

    18 août 2014, par Colum

    I’ve looked around for a while trying to find an answer to my problem and most point me to using ffmpeg.
    What I want to do is after a user uploads a video, it gets converted to an mp4 file.

    I know ffmpeg can do this, what I cant work out how to do is : install ffmpeg, install ffmpeg on a server i do not own, use ffmpeg to convert uploaded files.

    I have just been told that my server doesnt support ffmpeg, so my QUESTION is, is there a way to do this without ffmpeg ?

  • FFMPEG With PHP Upload

    27 décembre 2014, par Will S.

    I’ve created an upload form that uses Ajax to dynamically upload image files to my webserver, and then uses shell_exec and ffmpeg to resize the images (and convert them to jpg, if they are already the correct size), and then save the resulting file. I’m getting really strange behaviour with it. It works about 50% of the time (so far I’ve only tested with JPG and PNG files). Whenever it fails, I get this results :

    ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
     built on Dec 23 2014 16:55:38 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
     configuration:
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
    /tmp/phpU0pnje: Invalid data found when processing input

    Here’s the PHP code :

    if ($file_info[0] == 'image'){
           $image_info = getimagesize($_FILES['upload_media_hidden']['tmp_name'][$i]);
           $longest_edge = ($image_info[0] > $image_info[1]) ? $image_info[0] : $image_info[1];
           $aspect_ratio = $image_info[0]/$image_info[1];
           $aspect_ratio_s = ($image_info[0] > $image_info[1]) ? '200x' . (int)(200/$aspect_ratio) : (int)(200*$aspect_ratio) . 'x200';
           $aspect_ratio_m = ($image_info[0] > $image_info[1]) ? '400x' . (int)(400/$aspect_ratio) : (int)(400*$aspect_ratio) . 'x400';
           $aspect_ratio_l = ($image_info[0] > $image_info[1]) ? '700x' . (int)(700/$aspect_ratio) : (int)(700*$aspect_ratio) . 'x700';

           if ($longest_edge > 200){
                   $file_s = shell_exec('ffmpeg -i ' . escapeshellarg($_FILES['upload_media_hidden']['tmp_name'][$i]) . ' -f image2 -s ' . $aspect_ratio_s . ' - 2>&1');
           }

         ................more processing below

    So the ffmpeg command essentially looks like this :

    ffmpeg -i ’SOMEFILE.jpg’ -f image2 -s 400x200 -

    When I run that command in bash to the actual file (not the temporary file when I upload it to my form), it works fine. I’m guessing the issue is with the pipe, but I’m not sure. Any ideas ?

    Thanks !

    Update :
    When I run this code :

    if ($file_info[0] == 'image'){
           $image_info = getimagesize($_FILES['upload_media_hidden']['tmp_name'][$i]);
           $longest_edge = ($image_info[0] > $image_info[1]) ? $image_info[0] : $image_info[1];
           $aspect_ratio = $image_info[0]/$image_info[1];
           $aspect_ratio_s = ($image_info[0] > $image_info[1]) ? '200x' . (int)(200/$aspect_ratio) : (int)(200*$aspect_ratio) . 'x200';
           $aspect_ratio_m = ($image_info[0] > $image_info[1]) ? '400x' . (int)(400/$aspect_ratio) : (int)(400*$aspect_ratio) . 'x400';
           $aspect_ratio_l = ($image_info[0] > $image_info[1]) ? '700x' . (int)(700/$aspect_ratio) : (int)(700*$aspect_ratio) . 'x700';

           if ($longest_edge > 200){
                   move_uploaded_file($_FILES['upload_media_hidden']['tmp_name'][$i],'/tmp/TEST.jpg');
                   system('ffmpeg -i /tmp/TEST.jpg -f image2 -s ' . $aspect_ratio_s . ' - 2>&1');

                   $file_s = system('ffmpeg -i ' . escapeshellarg($_FILES['upload_media_hidden']['tmp_name'][$i]) . ' -f image2 -s ' . $aspect_ratio_s . ' - 2>&1');

    I get this result from php :

    ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
     built on Dec 23 2014 16:55:38 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
     configuration:
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
    Input #0, image2, from '/tmp/TEST.jpg':
     Duration: 00:00:00.04, start: 0.000000, bitrate: 54530 kb/s
       Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1024x1432 [SAR 1:1 DAR 128:179], 25 tbr, 25 tbn, 25 tbc
    [swscaler @ 0x2bce0c0] deprecated pixel format used, make sure you did set range correctly
    Output #0, image2, to 'pipe:':
     Metadata:
       encoder         : Lavf56.15.102
       Stream #0:0: Video: mjpeg, yuvj420p(pc), 143x200 [SAR 25600:25597 DAR 128:179], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
       Metadata:
         encoder         : Lavc56.13.100 mjpeg
    Stream mapping:
     Stream #0:0 -> #0:0 (mjpeg (native) -> mjpeg (native))
    Press [q] to stop, [?] for help
    �����JFIF��d�c������Lavc56.13.100����C�    
    ----FILE OUTPUT...edited out for clarity---
    ���frame=    1 fps=0.0 q=3.7 Lsize=N/A time=00:00:00.04 bitrate=N/A    
    video:5kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead:     unknown
    ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
     built on Dec 23 2014 16:55:38 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
     configuration:
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
    /tmp/phpxqYzHN: No such file or directory
    /tmp/phpxqYzHN: No such file or directory

    So it seems to work if I move the file first ? It’s really important that I don’t have any extra disk io, so this solution wouldn’t be acceptable...

    SOLUTION :
    So the problem was that ffmpeg was not able to recognize the input file type, since PHP’s tmp files don’t end with an extension (seems like a bug that ffmpeg looks at the extension rather than the internal mime type/headers). The solution was that I needed to add "-f image2" to the beginning of my command, so it ended up looking something like this :

    ffmpeg -f image2 -i '/tmp/PHP_TMP_FILE' -f image2 -s 400x200 -

    Hopefully this will save someone the many hours it took me to figure this out...

  • Anomalie #3106 : plus d’upload de doc possible en php 5.5

    30 novembre 2013, par cedric -

    Y a peut-être le fix d’utiliser le plugin mediatheque ?