Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (71)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • 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

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

Sur d’autres sites (11462)

  • Is there any way that I can speed up the ffmpeg processing time

    20 mai 2020, par Ahmed Al-Rayan

    I am facing a problem with the processing process. I use a real joint server in a digital hosting package of $ 10 and use cloud service from Amazon s3. The problem is when uploading a video, whatever the size of the video, whether its size is 1 megabyte or 2 Giga. After the upload process, the processing process starts to upload, there is no problem But when the processing process takes a very long time so that I cannot complete it, what is the solution to that, is there a problem for me or is this process normal ?
 I use laravel-ffmpeg and through laravel queue I am cutting the video into several qualities I will attach the code to you below.

    



    public function handle()
{
    //180p
    $lowBitrate1 = (new X264('aac'))->setKiloBitrate(613);
    //270p
    $lowBitrate2 = (new X264('aac'))->setKiloBitrate(906);
    //360p
    $midBitrate1 = (new X264('aac'))->setKiloBitrate(1687);
    //540p
    $midBitrate2 = (new X264('aac'))->setKiloBitrate(2227);
    //720p
    $highBitrate1 = (new X264('aac'))->setKiloBitrate(4300);
    //1080
    $highBitrate2 = (new X264('aac'))->setKiloBitrate(7917);

FFMpeg::fromDisk('s3')
    ->open($this->movie->path)
    ->exportForHLS()
    ->onProgress(function ($percent) {
        $this->movie->update([
            'percent' => $percent
        ]);
    })
    ->setSegmentLength(10)// optional
    ->addFormat($lowBitrate1)
    ->addFormat($lowBitrate2)
    ->addFormat($midBitrate1)
    ->addFormat($midBitrate2)
    ->addFormat($highBitrate1)
    ->addFormat($highBitrate2)
    ->toDisk('s3')
    ->save("public/Movies/{$this->movie->id}/{$this->movie->id}.m3u8");
}//end of handle


    


  • ffmpeg transcode to live stream

    14 septembre 2016, par brayancastrop

    I need to display a ip camera stream in an html video tag, i have figured out how to transcode to a file from the rtsp stream like this

    ffmpeg -i "rtsp://user:password@ip" -s 640x480 /tmp/output.mp4

    now i need to be able to be able to live stream the rtsp input in a video tag like this

    <video src="http://domain:port/output.mp4" autoplay="autoplay"></video>

    I was trying to do something like this in my server (an ubuntu micro instance on amazon) in order to reproduce the video in the video tag but didn’t work

    ffmpeg -i "rtsp://user:password@ip" -s 640x480 http://localhost:8080/stream.mp4

    instead i got this log

    [tcp @ 0x747b40] Connection to tcp://localhost:8080 failed: Connection refused
    http://localhost:8080/stream.mp4: Connection refused

    i don’t really understand what’s happening, not sure if it’s sending the output to that url or serving the output there and this, i’ve been checking the ffmpeg man docs but i didn’t find any example related to this use case and also other questiones like this one FFmpeg Stream Transcoding which is similar to my last try without success

    btw, this is the camera i’m using DS-2CD2020F-I(W) - http://www.hikvision.com/en/Products_accessries_157_i5847.html
    they offer an httppreview but it’s just an img tag source which updates but appears to be unstable

    This is my first time trying to do something like this so any insight about how to achieve it will be really usefull and appreciated

  • AWS Lambda in Node JS with FFMPEG Lambda Layer

    29 mars 2023, par mwcwge23

    I'm trying to make a Lambda that takes a video and puts a watermark image on it.&#xA;I'm using Lambda with NodeJS and FFMPEG Lambda Layer I took from here :&#xA;https://serverlessrepo.aws.amazon.com/applications/us-east-1/145266761615/ffmpeg-lambda-layer

    &#xA;

    I got these two errors and I don't have a clue what do I did wrong :&#xA;errors

    &#xA;

    Please help me :)

    &#xA;

    (by the way, if you have an easier solution to put a watermark image on video that'll also be great)

    &#xA;

    That's my code (trying to put a watermark image on a video file) :

    &#xA;

    const express = require("express");&#xA;const childProcess = require("child_process");&#xA;const path = require("path");&#xA;const fs = require("fs");&#xA;const util = require("util");&#xA;const os = require("os");&#xA;const { fileURLToPath } = require("url");&#xA;const { v4: uuidv4 } = require("uuid");&#xA;const bodyParser = require("body-parser");&#xA;const awsServerlessExpressMiddleware = require("aws-serverless-express/middleware");&#xA;const AWS = require("aws-sdk");&#xA;const workdir = os.tmpdir();&#xA;&#xA;const s3 = new AWS.S3();&#xA;&#xA;// declare a new express app&#xA;const app = express();&#xA;app.use(bodyParser.json());&#xA;app.use(awsServerlessExpressMiddleware.eventContext());&#xA;&#xA;// Enable CORS for all methods&#xA;app.use(function (req, res, next) {&#xA;  res.header("Access-Control-Allow-Origin", "*");&#xA;  res.header("Access-Control-Allow-Headers", "*");&#xA;  next();&#xA;});&#xA;&#xA;const downloadFileFromS3 = function (bucket, fileKey, filePath) {&#xA;  "use strict";&#xA;  console.log("downloading", bucket, fileKey, filePath);&#xA;  return new Promise(function (resolve, reject) {&#xA;    const file = fs.createWriteStream(filePath),&#xA;      stream = s3&#xA;        .getObject({&#xA;          Bucket: bucket,&#xA;          Key: fileKey,&#xA;        })&#xA;        .createReadStream();&#xA;    stream.on("error", reject);&#xA;    file.on("error", reject);&#xA;    file.on("finish", function () {&#xA;      console.log("downloaded", bucket, fileKey);&#xA;      resolve(filePath);&#xA;    });&#xA;    stream.pipe(file);&#xA;  });&#xA;};&#xA;&#xA;const uploadFileToS3 = function (bucket, fileKey, filePath, contentType) {&#xA;  "use strict";&#xA;  console.log("uploading", bucket, fileKey, filePath);&#xA;  return s3&#xA;    .upload({&#xA;      Bucket: bucket,&#xA;      Key: fileKey,&#xA;      Body: fs.createReadStream(filePath),&#xA;      ACL: "private",&#xA;      ContentType: contentType,&#xA;    })&#xA;    .promise();&#xA;};&#xA;&#xA;const spawnPromise = function (command, argsarray, envOptions) {&#xA;  return new Promise((resolve, reject) => {&#xA;    console.log("executing", command, argsarray.join(" "));&#xA;    const childProc = childProcess.spawn(&#xA;        command,&#xA;        argsarray,&#xA;        envOptions || { env: process.env, cwd: process.cwd() }&#xA;      ),&#xA;      resultBuffers = [];&#xA;    childProc.stdout.on("data", (buffer) => {&#xA;      console.log(buffer.toString());&#xA;      resultBuffers.push(buffer);&#xA;    });&#xA;    childProc.stderr.on("data", (buffer) => console.error(buffer.toString()));&#xA;    childProc.on("exit", (code, signal) => {&#xA;      console.log(`${command} completed with ${code}:${signal}`);&#xA;      if (code || signal) {&#xA;        reject(`${command} failed with ${code || signal}`);&#xA;      } else {&#xA;        resolve(Buffer.concat(resultBuffers).toString().trim());&#xA;      }&#xA;    });&#xA;  });&#xA;};&#xA;&#xA;app.post("/api/addWatermark", async (req, res) => {&#xA;  try {&#xA;    const bucketName = "bucketName ";&#xA;    const uniqeName = uuidv4() &#x2B; Date.now();&#xA;    const outputPath = path.join(workdir, uniqeName &#x2B; ".mp4");&#xA;    const key = "file_example_MP4_480_1_5MG.mp4";&#xA;    const localFilePath = path.join(workdir, key);&#xA;    const watermarkPngKey = "watermark.png";&#xA;    const watermarkLocalFilePath = path.join(workdir, watermarkPngKey);&#xA;&#xA;    downloadFileFromS3(bucketName, key, localFilePath)&#xA;      .then(() => {&#xA;        downloadFileFromS3(bucketName, watermarkPngKey, watermarkLocalFilePath)&#xA;          .then(() => {&#xA;            fs.readFile(localFilePath, (err, data) => {&#xA;              if (!err &amp;&amp; data) {&#xA;                console.log("successsss111");&#xA;              }&#xA;            });&#xA;            fs.readFile(watermarkLocalFilePath, (err, data) => {&#xA;              if (!err &amp;&amp; data) {&#xA;                console.log("successsss222");&#xA;              }&#xA;            });&#xA;&#xA;            fs.readFile(outputPath, (err, data) => {&#xA;              if (!err &amp;&amp; data) {&#xA;                console.log("successsss3333");&#xA;              }&#xA;            });&#xA;&#xA;            spawnPromise(&#xA;              "/opt/bin/ffmpeg",&#xA;              [&#xA;                "-i",&#xA;                localFilePath,&#xA;                "-i",&#xA;                watermarkLocalFilePath,&#xA;                "-filter_complex",&#xA;                `[1]format=rgba,colorchannelmixer=aa=0.5[logo];[0][logo]overlay=5:H-h-5:format=auto,format=yuv420p`,&#xA;                "-c:a",&#xA;                "copy",&#xA;                outputPath,&#xA;              ],&#xA;              { env: process.env, cwd: workdir }&#xA;            )&#xA;              .then(() => {&#xA;                uploadFileToS3(&#xA;                  bucketName,&#xA;                  uniqeName &#x2B; ".mp4",&#xA;                  outputPath,&#xA;                  "mp4"&#xA;                );&#xA;              });&#xA;           });&#xA;      });&#xA;  } catch (err) {&#xA;    console.log({ err });&#xA;    res.json({ err });&#xA;  }&#xA;});&#xA;&#xA;app.listen(8136, function () {&#xA;  console.log("App started");&#xA;});&#xA;&#xA;module.exports = app;&#xA;&#xA;

    &#xA;