Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (88)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • 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 (...)

  • Configuration spécifique pour PHP5

    4 février 2011, par

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

Sur d’autres sites (7366)

  • How see if the client aborted the request in nodejs

    9 février 2023, par Pitzho

    I'm trying do a mp4 converter, but if the client cancel the request, continues the conversion, how I stop the conversion if the client cancel the request ?

    


    Code from conversor :

    


        // Start the ffmpeg child process
    const ffmpegProcess = cp.spawn(ffmpeg, [
    // Remove ffmpeg's console spamming
    '-loglevel', '8', '-hide_banner',
    // Redirect/Enable progress messages
    '-progress', 'pipe:3',
    // Set inputs
    '-i', 'pipe:4',
    '-i', 'pipe:5',
    // Map audio & video from streams
    '-map', '0:a',
    '-map', '1:v',
    // Keep encoding
    '-c:v', 'copy',
    // Define output file
    token + formato,
  ], {
    windowsHide: true,
    stdio: [
      /* Standard: stdin, stdout, stderr */
      'inherit', 'inherit', 'inherit',
      /* Custom: pipe:3, pipe:4, pipe:5 */
      'pipe', 'pipe', 'pipe', 'pipe'
    ],
  });

  ffmpegProcess.stdio[3].on('data', (err) => {
    console.log(res.status())
  });
  
  audio.pipe(ffmpegProcess.stdio[4]);
  video.pipe(ffmpegProcess.stdio[5]);
  
  ffmpegProcess.stdio[6].on('error', (err) => {
    // Remover token do objeto
    delete inUseTokens[token];
    res.status(500).send(err.message);
  });

  ffmpegProcess.stdio[6].on('close', () => {
    console.log("convertido!")
    res.render('downloated', {formato: formato, title: titulo, token: token, thumbnail: thumbnail, seconds: seconds})
    })
  });


    


    I don't know how I can solve this...

    


  • 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] 직접 기른 허브로 만들면 더 맛있는 허브포카치아 🌿 (8m2hNIEoXEw).mkv).

    


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


    


    Trying to run FFmpeg gives me this error :

    


    ---------------------------------------------------------------------------&#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;

  • Keep trying a command until it returns "True" and then execute another

    6 janvier 2023, par Tyrone Hirt

    I'm trying to make a script to check the processor usage for a specific process every 10 seconds, and when the usage is less than 2% I want another 2 commands to be executed.

    &#xA;

    The purpose is to know when the program has finished processing the requests, in order to release the execution of the other commands.

    &#xA;

    I created this script to check the processor usage by this application :

    &#xA;

    SET ProcessorUsage = wmic path Win32_PerfFormattedData_PerfProc_Process get Name,PercentProcessorTime | findstr /i /c:RenderQuery&#xA;&#xA;%ProcessorUsage%&#xA;

    &#xA;

    And these are the commands I want to be executed when the processor usage of the RenderQuery application is less than 2% :

    &#xA;

    for /f "delims=" %%X in (&#x27;dir /s/b/ad Proxy&#x27;) do for /f "delims=" %%Y in (&#x27;dir /s/b/a-d "%%X"&#x27;) do move "%%Y" ".\03. Proxy"&#xA;&#xA;for /f "delims=" %%i in (&#x27;dir /s/b/ad Proxy&#x27;) do rd "%%i"&#xA;

    &#xA;

    I tried to create a script that way here :

    &#xA;

    SET ProcessorUsage = wmic path Win32_PerfFormattedData_PerfProc_Process get Name,PercentProcessorTime | findstr /i /c:RenderQuery&#xA;:Loop&#xA;IF %ProcessorUsage% LSS 2 (&#xA;(for /f "delims=" %%X in (&#x27;dir /s/b/ad Proxy&#x27;) do for /f "delims=" %%Y in (&#x27;dir /s/b/a-d "%%X"&#x27;) do move "%%Y" ".\03. Proxy") &amp;&amp; (for /f "delims=" %%i in (&#x27;dir /s/b/ad Proxy&#x27;) do rd "%%i")&#xA;) ELSE (&#xA;sleep 10 &amp;&amp; goto Loop&#xA;)&#xA;

    &#xA;

    I also tried this way here :

    &#xA;

    SET ProcessorUsage = wmic path Win32_PerfFormattedData_PerfProc_Process get Name,PercentProcessorTime | findstr /i /c:RenderQuery&#xA;&#xA;:Loop&#xA;for %ProcessorUsage% LSS 2 do (&#xA;(for /f "delims=" %%X in (&#x27;dir /s/b/ad Proxy&#x27;) do for /f "delims=" %%Y in (&#x27;dir /s/b/a-d "%%X"&#x27;) do move "%%Y" ".\03. Proxy") &amp;&amp; (for /f "delims=" %%i in (&#x27;dir /s/b/ad Proxy&#x27;) do rd "%%i") || (sleep 10 &amp;&amp; goto Loop)&#xA;)&#xA;

    &#xA;

    With these scripts I tried to create the window that only blinks and closes right away...

    &#xA;

    What's the best way to do this ?

    &#xA;

    EDIT

    &#xA;

    Explaining in more detail : I work with video production, so I constantly need to render Proxy files, which are video files with low quality to be used during my video editing and replaced at the end of editing, this makes the much smoother video editing.

    &#xA;

    Having said that, I have a folder model, inside this folder model there is a folder where I always download the video files from the camera and in that folder there is always a .bat file that opens all the video files in the software that generates proxy files of the camera's video files.

    &#xA;

    This .bat file has this exact code :

    &#xA;

    start "" "C:\Users\User\Downloads\FFmpeg_Batch_AV_Converter_Portable_2.8.4_x64\FFBatch.exe" -f "%~dp0\"&#xA;

    &#xA;

    When this software opens, it automatically renders the proxy files and their output is always in a child folder of the original files folder, and the name of the folder is Proxy.

    &#xA;

    The issue is that I don't want them to be in several separate Proxy folders, so I created another .bat file that is in the parent folder of all video files, this script contains exactly these lines :

    &#xA;

    for /f "delims=" %%X in (&#x27;dir /s/b/ad Proxy&#x27;) do for /f "delims=" %%Y in (&#x27;dir /s/b/a-d "%%X"&#x27;) do move "%%Y" ".\03. Proxy"&#xA;&#xA;for /f "delims=" %%i in (&#x27;dir /s/b/ad Proxy&#x27;) do rd "%%i"&#xA;

    &#xA;

    That is, it only searches recursively for files that are inside folders named Proxy, then it moves these files to the folder 03. Proxy that is inside the parent folder.

    &#xA;

    The second line looks for all proxy folders (which are now empty) and deletes them.

    &#xA;

    The point is : I currently run the second script manually, as soon as the render finishes, and I would like it to run automatically.

    &#xA;

    Given this, I thought of adding a line in the first script, which opens the video files in the rendering program, this line would call the second script in the background, and the second script would be analyzing the CPU usage of this application every 10 seconds, and when the usage is less than 2% (in theory there is nothing else rendering, since it has a low CPU usage) it executes the lines that move the files and remove the folders.

    &#xA;

    I think there's a good change for this to work, because this software renders 4 videos at a time, and this means that there is no time between stopping rendering a video and starting another... the CPU usage is always very high until all the videos are finished, so I think this would be the best signal to release the other commands.

    &#xA;