Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (61)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

Sur d’autres sites (3887)

  • FFMPEG in an AWS Lambda will only output 5 seconds of converted video [duplicate]

    5 juin 2021, par beerandsmiles

    I've been looking for a solution for this issue, but I can't seem to find what's going wrong.

    &#xA;

    In short, I'm using an AWS Lambda to convert video captured from an raspberry pi in a raw .h264 format to .mp4. The problem is that the output file is always, only 5 seconds long.

    &#xA;

    So I input a video of say 500mb, that is 10 minutes long, and the output is an mp4 that is exactly the first 5 seconds of the source video.

    &#xA;

    The lambda has been setup following the tutorial from Amazon that is shown here :&#xA;https://aws.amazon.com/blogs/media/processing-user-generated-content-using-aws-lambda-and-ffmpeg/

    &#xA;

    It is triggered by an upload from one s3 buckets, transcodes, and puts it in a different bucket. The purpose is to store a high quality copy of the video that is smaller to save costs. (this is a personal project, so I'm paying personally)

    &#xA;

    I've put the full code of the lambda down below.&#xA;I had trouble using their recommended stdout method as that resulted in a file being created with a size of 0 bytes.

    &#xA;

    You'll see a few commented lines where I tried different things to solve it. I thought it best to leave that in while asking the questions so you can see what I've done. Firstly the method of using stdout piped directly into the output S3 did not work, so I stored the output file in lambda's /tmp directory.

    &#xA;

    However, when I first did this using the signed link as the input it gave me 5 seconds of the input video.

    &#xA;

    Thinking this had to do with an issue in the stream that FFMPEG was getting, I tried instead to download the file from the first S3 bucket into the temp folder, then convert it, and then upload it.

    &#xA;

    The actual FFMPEG command is quite simple

    &#xA;

    f"/opt/bin/ffmpeg -framerate 25 -i {s3_source_key} output.mp4"

    &#xA;

    But this outputs a 5 second video.

    &#xA;

    I have also tried using different versions of FFMPEG for the layer with lambda and no help. Also, I have set and execution timeout of 2 minutes with 2gb or ram for this lambda.

    &#xA;

    The last thing, is that running this command on a linux machine, such as a raspberry pi directly, results in an mp4 of the correct length, only in the lambda am I having this problem.

    &#xA;

    I'm completely lost, and I can't seem to find any documentation on this happening to anyone else.

    &#xA;

    import os&#xA;import subprocess&#xA;import shlex&#xA;import boto3&#xA;from time import sleep&#xA;&#xA;S3_DESTINATION_BUCKET = "dashcam-duncan"&#xA;SIGNED_URL_TIMEOUT = 600&#xA;&#xA;def lambda_handler(event, context):&#xA;    print(event)&#xA;    os.chdir(&#x27;/tmp&#x27;)&#xA;    s3_source_bucket = event[&#x27;Records&#x27;][0][&#x27;s3&#x27;][&#x27;bucket&#x27;][&#x27;name&#x27;]&#xA;    s3_source_key = event[&#x27;Records&#x27;][0][&#x27;s3&#x27;][&#x27;object&#x27;][&#x27;key&#x27;]&#xA;&#xA;    s3_source_basename = os.path.splitext(os.path.basename(s3_source_key))[0]&#xA;    s3_destination_filename = s3_source_basename &#x2B; ".mp4"&#xA;&#xA;    s3_client = boto3.client(&#x27;s3&#x27;)&#xA;    s3_source_signed_url = s3_client.generate_presigned_url(&#x27;get_object&#x27;,&#xA;        Params={&#x27;Bucket&#x27;: s3_source_bucket, &#x27;Key&#x27;: s3_source_key},&#xA;        ExpiresIn=SIGNED_URL_TIMEOUT)&#xA;    print(s3_source_signed_url)&#xA;    s3_client.download_file(s3_source_bucket,s3_source_key,s3_source_key)&#xA;    # ffmpeg_cmd = "/opt/bin/ffmpeg -framerate 25 -i \"" &#x2B; s3_source_signed_url &#x2B; "\" output.mp4 "&#xA;    ffmpeg_cmd = f"/opt/bin/ffmpeg -framerate 25 -i {s3_source_key} output.mp4 "&#xA;    # command1 = shlex.split(ffmpeg_cmd)&#xA;    # print(command1)&#xA;    os.system(ffmpeg_cmd)&#xA;    # os.system(&#x27;ls&#x27;)&#xA;    # p1 = subprocess.run(command1, stdout=subprocess.PIPE, stderr=subprocess.PIPE)&#xA;    file = &#x27;output.mp4&#x27;&#xA;    resp = s3_client.put_object(Body=open(file,"rb"), Bucket=S3_DESTINATION_BUCKET, Key=s3_destination_filename)&#xA;    # resp = s3_client.put_object(Body=p1.stdout, Bucket=S3_DESTINATION_BUCKET, Key=s3_destination_filename)&#xA;    s3 = boto3.resource(&#x27;s3&#x27;)&#xA;    s3.Object(s3_source_bucket,s3_source_key).delete()&#xA;    return {&#xA;        &#x27;statusCode&#x27;: 200,&#xA;        &#x27;body&#x27;: json.dumps(&#x27;Processing complete successfully&#x27;)&#xA;    }&#xA;

    &#xA;

    The cloudwatch logs on the last execution of this :

    &#xA;

    built with gcc 8 (Debian 8.3.0-6)&#xA;configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg&#xA;libavutil      56. 70.100 / 56. 70.100&#xA;libavcodec     58.134.100 / 58.134.100&#xA;libavformat    58. 76.100 / 58. 76.100&#xA;libavdevice    58. 13.100 / 58. 13.100&#xA;libavfilter     7.110.100 /  7.110.100&#xA;libswscale      5.  9.100 /  5.  9.100&#xA;libswresample   3.  9.100 /  3.  9.100&#xA;libpostproc    55.  9.100 / 55.  9.100&#xA;Input #0, h264, from &#x27;video00087.h264&#x27;:&#xA;Duration: N/A, bitrate: N/A&#xA;Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720, 25 fps, 25 tbr, 1200k tbn, 50 tbc&#xA;Stream mapping:&#xA;Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))&#xA;Press [q] to stop, [?] for help&#xA;[libx264 @ 0x6aaf500] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2&#xA;[libx264 @ 0x6aaf500] profile High, level 3.1, 4:2:0, 8-bit&#xA;[libx264 @ 0x6aaf500] 264 - core 161 r3048 b86ae3c - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - 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=3 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=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&#xA;Output #0, mp4, to &#x27;output.mp4&#x27;:&#xA;Metadata:&#xA;encoder         : Lavf58.76.100&#xA;Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(progressive), 1280x720, q=2-31, 25 fps, 12800 tbn&#xA;Metadata:&#xA;encoder         : Lavc58.134.100 libx264&#xA;Side data:&#xA;cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A&#xA;frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    &#xA;frame=   47 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    &#xA;frame=   56 fps= 44 q=28.0 size=       0kB time=00:00:00.24 bitrate=   1.6kbits/s speed=0.187x    &#xA;frame=   65 fps= 35 q=28.0 size=       0kB time=00:00:00.60 bitrate=   0.6kbits/s speed=0.325x    &#xA;frame=   74 fps= 31 q=28.0 size=       0kB time=00:00:00.96 bitrate=   0.4kbits/s speed=0.399x    &#xA;Enter command: <target>|all <time>|-1 <command>[ <argument>]&#xA;Parse error, at least 3 arguments were expected, only 1 given in string &#x27;V����Ҿ�#I���bv��oF��LxE��{��y5Jx�X�-f?2k�E~ہ��L��Y?�w���9?S�?�(q?��y��V8�=)�9&#x27;�?�-j?��?�3���Ŧ$��r���\��r}?zb?E��?��B}b4��2��[z�&amp;�逋�Qk�ar�=y���&#x27;&#xA;frame=   82 fps= 28 q=28.0 size=     256kB time=00:00:01.28 bitrate=1638.6kbits/s speed=0.434x    &#xA;frame=   90 fps= 25 q=28.0 size=     256kB time=00:00:01.60 bitrate=1310.9kbits/s speed=0.442x    &#xA;frame=   98 fps= 23 q=28.0 size=     256kB time=00:00:01.92 bitrate=1092.4kbits/s speed=0.458x    &#xA;frame=  107 fps= 23 q=28.0 size=     256kB time=00:00:02.28 bitrate= 919.9kbits/s speed=0.48x    &#xA;frame=  115 fps= 22 q=28.0 size=     512kB time=00:00:02.60 bitrate=1613.3kbits/s speed=0.495x    &#xA;frame=  122 fps= 21 q=28.0 size=     512kB time=00:00:02.88 bitrate=1456.4kbits/s speed=0.499x    &#xA;[h264 @ 0x6b68c80] left block unavailable for requested intra mode&#xA;[h264 @ 0x6b68c80] error while decoding MB 0 19, bytestream 37403&#xA;[h264 @ 0x6b68c80] concealing 2129 DC, 2129 AC, 2129 MV errors in P frame&#xA;video00087.h264: corrupt decoded frame in stream 0&#xA;[h264 @ 0x6ab4080] left block unavailable for requested intra4x4 mode -1&#xA;[h264 @ 0x6ab4080] error while decoding MB 0 37, bytestream 13222&#xA;[h264 @ 0x6ab4080] concealing 689 DC, 689 AC, 689 MV errors in P frame&#xA;video00087.h264: corrupt decoded frame in stream 0&#xA;[h264 @ 0x6b68c80] concealing 1347 DC, 1347 AC, 1347 MV errors in P frame&#xA;frame=  130 fps= 21 q=28.0 size=     512kB time=00:00:03.20 bitrate=1310.8kbits/s speed=0.509x    &#xA;video00087.h264: corrupt decoded frame in stream 0&#xA;frame=  131 fps= 15 q=-1.0 Lsize=    1081kB time=00:00:05.12 bitrate=1729.6kbits/s speed=0.575x    &#xA;video:1079kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.220914%&#xA;[libx264 @ 0x6aaf500] frame I:1     Avg QP:21.61  size: 37761&#xA;[libx264 @ 0x6aaf500] frame P:34    Avg QP:22.25  size: 18066&#xA;[libx264 @ 0x6aaf500] frame B:96    Avg QP:24.46  size:  4706&#xA;[libx264 @ 0x6aaf500] consecutive B-frames:  2.3%  0.0%  0.0% 97.7%&#xA;[libx264 @ 0x6aaf500] mb I  I16..4: 15.2% 61.2% 23.6%&#xA;[libx264 @ 0x6aaf500] mb P  I16..4:  8.4% 15.6%  1.2%  P16..4: 39.2% 13.7%  6.9%  0.0%  0.0%    skip:15.0%&#xA;[libx264 @ 0x6aaf500] mb B  I16..4:  0.7%  1.8%  0.0%  B16..8: 44.5%  4.5%  0.5%  direct: 3.6%  skip:44.4%  L0:46.9% L1:48.0% BI: 5.1%&#xA;[libx264 @ 0x6aaf500] 8x8 transform intra:63.5% inter:83.1%&#xA;[libx264 @ 0x6aaf500] coded y,uvDC,uvAC intra: 22.1% 25.4% 2.8% inter: 11.6% 19.3% 1.2%&#xA;[libx264 @ 0x6aaf500] i16 v,h,dc,p:  4% 63%  8% 25%&#xA;[libx264 @ 0x6aaf500] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  9% 26% 53%  1%  2%  1%  3%  1%  3%&#xA;[libx264 @ 0x6aaf500] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 44% 16%  4%  4%  3%  5%  4%  4%&#xA;[libx264 @ 0x6aaf500] i8c dc,h,v,p: 66% 24%  9%  1%&#xA;[libx264 @ 0x6aaf500] Weighted P-Frames: Y:0.0% UV:0.0%&#xA;[libx264 @ 0x6aaf500] ref P L0: 57.5% 16.8% 18.2%  7.5%&#xA;[libx264 @ 0x6aaf500] ref B L0: 89.8%  8.0%  2.2%&#xA;[libx264 @ 0x6aaf500] ref B L1: 96.0%  4.0%&#xA;[libx264 @ 0x6aaf500] kb/s:1685.21&#xA;END RequestId: 96e1031a-b1a2-4480-a59d-68de487671bd&#xA;REPORT RequestId: 96e1031a-b1a2-4480-a59d-68de487671bd  Duration: 11721.77 ms   Billed Duration: 11722 ms   Memory Size: 2048 MB    Max Memory Used: 494 MB Init Duration: 353.14 ms&#xA;</argument></command></time></target>

    &#xA;

    I've been struggling with this for a couple days now, any help would be amazing.

    &#xA;

  • Announcing Matomo 4 : More security, privacy and better performance

    17 novembre 2020, par Matomo Core Team — Community, Development, Privacy, Security

    The moment we’ve all been waiting for is here … Matomo Analytics 4 has launched !! We’re incredibly grateful for all community members and contributors who’ve helped with improvements, and our awesome team for all the fixes. 

    We can’t wait for you to gain greater security, privacy protection, and be able to boost your website performance. Now who’s ready ?

    Minimise your business’ web data security risk

    We’ve made Matomo even more secure to meet our users’ ever increasing security needs. Matomo 4 has certainly delivered on these expectations with a wide range of security enhancements and fixes across the platform :

    • Support for app specific API tokens. [#6559]
    • API tokens and session ids are now stored hashed in the database which means if someone can access your database they wouldn’t be able to get the actual token.
    • A more secure host validation. [#16169]
    • By default, you no longer can embed widgets through tokens with higher privileges. [#16264]
    • Plenty of other minor security fixes.

    More protection of your customer’s personal data

    Matomo 4 ensures you’re compliant with data privacy laws and provides you with more ways to keep your customer’s personal data private, such as :

    • The ability to automatically anonymise the referrer to avoid tracking personal data by accident. [#15426]
    • The option to enforce the disabling of cookies. [#16258]
    • Possibility in JavaScript tracker to turn cookies on and off at any time. [#13056]
    • The option to not store any IP address at all. [#16377]
    • Easily disable visits log and visitor profile feature if needed for privacy compliance [#16259]
    • New segment to separate visitors who gave consent vs visitors who didn’t give consent. [#16192]

    Matomo now offers PHP 8 support to users. Want to know more ? Get a detailed list of over 300 fixes and improvements in the Matomo 4 changelog.

    Increased conversion rates with a focus on page performance

    Our new Page Performance feature in Matomo 4 can help you increase conversion rates by showing you exactly how fast or slow your website is going, and WHY. An Akamai Online Retail Study in 2017 found that a 100-millisecond delay in website load time could underperform website conversion rates by up to 7%. 

    By using this new feature you can quickly identify slow pages and fix page speed issues as soon as they arise, meaning you never miss out on those valuable new sales opportunities.

    Improve your Google search rankings in 2021

    According to moz.com, Google’s bringing in a new ranking factor into their algorithm named Core Web Vitals, which will place greater emphasis on load speed (favouring websites that load faster). This means the slower your page loads, the worse it will rank in Google. With Matomo’s new feature, you’ll be able to optimise your pages to rank better according to the Core Web Vitals ranking factor. 

    Read more on how you can use this new feature : https://matomo.org/faq/how-to/how-do-i-see-page-performance-reports/

    Need help upgrading Matomo ?

    Read the Updating Matomo user guide or contact the Matomo experts

    Please note : It may take a while for you to receive a notice to update to Matomo 4.

  • Why does my ffmpeg audio sound slower and deeper - sample rate mismatch

    4 septembre 2020, par yogesh zinzu

    ok so this is a discord bot to record voice chat&#xA;https://hatebin.com/hgjlazacri&#xA;Now the bot works perfectly fine but the issue is that the audio sounds a bit deeper and slower than normal.. Why does it happen ? how can I make the audio sound 1:1..

    &#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    const Discord = require(&#x27;discord.js&#x27;);&#xA;const client = new Discord.Client();&#xA;const ffmpegInstaller = require(&#x27;@ffmpeg-installer/ffmpeg&#x27;);&#xA;const ffmpeg = require(&#x27;fluent-ffmpeg&#x27;);&#xA;ffmpeg.setFfmpegPath(ffmpegInstaller.path);&#xA;const fs = require(&#x27;fs-extra&#x27;)&#xA;const mergeStream = require(&#x27;merge-stream&#x27;);&#xA;const config = require(&#x27;./config.json&#x27;);&#xA;const { getAudioDurationInSeconds } = require(&#x27;get-audio-duration&#x27;);&#xA;const cp = require(&#x27;child_process&#x27;);&#xA;const path1 = require(&#x27;path&#x27;);&#xA;const Enmap = require(&#x27;enmap&#x27;);&#xA;const UserRecords = require("./models/userrecords.js")&#xA;const ServerRecords = require("./models/serverrecords.js")&#xA;let prefix = `$`&#xA;class Readable extends require(&#x27;stream&#x27;).Readable { _read() {} }&#xA;let recording = false;&#xA;let currently_recording = {};&#xA;let mp3Paths = [];&#xA;const silence_buffer = new Uint8Array(3840);&#xA;const express = require(&#x27;express&#x27;)&#xA;const app = express()&#xA;const port = 3000&#xA;const publicIP = require(&#x27;public-ip&#x27;)&#xA;const { program } = require(&#x27;commander&#x27;);&#xA;const { path } = require(&#x27;@ffmpeg-installer/ffmpeg&#x27;);&#xA;const version = &#x27;0.0.1&#x27;&#xA;program.version(version);&#xA;let debug = false&#xA;let runProd = false&#xA;let fqdn = "";&#xA;const mongoose = require("mongoose");&#xA;const MongoClient = require(&#x27;mongodb&#x27;).MongoClient;&#xA;mongoose.connect(&#x27;SECRRET&#x27;,{&#xA;  useNewUrlParser: true&#xA;}, function(err){&#xA;  if(err){&#xA;    console.log(err);&#xA;  }else{&#xA;    console.log("Database connection initiated");&#xA;  }&#xA;});&#xA;require("dotenv").config()&#xA;function bufferToStream(buffer) {&#xA;    let stream = new Readable();&#xA;    stream.push(buffer);&#xA;    return stream;&#xA;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;client.commands = new Enmap();&#xA;&#xA;client.on(&#x27;ready&#x27;, async () => {&#xA;    console.log(`Logged in as ${client.user.tag}`);&#xA;&#xA;    let host = "localhost"&#xA;&#xA;    &#xA;&#xA;    let ip = await publicIP.v4();&#xA;&#xA;    let protocol = "http";&#xA;    if (!runProd) {&#xA;        host = "localhost"&#xA;    } else {&#xA;        host = `35.226.244.186`;&#xA;    }&#xA;    fqdn = `${protocol}://${host}:${port}`&#xA;    app.listen(port, `0.0.0.0`, () => {&#xA;        console.log(`Listening on port ${port} for ${host} at fqdn ${fqdn}`)&#xA;    })&#xA;});&#xA;let randomArr = []&#xA;let finalArrWithIds = []&#xA;let variable = 0&#xA;client.on(&#x27;message&#x27;, async message => {&#xA;    console.log(`fuck`);&#xA;    if(message.content === `$record`){&#xA;        mp3Paths = []&#xA;        finalArrWithIds = []&#xA;        let membersToScrape = Array.from(message.member.voice.channel.members.values());&#xA;        membersToScrape.forEach((member) => {&#xA;            if(member.id === `749250882830598235`) {&#xA;                console.log(`botid`);&#xA;            }&#xA;            else {&#xA;                finalArrWithIds.push(member.id)&#xA;            }&#xA;            &#xA;        })&#xA;        const randomNumber = Math.floor(Math.random() * 100)&#xA;        randomArr = []&#xA;        randomArr.push(randomNumber)&#xA;    }&#xA;   &#xA;    &#xA;    const generateSilentData = async (silentStream, memberID) => {&#xA;        console.log(`recordingnow`)&#xA;        while(recording) {&#xA;            if (!currently_recording[memberID]) {&#xA;                silentStream.push(silence_buffer);&#xA;            }&#xA;            await new Promise(r => setTimeout(r, 20));&#xA;        }&#xA;        return "done";&#xA;    }&#xA;    console.log(generateSilentData, `status`)&#xA;    function generateOutputFile(channelID, memberID) {&#xA;        const dir = `./recordings/${channelID}/${memberID}`;&#xA;        fs.ensureDirSync(dir);&#xA;        const fileName = `${dir}/${randomArr[0]}.aac`;&#xA;        console.log(`${fileName} ---------------------------`);&#xA;        return fs.createWriteStream(fileName);&#xA;    }&#xA;    &#xA;    if (!fs.existsSync("public")) {&#xA;        fs.mkdirSync("public");&#xA;    }&#xA;    app.use("/public", express.static("./public"));&#xA;  if (!message.guild) return;&#xA;&#xA;  if (message.content === config.prefix &#x2B; config.record_command) {&#xA;    if (recording) {&#xA;        message.reply("bot is already recording");&#xA;        return&#xA;    }&#xA;    if (message.member.voice.channel) {&#xA;        recording = true;&#xA;        const connection = await message.member.voice.channel.join();&#xA;        const dispatcher = connection.play(&#x27;./audio.mp3&#x27;);&#xA;&#xA;        connection.on(&#x27;speaking&#x27;, (user, speaking) => {&#xA;            if (speaking.has(&#x27;SPEAKING&#x27;)) {&#xA;                currently_recording[user.id] = true;&#xA;            } else {&#xA;                currently_recording[user.id] = false;&#xA;            }&#xA;        })&#xA;&#xA;&#xA;        let members = Array.from(message.member.voice.channel.members.values());&#xA;        members.forEach((member) => {&#xA;&#xA;            if (member.id != client.user.id) {&#xA;                let memberStream = connection.receiver.createStream(member, {mode : &#x27;pcm&#x27;, end : &#x27;manual&#x27;})&#xA;&#xA;                let outputFile = generateOutputFile(message.member.voice.channel.id, member.id);&#xA;                console.log(outputFile, `outputfile here`);&#xA;                mp3Paths.push(outputFile.path);&#xA;                    &#xA;&#xA;                silence_stream = bufferToStream(new Uint8Array(0));&#xA;                generateSilentData(silence_stream, member.id).then(data => console.log(data));&#xA;                let combinedStream = mergeStream(silence_stream, memberStream);&#xA;&#xA;                ffmpeg(combinedStream)&#xA;                    .inputFormat(&#x27;s32le&#x27;)&#xA;                    .audioFrequency(44100)&#xA;                    .audioChannels(2)&#xA;                    .on(&#x27;error&#x27;, (error) => {console.log(error)})&#xA;                    .audioCodec(&#x27;aac&#x27;)&#xA;                    .format(&#x27;adts&#x27;) &#xA;                    .pipe(outputFile)&#xA;                    &#xA;            }&#xA;        })&#xA;    } else {&#xA;      message.reply(&#x27;You need to join a voice channel first!&#x27;);&#xA;    }&#xA;  }&#xA;&#xA;  if (message.content === config.prefix &#x2B; config.stop_command) {&#xA;&#xA;    let date = new Date();&#xA;    let dd = String(date.getDate()).padStart(2, &#x27;0&#x27;);&#xA;    let mm = String(date.getMonth() &#x2B; 1).padStart(2, &#x27;0&#x27;); &#xA;    let yyyy = date.getFullYear();&#xA;    date = mm &#x2B; &#x27;/&#x27; &#x2B; dd &#x2B; &#x27;/&#x27; &#x2B; yyyy;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;    let currentVoiceChannel = message.member.voice.channel;&#xA;    if (currentVoiceChannel) {&#xA;        recording = false;&#xA;        await currentVoiceChannel.leave();&#xA;&#xA;        let mergedOutputFolder = &#x27;./recordings/&#x27; &#x2B; message.member.voice.channel.id &#x2B; `/${randomArr[0]}/`;&#xA;        fs.ensureDirSync(mergedOutputFolder);&#xA;        let file_name = `${randomArr[0]}` &#x2B; &#x27;.aac&#x27;;&#xA;        let mergedOutputFile = mergedOutputFolder &#x2B; file_name;&#xA;    &#xA;        &#xA;    let download_path = message.member.voice.channel.id &#x2B; `/${randomArr[0]}/` &#x2B; file_name;&#xA;&#xA;        let mixedOutput = new ffmpeg();&#xA;        console.log(mp3Paths, `mp3pathshere`);&#xA;        mp3Paths.forEach((mp3Path) => {&#xA;             mixedOutput.addInput(mp3Path);&#xA;            &#xA;        })&#xA;        console.log(mp3Paths);&#xA;        //mixedOutput.complexFilter(&#x27;amix=inputs=2:duration=longest&#x27;);&#xA;        mixedOutput.complexFilter(&#x27;amix=inputs=&#x27; &#x2B; mp3Paths.length &#x2B; &#x27;:duration=longest&#x27;);&#xA;        &#xA;        let processEmbed = new Discord.MessageEmbed().setTitle(`Audio Processing.`)&#xA;        processEmbed.addField(`Audio processing starting now..`, `Processing Audio`)&#xA;        processEmbed.setThumbnail(`https://media.discordapp.net/attachments/730811581046325348/748610998985818202/speaker.png`)&#xA;        processEmbed.setColor(` #00FFFF`)&#xA;        const processEmbedMsg = await message.channel.send(processEmbed)&#xA;        async function saveMp3(mixedData, outputMixed) {&#xA;            console.log(`${mixedData} MIXED `)&#xA;            &#xA;            &#xA;            &#xA;            return new Promise((resolve, reject) => {&#xA;                mixedData.on(&#x27;error&#x27;, reject).on(&#x27;progress&#x27;,&#xA;                async (progress) => {&#xA;                    &#xA;                    let processEmbedEdit = new Discord.MessageEmbed().setTitle(`Audio Processing.`)&#xA;                    processEmbedEdit.addField(`Processing: ${progress.targetSize} KB converted`, `Processing Audio`)&#xA;                    processEmbedEdit.setThumbnail(`https://media.discordapp.net/attachments/730811581046325348/748610998985818202/speaker.png`)&#xA;                    processEmbedEdit.setColor(` #00FFFF`)&#xA;                    processEmbedMsg.edit(processEmbedEdit)&#xA;                    console.log(&#x27;Processing: &#x27; &#x2B; progress.targetSize &#x2B; &#x27; KB converted&#x27;);&#xA;                }).on(&#x27;end&#x27;, () => {&#xA;                    console.log(&#x27;Processing finished !&#x27;);&#xA;                    resolve()&#xA;                }).saveToFile(outputMixed);&#xA;                console.log(`${outputMixed} IT IS HERE`);&#xA;            })&#xA;        }&#xA;        // mixedOutput.saveToFile(mergedOutputFile);&#xA;        await saveMp3(mixedOutput, mergedOutputFile);&#xA;        console.log(`${mixedOutput} IN HEREEEEEEE`);&#xA;        // We saved the recording, now copy the recording&#xA;        if (!fs.existsSync(`./public`)) {&#xA;            fs.mkdirSync(`./public`);&#xA;        }&#xA;        let sourceFile = `${__dirname}/recordings/${download_path}`&#xA;        console.log(`DOWNLOAD PATH HERE ${download_path}`)&#xA;        const guildName = message.guild.id;&#xA;        const serveExist = `/public/${guildName}`&#xA;        if (!fs.existsSync(`.${serveExist}`)) {&#xA;            fs.mkdirSync(`.${serveExist}`)&#xA;        }&#xA;        let destionationFile = `${__dirname}${serveExist}/${file_name}`&#xA;&#xA;        let errorThrown = false&#xA;        try {&#xA;            fs.copySync(sourceFile, destionationFile);&#xA;        } catch (err) {&#xA;            errorThrown = true&#xA;            await message.channel.send(`Error: ${err.message}`)&#xA;        }&#xA;        const usersWithTag = finalArrWithIds.map(user => `\n &lt;@${user}>`);&#xA;        let timeSpent = await getAudioDurationInSeconds(`public/${guildName}/${file_name}`)&#xA;        let timesSpentRound = Math.floor(timeSpent)&#xA;        let finalTimeSpent = timesSpentRound / 60&#xA;        let finalTimeForReal = Math.floor(finalTimeSpent)&#xA;        if(!errorThrown){&#xA;            //--------------------- server recording save START&#xA;            class GeneralRecords {&#xA;                constructor(generalLink, date, voice, time) {&#xA;                  this.generalLink = generalLink;&#xA;                  this.date = date;&#xA;                  this.note = `no note`;&#xA;                  this.voice = voice;&#xA;                  this.time = time&#xA;                }&#xA;              }&#xA;              let newGeneralRecordClassObject = new GeneralRecords(`${fqdn}/public/${guildName}/${file_name}`, date, usersWithTag, finalTimeForReal)&#xA;              let checkingServerRecord = await ServerRecords.exists({userid: `server`})&#xA;              if(checkingServerRecord === true){&#xA;                  existingServerRecord = await ServerRecords.findOne({userid: `server`})&#xA;                  existingServerRecord.content.push(newGeneralRecordClassObject)&#xA;                  await existingServerRecord.save()&#xA;              }&#xA;              if(checkingServerRecord === false){&#xA;                let serverRecord = new ServerRecords()&#xA;                serverRecord.userid = `server`&#xA;                serverRecord.content.push(newGeneralRecordClassObject)&#xA;                await serverRecord.save()&#xA;              }&#xA;              //--------------------- server recording save STOP&#xA;        }&#xA;        &#xA;        //--------------------- personal recording section START&#xA;        for( member of finalArrWithIds) {&#xA;&#xA;        let personal_download_path = message.member.voice.channel.id &#x2B; `/${member}/` &#x2B; file_name;&#xA;        let sourceFilePersonal = `${__dirname}/recordings/${personal_download_path}`&#xA;        let destionationFilePersonal = `${__dirname}${serveExist}/${member}/${file_name}`&#xA;        await fs.copySync(sourceFilePersonal, destionationFilePersonal);&#xA;        const user = client.users.cache.get(member);&#xA;        console.log(user, `user here`);&#xA;        try {&#xA;            ffmpeg.setFfmpegPath(ffmpegInstaller.path);&#xA;          &#xA;            ffmpeg(`public/${guildName}/${member}/${file_name}`)&#xA;             .audioFilters(&#x27;silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB&#x27;)&#xA;             .output(`public/${guildName}/${member}/personal-${file_name}`)&#xA;             .on(`end`, function () {&#xA;               console.log(`DONE`);&#xA;             })&#xA;             .on(`error`, function (error) {&#xA;               console.log(`An error occured` &#x2B; error.message)&#xA;             })&#xA;             .run();&#xA;             &#xA;          }&#xA;          catch (error) {&#xA;          console.log(error)&#xA;          }&#xA;        &#xA;&#xA;        // ----------------- SAVING PERSONAL RECORDING TO DATABASE START&#xA;        class PersonalRecords {&#xA;            constructor(generalLink, personalLink, date, time) {&#xA;              this.generalLink = generalLink;&#xA;              this.personalLink = personalLink;&#xA;              this.date = date;&#xA;              this.note = `no note`;&#xA;              this.time = time;&#xA;            }&#xA;          }&#xA;          let timeSpentPersonal = await getAudioDurationInSeconds(`public/${guildName}/${file_name}`)&#xA;          let timesSpentRoundPersonal = Math.floor(timeSpentPersonal)&#xA;          let finalTimeSpentPersonal = timesSpentRoundPersonal / 60&#xA;          let finalTimeForRealPersonal = Math.floor(finalTimeSpentPersonal)&#xA;          let newPersonalRecordClassObject = new PersonalRecords(`${fqdn}/public/${guildName}/${file_name}`, `${fqdn}/public/${guildName}/${member}/personal-${file_name}`, date, finalTimeForRealPersonal)&#xA;&#xA;           let checkingUserRecord = await UserRecords.exists({userid: member})&#xA;              if(checkingUserRecord === true){&#xA;                  existingUserRecord = await UserRecords.findOne({userid: member})&#xA;                  existingUserRecord.content.push(newPersonalRecordClassObject)&#xA;                  await existingUserRecord.save()&#xA;              }&#xA;              if(checkingUserRecord === false){&#xA;                let newRecord = new UserRecords()&#xA;                newRecord.userid = member&#xA;                newRecord.content.push(newPersonalRecordClassObject)&#xA;                await newRecord.save()&#xA;              }&#xA;&#xA;&#xA;       &#xA;        // ----------------- SAVING PERSONAL RECORDING TO DATABASE END&#xA;       &#xA;&#xA;        const endPersonalEmbed = new Discord.MessageEmbed().setTitle(`Your performance was amazing ! Review it here :D`)&#xA;        endPersonalEmbed.setColor(&#x27;#9400D3&#x27;)&#xA;        endPersonalEmbed.setThumbnail(`https://media.discordapp.net/attachments/730811581046325348/745381641324724294/vinyl.png`)&#xA;        endPersonalEmbed.addField(`1