Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (81)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

Sur d’autres sites (7532)

  • Can not find file with ffmpeg

    3 août 2018, par P.Ung

    I am programming a server in node.js to process a audio file.
    I save the file with this code :

    app.use(upload());
    app.get("/", function (req, res) {
    res.sendFile("index.html")
    });
    //Uploaded files will be saved
    app.post("/", function (req, res) {
    if (req.files) {
       var file = req.files.filename,
           filename = file.name;
       file.mv("./upload/" + filename, function (err) {
           if (err) {
               console.log("err");
           }
           else {
               res.send("Done");
               console.log(filename);
               convert(filename);

           }
       })
    }
    })

    I save the file in my upload directory. There everthing works great but now comes the problem.
    I convert the file with ffmpeg

    function convert(filename) {    
    var realName = "./upload/" + filename;
    var newName = "./output/" + filename.substr(0, filename.length - 4) + ".flac";
    ffmpegN = ffmpeg(realName);
    ffmpegN.audioBitrate(16).audioFrequency(16000).withAudioCodec('flac').format("flac").save(outputFile);

    ffmpeg(realName)
       .toFormat('flac')
       .on('error', (err) => {
           console.log('An error occurred: ' + err.message);
       })
       .on('progress', (progress) => {
           // console.log(JSON.stringify(progress));
           console.log('Processing: ' + progress.targetSize + ' KB converted');
       })
       .on('end', () => {
           console.log('Processing finished !');
       })
       .save(newName);//path where you want to save your file    
    SpeechToText(newName);
    }

    Then I want to pass this file to the google speech api. But then I get the error that the file is not found
    Here is the code for the Speech Api :

    function SpeechToText(path) {
    // The name of the audio file to transcribe
    const fileName = path;

    // Reads a local audio file and converts it to base64
    const file = fs.readFileSync(fileName);
    const audioBytes = file.toString('base64');

    // The audio file's encoding, sample rate in hertz, and BCP-47 language code
    const audio = {
       content: audioBytes,
    };
    const config = {
       encoding: 'FLAC',        
       languageCode: 'de-DE',
    };
    const request = {
       audio: audio,
       config: config,
    };

    // Detects speech in the audio file
    client
       .recognize(request)
       .then(data => {
           const response = data[0];
           const transcription = response.results
               .map(result => result.alternatives[0].transcript)
               .join('\n');
           console.log(`Transcription: ${transcription}`);
       })
       .catch(err => {
           console.error('ERROR:', err);
       });
    }

    The thing is that if I upload a file everything works. But if I try it for a second time the error occurs :

    fs.js:646
    return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                ^

    Error: ENOENT: no such file or directory, open                
    'C:\Users\paulu\desktop\API\output\sample.flac'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at SpeechToText (C:\Users\paulu\desktop\API\server.js:68:21)
    at convert (C:\Users\paulu\desktop\API\server.js:121:5)
    at C:\Users\paulu\desktop\API\server.js:50:17
    at doMove (C:\Users\paulu\desktop\API\node_modules\express-
    fileupload\lib\index.js:152:17)
    at WriteStream.<anonymous> (C:\Users\paulu\desktop\API\node_modules\express-
    fileupload\lib\in                             dex.js:182:15)
    at emitNone (events.js:106:13)
    at WriteStream.emit (events.js:208:7)
    at fs.close (fs.js:2094:12)
    </anonymous>

    Thank you for all answers !

  • How to concat the mp3 file and webm file into a new webm file ?

    12 août 2015, par it_is_a_literature

    There is a webm file that contains no audio. I want to merge an audio file with this video. I’ve tried the following command :

    ffmpeg -i /home/test.mp3  -i /home/output.webm -vcodec copy -acodec copy /home/newtest.webm

    And received the error :

    Could not write header for output file #0 (incorrect codec parameters ?):         Invalid argument.
  • RTSP streaming on Android client using FFMpeg

    7 février 2021, par rurtle

    I am working on a hobby project the goal for which is to develop an Android application capable of streaming live feeds captured through web cams in a LAN setting using FFMpeg as the underlying engine. So far, I did the following -

    &#xA;&#xA;

    A. Compiling and generating FFMpeg related libraries for the following releases -

    &#xA;&#xA;

    FFMpeg version : 2.0
    &#xA;NDK version : r8e & r9
    &#xA;Android Platform version : android-16 & android-18thisthisthisthis
    &#xA;Toolchain version : 4.6 & 4.8
    &#xA;Platform built on : Fedora 18 (x86_64)

    &#xA;&#xA;

    B. Creating the files Android.mk & Application.mk in appropriate path.

    &#xA;&#xA;

    However, when it came to writing the native code for accessing appropriate functionality of FFMpeg from the application layer using Java, I'm stuck with following questions -

    &#xA;&#xA;

    a) Which all of FFMpeg's features I need to make available from native to app layer for streaming real-time feeds ?
    &#xA;b) In order to compile FFMpeg for Android, I followed this link. Whether the compilation options are sufficient for handling *.sdp streams or do I need to modify it ?
    &#xA;c) Do I need to make use of live555 ?

    &#xA;&#xA;

    I am totally new to FFMpeg and Android application development and this is going to be my first serious project for Android platform. I have been searching for relevant tutorials dealing with RTSP streaming using FFMpeg for a while now without much success. Moreover, I tried the latest development build of VLC player and found it to be great for streaming real-time feeds. However, it's a complex beast and the goal for my project is of quite limited nature, mostly learning - in a short time span.

    &#xA;&#xA;

    Could you suggest some pointers (e.g. links, documents or sample code) on how can I write the native code for utilizing FFMpeg library and subsequently use those functionality from the app layer for streaming real-time feeds ? Moreover, will really appreciate if you could let me know the kind of background knowledge necessary for this project from a functional standpoint (in a language agnostic sense).

    &#xA;