Recherche avancée

Médias (0)

Mot : - Tags -/tags

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

Autres articles (100)

  • 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

  • Création définitive du canal

    12 mars 2010, par

    Lorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
    A la validation, vous recevez un email vous invitant donc à créer votre canal.
    Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
    A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (9123)

  • How to speed up creating video mosaic with ffmpeg

    7 janvier 2020, par DALER RAHIMOV

    I’m looking to speed up ffmpeg pipeline in some way (camera configuration, different filters or any other ideas would be appreciated).

    I have a device that captures videos streams and later creates mosaic video view from 4 cameras. The main issue I’m having is that it’s taking too long to create mosaic video. There is no GPU on the device that could be used to accelerate the process so I’m left with camera configurations (Hikvision).

    Here is what I have so far

    About 160 sec on Intel J-1900 :

    - 5 min video files,
    - 640*480 resolution,
    - h264 encoding,
    - 10 fps,
    - 1024 max bitrate,
    - 10 I-frame interval,      

    Command that I’m using :

    ffmpeg -y -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 \
      -filter_complex " \
         color=c=black:size=1280x720 [base]; \
         [0:v] setpts=PTS-STARTPTS, scale=640x360 [cam0]; \
         [1:v] setpts=PTS-STARTPTS, scale=640x360 [cam1]; \
         [2:v] setpts=PTS-STARTPTS, scale=640x360 [cam2]; \
         [3:v] setpts=PTS-STARTPTS, scale=640x360 [cam3]; \
         [base][cam0] overlay=shortest=1:x=0:y=0  [z1]; \
         [z1][cam1] overlay=shortest=1:x=640:y=0  [z2]; \
         [z2][cam2] overlay=shortest=1:x=0:y=360  [z3]; \
         [z3][cam3] overlay=shortest=1:x=640:y=360 \
       " \
       -an -c:v libx264  -x264-params keyint=10 \
       -movflags faststart -preset fast -nostats -loglevel quiet -r 10.000000 mosaic.mp4

    Thanks

    Here is full output as requested

    ffmpeg -y -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 \
    >    -filter_complex " \
    >       color=c=black:size=1280x720 [base]; \
    >       [0:v] setpts=PTS-STARTPTS, scale=640x360 [cam0]; \
    >       [1:v] setpts=PTS-STARTPTS, scale=640x360 [cam1]; \
    >       [2:v] setpts=PTS-STARTPTS, scale=640x360 [cam2]; \
    >       [3:v] setpts=PTS-STARTPTS, scale=640x360 [cam3]; \
    >       [base][cam0] overlay=shortest=1:x=0:y=0  [z1]; \
    >       [z1][cam1] overlay=shortest=1:x=640:y=0  [z2]; \
    >       [z2][cam2] overlay=shortest=1:x=0:y=360  [z3]; \
    >       [z3][cam3] overlay=shortest=1:x=640:y=360 \
    >     " \
    >     -an -c:v libx264  -x264-params keyint=10 \
    >     -movflags faststart -preset fast -nostats -r 10.000000 mosaic.mp4
    ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
     configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg -y -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4    -filter_complex " \
         color=c=black:size=1280x720 [base]; \
         [0:v] setpts=PTS-STARTPTS, scale=640x360 [cam0]; \
         [1:v] setpts=PTS-STARTPTS, scale=640x360 [cam1]; \
         [2:v] setpts=PTS-STARTPTS, scale=640x360 [cam2]; \
         [3:v] setpts=PTS-STARTPTS, scale=640x360 [cam3]; \
         [base][cam0] overlay=shortest=1:x=0:y=0  [z1]; \
         [z1][cam1] overlay=shortest=1:x=640:y=0  [z2]; \
         [z2][cam2] overlay=shortest=1:x=0:y=360  [z3]; \
         [z3][cam3] overlay=shortest=1:x=640:y=360 \
       "     -an -c:v libx264  -x264-params keyint=10     -movflags faststart -preset fast -r 10.000000 mosaic.mp4
    ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
     configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
     libavutil      54. 31.100 / 54. 31.100
     libavcodec     56. 60.100 / 56. 60.100
     libavformat    56. 40.101 / 56. 40.101
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 40.101 /  5. 40.101
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  2.101 /  1.  2.101
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1578324600-1-stitched.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.40.101
     Duration: 00:05:00.07, start: 0.000000, bitrate: 96 kb/s
       Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x480, 95 kb/s, 10 fps, 25 tbr, 10240 tbn, 20 tbc (default)
       Metadata:
         handler_name    : VideoHandler
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '1578324600-1-stitched.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.40.101
     Duration: 00:05:00.07, start: 0.000000, bitrate: 96 kb/s
       Stream #1:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x480, 95 kb/s, 10 fps, 25 tbr, 10240 tbn, 20 tbc (default)
       Metadata:
         handler_name    : VideoHandler
    Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '1578324600-1-stitched.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.40.101
     Duration: 00:05:00.07, start: 0.000000, bitrate: 96 kb/s
       Stream #2:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x480, 95 kb/s, 10 fps, 25 tbr, 10240 tbn, 20 tbc (default)
       Metadata:
         handler_name    : VideoHandler
    Input #3, mov,mp4,m4a,3gp,3g2,mj2, from '1578324600-1-stitched.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.40.101
     Duration: 00:05:00.07, start: 0.000000, bitrate: 96 kb/s
       Stream #3:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x480, 95 kb/s, 10 fps, 25 tbr, 10240 tbn, 20 tbc (default)
       Metadata:
         handler_name    : VideoHandler
    [libx264 @ 0x171c9e0] using SAR=1/1
    [libx264 @ 0x171c9e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
    [libx264 @ 0x171c9e0] profile High, level 3.1
    [libx264 @ 0x171c9e0] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=10 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'mosaic.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.40.101
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 10 fps, 10240 tbn, 10 tbc (default)
       Metadata:
         encoder         : Lavc56.60.100 libx264
    Stream mapping:
     Stream #0:0 (h264) -> setpts
     Stream #1:0 (h264) -> setpts
     Stream #2:0 (h264) -> setpts
     Stream #3:0 (h264) -> setpts
     overlay -> Stream #0:0 (libx264)
    Press [q] to stop, [?] for help
    [mp4 @ 0x1730600] Starting second pass: moving the moov atom to the beginning of the filerop=4497
    frame= 3002 fps= 17 q=-1.0 Lsize=   51052kB time=00:05:00.00 bitrate=1394.1kbits/s dup=0 drop=4498
    video:51017kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.068308%
    [libx264 @ 0x171c9e0] frame I:301   Avg QP:15.80  size:154257
    [libx264 @ 0x171c9e0] frame P:959   Avg QP:21.69  size:  5486
    [libx264 @ 0x171c9e0] frame B:1742  Avg QP:22.73  size:   315
    [libx264 @ 0x171c9e0] consecutive B-frames: 22.0%  0.0%  5.8% 72.2%
    [libx264 @ 0x171c9e0] mb I  I16..4:  9.7% 31.0% 59.4%
    [libx264 @ 0x171c9e0] mb P  I16..4:  0.6%  0.7%  0.2%  P16..4: 14.5%  2.8%  2.4%  0.0%  0.0%    skip:78.7%
    [libx264 @ 0x171c9e0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  2.7%  0.3%  0.0%  direct: 1.4%  skip:95.5%  L0:25.9% L1:73.3% BI: 0.9%
    [libx264 @ 0x171c9e0] 8x8 transform intra:31.8% inter:43.5%
    [libx264 @ 0x171c9e0] coded y,uvDC,uvAC intra: 83.2% 85.2% 69.5% inter: 3.0% 6.3% 0.7%
    [libx264 @ 0x171c9e0] i16 v,h,dc,p: 35% 21%  8% 36%
    [libx264 @ 0x171c9e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 42% 10%  3%  2%  3%  6%  4%  5%
    [libx264 @ 0x171c9e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 33%  9%  6%  5%  5%  7%  5%  6%
    [libx264 @ 0x171c9e0] i8c dc,h,v,p: 44% 29% 20%  7%
    [libx264 @ 0x171c9e0] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x171c9e0] ref P L0: 93.8%  6.2%
    [libx264 @ 0x171c9e0] ref B L0: 91.7%  8.3%
    [libx264 @ 0x171c9e0] ref B L1: 89.3% 10.7%
    [libx264 @ 0x171c9e0] kb/s:1392.16
  • Speed up the FFmpeg process time in Android

    19 septembre 2019, par Yogesh Paliyal

    I want to loop video until the sound stops, everything works good but it takes too much time.
    if my audio file length is 4 minutes then it takes approx of 4 minutes & the size is also too much, here is my command

    String[] cmd = new String[]{"-i",audioFile.getAbsolutePath(),"-filter_complex","movie="+videoFile.getAbsolutePath()+":loop=0,setpts=N/(FRAME_RATE*TB)","-c","copy","-y",createdFile.getAbsolutePath()};
  • how to get time bitrate, q and speed from ffmpeg using ffprobe ?

    24 décembre 2016, par user2631534

    i im using node js that creates and start ffmpeg for restream using pipe function that works but i im unable to get from stdout.pipe ffmpeg informations about started stream : bitrate, speed, time and q.

    this is what i get when i start ffmpeg using : ./ffmpeg -i http://serverip :/stream1.ts

    frame= 710 fps = 65 q=1.0 Lsize = 4974kB time=00:00:28.33 bitrate = 1437.9kbits/s speed = 2.61x

    and i would like to read into string this parameters so that i can write in mysql database and later show in datatables info...how to get frame, fps, q, time, bitrate and speed value into javascript variable so that i can use it later ?

    i im starting ffmpeg using this :

    function listener(id, stream_url) {
                   /* LISTENER - ffmpeg */
                   streams[id].on('close', function() {
                       /* START - stream */
                       stream(id, stream_url);
                   });
               }

               function stream(id, stream_url) {
                   /* START - ffmpeg */
                   streams[id] = child_process.spawn(process.env.PWD + "/node_modules/ffmpeg-static/bin/linux/x64/ffmpeg", [
                       "-re",                                                              /* STREAM - realtime    */
                       "-y",                                                               /* OVERWRITE - output file */
                       "-hide_banner",                                                     /* BANNER - hide        */
                       "-loglevel", "quiet",                                               /* LOG    - hide        */
                       "-i", stream_url,                                                   /* STREAM - source      */
                       "-vcodec", "copy",
                       "-reset_timestamps", "1",
                       "-movflags", "frag_keyframe+empty_moov",
                       "-f", "mpegts",
                       "-"
                   ], { detached: false });

                   /* LISTENER - ffmpeg */
                   listener(id, stream_url);
               }

               /* LOOP - throught all streams */
               for (var i in rows) {
                   /* CHECK - ffmpeg */
                   if (!streams[rows[i].id])  {

                       /* START - stream */
                       stream(rows[i].id, rows[i].stream);
                   };
               };

    And showing stream using :

    streamRoutes.get('/stream2', function(req, res) {
    /* STREAM - header */
    res.writeHead(200, {
     'Content-Type': 'video/H264'
    });            

    /* PIPE - stream to client */
    streams[2].stdout.pipe(res);

    ffprobe(streams[2].stdout, { path: ffprobeStatic.path }, function (err, info) {

           console.log(info);
       });

    }) ;

    i try using ffprobe input stream as stdout from ffmpeg that is read from memory but i get undefined in console.log....

    UPDATED QUESTION :

    i save file using this code to HDD and then read frpm fluent-ffmpeg-extended metadata and i im getting correct JSON data (duration, bitrate, resolution, time etc...) but i would like not to save stream to HDD to get informations...i would like to get from memory stream and get this informations...but fluent-ffmpeg-extended accept only local input file on HDD not stream (http link), how can i enter stream link into fluent-ffmpeg to get this infomations from memory (stdout.pipe) ?

    var inputfile = "http://myserverip/stream/ -vcodec copy -f mpegts 1.ts";
    var exec = require('child_process').exec;
    exec("/root/mediaxtream-codes/node_modules/ffmpeg-static/bin/linux/x64/ffmpeg" + ' -i ' + inputfile, function(err, stdout, stderr) {
       console.log(stdout);
    });

    function check() {
       var Metalib = require('fluent-ffmpeg-extended').Metadata;
       var metaObject = new Metalib("1.ts", function(metadata, err) {
           console.log(require('util').inspect(metadata, false, null));
       });
       setTimeout(check, 1000);
    };
    setTimeout(check, 1000);

    And form console.log in terminal i get correct informations every seconds :

    { ffmpegversion: '3.1',
    title: '',
    artist: '',
    album: '',
    track: '',
    date: '',
    durationraw: '00:02:02.08',
    durationsec: 122,
    synched: false,
    major_brand: undefined,
    video:
    { container: 'mpegts',
      bitrate: 2058,
      codec: 'h264',
      resolution: { w: 1280, h: 720 },
      resolutionSquare: { w: 1280, h: 720 },
      rotate: 0,
      fps: 25,
      stream: 0,
      aspectString: '16:9',
      aspect: 1.7777777777777777,
      pixelString: '1:1',
      pixel: 1 },
    audio: { codec: 'mp2', bitrate: 384, sample_rate: 48000, stream: 0 } }