Recherche avancée

Médias (91)

Autres articles (35)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

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

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (5089)

  • JavaFX : ffmpeg process finishes writing the file only after closing the program

    16 juin 2024, par The Engineer

    My JavaFX application uses ffmpeg to extract the first frame from a video file. The ffmpeg command is run in a separate thread, and the process ends with a wait. However, despite the fact that the image is saved to a temporary directory (temp/video_preview.jpg ), it becomes available only after the forced termination of the entire program, and not immediately after the completion of the ffmpeg process. I need the image to be available for display in ImageView immediately after the ffmpeg process is completed.
    
https://github.com/Memory420/GifConverter/tree/master

    


    I expected the ffmpeg process to quickly create a picture and I would apply it where I need it.

    


    @FXML&#xA;    private void onDragOver(DragEvent event) {&#xA;        if (event.getDragboard().hasFiles()) {&#xA;            event.acceptTransferModes(TransferMode.ANY);&#xA;        }&#xA;    }&#xA;&#xA;    @FXML&#xA;    private void onDragDropped(DragEvent event) {&#xA;        Dragboard db = event.getDragboard();&#xA;        boolean success = false;&#xA;        if (db.hasFiles()) {&#xA;            List<file> files = db.getFiles();&#xA;            File videoFile = files.get(0);&#xA;            Image image = extractFirstFrameFromVideo(videoFile.getAbsolutePath());&#xA;            mainImage.setImage(image);&#xA;            success = true;&#xA;        }&#xA;        event.setDropCompleted(success);&#xA;        event.consume();&#xA;    }&#xA;</file>

    &#xA;

    private Image extractFirstFrameFromVideo(String pathToVideo) {&#xA;        try {&#xA;            ProcessBuilder processBuilder = new ProcessBuilder(&#xA;                    ffmpegPath,&#xA;                    "-y",&#xA;                    "-ss", "00:00:00",&#xA;                    "-i", pathToVideo,&#xA;                    "-frames:v", "1",&#xA;                    outputFilePath  // "temp/video_preview.jpg"&#xA;            );&#xA;&#xA;            Process process = processBuilder.start();&#xA;&#xA;            int exitCode = process.exitValue();&#xA;            if (exitCode != 0) {&#xA;                throw new IOException("ffmpeg process exited with error code: " &#x2B; exitCode);&#xA;            }&#xA;&#xA;            return new Image(new File(outputFilePath).toURI().toString());&#xA;&#xA;        } catch (IOException e) {&#xA;            throw new RuntimeException(e);&#xA;        }&#xA;    }&#xA;

    &#xA;

  • Streaming audio over websockets and process it with ffmpeg, Invalid frame size error

    12 avril 2024, par Nimrod Sadeh

    I am building an application in Python that processes audio data on a streaming connection with WebSockets. To work with it, I need to process it with ffmpeg on the server before passing it to some ML algorithms.

    &#xA;

    I have the following ffmpeg code setup to process each byte sequence that comes over WebSockets :

    &#xA;

    async def ffmpeg_read(bpayload: bytes, sampling_rate: int = 16000) -> np.array:&#xA;    ar = f"{sampling_rate}"&#xA;    ac = "1"&#xA;    format_for_conversion = "f32le"&#xA;    ffmpeg_command = [&#xA;        "ffmpeg",&#xA;        "-i", "pipe:0",&#xA;        "-ac", ac,&#xA;        "-acodec", f"pcm_{format_for_conversion}",&#xA;        "-ar", ar,&#xA;        "-f", format_for_conversion,&#xA;        "pipe:1"]&#xA;    try:&#xA;        process = await asyncio.create_subprocess_exec(&#xA;            *ffmpeg_command,&#xA;            stdin=asyncio.subprocess.PIPE,&#xA;            stdout=asyncio.subprocess.PIPE)&#xA;&#xA;        process.stdin.write(bpayload)&#xA;        await process.stdin.drain() &#xA;        process.stdin.close()&#xA;&#xA;        out_bytes = await process.stdout.read(8000)  # Read asynchronously&#xA;        audio = np.frombuffer(out_bytes, np.float32)&#xA;&#xA;        if audio.shape[0] == 0:&#xA;            raise ValueError("Malformed soundfile")&#xA;        return audio&#xA;&#xA;    except FileNotFoundError:&#xA;        raise ValueError(&#xA;            "ffmpeg was not found but is required to load audio files from filename")&#xA;

    &#xA;

    In every test, this works for exactly one message and prints the desired output to the screen, but the second one gets the following :

    &#xA;

    [mp3 @ 0x1208051e0] Invalid frame size (352): Could not seek to 363.&#xA;[in#0 @ 0x600002214200] Error opening input: Invalid argument&#xA;Error opening input file pipe:0.&#xA;

    &#xA;

    How do I fix this ?

    &#xA;

  • Bash Scripting FFMPEG how to wait the process to complete

    9 décembre 2013, par user1738671

    I have a strange problem. I have a folder monitor with incrontab that launches an automatic transcoding script on CLOSE_WRITE state of a file I dropped in. The problem is that the script doesn't wait until the ffmpeg process finishes before continuing with the rest of the script commands. This means that the original file get deleted before the transcoding is finished, which is bad.

    First question :
    What is the root cause of this behaviour ?

    Second question : In a bash script, what is the best way to make sure an ffmpeg process is done before get going with the rest of the script ?

    Script :

    #/bin/bash

    #transcoding
    /usr/bin/ffmpeg -i "sourcefile push with incron as $1" -vcodec somecode -acodec somecodec "destination file"

    #delete source
    rm "path/to/file$1"

    Should I encapsulate my FFMPEG in a while statement ?