Recherche avancée

Médias (0)

Mot : - Tags -/presse-papier

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

Autres articles (23)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (5940)

  • Firebase function error : Cannot find ffmpeg

    9 janvier 2020, par Nathan

    I’m using the firebase storage to execute a function when a video gets uploaded to the default bucket, in the function I’m using Ffmpeg to convert the video and set some other options like size, then I want to reupload the file back to storage and I keep getting this error :

    Error: Cannot find ffmpeg
    at /srv/node_modules/fluent-ffmpeg/lib/processor.js:136:22
    at FfmpegCommand.proto._getFfmpegPath (/srv/node_modules/fluent-ffmpeg/lib/capabilities.js:90:14)
    at FfmpegCommand.proto._spawnFfmpeg (/srv/node_modules/fluent-ffmpeg/lib/processor.js:132:10)
    at FfmpegCommand.proto.availableFormats.proto.getAvailableFormats (/srv/node_modules/fluent-ffmpeg/lib/capabilities.js:517:10)
    at /srv/node_modules/fluent-ffmpeg/lib/capabilities.js:568:14
    at nextTask (/srv/node_modules/async/dist/async.js:4578:27)
    at Object.waterfall (/srv/node_modules/async/dist/async.js:4589:9)
    at Object.awaitable(waterfall) [as waterfall] (/srv/node_modules/async/dist/async.js:208:32)
    at FfmpegCommand.proto._checkCapabilities (/srv/node_modules/fluent-ffmpeg/lib/capabilities.js:565:11)
    at /srv/node_modules/fluent-ffmpeg/lib/processor.js:298:14

    I have used npm install to install both fluent-ffmpeg and ffmpeg-static yet it says it cannot find it ? Here’s my code :

    const ffmpeg = require('fluent-ffmpeg');
    const ffmpeg_static = require('ffmpeg-static');
    const {Storage} = require('@google-cloud/storage');
    const fs = require('fs');
    const os = require('os');
    var path = require('path');

    // Creates a client
    const storage = new Storage({
    projectId: 'projectID',
    });

    function promisifyCommand(command) {
    return new Promise((resolve, reject) => {
     command.on('end', resolve).on('error', reject).run();
    });
    }

    exports.updatePost = functions.storage.object().onFinalize(async (object) => {

    const fileBucket = object.bucket; // The Storage bucket that contains the file.
    const filePath = object.name; // File path in the bucket.
    const contentType = object.contentType; // File content type.
    const resourceState = object.resourceState; // The resourceState is 'exists' or 'not_exists' (for file/folder deletions).
    const metageneration = object.metageneration; // Number of times metadata has been generated. New objects have a value of 1.

    // Get file name
    const fileName = path.basename(filePath);

    // Exit if this is a move or deletaion event.
    if(resourceState === 'not_exists'){
       console.log('This is a deletion event');
       return;
    }

    // Download file from bucket
    const bucket = storage.bucket(fileBucket);
    const tempFilePath = path.join(os.tmpdir(), fileName)
    // We add a '_output.flac' suffix to target audio file name. That's where we'll upload the converted audio.
    const targetTempFileName = fileName.replace(/\.[^/.]+$/, "") + '_output.mp4';
    const targetTempFilePath = path.join(os.tmpdir(), targetTempFileName);
    const targetStorageFilePath = path.join(path.dirname(filePath), targetTempFileName);

    await bucket.file(filePath).download({destination: tempFilePath});
       console.log('Video downloaded locally to', tempFilePath);
       // Convert the video to suitable formats
       const command = ffmpeg(tempFilePath)
       .setFfmpegPath(ffmpeg_static.path)
       .withSize('50%')
       .toFormat('mp4')
       .output(targetTempFilePath);
       await promisifyCommand(command);
           console.log('New video created');

           //Upload video again
           await bucket.upload(targetTempFilePath, {destination: targetStorageFilePath});
               console.log('Output video uploaded to', targetStorageFilePath);
               // Delete the local file from server as it's been uploaded to storage
               fs.unlinkSync(tempFilePath);
               fs.unlinkSync(targetTempFilePath);

               console.log('Tempory files removed.', targetTempFilePath);
    });

    I have searched everywhere and people are also saying that running the ffmpeg module on the function will also exceed the limit very quickly and where told to use ffmpeg-static instead ?
    Thanks,

    Nathan

  • Add audio to Xuggler video stream (ffmpeg)

    11 avril 2017, par zholmes1

    I am trying to set up Facebook live video streaming in Java. I maintain a BufferedImage separately from this method which contains the image that is being streamed. I am connecting successfully and streaming the video, but Facebook takes the video down after two minutes because I am not sending audio as well. How can I add audio to this stream ?

       IContainer container = IContainer.make();
       IContainerFormat containerFormat_live = IContainerFormat.make();
       containerFormat_live.setOutputFormat("flv", streamUrl, null);
       container.setInputBufferLength(0);
       int retVal = container.open(streamUrl, IContainer.Type.WRITE, containerFormat_live);
       if (retVal < 0) {
           System.err.println("Could not open output container for live stream");
           System.exit(1);
       }


       IStream videoStream = container.addNewStream(0);
       IStreamCoder videoCoder = videoStream.getStreamCoder();
       ICodec videoCodec = ICodec.findEncodingCodec(ICodec.ID.CODEC_ID_H264);
       videoCoder.setNumPicturesInGroupOfPictures(5);
       videoCoder.setCodec(videoCodec);
       videoCoder.setBitRate(200000);
       videoCoder.setPixelType(IPixelFormat.Type.YUV420P);
       videoCoder.setHeight(IMAGE_HEIGHT_PX_OUTPUT);
       videoCoder.setWidth(IMAGE_WIDTH_PX_OUTPUT);
       System.out.println("[ENCODER] video size is " + IMAGE_HEIGHT_PX_OUTPUT + "x" + IMAGE_WIDTH_PX_OUTPUT);
       videoCoder.setFlag(IStreamCoder.Flags.FLAG_QSCALE, true);
       videoCoder.setGlobalQuality(0);
       IRational frameRate = IRational.make(30, 1);
       videoCoder.setFrameRate(frameRate);

       IRational timeBase = IRational.make(frameRate.getDenominator(), frameRate.getNumerator());
       videoCoder.setTimeBase(timeBase);

    //        IStream audioStream = container.addNewStream(1);
    //        IStreamCoder audioCoder = audioStream.getStreamCoder();
    //        ICodec audioCodec = ICodec.findEncodingCodec(ICodec.ID.CODEC_ID_AAC);
    //        audioCoder.setCodec(audioCodec);
    //        audioCoder.setBitRate(128 * 1024);
    //        audioCoder.setChannels(1);
    //        audioCoder.setSampleRate(44100);
    //        audioCoder.setFrameRate(IRational.make(1, 1));
    //        audioCoder.setTimeBase(timeBase);
    //
    //        IAudioResampler audioResampler = IAudioResampler.make(audioCoder.getChannels(), audioCoder.getChannels(), audioCoder.getSampleRate(), audioCoder.getSampleRate(), IAudioSamples.Format.FMT_S32, audioCoder.getSampleFormat());

       Properties props = new Properties();
       InputStream is = XugglerRtmpReferenceImpl.class.getResourceAsStream("/libx264-normal.ffpreset");
       try {
           props.load(is);
       } catch (IOException e) {
           System.err.println("You need the libx264-normal.ffpreset file from the Xuggle distribution in your classpath.");
           System.exit(1);
       }

       Configuration.configure(props, videoCoder);
    //        Configuration.configure(props, audioCoder);

       videoCoder.open();
    //        audioCoder.open();
       container.writeHeader();

    //        IAudioSamples audioSamples = IAudioSamples.make(512, audioCoder.getChannels());
    //        audioSamples.setComplete(true, 1024, audioCoder.getSampleRate(), audioCoder.getChannels(), IAudioSamples.Format.FMT_S32, 0);
    //
    //        IAudioSamples resampledAudio = IAudioSamples.make(512, audioCoder.getChannels(), IAudioSamples.Format.FMT_S32);
    //        audioResampler.resample(resampledAudio, audioSamples, 0);


       long firstTimeStamp = System.currentTimeMillis();
       long lastKeyFrameTimestamp = 0;
       long lastTimeStamp = System.currentTimeMillis();
       int i = 0;
       while (streaming) {
           //long iterationStartTime = System.currentTimeMillis();
           long now = System.currentTimeMillis();
           //convert it for Xuggler
           BufferedImage currentScreenshot = new BufferedImage(bufferedImage.getWidth(), bufferedImage.getHeight(), BufferedImage.TYPE_3BYTE_BGR);
           currentScreenshot.getGraphics().drawImage(bufferedImage, 0, 0, null);
           //start the encoding process
           IPacket packet = IPacket.make();
           IConverter converter = ConverterFactory.createConverter(currentScreenshot, IPixelFormat.Type.YUV420P);
           long timeStamp = (now - firstTimeStamp) * 1000;
           IVideoPicture outFrame = converter.toPicture(currentScreenshot, timeStamp);

           // make sure there is a keyframe at least every 2 seconds
           if (System.currentTimeMillis() - lastKeyFrameTimestamp > 1500) {
               outFrame.setKeyFrame(true);
               lastKeyFrameTimestamp = System.currentTimeMillis();
           }
           outFrame.setQuality(0);
           videoCoder.encodeVideo(packet, outFrame, 0);
           // audioCoder.encodeAudio(packet, IAudioSamples.make(0, audioCoder.getChannels()), 0);

           outFrame.delete();
           if (packet.isComplete()) {
               container.writePacket(packet);
               System.out.println("[ENCODER] writing packet of size " + packet.getSize() + " for elapsed time " + ((timeStamp - lastTimeStamp) / 1000));
               lastTimeStamp = System.currentTimeMillis();
           }
           System.out.println("[ENCODER] encoded image " + i + " in " + (System.currentTimeMillis() - now));
           i++;
           try {
               // sleep for framerate milliseconds
               Thread.sleep(Math.max((long) (1000 / frameRate.getDouble()) - (System.currentTimeMillis() - now), 0));
           } catch (InterruptedException e) {
               e.printStackTrace();
           }
       }
       container.writeTrailer();
  • Revision 50038 : Petites améliorations du formulaire de configuration On retrouve le ...

    11 juin 2018, par kent1@… — Log

    Petites améliorations du formulaire de configuration
    On retrouve le logo pour CFG2
    Un peu de ménage dans les sites :
    Les éléments enlevés de la liste :
    - Bluegger => fermé
    - Furl => renvoit vers diigo.com
    - Kirtsy => ne semble plus être un site de ce type
    - Mixx => racheté et ne fonctionne plis
    - pioche.fr => N’existe plus
    - propeller.com => Racheté par aol news
    - Shoutwire => semble avoir disparu de la toile
    - http://simpy.com/ => semble avoir disparu de la toile
    - http://www.tagtooga.com/ => semble avoir disparu de la toile
    - twine => pointe vers evri.com => url à trouver ?
    Les éléments ajoutés :
    - BarraPunto ? => http://barrapunto.com
    - Bitacoras => http://bitacoras.com
    - Dzone => http://www.dzone.com/
    - Friendfeed => http://www.friendfeed.com
    - identi.ca => http://identi.ca
    - linkedin => http://www.linkedin.com
    - Plaxo
    Petite modification de l’url de facebook
    On incrémente le numéro de version