Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

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

Autres articles (72)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (3004)

  • why would ffmpeg rotate 2nd video on concatenation when I don't want it to or seemingly ask for it ?

    10 janvier 2023, par Pompey Magnus

    here is the command I run :

    


    ffmpeg -f concat -an -i ./files.txt ztestout.mp4


    


    I have about 5 videos, but just to test I did with two.
the 2nd video gets flipped upside down, even though opening each video in VLC opens and plays them correctly.

    


    Any ideas why it would do that ? Is the metadata wrong in the video ? I took all the videos I'm trying to concat with the same android phone.

    


    output below, and I noticed its says rotation zero degrees :

    


    ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with Apple clang version 14.0.0 (clang-1400.0.29.102)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.1.2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-neon
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x138804730] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from './files.txt':
  Duration: N/A, start: 0.000000, bitrate: 17255 kb/s
  Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, smpte170m, progressive), 1920x1080, 16999 kb/s, SAR 1:1 DAR 16:9, 30.01 fps, 30 tbr, 90k tbn
    Metadata:
      creation_time   : 2023-01-08T13:32:50.000000Z
      handler_name    : VideoHandle
      vendor_id       : [0][0][0][0]
    Side data:
      displaymatrix: rotation of -180.00 degrees
  Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s
    Metadata:
      creation_time   : 2023-01-08T13:32:50.000000Z
      handler_name    : SoundHandle
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x137f07fe0] using SAR=1/1
[libx264 @ 0x137f07fe0] using cpu capabilities: ARMv8 NEON
[libx264 @ 0x137f07fe0] profile High, level 4.0, 4:2:0, 8-bit
[libx264 @ 0x137f07fe0] 264 - core 164 r3095 baee400 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 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=15 lookahead_threads=2 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=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 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 'ztestout.mp4':
  Metadata:
    encoder         : Lavf59.27.100
  Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuvj420p(pc, smpte170m, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 30 fps, 15360 tbn
    Metadata:
      creation_time   : 2023-01-08T13:32:50.000000Z
      handler_name    : VideoHandle
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.37.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
      displaymatrix: rotation of -0.00 degrees
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x138904b40] Auto-inserting h264_mp4toannexb bitstream filterdrop=20 speed=3.67x    
frame=74497 fps=109 q=-1.0 Lsize= 1740353kB time=00:41:23.13 bitrate=5741.5kbits/s dup=0 drop=25 speed=3.64x    
video:1739531kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.047236%
[libx264 @ 0x137f07fe0] frame I:300   Avg QP:20.73  size:294110
[libx264 @ 0x137f07fe0] frame P:29265 Avg QP:23.65  size: 45500
[libx264 @ 0x137f07fe0] frame B:44932 Avg QP:27.95  size:  8045
[libx264 @ 0x137f07fe0] consecutive B-frames: 19.4%  0.4%  0.7% 79.5%
[libx264 @ 0x137f07fe0] mb I  I16..4:  5.5% 43.8% 50.7%
[libx264 @ 0x137f07fe0] mb P  I16..4:  0.2%  0.9%  0.7%  P16..4: 36.9% 13.9% 10.8%  0.0%  0.0%    skip:36.6%
[libx264 @ 0x137f07fe0] mb B  I16..4:  0.0%  0.1%  0.1%  B16..8: 30.0%  3.0%  1.3%  direct: 1.1%  skip:64.3%  L0:38.1% L1:55.8% BI: 6.1%
[libx264 @ 0x137f07fe0] 8x8 transform intra:49.7% inter:45.0%
[libx264 @ 0x137f07fe0] coded y,uvDC,uvAC intra: 84.0% 82.3% 41.9% inter: 12.8% 10.8% 0.5%
[libx264 @ 0x137f07fe0] i16 v,h,dc,p: 30% 17%  8% 45%
[libx264 @ 0x137f07fe0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 25% 12%  4%  7%  7% 12%  7%  8%
[libx264 @ 0x137f07fe0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 25% 12%  5%  7%  7% 10%  6%  8%
[libx264 @ 0x137f07fe0] i8c dc,h,v,p: 47% 22% 22%  9%
[libx264 @ 0x137f07fe0] Weighted P-Frames: Y:0.3% UV:0.0%
[libx264 @ 0x137f07fe0] ref P L0: 70.3% 10.7% 13.9%  5.0%  0.0%
[libx264 @ 0x137f07fe0] ref B L0: 91.8%  6.2%  2.0%
[libx264 @ 0x137f07fe0] ref B L1: 95.7%  4.3%
[libx264 @ 0x137f07fe0] kb/s:5738.58


    


  • How to overlay two mp3 audio files with different bitrates using fluent-ffmpeg

    7 janvier 2023, par Alex P Mnz

    I am trying to overlay one mp3 file (a speech track, the file name for which is passed into the below function) on top of another (a background music track, the url of which is passed into the function), so that they both play simultaneously, using NodeJS and fluent-ffmpeg.

    


    What happens when I call the function is that I get an output file which 1) only plays the background audio track, and 2) upon opening the output track, the time seeker skips straight to where the end of the first audio track would have been (around 1 minute 30 seconds).

    


    I'd like to in the first instance have them play at the same time as each other in the output file, without this skipping ahead effect (even if I drag the slider back to within the first 1 minute 30, it just jumps straight back to 1 minute 31 seconds - as if somehow there was no data in that first minute and a half).

    


    In the second instance, I'd also like to have the background audio track loop until the first track finishes, so any help with that as part of an answer would be very much appreciated. But the immediate problem is just getting the two audios to actually play simultaneously starting from 0 seconds.

    


    I have tried the below to get to this point :

    


    const fs = require('fs');
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffmpeg = require('fluent-ffmpeg');
ffmpeg.setFfmpegPath(ffmpegPath);
var ffprobe = require('ffprobe-static');
ffmpeg.setFfprobePath(ffprobe.path);
const axios = require('axios');
const crypto = require('crypto');
const path = require('path');


