Recherche avancée

Médias (1)

Mot : - Tags -/sintel

Autres articles (90)

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

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

Sur d’autres sites (8377)

  • FFMpeg crop a portrait (vertical) video square 1:1

    1er avril 2022, par hugger

    SOLVED... It was a UI issue... Not an FFpeg issue.

    


    I am new to FFMpeg. I am stuck on cropping a portrait video taken from a portrait device square.

    


    I would like my video output to be 1080x1080.

    


    First, I tried this.

    


    FFmpegKit.execute(`-y -i ${media.path} -vf "crop=1080:1080:exact=1" ${path}`)


    


    As I hoped, this worked for photos. (but strangely rotates the photo) - looking into that...

    


    BUT, for videos it does not work. instead it turns the video landscape.

    


    I then tried to add scale :

    


    FFmpegKit.execute(`-y -i ${media.path} -vf "crop=1080:1080:exact=1, scale=1080:1080" ${path}`)


    


    But this left me with the same result.

    


    Here are the console logs for some more information :

    


     LOG  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:///private/var/mobile/Containers/Data/Application/71E462FC-4824-41FE-B28D-57AF7B6078C3/tmp/ReactNative/329ACC6F-42B6-4B12-A289-889DADE1BC3A.mov':
 LOG    Metadata:
 LOG      major_brand     :
 LOG  qt
 LOG  
 LOG      minor_version   :
 LOG  0
 LOG  
 LOG      compatible_brands:
 LOG  qt
 LOG  
 LOG      creation_time   :
 LOG  2022-04-01T03:41:12.000000Z
 LOG  
 LOG    Duration:
 LOG  00:00:02.35
 LOG  , start:
 LOG  0.000000
 LOG  , bitrate:
 LOG  21200 kb/s
 LOG  
 LOG    Stream #0:0
 LOG  [0x1]
 LOG  (und)
 LOG  : Video: hevc (hvc1 / 0x31637668), yuv420p(tv, bt709), 1080x1920, 21140 kb/s
 LOG  ,
 LOG  59.96 fps,
 LOG  59.94 tbr,
 LOG  600 tbn
 LOG   (default)
 LOG  
 LOG      Metadata:
 LOG        creation_time   :
 LOG  2022-04-01T03:41:13.000000Z
 LOG  
 LOG        handler_name    :
 LOG  Core Media Video
 LOG  
 LOG        vendor_id       :
 LOG  [0][0][0][0]
 LOG  
 LOG        encoder         :
 LOG  HEVC
 LOG  
 LOG    Stream #0:1
 LOG  [0x2]
 LOG  (und)
 LOG  : Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 61 kb/s
 LOG   (default)
 LOG  
 LOG      Metadata:
 LOG        creation_time   :
 LOG  2022-04-01T03:41:13.000000Z
 LOG  
 LOG        handler_name    :
 LOG  Core Media Audio
 LOG  
 LOG        vendor_id       :
 LOG  [0][0][0][0]
 LOG  
 LOG  [hevc @ 0x118ce07d0] The "sub_text_format" option is deprecated: Deprecated, does nothing
 LOG  [aac @ 0x10d30e190] The "sub_text_format" option is deprecated: Deprecated, does nothing
 LOG  Stream mapping:
 LOG    Stream #0:0 -> #0:0
 LOG   (hevc (native) -> mpeg4 (native))
 LOG  
 LOG    Stream #0:1 -> #0:1
 LOG   (aac (native) -> aac (native))
 LOG  
 LOG  Press [q] to stop, [?] for help
 LOG  Output #0, mp4, to '/var/mobile/Containers/Data/Application/71E462FC-4824-41FE-B28D-57AF7B6078C3/Documents/after.mp4':
 LOG    Metadata:
 LOG      major_brand     :
 LOG  qt
 LOG  
 LOG      minor_version   :
 LOG  0
 LOG  
 LOG      compatible_brands:
 LOG  qt
 LOG  
 LOG      encoder         :
 LOG  Lavf59.10.100
 LOG  
 LOG    Stream #0:0
 LOG  (und)
 LOG  : Video: mpeg4 (mp4v / 0x7634706D), yuv420p(tv, bt709, progressive), 1080x1080, q=2-31, 10000 kb/s
 LOG  ,
 LOG  59.94 fps,
 LOG  60k tbn
 LOG   (default)
 LOG  
 LOG      Metadata:
 LOG        creation_time   :
 LOG  2022-04-01T03:41:13.000000Z
 LOG  
 LOG        handler_name    :
 LOG  Core Media Video
 LOG  
 LOG        vendor_id       :
 LOG  [0][0][0][0]
 LOG  
 LOG        encoder         :
 LOG  Lavc59.15.102 mpeg4
 LOG  
 LOG      Side data:
 LOG  
 LOG  cpb:
 LOG  bitrate max/min/avg: 0/0/10000000 buffer size: 0
 LOG  vbv_delay: N/A
 LOG  
 LOG    Stream #0:1
 LOG  (und)
 LOG  : Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s
 LOG   (default)
 LOG  
 LOG      Metadata:
 LOG        creation_time   :
 LOG  2022-04-01T03:41:13.000000Z
 LOG  
 LOG        handler_name    :
 LOG  Core Media Audio
 LOG  
 LOG        vendor_id       :
 LOG  [0][0][0][0]
 LOG  
 LOG        encoder         :
 LOG  Lavc59.15.102 aac
 LOG  
 LOG  frame=    1 fps=0.0 q=3.6 size=       0kB time=00:00:01.06 bitrate=   0.3kbits/s speed=9.23x
 LOG  frame=   47 fps=0.0 q=2.0 size=     768kB time=00:00:01.85 bitrate=3390.0kbits/s speed=3.01x
 LOG  frame=   95 fps= 81 q=2.2 size=    1792kB time=00:00:02.32 bitrate=6313.3kbits/s speed=1.99x
 LOG  frame=  129 fps= 77 q=2.5 size=    2560kB time=00:00:02.32 bitrate=9018.9kbits/s speed=1.39x
 LOG  frame=  139 fps= 78 q=2.6 Lsize=    2953kB time=00:00:02.38 bitrate=10124.6kbits/s speed=1.34x
 LOG  video:2929kB audio:20kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead:
 LOG  0.136336%
 LOG  
 LOG  [aac @ 0x112820f50] Qavg: 113.412
 LOG  COMPLETED
 LOG  {}


    


    This is the result, when i replace
