Recherche avancée

Médias (1)

Mot : - Tags -/net art

Autres articles (53)

  • 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

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (10928)

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