Recherche avancée

Médias (0)

Mot : - Tags -/masques

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (66)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

Sur d’autres sites (9389)

  • AJAX - PHP - FFMPEG - Execution not completing

    6 septembre 2018, par Hue Man

    Here is a slightly tricky situation :

    I am using ajax to call a function that uses FFMpeg to convert a video.

    The code all works fine EXCEPT :

    The execution is cut short so I end up with a video of 2 frames.

    I assume this is ajax causing the problem because as far as its concerned, its called the function and returned a success output to my php page.

    In other words, the ffmpeg script cuts off when the ajax has completed.

    Is there a way I can tell ajax to wait for the ffmpeg function to finish or do i need to set up a cron job for it to run in the background ?

    EDIT :

    Heres the code :

    AJAX :

    // watermark($thevideo)
    var ajaxurl = "<?php echo admin_url('admin-ajax.php'); ?>";
    var formData = new FormData();

    formData.append('thevideo', thevideo);
    formData.append('action', "watermark");

    $.ajax({
    url: ajaxurl,
    type: "POST",
    data:formData,cache: false,
    processData: false, // Don't process the files
    contentType: false, // Set content type to false as jQuery will tell the server its a query string request
    success:function(data) {
       alert(data);
    }

    });

    PHP FFMPEG Function :

    // Watermark ***************
    // IMPORTANT!
    // This action & function can be called by ajax but requires absolute file paths!

    add_action( 'wp_ajax_watermark', 'do_watermark' );
    add_action( 'wp_ajax_nopriv_watermark', 'do_watermark' );

    function getabspath( $file_url ){
      return realpath($_SERVER['DOCUMENT_ROOT'] . parse_url( $file_url, PHP_URL_PATH ));
    }

    function do_watermark() {

       session_start();  
       ini_set('display_errors', 1);
       error_reporting(E_ALL);

    //  $thevideo = $_POST['thevideo'];
       $thevideo = getabspath($_POST['thevideo']);

       $newvideo = getabspath('./wp-content/uploads') . '/test.mp4';

       $thewatermark = getabspath('./wp-content/uploads/mefbpic.png');
    //  For some reason we have to OMIT THE DRIVE LETTER from the watermark image path
    //  AND the backslashes need to be turned forward even tho its an absolute path!?!
       $thewatermark = substr($thewatermark,2); // Cuts off the first 2 chars. - (C:)
       $thewatermark = str_replace('\\','/',$thewatermark);

    //  require_once('./vendor/autoload.php');
       require_once(getabspath('./vendor/autoload.php'));

    $ffmpeg = FFMpeg\FFMpeg::create(array(
    'ffmpeg.binaries' => getabspath('./FFMpeg/bin/ffmpeg.exe'),
    'ffprobe.binaries' => getabspath('./FFMpeg/bin/ffprobe.exe'),
    'timeout' => 3600, // The timeout for the underlying process
    'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use
    ));

       $video = $ffmpeg->open($thevideo);

       $video
         ->filters()
         ->resize(new \FFMpeg\Coordinate\Dimension(640, 360))
         ->watermark($thewatermark, [
           'position' => 'relative',
           'bottom' => 50,
           'right' => 50,
         ])
         ->synchronize();
       //$video
       //  ->save(new \FFMpeg\Format\Video\X264(), $thevideo);

           $format = new \FFMpeg\Format\Video\X264();
           $format->setAdditionalParameters(array('-y'));
           $video->save($format, $newvideo);

       echo 'done!';

    }
  • avcodec/wmaprodec : do not force extradata presence for XMA

    11 janvier 2017, par Paul B Mahol
    avcodec/wmaprodec : do not force extradata presence for XMA
    

    Mainly useful for supporting decoding of headerless files.

    Signed-off-by : Paul B Mahol <onemda@gmail.com>

    • [DH] libavcodec/wmaprodec.c
  • FFMpeg\Exception\RuntimeException Encoding failed - Laravel 4 PHP-FFMPEG

    10 avril 2014, par Woogygun

    I'm using PHP-FFMPEG and the latest version of FFPMEG this is the same for my localhost and production server. Im encoding a .wav file(1.5 meg 44.1khz) to .mp3 128k bit rate.

    On localhost it runs without issues but, on the production server it gives the following error.

    FFMpeg \ Exception \ RuntimeException
    Encoding failed

    My binaries are located in the public folder right now for dev purposes.

    My code is as follows :

       Route::get(&#39;/audio&#39;, function() {
    $ffmpeg = FFMpeg\FFMpeg::create([
                                    &#39;ffmpeg.binaries&#39; => &#39;ffmpeg&#39;,
                                    &#39;ffprobe.binaries&#39; => &#39;ffprobe&#39;,
                                    &#39;timeout&#39;          => 3600]);
    $audio = $ffmpeg->open(public_path(&#39;track.wav&#39;));
    $format = new FFMpeg\Format\Audio\Mp3();
    $format->on(&#39;progress&#39;, function ($audio, $format, $percentage) {
       echo "$percentage % transcoded";
    });
    $format-> setAudioKiloBitrate(128);

    $audio->save($format, &#39;track.mp3&#39;);

    }) ;

    I can also confirm that FFMPEG is running via shell access :

    myuser@mydomain.com [~/public_html/hidden/public]# ffmpeg -i track.wav file.mp3
    FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
    built on Jan 29 2012 23:55:02 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
    configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --
    mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags=&#39;-O2 -g -
    pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-
    size=4 -m64 -mtune=generic -fPIC&#39; --enable-avfilter --enable-avfilter-lavf --enable-
    libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-
    libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --
    enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-
    swscale --enable-vdpau --enable-version3 --enable-x11grab
    libavutil     50.15. 1 / 50.15. 1
    libavcodec    52.72. 2 / 52.72. 2
    libavformat   52.64. 2 / 52.64. 2
    libavdevice   52. 2. 0 / 52. 2. 0
    libavfilter    1.19. 0 /  1.19. 0
    libswscale     0.11. 0 /  0.11. 0
    libpostproc   51. 2. 0 / 51. 2. 0
    [wav @ 0x8434b0]max_analyze_duration reached
    [wav @ 0x8434b0]Estimating duration from bitrate, this may be inaccurate
    Input #0, wav, from &#39;track.wav&#39;:
    Duration: 00:00:08.98, bitrate: 1411 kb/s
    Stream #0.0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
    Output #0, mp3, to &#39;file.mp3&#39;:
    Metadata:
    TSSE            : Lavf52.64.2
    Stream #0.0: Audio: libmp3lame, 44100 Hz, 2 channels, s16, 64 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Press [q] to stop encoding
    size=      70kB time=9.01 bitrate=  64.0kbits/s    
    video:0kB audio:70kB global headers:0kB muxing overhead 0.045772%