-i {media} with
-f lavfi -i smptebars=r=60000/1001:s=1080x1920:d=1

    


    enter image description here

    


    ALMOST but not 1:1...

    


    I have not had any luck online trying to find a solution for this so I have decided to post on here.

    


    I hope I can get some guidance here !

    


    Cheers.

    


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

    


  • Recording a webpage stream with multiple requests using PhantomJS & ffmpeg to /dev/stdout leads to ffmpeg error

    2 septembre 2016, par Allisson Ferreira

    First of all, sorry for my english.

    I’m in a quest for days. I’ve researched everywhere and I couldn’t find an answer to my problem.

    I’m using Nodejs, Phantomjs and ffmpeg in this scenary :

    • An user enters the site, login with facebook and he can ask for a video with his name and some random photos (gathered by /me/ & sent via JSON POST) ;
    • Node receive the user data, creates a child process (PhantomJS + ffmpeg) and awaits for a response to send the video URL to the user.

    When I run a single instance of this request, everything is working fine. BUT, when two or more users make the request, only one video is sent and the others process end up in a ffmpeg stream error.

    I think the reason is that all the ffmpeg processes are using the same place (/dev/stdout). Since one process is already using it, the others enters in a "can’t access" error. But it is a assumption, I don’t know how /dev/stdout really works.

    Here are my codes. (I have removed some lines and renamed some variables for better understanding, sorry for any mistake)

    index.js :

    var generateVideo = 'phantomjs phantom.js '+videoID+' '+userID+' | ffmpeg -vcodec png -f image2pipe -r 30 -i - -pix_fmt yuv420p public/videos/'+userID+'/'+videoID+'.mp4 -y';

    childProcess.exec(generateVideo, function(err, stdout, stderr) {
       var json    = {};
       json.video  = '/videos/'+userID+'/'+videoID+'.mp4';
       res.send(json);
    });

    phantom.js :

    var page            = require('webpage').create();
    page.viewportSize   = { width: 1366, height: 768 };
    page.settings.resourceTimeout = 10000;

    var args            = require('system').args;
    var videoID         = args[1];
    var userID          = args[2];

    page.open('http://localhost:3000/recordvideo/'+videoID, 'post', function(status){
       var frame       = 0;
       var target_fps  = 30;
       var maxframes   = page.evaluate(function () {
                           return getTotalDurationInSeconds();
                       }) * target_fps;

       setInterval(function(){
           page.render('/dev/stdout', { format: "png" });
           if( frame >= maxframes ){
               phantom.exit();
           }
           frame++;
       }, (1000 / target_fps));
    });

    And the error :

    [Error: Command failed: /bin/sh -c phantomjs phantom.js XXXXXXXX XXXXXXXX | ffmpeg -vcodec png -f image2pipe -r 30 -i - -pix_fmt yuv420p public/videos/XXXXXXXX/XXXXXXXX.mp4 -y
    www-0 ffmpeg version N-80901-gfebc862 Copyright (c) 2000-2016 the FFmpeg developers
    www-0   built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
    www-0   configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab
    www-0   libavutil      55. 28.100 / 55. 28.100
    www-0   libavcodec     57. 48.101 / 57. 48.101
    www-0   libavformat    57. 41.100 / 57. 41.100
    www-0   libavdevice    57.  0.102 / 57.  0.102
    www-0   libavfilter     6. 47.100 /  6. 47.100
    www-0   libavresample   3.  0.  0 /  3.  0.  0
    www-0   libswscale      4.  1.100 /  4.  1.100
    www-0   libswresample   2.  1.100 /  2.  1.100
    www-0   libpostproc    54.  0.100 / 54.  0.100
    www-0 [png @ 0x3d7c4a0] Invalid PNG signature 0x46726F6D20506861.
    www-0 [image2pipe @ 0x3d72780] decoding for stream 0 failed
    www-0 [image2pipe @ 0x3d72780] Could not find codec parameters for stream 0 (Video: png, none(pc)): unspecified size
    www-0 Consider increasing the value for the 'analyzeduration' and 'probesize' options
    www-0 Input #0, image2pipe, from 'pipe:':
    www-0   Duration: N/A, bitrate: N/A
    www-0     Stream #0:0: Video: png, none(pc), 30 tbr, 30 tbn, 30 tbc
    www-0 [buffer @ 0x3d81540] Unable to parse option value "0x0" as image size
    www-0 [buffer @ 0x3d81540] Unable to parse option value "-1" as pixel format
    www-0 [buffer @ 0x3d81540] Unable to parse option value "0x0" as image size
    www-0 [buffer @ 0x3d81540] Error setting option video_size to value 0x0.
    www-0 [graph 0 input from stream 0:0 @ 0x3d72600] Error applying options to the filter.
    www-0 Error opening filters!
    www-0 ]

    I really hope that I can find an answer here !
    And sorry if there already is an answer for this. But I researched for days.

    Thank you in advance !