Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (26)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

Sur d’autres sites (5232)

  • Reading live output from FFMPEG using PHP

    29 septembre 2018, par user561787

    the problem i’m dealing with is getting the shell output from a ffmpeg command while it’s being executed and writing it in an html page using php.

    After some research i found a very similar request here :Update page content from live PHP and Python output using Ajax, which seemed to be perfect, but it’s not working at all.

    The basic idea is to use an AJAX request to invoke the PHP script, which should execute the command and echo the live read content from the process, taking care to use this.readyState==3 (otherwise the JS script would receive the response only upon completion)

    For the PHP section i tried using the code in the answer above, (obviously adapted to my needs) :

    function liveExecuteCommand($command){

       while (@ ob_end_flush()); // end all output buffers if any

       $proc = popen($command, 'r');

       $live_output     = "";
       $complete_output = "";

       while (!feof($proc))
       {
           $live_output     = fread($proc, 4096);
           $complete_output = $complete_output . $live_output;
           echo "<pre>$live_output</pre>";
           @ flush();
       }

       pclose($proc);          

    }

    And for the AJAX section i used

    function getLiveStream(){


           var ajax = new XMLHttpRequest();
             ajax.onreadystatechange = function() {
               if (this.readyState == 3) {

                 document.getElementById("result").innerHTML = this.responseText;
               }              
           };          
           var url = 'process/getlive';
           ajax.open('GET', url,true);
           ajax.send();
      }

    Which sadly doesn’t work.

    The command being executed is this : 'ffmpeg.exe -i "C:/Users/BACKUP/Desktop/xampp/htdocs/testarea/test.mp4" -map 0:0 -map 0:1 -c:v libx264 -preset fast -crf 26 -c:a libmp3lame -ar 24000 -q:a 5 "C:\Users\BACKUP\Desktop\xampp\htdocs\testarea\output/test.mkv"', which i tested and it works.

    When i run the html page and the ajax script within, the ffmpeg command doesn’t even run, as i checked in task managet. It simply returns a blank text.

    When i run the php script by itself, the command runs, the file is converted but it doesn’t echo anything at all.

    After some more research i also found this page, which seems to be made for this exact purpose : https://github.com/4poc/php-live-transcode/blob/master/stream.php

    The relevant section is at the end, the code before is for dealing with options specific to ffmpeg. But it didn’t work either, with the same exact outcomes.

    Now i’m considering simply writing the output to a file and reading it from it dinamically, but i’d really like to know the reason why they both don’t work for me.

    EDIT : PHP Execute shell command asynchronously and retrieve live output answers to how to get content from a temporary file that is being written, not directly from the process.

  • Upload and Play Any Video in web browser using php CI

    14 août 2017, par Roni Modak

    I have tried to upload any video and convert the video file to mp4 at the time of upload using ffmpeg. The shell command I tried :

    $input = base_url().'video_upload/'.$file_name;
    $output = video_upload/video_'.$video_data['username'].'_'.$dtd.'_'.$random_number.'.mp4';
    $convt = shell_exec('ffmpeg -i '.$input.' '.$output);

    But i am unable to play those converted video in the web browser.

  • FFmpeg can't process videos with filenames containing emojis on Google Colab

    25 novembre 2022, par athena

    I mounted my Google Drive on Google Colab, inside the Drive, there's a video file with an emoji on it's filename (example : 20221124 [우리의식탁 W TABLE] 직접 기른 허브로 만들면 더 맛있는 허브포카치아 &#127807; (8m2hNIEoXEw).mkv).

    &#xA;

    !ffmpeg -i "/content/drive/MyDrive/DOWNLOAD/20221124 [우리의식탁 W TABLE] 직접 기른 허브로 만들면 더 맛있는 허브포카치아 &#127807; (8m2hNIEoXEw).mkv"&#xA;

    &#xA;

    Trying to run FFmpeg gives me this error :

    &#xA;

    ---------------------------------------------------------------------------&#xA;UnicodeEncodeError                        Traceback (most recent call last)&#xA; in <module>&#xA;      3 video = "/content/drive/MyDrive/DOWNLOAD/20221124 [\u110B\u116E\u1105\u1175\u110B\u1174\u1109\u1175\u11A8\u1110\u1161\u11A8 W TABLE] \u110C\u1175\u11A8\u110C\u1165\u11B8 \u1100\u1175\u1105\u1173\u11AB \u1112\u1165\u1107\u1173\u1105\u1169 \u1106\u1161\u11AB\u1103\u1173\u11AF\u1106\u1167\u11AB \u1103\u1165 \u1106\u1161\u11BA\u110B\u1175\u11BB\u1102\u1173\u11AB \u1112\u1165\u1107\u1173\u1111\u1169\u110F\u1161\u110E\u1175\u110B\u1161 \uD83C\uDF3F (8m2hNIEoXEw).mkv" #@param {type: "string"}&#xA;      4 &#xA;----> 5 get_ipython().system(&#x27;ffmpeg -i "$video" #-hide_banner&#x27;)&#xA;&#xA;4 frames&#xA;/usr/local/lib/python3.7/dist-packages/google/colab/_shell.py in system(self, *args, **kwargs)&#xA;     93       kwargs.update({&#x27;also_return_output&#x27;: True})&#xA;     94 &#xA;---> 95     output = _system_commands._system_compat(self, *args, **kwargs)  # pylint:disable=protected-access&#xA;     96 &#xA;     97     if pip_warn:&#xA;&#xA;/usr/local/lib/python3.7/dist-packages/google/colab/_system_commands.py in _system_compat(shell, cmd, also_return_output)&#xA;    435   # stack.&#xA;    436   result = _run_command(&#xA;--> 437       shell.var_expand(cmd, depth=2), clear_streamed_output=False)&#xA;    438   shell.user_ns[&#x27;_exit_code&#x27;] = result.returncode&#xA;    439   if -result.returncode in _INTERRUPTED_SIGNALS:&#xA;&#xA;/usr/local/lib/python3.7/dist-packages/google/colab/_system_commands.py in _run_command(cmd, clear_streamed_output)&#xA;    189           stdin=stdin,&#xA;    190           stderr=child_pty,&#xA;--> 191           close_fds=True)&#xA;    192       # The child PTY is only needed by the spawned process.&#xA;    193       os.close(child_pty)&#xA;&#xA;/usr/lib/python3.7/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)&#xA;    798                                 c2pread, c2pwrite,&#xA;    799                                 errread, errwrite,&#xA;--> 800                                 restore_signals, start_new_session)&#xA;    801         except:&#xA;    802             # Cleanup if the child failed starting.&#xA;&#xA;/usr/lib/python3.7/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)&#xA;   1480                             errread, errwrite,&#xA;   1481                             errpipe_read, errpipe_write,&#xA;-> 1482                             restore_signals, start_new_session, preexec_fn)&#xA;   1483                     self._child_created = True&#xA;   1484                 finally:&#xA;&#xA;UnicodeEncodeError: &#x27;utf-8&#x27; codec can&#x27;t encode characters in position 131-132: surrogates not allowed&#xA;</module>

    &#xA;

    My Colab uses Python 3.7.15 and ffmpeg/ffprobe version N-109226-g2ad199ae31-20221125 (from https://github.com/BtbN/FFmpeg-Builds).

    &#xA;

    I tried searching similar issues as mine here, but most of the solutions are way beyond my knowledge, I'm not sure how to apply them to my use case.

    &#xA;

    I'll appreciate your help, thank you !

    &#xA;