Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (60)

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

  • Activation de l’inscription des visiteurs

    12 avril 2011, par

    Il est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
    Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
    Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

Sur d’autres sites (11689)

  • FFMPEG dshow format not working Windows 10

    22 octobre 2016, par Jonathan Beaudoin

    I’d like to use this library for my remote desktop software but it does not seem to be working. It works fine if I run ffmpeg from command line.

    Here is my test class :

    public class FFMPEG {

       public static void main(String[] args) throws Exception {
           FFmpegFrameGrabber grabber = new FFmpegFrameGrabber("video=\"screen-capture-recorder\"");
           grabber.setFormat("dshow");
           grabber.setImageWidth(2560);
           grabber.setImageHeight(1440);
           grabber.start();

           CanvasFrame frame = new CanvasFrame("Screen Capture");
           while (frame.isVisible()) {
               frame.showImage(grabber.grab());
           }
           frame.dispose();
           grabber.stop();
       }

    }

    and here is what I have in my gradle.build

    repositories {
       mavenCentral()
    }

    configurations {
       all*.exclude group: 'org.bytedeco', module: 'javacpp-presets'
    }

    dependencies {
       compile "org.bytedeco:javacv:1.2"
       compile "org.bytedeco:javacpp:1.2.1"

       compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.1.2-1.2'
       compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.1.2-1.2', classifier: 'windows-x86_64'
    }

    Here is the error I get when running that class :

    Exception in thread "main" org.bytedeco.javacv.FrameGrabber$Exception: avformat_open_input() error -5: Could not open input "video="screen-capture-recorder"". (Has setFormat() been called?)
       at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:437)
       at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:385)
       at FFMPEG.main(FFMPEG.java:14)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
    [dshow @ 000000000179c5e0] Could not enumerate video devices (or none found).
    [dshow @ 000000000179c5e0] Could not enumerate video devices (or none found)
  • A process' child doesn't get killed from killing the parent process

    2 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 ?

    


  • Ble with record video

    24 juillet 2017, par Vitaly

    I’m working on rpi3.
    When I try to run the command :

    sudo ffmpeg -f video4linux2 -i /dev/video0 -video_size 640x480 -r 25 output.avi

    to record a video using ffmpeg.

    In this time,I try to connect with Bluetooth.

    The BT cannot connect.

    the exception I get is :
    A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

    top result :

    1156 root 20 0 299860 197172 137736 S 80.6 20.9 40:21.35 ffmpeg

    80.6 % cpu and 20.9 % mem.

    all the other processes take less than 1%.

    Did you encounter with this ?
    Do you have a clue what can be done ?

    Thanks