Recherche avancée

Médias (0)

Mot : - Tags -/médias

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

Autres articles (50)

Sur d’autres sites (8992)

  • Real time ffmpeg output from terminal in php

    8 novembre 2014, par user2978381

    I am using this code to get real time update from windows terminal. It doesn’t output anything in the browser but process the command and in the background and completes the conversion.

       set_time_limit(0);
       $ffmpegCommand  = 'C:\\ffmpeg\\bin\\ffmpeg';

       $handle = popen($ffmpegCommand." -i upload/1415292048.mp4 -ar 22050 -ab 32 -f flv -s 640x320 -vcodec libx264  -vsync 1  -bt 50k converted/video001.flv", "r");

       if (ob_get_level() == 0)
           ob_start();

       while(!feof($handle)) {

           $buffer = fread($handle, 4096);
           $buffer = trim(htmlspecialchars($buffer));
           echo "<pre>";

           echo $buffer ;
           echo str_pad('', 4096);
           echo "</pre>";

           ob_flush();
           flush();
           sleep(1);
       }

       pclose($handle);
       ob_end_flush();

    But when the same code I am using for youtube_dl it updates in the real time.

       header('Content-Encoding: none;');

       set_time_limit(0);

       $handle = popen("python -m youtube_dl -F http://vimeo.com/30261818", "r");

       if (ob_get_level() == 0)
           ob_start();

       while(!feof($handle)) {

           $buffer = fread($handle, 4096);
           $buffer = trim(htmlspecialchars($buffer));
           echo "<pre>";

           echo $buffer ;
           echo str_pad('', 4096);
           echo "</pre>";

           ob_flush();
           flush();
           sleep(1);
       }

       pclose($handle);
       ob_end_flush();

    So if I want to show output of ffmpeg in the browser what should I do ?

  • How do I use ffprobe in Terminal ?

    9 avril 2020, par Westicle

    When I use ffmpeg I use it like this :

    &#xA;&#xA;

    ./ffmpeg -ss 00:30:00 -i inputvideo.mp4 -t 00:00:20 -c:v copy -c:a copy outputvideo.mp4&#xA;

    &#xA;&#xA;

    So how to I use ffprobe ? I've tried this but I can't get it to work :

    &#xA;&#xA;

    ./ffmpeg ffprobe -v error -show_frames inputvideo.mp4&#xA;

    &#xA;

  • Debian ffmpeg working in terminal but not in php

    30 octobre 2013, par user2938660

    I reinstalled ffmpeg on debian and php exec doesn't work for me anymore when called from php. I'm using :

    if ($success_msg)
    {
       $tmp_parts = explode(&#39;.&#39;, $file[&#39;name&#39;]);
       $ext = array_pop($tmp_parts);
       $ext = strtolower($ext);
       if($ext == "avi" &amp;&amp; $convert_avi == true)
       {
           $convert_source = _VIDEOS_DIR_PATH.$new_name;
           $conv_name = substr(md5($file[&#39;name&#39;].rand(1,888)), 2, 10).".mp4";
           //$conv_name2 = substr(md5($file[&#39;name&#39;].rand(1,888)), 2, 10).".mp4";
           $converted_file  = _VIDEOS_DIR_PATH.$conv_name;
           //$fastarted_file  = _VIDEOS_DIR_PATH.$conv_name2;
           $ffmpeg_command = &#39;ffmpeg -i &#39;.$convert_source.&#39; -r 20 -g 40 -acodec libfaac -ar 44100 -ab 96k -vcodec libx264 -sameq &#39;.$converted_file;
           //$faststart_command = "qt-faststart ".$converted_file." ".$fastarted_file;
           shell_exec($ffmpeg_command);
           unlink($convert_source);
           //shell_exec($faststart_command);
           $sql = "UPDATE pm_temp SET url = &#39;".$conv_name."&#39; WHERE url = &#39;".$new_name."&#39; LIMIT 1";
           $result = @mysql_query($sql);
    }
    echo $success_msg;

    this code to convert videos and ffmpeg output is :

    root@1tb:~# ffmpeg -version
    ffmpeg version git-2013-10-28-f1f0b01
    built on Oct 29 2013 02:05:45 with gcc 4.4.5 (Debian 4.4.5-8)
    configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3 --enable-x11grab
    libavutil      52. 48.100 / 52. 48.100
    libavcodec     55. 39.100 / 55. 39.100
    libavformat    55. 19.104 / 55. 19.104
    libavdevice    55.  5.100 / 55.  5.100
    libavfilter     3. 90.100 /  3. 90.100
    libswscale      2.  5.101 /  2.  5.101
    libswresample   0. 17.104 /  0. 17.104
    libpostproc    52.  3.100 / 52.  3.100
    root@1tb:~#

    in terminal it works fine just via php not im sure this is server problem and exec is enabled.