const overlayBackgroundAudio = async (inputFileName, backgroundFileUrl) => {

    const backgroundTrack = await axios({
        method: 'GET',
        url: backgroundFileUrl,
        responseType: 'arraybuffer'
    });

    // write a file with the retrieved background audio track
    const backgroundTrackFileName = crypto.randomBytes(12).toString('hex');
    fs.writeFileSync(`${backgroundTrackFileName}.mp3`, backgroundTrack.data); //todo - delete after


    // set the name of the output file
    const newFileName = crypto.randomBytes(12).toString('hex');
    const outputFileName = `${newFileName}.mp3`;

    // run the relevant ffmpeg commands

    const overlayTracks = async () => {
    
        return new Promise((resolve, reject) => {
            ffmpeg()
                .input(`${inputFileName}.mp3`)
                .input(`${backgroundTrackFileName}.mp3`)
                .complexFilter([
                    {
                      filter: 'volume',
                      options: '1',
                      inputs: '[0:0]',
                      outputs: '[a]'
                    },
                    {
                      filter: 'volume',
                      options: '1',
                      inputs: '[1:0]',
                      outputs: '[b]'
                    },
                    {
                        filter: 'adelay',
                        options: '0',
                        inputs: '[a]',
                        outputs: '[a1]'
                    },
                    {
                        filter: 'adelay',
                        options: '0|0',
                        inputs: '[b]',
                        outputs: '[b1]'
                    },
                    {
                      filter: 'amix',
                      options: 'inputs=2:duration=first',
                      inputs: '[a1][b1]',
                      outputs: '[out]'
                    }
                ])
                .outputOptions(['-map', '[out]', outputFileName])
                .output(outputFileName)
                .on('end', function() {
                    resolve(outputFileName);
                })
                .on('stderr', console.log) // log ffmpeg output to console
                .on('error', function(err) {
                    console.log(`An error occurred overlaying tracks: ${err.message}`);
                    reject(err);
                })
                .run()
        })
    }

    const overlaidTracksFileName = await overlayTracks();

    console.log('overlaid file name:', overlaidTracksFileName)

    return overlaidTracksFileName;
   
}

module.exports = overlayBackgroundAudio;


    


    Here is what the ffmpeg library is logging to my console (which may help in figuring out why this is not working as intended) :

    


    Input #0, mp3, from '95c8ec8ccbb100d2bfe81ffd.mp3':
  Metadata:
    encoder         : Lavf58.24.101
  Duration: 00:02:41.42, start: 0.046042, bitrate: 48 kb/s
    Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 48 kb/s
[mp3 @ 000002c77978ddc0] Estimating duration from bitrate, this may be inaccurate
Input #1, mp3, from '14e70bbd339b612e96f29017.mp3':
  Metadata:
    date            : 2022-12-30 17:56
    id3v2_priv.XMP  : <?xpacket begin="\xef\xbb\xbf" id="W5M0MpCehiHzreSzNTczkc9d"?>\x0a\x0a \x0a  s
    Stream #1:0: Audio: mp3, 48000 Hz, stereo, fltp, 192 kb/s
