Recherche avancée

Médias (91)

Autres articles (42)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • 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

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (6940)

  • cinepakenc : fixes and improvements

    27 juin 2017, par addr-see-the-website@aetey.se
    cinepakenc : fixes and improvements
    

    version 2013-02-08 Rl
    - fixes/optimization in multistrip encoding and codebook size choice,
    quality/bitrate is now better than that of the binary proprietary encoder

    version 2013-02-12 Rl
    - separated codebook training sets, avoided the transfer of wasted bytes,
    which yields both better quality and smaller files
    - now using the correct colorspace (TODO : move conversion to libswscale)

    version 2013-02-14 Rl "Valentine’s Day" version :
    - made strip division more robust
    - minimized bruteforcing the number of strips,
    (costs some R/D but speeds up compession a lot), the heuristic
    assumption is that score as a function of the number of strips has
    one wide minimum which moves slowly, of course not fully true
    - simplified codebook generation,
    the old code was meant for other optimizations than we actually do
    - optimized the codebook generation / error estimation for MODE_MC

    version 2013-04-28 Rl
    - bugfixed codebook optimization logic

    version 2014-01-20 Rl
    - made the encoder compatible with vintage decoders
    and added some yet unused code for possible future
    incremental codebook updates
    - fixed a small memory leak

    version 2014-01-21 Rl
    - believe it or not, now we get even smaller files, with better quality
    (which means I missed an optimization earlier :)

    Signed-off-by : Diego Biurrun <diego@biurrun.de>

    • [DBH] libavcodec/cinepakenc.c
  • Revision 36037 : s’assurer que la class ffmpeg_movie est disponible sinon cela ne sert pas ...

    9 mars 2010, par kent1@… — Log

    s’assurer que la class ffmpeg_movie est disponible sinon cela ne sert pas à grand chose

  • Why does my lambda doesn't end with an expected request end event ? [on hold]

    16 avril 2019, par Nachum Freedman
    const now = (...a) =>
     console.log(...a, Math.floor(new Date().getTime() / 1000) % 3600);

    exports.handler = (event, context, callback) => {
     console.log("PROCESS START");

     const FROM_BUCKET = event.Records[0].s3.bucket.name;
     const Key = decodeURIComponent(
       event.Records[0].s3.object.key.replace(/\+/g, " ")
     );
     const uploadKey = Key.replace(/.webm/, ".mp4");

     console.log("FROM BUCKET", FROM_BUCKET);
     console.log("Recived key", Key);

     const slicedFilename = Key.slice(-4) !== "webm" ? Key.slice(-4) : ".webm";
     const extension =
       slicedFilename === ".mp4"
         ? ".mp4"
         : slicedFilename === ".pcm"
         ? ".pcm"
         : slicedFilename === ".webm"
         ? ".webm"
         : console.log("THE FILE NAME IS INCORRECT PLEASE CHECK @:", Key);

     console.log("Extension detected is", extension);

     const downloadKey =
       Key.slice(-4) !== "webm"
         ? Key.slice(0, -4) + extension
         : Key.slice(0, -5) + extension;

     const downloadParams = { Bucket: FROM_BUCKET, Key: downloadKey };

     console.log("Downloading file from S3", downloadParams);

     const mobileDownloadExtension =
       extension === ".mp4" ? ".pcm" : extension === ".pcm" ? ".mp4" : null;

     const mobileDownloadParams = {
       Bucket: FROM_BUCKET,
       Key: Key.slice(0, -4) + mobileDownloadExtension
     };

     console.log("Downloading file from S3", mobileDownloadParams);

     const tmpNamespace = Math.random();

     const isMobile = extension === ".mp4" || extension === ".pcm";
     let firstDigit = 0;
     let restOfTheOffset = 0;
     if (isMobile) {
       console.log(
         "If apply, second key to download is a file type",
         mobileDownloadExtension
       );
       const offsetTime = Key.slice(
         Key.lastIndexOf("_") + 1,
         Key.indexOf(".")
       ).replace("-", "");
       if (offsetTime > 999) {
         firstDigit = 1;
         restOfTheOffset = offsetTime.slice(1, offsetTime.length);
       } else {
         firstDigit = 0;
         restOfTheOffset = offsetTime;
       }
     }
     console.log("FIle recieved from Mobile?", isMobile);

     Promise.all([
       // download file from s3
       new Promise((resolve, reject) =>
         s3.getObject(downloadParams, (err, response) => {
           if (err) {
             console.error(
               "Error while downloading file from S3",
               downloadParams,
               err.code,
               "-",
               err.message
             );
             return reject(err);
           }
           console.log("Successfully downloaed file from S3", downloadParams);
           fs.writeFile(
             tmp + "/input" + tmpNamespace + extension,
             response.Body,
             err =>
               err
                 ? console.log(err.code, "-", err.message) || reject(err)
                 : console.log(tmp + "/input" + tmpNamespace + extension) ||
                   resolve()
           );
         })
       ),
       new Promise((resolve, reject) => {
         extension !== ".mp4" &amp;&amp; extension !== ".pcm"
           ? resolve()
           : s3.getObject(mobileDownloadParams, (err, response) => {
               if (err) {
                 console.error(
                   "Error while downloading file from S3",
                   mobileDownloadParams,
                   err.code,
                   "-",
                   err.message
                 );
                 return reject(err);
               }
               console.log(
                 "Successfully downloaed file from S3",
                 mobileDownloadParams
               );
               fs.writeFile(
                 tmp + "/input" + tmpNamespace + mobileDownloadExtension,
                 response.Body,
                 err =>
                   err
                     ? console.log(err.code, "-", err.message) || reject(err)
                     : console.log(
                         tmp + "/input" + tmpNamespace + mobileDownloadExtension
                       ) || resolve()
               );
             });
       })
     ])
       .then(() =>
         Promise.all([
           // call the answerVideoReady -> PROCESSING mobileDownloadExtnesion is actually the second file we seek (if mp4 then pcm)
           // ,

           isMobile
             ? Promise.resolve()
                 .then(() => {
                   new Promise((resolve, reject) => {
                     console.log("CALLING VIDEO PROCESSING", Key);
                     videoProcessing(Key);
                     resolve();
                   });
                 })
                 .then(
                   () =>
                     // run ffmpeg
                     // ffmpeg -i tmp/input.mp4 -movflags faststart -acodec copy -vcodec copy output.mp4
                     now("FFMPEG CONVERT PCM TO WAV START") ||
                     new Promise((resolve, reject) =>
                       spawn("./ffmpeg/ffmpeg", [
                         "-f",
                         "s16le",
                         "-ar",
                         "16000",
                         "-ac",
                         "1",
                         "-i",
                         tmp + "/input" + tmpNamespace + ".pcm",
                         "-ar",
                         "44100",
                         "-ac",
                         "2",
                         tmp + "/input" + tmpNamespace + ".wav"
                       ]).on("close", code =>
                         console.log("FFMPEG CONVERT PCM TO WAV SUCCESS", code) ||
                         !code
                           ? resolve()
                           : reject()
                       )
                     )
                 )
                 .then(
                   () =>
                     // run ffmpeg
                     // ffmpeg -i tmp/input.mp4 -movflags faststart -acodec copy -vcodec copy output.mp4
    //more stuff
                     now("FFMPEG COMBINE MP4 AND WAV START") ||
                     new Promise(
                       (resolve, reject) =>
                         console.log(
                           [
                             "-i",
                             tmp + "/input" + tmpNamespace + ".mp4",
                             "-itsoffset",
                             "-" + firstDigit + "." + restOfTheOffset,
                             "-i",
                             tmp + "/input" + tmpNamespace + ".wav",
                             "-movflags",
                             "faststart",
                             "-filter_complex",
                             " [1:0] apad ",
                             "-shortest",
                             tmp + "/output" + tmpNamespace + ".mp4"
                           ].join(" ")
                         ) ||
                         spawn("./ffmpeg/ffmpeg", [
                           "-i",
                           tmp + "/input" + tmpNamespace + ".mp4",
                           "-itsoffset",
                           "-" + firstDigit + "." + restOfTheOffset,
                           "-i",
                           tmp + "/input" + tmpNamespace + ".wav",
                           "-movflags",
                           "faststart",
                           "-filter_complex",
                           " [1:0] apad ",
                           "-shortest",
                           tmp + "/output" + tmpNamespace + ".mp4"
                         ]).on("close", code =>
                           console.log(
                             "FFMPEG COMBINE MP4 AND WAV SUCCESS",
                             code
                           ) || !code
                             ? resolve()
                             : reject()
                         )
                     )
                 )
             : Promise.resolve()
                 .then(() => {
                   new Promise((resolve, reject) => {
                     console.log("CALLING VIDEO PROCESSING", Key);
                     videoProcessing(Key);
                     resolve();
                   });
                 })
                 .then(
                   () =>
                     now("FFMPEG SEND WEBM START") ||
                     new Promise((resolve, reject) => {
                       exec(
                         "./sed -i '1,4d;$d' " +
                           tmp +
                           "/input" +
                           tmpNamespace +
                           ".webm"
                       ).on(
                         "close",
                         code =>
                           console.log("FFMPEG SEND WEBM SUCCESS", code) ||
                           (!code ? resolve() : reject())
                       );
                     })
                 )
                 .then(
                   () =>
                     // run ffmpeg
                     // ffmpeg -i tmp/input.mp4 -movflags faststart -acodec copy -vcodec copy output.mp4
                     now("FFMPEG WEBM WEB READY START") ||
                     new Promise((resolve, reject) =>
                       (a => {
                         a.stdout.on("data", data => {
                           //console.log(`child stdout:\n${data}`);
                         });
                         a.stderr.on("data", data => {
                           //console.log(`child stdout:\n${data}`);
                         });
                         return a;
                       })(
                         spawn("./ffmpeg/ffmpeg", [
                           "-i",
                           tmp + "/input" + tmpNamespace + extension,
                           "-movflags",
                           "faststart",
                           "-acodec",
                           "aac",
                           "-vcodec",
                           "h264",
                           "-preset",
                           "slow",
                           "-crf",
                           "26",
                           "-r",
                           "25",
                           tmp + "/output" + tmpNamespace + ".mp4"
                         ])
                       ).on("close", code =>
                         console.log(
                           "FFMPEG WEBM WEB READY FINISHED WITH:",
                           code
                         ) || !code
                           ? resolve()
                           : reject()
                       )
                     )
                 )
         ])
       )
       .then(
         () =>
           new Promise((resolve, reject) =>
             // upload the output.mp4 to s3
             fs.readFile(
               tmp + "/output" + tmpNamespace + ".mp4",
               (err, filedata) => {
                 if (err) {
                   console.log("ERROR WHILE TRYING TO READ FILE", err);
                   throw err;
                 }
                 console.log("KEEEEYYY", uploadKey),
                   s3.putObject(
                     {
                       Bucket: TO_BUCKET,
                       Key: uploadKey,
                       Body: filedata
                     },
                     (err, response) => {
                       console.log(response);
                       if (err) {
                         console.log(
                           "ERROR WHILE UPLOADING FILE TO S3",
                           err,
                           response
                         );
                         return reject(err);
                       }
    //uploading file
                       console.log(
                         "Successfully uploaded file to " + TO_BUCKET,
                         Key
                       );
                       resolve();
                     }
                   );
               }
             )
           )

         // call the answerVideoReady -> COMPLETED, context.success  or ERROR, context.fail or error on set status to ERROR -> fail
       )
       .then(p =>
         videoCompleted(Key)
           .then(c => context.succeed())
           .catch(es => context.fail(es))
       )
       .catch(
         e =>
           console.log("catch for upload error with:", e) ||
           videoError(Key)
             .then(p => context.fail(e))
             .catch(ee => context.fail(ee))
       );
    };