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 (52)

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

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

Sur d’autres sites (6152)

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