Stream mapping:
  Stream #0:0 (mp3float) -> volume (graph 0)
  Stream #1:0 (mp3float) -> volume (graph 0)
  amix (graph 0) -> Stream #0:0 (libmp3lame)
  Stream #1:0 -> #1:0 (mp3 (mp3float) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to '0c0404b793d488bf38e882a0.mp3':
  Metadata:
    TSSE            : Lavf58.24.101
    Stream #0:0: Audio: mp3 (libmp3lame), 24000 Hz, mono, fltp (default)
    Metadata:
      encoder         : Lavc58.42.102 libmp3lame
Output #1, mp3, to '0c0404b793d488bf38e882a0.mp3':
  Metadata:
    TSSE            : Lavf58.24.101
    Stream #1:0: Audio: mp3 (libmp3lame), 48000 Hz, stereo, fltp
    Metadata:
      encoder         : Lavc58.42.102 libmp3lame




    


    Thank you very much in advance for any help that you can try to provide !

    


  • ffmpeg not capture screenshot on siteground

    20 mars 2023, par saddam

    I'm using ffmpeg (v5.1) in laravel with PHP 7.4

    


    //where to save the image  
$new_file_name = time() . '.jpg';
$image = public_path() . '/uploads/images/' . $new_file_name; //Full path of image
$path = public_path() . '/uploads/' . $path;   //Full path of video
//ffmpeg command to find thumbnail from video
$interval = env('PLAEHOLDER_CAPTURE_TIME', 2);  //time to take screenshot at  
$cmd = "ffmpeg -i $path -ss 00:00:01 -vframes 1 $image 2>&1";
exec($cmd, $output);
var_dump($output); 
exit;


    


    It's throwing an error :

    


    


    array(32) [0]=> string(64) "ffmpeg version 5.1 Copyright (c) 2000-2022 the FFmpeg developers" [1]=> string(25) " built with gcc 12 (GCC)" [2]=> string(128) " configuration : —enable-pic —enable-static —disable-ffplay —disable-ffprobe —disable-doc —disable-avdevice —disable-alsa" [3]=> string(40) " libavutil 57. 28.100 / 57. 28.100" [4]=> string(40) " libavcodec 59. 37.100 / 59. 37.100" [5]=> string(40) " libavformat 59. 27.100 / 59. 27.100" [6]=> string(40) " libavfilter 8. 44.100 / 8. 44.100" [7]=> string(40) " libswscale 6. 7.100 / 6. 7.100" [8]=> string(40) " libswresample 4. 7.100 / 4. 7.100" [9]=> string(130) "Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/customer/www/backend.clavora.com/public_html/public/uploads/videos/1679277906.mp4' :" [10]=> string(11) " Metadata :" [11]=> string(26) " major_brand : isom" [12]=> string(25) " minor_version : 512" [13]=> string(39) " compatible_brands : isomiso2avc1mp41" [14]=> string(35) " encoder : Lavf58.45.100" [15]=> string(59) " Duration : 00:00:32.58, start : 0.000000, bitrate : 515 kb/s" [16]=> string(161) " Stream #0:00x1 : Video : h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 576x1024 [SAR 1:1 DAR 9:16], 380 kb/s, 30 fps, 30 tbr, 15360 tbn (default)" [17]=> string(13) " Metadata :" [18]=> string(56) " handler_name : ?Mainconcept Video Media Handler" [19]=> string(36) " vendor_id : [0][0][0][0]" [20]=> string(104) " Stream #0:10x2 : Audio : aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 129 kb/s (default)" [21]=> string(13) " Metadata :" [22]=> string(60) " handler_name : #Mainconcept MP4 Sound Media Handler" [23]=> string(36) " vendor_id : [0][0][0][0]" [24]=> string(15) "Stream mapping :" [25]=> string(55) " Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))" [26]=> string(31) "Press [q] to stop, [?] for help" [27]=> string(78) "[auto_scale_0 @ 0x564f48c3b180] Failed to configure output pad on auto_scale_0" [28]=> string(29) "Error reinitializing filters !" [29]=> string(76) "Failed to inject frame into filter network : Resource temporarily unavailable" [30]=> string(55) "Error while processing the decoded data for stream #0:0" [31]=> string(18) "Conversion failed !"