Recherche avancée

Médias (0)

Mot : - Tags -/objet éditorial

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (61)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • 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

Sur d’autres sites (14569)

  • Passing streams from Fluent-ffmpeg to Google Cloud Storage

    31 octobre 2019, par Emilio Faria

    Is there a way to pass a stream from Fluent-mmpeg to Google Cloud Storage ? I’m trying to allow the user to upload any kind of media (audio or video), and I want to convert it to flac before uploading it to GCS.

    I’m using a few middlewares on my route, such as :

    routes.post(
     '/upload',
     multer.single('audio'),
     ConvertController.convert,
     UploadController.upload,
     FileController.save,
     (req, res, next) => res.send('ok')
    );

    I was able to stream from Multer to Fluent-mmpeg and save to a file using this code on ConvertController :

    async convert(req, res, next) {
       ffmpeg(streamifier.createReadStream(req.file.buffer))
         .format('flac')
         .output('outputfile.flac')
         .audioChannels(1)
         .on('progress', function(progress) {
           console.log(progress);
         })
         .run();
     }

    But I would like to use .pipe() to pass it to UploadController, where I would then upload to GCS :

    class UploadController {
     async upload(req, res, next) {
       const gcsHelpers = require('../helpers/google-cloud-storage');
       const { storage } = gcsHelpers;

       const DEFAULT_BUCKET_NAME = 'my-bucket-name';

       const bucketName = DEFAULT_BUCKET_NAME;
       const bucket = storage.bucket(bucketName);
       const fileName = `test.flac`;
       const newFile = bucket.file(fileName);

       newFile.createWriteStream({
         metadata: {
           contentType: file.mimetype
         }
       })

       file.on('error', err => {
         throw err;
       });

       file.on('finish', () => console.log('finished'));
     }

    The problem is that I cannot find anywhere explaining how I can pass down a stream to the next middleware.

    Is it possible ?

  • error : `FFMPEG` can not read `` in google colab

    3 avril 2023, par 5opka

    the error occurs when loading a video file (mp4) previously the code worked with this video.
to run https://colab.research.google.com/github/AliaksandrSiarohin/first-order-model/blob/master/demo.ipynb
you need to put !pip install -U scikit-image==0.18.0 in the first cell.
video can download this https://youtu.be/smQvWpqX13I (144p).
enter image description here

    


    InitializationError         Traceback (most recent call last)&#xA;/usr/local/lib/python3.9/dist-packages/imageio/core/imopen.py &#xA;in imopen(uri, io_mode, plugin, extension, format_hint, &#xA;legacy_mode, **kwargs)&#xA;    141         try:&#xA;--> 142             return loader(request, **kwargs)&#xA;    143         except InitializationError as class_specific:&#xA;    &#xA;20 frames&#xA;    &#xA;InitializationError: `FFMPEG` can not read `<bytes>`.&#xA;&#xA;The above exception was the direct cause of the following &#xA;exception:&#xA;&#xA;RuntimeError           Traceback (most recent call last)&#xA;/usr/local/lib/python3.9/dist-packages/imageio/core/imopen.py &#xA;in imopen(uri, io_mode, plugin, extension, format_hint, &#xA;legacy_mode, **kwargs)&#xA;    158 &#xA;    159         request.finish()&#xA;--> 160         raise err_type(err_msg) from err_from&#xA;    161 &#xA;    162     # fast-path based on format_hint&#xA;&#xA;RuntimeError: `FFMPEG` can not handle the given uri.&#xA;</bytes>

    &#xA;

  • Google App Engine - Access file after uploaded to bucket

    28 mai 2021, par jessiPP

    I have uploaded a file using my google app engine backend to my storage bucket but now I cannot access the file to pass in into ffmpeg. I am getting this error message from the try-catch : "The input file does not exist". I can see that the file was uploaded because I checked my developer console under the storage bucket. I am using the boilerplate code provided by google but added the ffmpeg for testing. I am trying to access the path to the uploaded file using, but it is incorrect, though I am getting the bucket.name value and the blob.name value. I am using the "flex" environment for this.

    &#xA;

    const originalFilePath = `gs://${bucket.name}/${blob.name}`; &#xA;

    &#xA;

    here is the full code :

    &#xA;

    const process = require(&#x27;process&#x27;); // Required to mock environment variables&#xA;const express = require(&#x27;express&#x27;);&#xA;const helpers = require(&#x27;./helpers/index&#x27;);&#xA;const Multer = require(&#x27;multer&#x27;);&#xA;const bodyParser = require(&#x27;body-parser&#x27;);&#xA;const ffmpeg = require("ffmpeg"); //https://www.npmjs.com/package/ffmpeg&#xA;const {Storage} = require(&#x27;@google-cloud/storage&#x27;);&#xA;&#xA;// Instantiate a storage client&#xA;const storage = new Storage();&#xA;&#xA;const app = express();&#xA;app.set(&#x27;view engine&#x27;, &#x27;pug&#x27;);&#xA;app.use(bodyParser.json());&#xA;&#xA;// Multer is required to process file uploads and make them available via&#xA;// req.files.&#xA;const multer = Multer({&#xA;storage: Multer.memoryStorage(),&#xA; limits: {&#xA;  fileSize: 5 * 1024 * 1024, // no larger than 5mb, you can change as needed.&#xA; },&#xA;});&#xA;&#xA;// A bucket is a container for objects (files).&#xA;const bucket = storage.bucket(process.env.GCLOUD_STORAGE_BUCKET);&#xA;&#xA;// Display a form for uploading files.&#xA;app.get(&#x27;/&#x27;, (req, res) => {&#xA; res.render(&#x27;form.pug&#x27;);&#xA;});&#xA;&#xA;// Process the file upload and upload to Google Cloud Storage.&#xA;app.post(&#x27;/upload&#x27;, multer.single(&#x27;file&#x27;), (req, res, next) => {&#xA;&#xA;if (!req.file) {&#xA; res.status(400).send(&#x27;No file uploaded.&#x27;);&#xA; return;&#xA;}&#xA;&#xA;// Create a new blob in the bucket and upload the file data.&#xA;const blob = bucket.file(req.file.originalname);&#xA;const blobStream = blob.createWriteStream({&#xA; resumable: false,&#xA;});&#xA;&#xA;blobStream.on(&#x27;error&#x27;, err => {&#xA; next(err);&#xA;});&#xA;&#xA;blobStream.on(&#x27;finish&#x27;, () => {&#xA;&#xA;const audioFile = helpers.replaceAllExceptNumbersAndLetters(new Date());&#xA;&#xA;// this path is incorrect but I cannot find correct way to do it&#xA;const originalFilePath = `gs://${bucket.name}/${blob.name}`; &#xA;&#xA;const filePathOutput = `gs://${bucket.name}/${audioFile}.mp3`;&#xA;&#xA;try {&#xA; const process = new ffmpeg(originalFilePath);&#xA; process.then(function (video) {&#xA; // Callback mode&#xA; video.fnExtractSoundToMP3(filePathOutput, (error, file) => {&#xA; if (!error)&#xA;  res.send(`audio file: ${file}`);&#xA; });&#xA;}, (error) => {&#xA; res.send(`process error: ${error}`);&#xA;&#xA;});&#xA;} catch (e) {&#xA; res.send(`try catch error: ${JSON.stringify(e)} | bucket: ${JSON.stringify(bucket)} | &#xA; blob: : ${JSON.stringify(blob)}`);&#xA;}  &#xA;&#xA;&#xA;});&#xA;&#xA;blobStream.end(req.file.buffer);&#xA;&#xA;});&#xA;&#xA;const PORT = process.env.PORT || 8080;&#xA;app.listen(PORT, () => {&#xA; console.log(`App listening on port ${PORT}`);&#xA; console.log(&#x27;Press Ctrl&#x2B;C to quit.&#x27;);&#xA;});&#xA;&#xA;&#xA;module.exports = app;&#xA;

    &#xA;