Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

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

Autres articles (59)

  • 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 (...)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • 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 (7252)

  • Architecture of video-based service for mobile phones

    27 juin 2015, par David Azar

    I guess this is more of a conceptual question than a technical one.

    I’m trying to figure out the best way to upload short videos to a server and also be able to download them and watch them on both Android and iOS.

    Lets focus on Android for the moment.

    I’ve done some experiments, and my results have been :

    • I’m able to compress 12-14MB video down to 500KB using FFMPEG lib with pretty good results in quality, but it takes about 12 seconds.

    • Next, im uploading those videos to my Parse backend as ParseFile to store them.

    • Finally, i can download them and watch them with no problem using a VideoView widget.

    Now, for the tests i’ve been running, these are great results. But i want to see if there is a better way to manage and scale all of this.

    My questions are :

    • Is there a better, lighter way to compress video ?

    • Is Parse the right way to go ?

    • How can i stream videos instead of downloading them and storing the on local storage before playing them ? i know this will cause my app to use significant space on disk and i dont want that.

    • How do big companies do this kind of tasks ?

    I’ve heard Amazon S3 is a cool thing for projects like this one, also Google Cloud Platform. I want to understand the best approach before building everything so i can do it the right way and also, provide the absolute best user experience for watching these videos.

  • Create mp4 thumbnail in node.js

    21 mai 2015, par trdavidson

    new in node.js and aws framework so I apologize in advance. I am trying to configure the AWS DB of my app to automatically create thumbnails using AWS Lambda. This works great using the example provided by Amazon for regular .jpg images (walkthrough here : https://alestic.com/2014/11/aws-lambda-cli/).

    However to try and do the same operation for mp4 files seems exponentially more difficult. After some searching I found that it seems the way to do this is by using the ffmpeg module. The problem is that I do not at all understand the response object returned by aws, and thus am not sure how to manipulate it so that ffmpeg can use it.

    current code :

    // dependencies
    var async = require('async');
    var AWS = require('aws-sdk');
    var gm = require('gm')
               .subClass({ imageMagick: true }); // Enable ImageMagick integration.
    var util = require('util');
    var ffmpeg = require('ffmpeg');
    var stream = require('stream')

    // constants
    var MAX_WIDTH  = 250;
    var MAX_HEIGHT = 250;

    // get reference to S3 client
    var s3 = new AWS.S3();

    exports.handler = function(event, context) {
       // Read options from the event.
       console.log("Reading options from event:\n", util.inspect(event, {depth: 5}));
       var srcBucket = event.Records[0].s3.bucket.name;
       // Object key may have spaces or unicode non-ASCII characters.
       var srcKey    =
       decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " "));  
       var dstBucket = srcBucket + "small";
       var dstKey    = "small-" + srcKey;
    // Sanity check: validate that source and destination are different buckets.
    if (srcBucket == dstBucket) {
       console.error("Destination bucket must not match source bucket.");
       return;
    }

    // Infer the image type.
    var typeMatch = srcKey.match(/\.([^.]*)$/);
    if (!typeMatch) {
       console.error('unable to infer image type for key ' + srcKey);
       return;
    }
    var imageType = typeMatch[1];
    if (imageType != "mp4" && imageType != "avi") {
       console.log('skipping non-image ' + srcKey);
       return;
    }

    // Download the image from S3, transform, and upload to a different S3 bucket.
    async.waterfall([
       function download(next) {
           // Download the image from S3 into a buffer.

           s3.getObject({
                   Bucket: srcBucket,
                   Key: srcKey
               },
               next);
           },
       function tranform(response, next) {
           var instream = new stream.Readable();
           instream.push(response.Body)
           instream.push(null)

           var outstream = new stream();

           ffmpeg(instream)
           .screenshots({timestamps: 1, size: '200x200'})
           .output('screenshot.png')
           .output(outstream)
           .on('end', function(){
               console.log('screenshots finished processing son!')
           })

           gm(outstream, 'screenshot.png').size(function(err, size) {
               // Infer the scaling factor to avoid stretching the image unnaturally.
               var scalingFactor = Math.min(
                   MAX_WIDTH / size.width,
                   MAX_HEIGHT / size.height
               );
               var width  = scalingFactor * size.width;
               var height = scalingFactor * size.height;

               // Transform the image buffer in memory.
               this.resize(width, height)
                   .toBuffer(imageType, function(err, buffer) {
                       if (err) {
                           next(err);
                       } else {
                           next(null, response.ContentType, buffer);
                       }
                   });
           });
       },
       function upload(contentType, data, next) {
           // Stream the transformed image to a different S3 bucket.
           s3.putObject({
                   Bucket: dstBucket,
                   Key: dstKey,
                   Body: data,
                   ContentType: contentType
               },
               next);
           }
       ], function (err) {
           if (err) {
               console.error(
                   'Unable to resize ' + srcBucket + '/' + srcKey +
                   ' and upload to ' + dstBucket + '/' + dstKey +
                   ' due to an error: ' + err
               );
           } else {
               console.log(
                   'Successfully resized ' + srcBucket + '/' + srcKey +
                   ' and uploaded to ' + dstBucket + '/' + dstKey
               );
           }

           context.done();
       }
    );

    } ;

    Any suggestions are welcome ! Thanks

  • PipedInputStream / PipedOutputStream, ImageIO and ffmpeg

    19 avril 2015, par jdevelop

    I have the following code in Scala :

         val pos = new PipedOutputStream()
         val pis = new PipedInputStream(pos)

         Future {
           LOG.trace("Start rendering")
           generateFrames(videoRenderParams.length) {
             img ⇒ ImageIO.write(img, "PNG", pos)
           }
           pos.flush()
           IOUtils.closeQuietly(pos)
           LOG.trace("Finished rendering")
         } onComplete {
           case Success(_) ⇒
             LOG.trace("Complete successfully")
           case Failure(err) ⇒
             LOG.error("Can't render stuff", err)
             IOUtils.closeQuietly(pis)
             IOUtils.closeQuietly(pos)
         }

         val prc = (ffmpegCli #< pis).!(logger)

    the Future simply writes the generated images one by one to the OutputStream. Now the ffmpeg process reads the input images from stdin and converts them to MP4 file.

    That works pretty well, but for some reason sometimes I’m getting the following stacktraces :

    I/O error Pipe closed for process: <input stream="stream" />
    java.io.IOException: Pipe closed
       at java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:260)
       at java.io.PipedInputStream.receive(PipedInputStream.java:226)
       at java.io.PipedOutputStream.write(PipedOutputStream.java:149)
       at scala.sys.process.BasicIO$.loop$1(BasicIO.scala:236)
       at scala.sys.process.BasicIO$.transferFullyImpl(BasicIO.scala:242)
       at scala.sys.process.BasicIO$.transferFully(BasicIO.scala:223)
       at scala.sys.process.ProcessImpl$PipeThread.runloop(ProcessImpl.scala:159)
       at scala.sys.process.ProcessImpl$PipeSource.run(ProcessImpl.scala:179)

    At the same time I’m getting the following error from another stream :

    javax.imageio.IIOException: I/O error writing PNG file!
       at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1168)
       at javax.imageio.ImageWriter.write(ImageWriter.java:615)
       at javax.imageio.ImageIO.doWrite(ImageIO.java:1612)
       at javax.imageio.ImageIO.write(ImageIO.java:1578)
       at

    So it seems that the streams were broken somewhere in between, so ffmpeg can not read the data, and ImageIO can not write the data.

    What is even more interesting - the problem is reproducible only on certain Linux server (Amazon). It works flawlessly on other Linux boxes. So I wonder if somebody could point me out to the possible causes of this error.

    What I’ve tried so far :

    • use Oracle JDK 8 and OpenJDK
    • use different versions of FFMPEG

    Nothing worked by the moment.