Recherche avancée

Médias (0)

Mot : - Tags -/interaction

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

Autres articles (53)

  • 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 en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

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

  • Black detect ffmpeg and use in a javascript

    6 février 2023, par sol

    I had an ffmpeg script that allow me to detect black frames from a video file sample from the bottom.

    


    and i want to create a javascript code that will allow me to do the same function sample from the bottom but its not working.

    


    original code from ffmpeg script :

    


    `ffmpeg -i LKE-BLACK.mp4 -vf "blackdetect=d=0.5:pix_th=0.10" -an -f null - 2>&1 | findstr blackdetect > output.txt

    


    node script :

    


    var fs = require('fs');
const ffmpeg = require("ffmpeg.js");

var createStream = fs.createWriteStream("data.txt");
createStream.end();

const transcode = async ({ target: { files }  }) => {
    message.innerHTML = 'Loading ffmpeg-core.js';
    await ffmpeg.load();
    message.innerHTML = 'Start transcoding';
    
    await ffmpeg.transcode('-i', 'LKE-BLACK.mp4', "-vf", "blackdetect=d=0.5:pix_th=0.10", '-an', '-f', 'null - 2>&1', );
    message.innerHTML = 'Complete transcoding';

    fs.writeFile("data.txt", function (err) {
        if (err) throw err;
        console.log('File is created successfully.');
      });
}


    


  • Fluent-ffmpeg Invalid data found when processing input error only when the second request is received

    31 décembre 2022, par koji tanaka

    I am using Node.js for backend to use ffmpeg. To use ffmpeg, I adopted fluent-ffmpeg. This is working perfectly except for one problem. That is when I send video from client side SPA(single page application) to the server-side for the "second" time, node application crashes.

    


    What I did is saving the received video in the backend folder, which is made in the process, and taking a snapshot of the video.
This code actually works everytime after restarting the server, but once I used this route and try another time, the error message "Invalid data found when processing input video ./received/${receivedName}" comes up.

    


    app.post("/convert", fileUpload({ createParentPath: true }), async function (req, res) {
    makeDir(receivedVideoDirectory);
    const receivedName = Object.keys(req.files)[0];
    const directoryName = receivedName.substring(0, receivedName.indexOf("."));

    const receivedFile = req.files[receivedName];
    transcodedSegFolder = `./public/transcoded/${dirName}`;
    console.log("transcoded segment file folder is here", transcodedSegFolder);
    makeDir(transcodedSegFolder);

    fs.open(`./received/${receivedName}`, 'w', (err, fd) => {
        if (err) throw err;
        fs.writeFile(fd, receivedFile["data"], function (err) {
            if (err) {
                return console.log("Err in write file ", err);
            }
            console.log("The file was saved!", receivedName);
            fs.close(fd, (err) => {
                if (err) throw err;
            });
        });
    });

    ffmpeg(`./received/${receivedName}`)
        .takeScreenshots(
            {
                count: 1,
                timemarks: ['00:00:01.000'],
                folder: './public/thumbnails',
                filename: dirName
            }).on('error', function(err) {
                console.log('screenshot error happened: ' + err.message);
              }).on('end', function(err) {
                console.log('Screenshot process finished: ');
              });


    


    Probably some program keeps working, but I cannot find it. Any help is appreciated. Thank you.

    


  • Format video to upload on instagram API (Nodejs)

    6 octobre 2022, par Rafael de Carvalho

    I'm trying to automate the process of posting photos and videos on instagram but I constantly get errors when uploading to instagram.

    


    I will leave a video duration error here but several others happen, I need to follow the following requirements :

    


      

    • Container : MOV or MP4 (MPEG-4 Part 14), no edit lists, atom moov in front of file
    • 


    • Audio codec : AAC, 48 kHz maximum sampling rate, 1 or 2 channel (mono or stereo)
    • 


    • Video codec : HEVC or H.264, progressive scan, closed GOP, 4:2:0 chroma subsampling
    • 


    • Frame rate : from 23 to 60 FPS
    • 


    • photo size :

        

      • Maximum columns (horizontal pixels) : 1,920
      • 


      • Minimum aspect ratio [columns/rows] : 4/5
      • 


      • Maximum aspect ratio [columns/rows] : 9/16
      • 


      


    • 


    • Video bitrate : 5Mbps maximum VBR
    • 


    • Audio bitrate : 128 kbps
    • 


    • Duration : maximum 60 seconds and minimum 3 seconds
    • 


    • File size : max 100 MB
    • 


    


    My code :

    


    import { S3 } from 'aws-sdk';
import { IgApiClient } from 'instagram-private-api';
import fs from 'fs';

const s3 = new S3();
const ig = new IgApiClient();
const bucket = 'posts';
const { INSTA_USER, INSTA_PASS } = process.env;

ig.state.generateDevice(INSTA_USER);

export const main = async () => {
  try {
    await ig.account.login(INSTA_USER, INSTA_PASS);

    const { Contents } = await s3.listObjectsV2({ Bucket: bucket, MaxKeys: 2, Prefix: 'memes/geral' }).promise();

    const files = await Promise.all(Contents.map(async ({ Key }) => {
      const file = await s3.getObject({
        Bucket: bucket,
        Key,
      }).promise();

      return file.Body;
    }));

    const publishResult = await ig.publish.video({
      video: files[0],
      coverImage: await fs.readFileAsync("../../src/assets/cover.png")
    });

    console.dir({ publishResult }, { depth: null })
  } catch (error) {
    console.error(error);
    throw error;
  }
}


    


    When I get a file from s3, it comes in the following format.
I'm taking the content of the body property and put it in the video property of the publish method.
Is it right ?
I also tried to save the file with fs.writeFile and dps use readFileSync like in the example but it also gave the same error.

    


    {
    AcceptRanges: 'bytes',
    LastModified: 2022-08-04T23:15:24.000Z,
    ContentLength: 3252472,
    ETag: '"c491cfe2fb5bc29777fc34391fc1d56a"',
    ContentType: 'application/octet-stream',
    Body: Buffer(3252472) [Uint8Array] [
        0,   0,   0,  32, 102, 116, 121, 112, 105, 115, 111, 109,
        0,   0,   2,   0, 105, 115, 111, 109, 105, 115, 111,  50,
       97, 118,  99,  49, 109, 112,  52,  49,   0,   0, 209,   0,
      109, 111, 111, 118,   0,   0,   0, 108, 109, 118, 104, 100,
        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
        0,   0,   3, 232,   0,   0, 250,  17,   0,   1,   0,   0,
        1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
        0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
        0,   0,   0,   0,
      ... 3252372 more items
    ]
  }


    


    Error :

    


    {
    "errorMessage": "POST /api/v1/media/upload_finish/?video=1 - 400 Bad Request; server processing error: VideoSourceDurationCheckException",
    "errorType": "IgUploadVideoError",
    "stackTrace": [
        "IgUploadVideoError: POST /api/v1/media/upload_finish/?video=1 - 400 Bad Request; server processing error: VideoSourceDurationCheckException",
        "    at C:\\Users\\User\\Desktop\\dev\\Insta\\.webpack\\service\\src\\functions\\webpack:\\instagram-private-api\\dist\\services\\publish.service.js:26:1",  
        "    at tryCatcher (C:\\Users\\User\\Desktop\\dev\\Insta\\.webpack\\service\\src\\functions\\webpack:\\bluebird\\js\\release\\util.js:16:1)"
}


    


    when I try to post a video under 60 seconds (apparently within the requirements) :

    


    {
    "errorMessage": "POST /api/v1/media/configure/?video=1 - 403 Forbidden; ",
    "errorType": "IgConfigureVideoError",
    "stackTrace": [
        "IgConfigureVideoError: POST /api/v1/media/configure/?video=1 - 403 Forbidden; ",
        "    at PublishService.video (C:\\Users\\User\\Desktop\\dev\\Insta\\.webpack\\service\\src\\functions\\webpack:\\instagram-private-api\\dist\\services\\publish.service.js:123:1)",        
        "    at C:\\Users\\User\\Desktop\\dev\\Insta\\.webpack\\service\\src\\functions\\webpack:\\src\\functions\\cronFreefireMemes.js:71:31",
        "    at async Promise.all (index 1)",
        "    at main (C:\\Users\\User\\Desktop\\dev\\Insta\\.webpack\\service\\src\\functions\\webpack:\\src\\functions\\cronFreefireMemes.js:47:5)"
    ]
}


    


    I know that the error above is happening because of the size of the video which is longer than 60 seconds.

    


    But I would like to know if there is any way I can format any video to fit the instagram requirements.

    


    Any nodejs library ?