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 (28)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Pas question de marché, de cloud etc...

    10 avril 2011

    Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
    sur le web 2.0 et dans les entreprises qui en vivent.
    Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
    Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
    le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
    Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)

Sur d’autres sites (4892)

  • How to fix 'Error : Write EOF' when running a nodejs file which spawns a child process running ffmpeg ?

    16 septembre 2022, par Prithivin Lakshminarayanan

    I am new to nodejs scripting and I am trying to create a program which receives a video file as a buffer and creates a thumbnail from it. This is my code :

    


    create_thumbnail.js :

    


    const { Readable } = require('stream');
const child_process = require('node:child_process');

async function generate_thumbnail(videoFile, callback) {

    const readable = new Readable();
    readable._read = () => {}
    readable.push(videoFile.data)
    readable.push(null)
    const ffmpeg = child_process.spawn('C:\\FFmpeg\\bin\\ffmpeg', ['-i', 'pipe:0', '-vframes', '1', '-vf', 'scale=iw*.5:ih*0.5', '-f', 'mjpeg', 'pipe:1'], { stdio: ['pipe', 'pipe', 'ignore'] })
    readable.pipe(ffmpeg.stdin);

    const buffer = [];

    ffmpeg.stdout.on('data', (data) => {
        buffer.push(data);
    });

    const thumbnail = ffmpeg.stdout.on('end', () => {
        console.log('There will be no more data.');
        var buf = Buffer.concat(buffer);
        callback (buf);
    });
}

module.exports = { generate_thumbnail };


    


    The program is creating a thumbnail successfully for a video which has a few seconds length. It is failing for larger videos with the following error :

    


    node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: write EOF
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:98:16)
Emitted 'error' event on Socket instance at:
    at Socket.onerror (node:internal/streams/readable:773:14)
    at Socket.emit (node:events:390:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -4095,
  code: 'EOF',
  syscall: 'write'


    


    Can someone please let me know the reason for getting this error. How can I fix it ?

    


  • PHP passthru with proper child process closing

    6 juin 2022, par Bluchip Studio

    I am currently using the code below to try and restream a hls live stream via php the reason for this is php is all i have access to on the system i am using i can not use or install anything else and i like to watch my home tv in my current location my hls streams come direct from my own tbs octo encoder at my home so i know thats all good.

    


    my issue is that the stream randomly stops after around 30-50 seconds of playing it can be restarted no problem so i know the reading of the stream is not the issue.

    


    also when i disconnect and stop watching the stream the ffmpeg / streamlink processes do not stop and stay running in the back ground this has led to me getting some rather frustrating emails from the owner of the system i am using

    


    does anyone know if this is the best way to handel this task and how to possibly close the child processes created by passthru ?

    


    PS : I know all caps is not the correct way to code in production but as this is my personal code and it does not effect the way in witch the code is run it makes it so much easier for me to read being dyslexic !

    


    <?php

ini_set('output_buffering', '0');
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

set_time_limit(0);
ob_implicit_flush();

include './core/functions.php';

$PROCESS_URL = 'HTTP STREM URL GOES HERE';
    
$ENCODING_TYPE = 'mpegts';
    
$ENCODING_SETTINGS = 'streamlink '. $PROCESS_URL . ' best -O | '. FFMPEG .
    ' -threads 0' .
    ' -re' .
    ' -probesize 9000000'.
    ' -analyzeduration 9000000'.
    ' -i pipe:0' .
    ' -c:v copy -c:a copy' .
    ' -tune zerolatency' .
    ' -preset ultrafast' .
    ' -fflags +genpts' .
    ' -mpegts_flags initial_discontinuity' .
    ' -f ' . $ENCODING_TYPE . 
    ' pipe:1 2>' . LOG_DIRECTORY . '/' . MD5($PROCESS_URL) . '_ffmpeg.txt';

header('Content-type: application/octet-stream');
header('X-Accel-Buffering: no');

@passthru($ENCODING_SETTINGS);

?>


    


  • Killing a Python process from Node doesn't kill Python's child process (child process being ffmpeg.exe)

    3 avril 2022, par Impasse

    I am developing an Electron application. In this application, I am spawning a Python process with a file's path as an argument, and the file itself is then passed to ffmpeg (through the ffmpeg-python module) and then goes through some Tensorflow functions.

    


    I am trying to handle the case in which the user closes the Electron app while the whole background process is going. From my tests though, it seems like ffmpeg's process stays up no matter what. I'm on Windows and I'm looking at the task manager and I'm not sure what's going on : when closing the Electron app's window, sometimes ffmpeg.exe will be a single process, some other times it will stay in an Electron processes group.

    


    I have noticed that if I kill Electron's process through closing the window, the python process will also close once ffmpeg has done its work, so I guess this is half-working. The problem is, ffmpeg is doing intensive stuff and if the user needs to close the window, then the ffmpeg process also NEEDS to be killed. But I can't achieve that in any way.

    


    I have tried a couple things, so I'll paste some code :

    


    main.js

    


    // retrieve video data
ipcMain.handle('get-games', async (event, arg) => {
    const spawn = require('child_process').spawn;
    const pythonProcess = spawn('python', ["./backend/predict_games.py", arg]);

    // sets pythonProcess as a global variable to be accessed when quitting the app
    global.childProcess = pythonProcess;

    return new Promise((resolve, reject) => {
        let result = "";

        pythonProcess.stdout.on('data', async (data) => {
            data = String(data);

            if (data.startsWith("{"))
                result = JSON.parse(data);
        });

        pythonProcess.on('close', () => {
            resolve(result);
        })

        pythonProcess.on('error', (err) => {
            reject(err);
        });
    })
});

app.on('before-quit', function () {
    global.childProcess.kill('SIGINT');
});


    


    predict_games.py (the ffmpeg part)

    


    def convert_video_to_frames(fps, input_file):
    # a few useful directories
    local_dir = os.path.dirname(os.path.abspath(__file__))
    snapshots_dir = fr"{local_dir}/snapshots/{input_file.stem}"

    # creates snapshots folder if it doesn't exist
    Path(snapshots_dir).mkdir(parents=True, exist_ok=True)

print(f"Processing: {Path(fr'{input_file}')}")
try:
    (
        ffmpeg.input(Path(input_file))
        .filter("fps", fps=fps)
        .output(f"{snapshots_dir}/%d.jpg", s="426x240", start_number=0)
        .run(capture_stdout=True, capture_stderr=True)
    )
except ffmpeg.Error as e:
    print("stdout:", e.stdout.decode("utf8"))
    print("stderr:", e.stderr.decode("utf8"))


    


    Does anyone have any clue ?