Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (52)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (5756)

  • 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);
    }
}


    


  • How to use FFmpeg in android to edit video ? [closed]

    24 juillet 2023, par Rakesh Saini

    i am learning android. I tried the ffmpeg lib to merge the video and audio, but getting ffmpeg permission denied error. I search lot of but unable to find the solution.

    


    Please anyone help if have the solution.

    


            package com.example.mytestapp.Activity;
    
    import android.content.Context;
    import android.os.AsyncTask;
    import android.os.Environment;
    import android.util.Log;
    import com.github.hiteshsondhi88.libffmpeg.ExecuteBinaryResponseHandler;
    import com.github.hiteshsondhi88.libffmpeg.FFmpeg;
    import com.github.hiteshsondhi88.libffmpeg.exceptions.FFmpegCommandAlreadyRunningException;
    
    public class MergeAudioVideoTask extends AsyncTask {
        private static final String TAG = MergeAudioVideoTask.class.getSimpleName();
    
        private Context context;
        private String videoFilePath;
        private final String audioFilePath;
        private final String outputFilePath;
    
        public MergeAudioVideoTask(String videoFilePath, String audioFilePath, String outputFilePath) {
            this.videoFilePath = videoFilePath;
            this.audioFilePath = audioFilePath;
            this.outputFilePath = outputFilePath;
        }
    
    //    String inputAudioPath = "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3";
        String outputVideoPath = Environment.getExternalStorageDirectory() + "/trimVideos" + "sangtest.mp4";
    
    //    String[] command = {"-i", vpath, "-i", inputAudioPath, "-c:v", "copy", "-c:a", "aac", "-map", "0:v:0", "-map", "1:a:0", "-shortest", outputVideoPath};
    
    
        @Override
        protected Boolean doInBackground(Void... params) {
            String[] cmd = {"-i", videoFilePath, "-i", audioFilePath, "-shortest", outputVideoPath};
            try {
                FFmpeg.getInstance(context).execute(cmd, new ExecuteBinaryResponseHandler() {
                    @Override
                    public void onStart() {
                        Log.e("Started", "yes");
                    }
    
                    @Override
                    public void onProgress(String message) {
                        // do nothing
                    }
    
                    @Override
                    public void onFailure(String message) {
                        Log.e("Failed ", "yes");
                    }
    
                    @Override
                    public void onSuccess(String message) {
                        Log.e("Success ", "yes");
                    }
    
                    @Override
                    public void onFinish() {
                        // do nothing
                    }
                });
            } catch (FFmpegCommandAlreadyRunningException e) {
                e.printStackTrace();
            }
    
            return null;
        }
    
        @Override
        protected void onPostExecute(Boolean success) {
            if (success) {
            } else {
            }
        }
    
    }


    


    I am using this but getting 'permission denied error for ffmpeg' i have already added storage permission in manifiest.

    


  • How to extract a fixed number of frames with ffmpeg ?

    10 mars 2016, par W. Han

    I am trying to extract a fixed number of frames uniformly from a bunch of videos(say 50 frames from each video, 10,000 videos in total).

    Since the duration varies, I calculated the ideal output fps for each video and take it as a parameter for ffmpeg extraction, but failed to get the required number of frames.

    Does anyone know how to extract a fixed number of frames with ffmpeg, or other tools ? Thanks !