Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (83)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

Sur d’autres sites (16473)

  • Converting an audio file from .oga format to .mp3 using ffmpeg package on nodeJs produces a max of 3 seconds output file no matter the input duration

    15 janvier 2024, par JnrLouis

    I am downloading an audio file in .oga format and saving it. Then I am trying to convert the file to .mp3 format, but the issue is the output file is always truncated and a maximum of 3 seconds. I have gone through the fluent-ffmpeg library and I can't seem to find what I'm doing wrong.

    


    I have ffmpeg installed and I'm using the fluent-ffmpeg library. The downloaded .oga file doesn't seem to have any issues, the issue is after it gets converted to .mp3.

    


    I also tried converting to .wav, and I faced the same issue.

    


    Below is my current code :

    


    const fs = require("fs");
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffmpeg = require('fluent-ffmpeg');
ffmpeg.setFfmpegPath(ffmpegPath);
const axios = require("axios");

const inputPath = __dirname + '/audio/input.oga';
const outputPath = __dirname + '/audio/output.mp3';

const saveVoiceMessage = async (url) => {
    try {
        const response = await axios({
            method: 'GET',
            url: url,
            responseType: 'stream'
        });
        const inStream = fs.createWriteStream(inputPath);
        await response.data.pipe(inStream);
    } catch (error) {
        console.error(error);
    }
}

const convertToMp3 = async () => {
    try {
        const outStream = fs.createWriteStream(outputPath);
        const inStream = fs.createReadStream(inputPath);
        // I also tried using the inputPath directly, still didn't work
        ffmpeg(inStream)
            .toFormat("mp3")
            .on('error', error => console.log(`Encoding Error: ${error.message}`))
            .on('exit', () => console.log('Audio recorder exited'))
            .on('close', () => console.log('Audio recorder closed'))
            .on('end', () => console.log('Audio Transcoding succeeded !'))
            .pipe(outStream, { end: true })
    } catch (error) {
        console.error(error);
    }
}

const saveAndConvertToMp3 = async (url) => {
    try {
        await saveVoiceMessage(url);
        await convertToMp3();
        }

    } catch (error) {
        console.error(error);
    }
}


    


  • Extract 5 seconds of a mp4 video for every 60 seconds of the video [duplicate]

    8 mars 2024, par transientflaw

    I'm trying to write a batch script with ffmpeg that takes every mp4 files in a folder, extracts 5 seconds out of them at 2 seconds after the start of the video, and then, if the original video lasts longer than 60 seconds, as well as that first segment, it takes another 5 seconds segment for every 60 seconds until it cannot because there are not enough seconds to segment.

    


    Is it clear ?

    


    I've tried this code

    


    @echo off

rem Set input and output directories
set "input_dir=C:\Users\Lex\Desktop\vtrip"
set "output_dir=C:\Users\Lex\Desktop\vtrip\output"

rem Loop through all MP4 files in the input directory
for %%I in ("%input_dir%\*.mp4") do (
    rem Extract 5 seconds starting 2 seconds after the start of the video
    ffmpeg -i "%%I" -ss 2 -t 5 "%output_dir%\temp_segment_1_%%~nI.mp4"

    rem Get total duration of the video
    for /f "tokens=*" %%a in ('ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "%%I"') do set "duration=%%a"

    rem Check if the duration exceeds 60 seconds
    if !duration! GTR 60 (
        rem Calculate the number of segments
        set /a "num_segments=!duration!/62"
        
        rem Extract 5-second segments every 62 seconds
        set /a "start_time=64"  REM Start from 2 seconds after the first segment
        for /l %%x in (2,1,!num_segments!) do (
            ffmpeg -i "%%I" -ss !start_time! -t 5 "%output_dir%\temp_segment_%%x_%%~nI.mp4"
            set /a "start_time+=62"
        )
    )
)



    


    I've tried it on 3 files, the 2 that are under 1 minute are fine but there is one that lasts 2m29 and it only extracts 1 segment for that last one whereas it should extract 3 5-seconds segments for this one video.

    


    Any way to fix that ?

    


  • Add a seconds counter text to a sliced video with ffmpeg that starts from 0

    16 mars 2024, par virtualdj

    I'm trying to convert a small part of a screen recording video into a GIF with ffmpeg. I would like to add a seconds counter on it as the frame rate of the GIF file is reduced, so I can guess the time passing from the counter.

    


    Normally, assuming to start at 43 seconds and cutting after 33 seconds, the example video would have been encoded to GIF with :

    


    ffmpeg -i in.mp4 -vf "scale=300:-1,fps=5,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -ss 43 -t 33 out.gif


    


    To print the timecode, I add the following after fps=5, :

    


    drawtext=text='%{pts\:hms}':font='Arial':fontcolor=red:fontsize=14:x=(w-text_w)/2:y=(h-text_h-6),


    


    Doing so, prints a timecode on the output that starts from 00:00:43.000, not from zero. Similarly the timecode option :

    


    drawtext=text='':font='Arial':fontcolor=red:fontsize=14:x=(w-text_w)/2:y=(h-text_h-6):timecode='00\:00\:00\:00':timecode_rate=5,


    


    will ouput 00:00:43:0. There doesn't seem to have a way to use the "output" timecode (that starts from 0) ; also, I would like to have the seconds only.

    


    How can I do that ?