Recherche avancée

Médias (0)

Mot : - Tags -/diogene

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

Autres articles (69)

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

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

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (10774)

  • Extracting Thumbnail URL from Video URL

    29 août 2023, par Deepak Sangle

    So, I have a video URL in an Amazon S3 bucket. I must extract the thumbnail image (preview image) from the video URL. The catch is that I do not have the luxury to download or upload the complete video since it takes time. My approach is something like this.
I first created a blob object containing the first few seconds of that video using something like this.

    


      const chunkSize = 1024*1024; // 1MB
  const start = 0;
  const end = chunkSize - 1;
  const rangeHeader = `bytes=${start}-${end}`;
  
  const VideoResponse = await axios.get(url, { 
    responseType: 'arraybuffer',
    headers: { Range: rangeHeader }
  });

  const chunkData = VideoResponse.data; 
  
  const videoBlob = new Blob([chunkData], { type: 'video/mp4' });
  const videoUrl = URL.createObjectURL(videoBlob);
  console.log({chunkData, videoBlob, videoUrl});


    


    Console gives me something like this

    


    {&#xA;  chunkData: <buffer 00="00" 1c="1c" 66="66" 74="74" 79="79" 70="70" 6d="6d" 34="34" 32="32" 69="69" 73="73" 6f="6f" 61="61" 76="76" 63="63" 31="31" 02="02" bd="bd" ab="ab" 6c="6c" 68="68" 64="64" c7="c7" 1048526="1048526" more="more" bytes="bytes">,&#xA;  videoBlob: Blob { size: 1048576, type: &#x27;video/mp4&#x27; },&#xA;  videoUrl: &#x27;blob:nodedata:764fce87-792f-47e8-bc3e-15921ee5787f&#x27;&#xA;}&#xA;</buffer>

    &#xA;

    Now, there are many options after this. I am trying to download this blob object by converting it into a file. After I successfully convert it into an mp4 file, I can easily take a screenshot of it using fluent-ffmpeg package. However, I couldn't convert it into a file. If I try to do something like this

    &#xA;

      const BlobResponse = await axios({&#xA;    method: &#x27;GET&#x27;,&#xA;    url: videoUrl,&#xA;    responseType: &#x27;stream&#x27;&#xA;  });&#xA;&#xA;  const file = fs.createWriteStream(`video.mp4`);&#xA;  BlobResponse.data.pipe(file);&#xA;  &#xA;  file.on("error", (error) => {&#xA;    console.log(`There was an error writing the file. Details: $ {error}`);&#xA;  });&#xA;&#xA;  file.on(&#x27;finish&#x27;, () => {&#xA;    file.close();&#xA;    console.log("File downloaded successfully");&#xA;  });&#xA;

    &#xA;

    But it throws me the error AxiosError: Unsupported protocol blob:

    &#xA;

    I also tried to directly convert the blob object to a jpeg object but to no avail.

    &#xA;

    I have searched complete StackOverflow, and I have not found a single solution working so please let me know why those are not working or if there is any new solution to do this.

    &#xA;

  • AWS Lambda : "Unzipped size must be smaller than 106534017 bytes" after adding single file

    17 septembre 2023, par leon

    When trying to deploy my lambdas using AWS through the serverless framework I had no problems until I tried adding the ffmpeg binary.

    &#xA;

    Now the ffmpeg binaries I have tried to add have ranged from 26 mb to 50 mb. Whichever I add, I get the following error :

    &#xA;

    UPDATE_FAILED: WhatsappDocumentHandlerLambdaFunction (AWS::Lambda::Function)&#xA;Resource handler returned message: "Unzipped size must be smaller than 106534017 bytes (Service: Lambda, Status Code: 400, Request ID: ...)" (RequestToken: ..., HandlerErrorCode: InvalidRequest)&#xA;

    &#xA;

    The problem is that I did not add the file to this function. I added it to a completely different one.

    &#xA;

    I have tried the following things :

    &#xA;

    &#xA;

    When trying every single one of these options I get the UPDATE_FAILED error in a different function that surely is not too big.

    &#xA;

    I know I can deploy using a docker image but why complicate things with docker images when it should work ?

    &#xA;

    I am very thankful for any ideas.

    &#xA;

  • FFmpeg transcode GIF into Mp4 and Mp4 to AVI using GPU

    9 octobre 2023, par Cristian

    I'm trying to convert GIF animated to mp4 and mp4 to AVI with FFmpeg.

    &#xA;

    I started to use just the CPU, but I have to process millions of GIFs/mp4 content pieces. So, I started to have a lot of errors processing them, and it ended as a bottleneck. Therefore, I'm trying to use GPU to process the videos.

    &#xA;

    Converting GIF to mp4 with CPU, I run the following command :

    &#xA;

    ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4&#xA;

    &#xA;

    Using the GPU I'm trying the following :

    &#xA;

    ffmpeg&#xA;  -y&#xA;  -hwaccel nvdec&#xA;  -hwaccel_output_format cuda&#xA;  -i gifInputPath&#xA;  -threads 1&#xA;  -filter_threads 1&#xA;  -c:v h264_nvenc&#xA;  -vf hwupload_cuda,scale_cuda=-2:320:240:format=yuv420p&#xA;  -gpu 0&#xA;   mp4VideoPath&#xA;

    &#xA;

    The above command generates an exit status 1.

    &#xA;

    The following is the dmesg command log

    &#xA;

    Converting mp4 videos to AVI videos I'm running the following command

    &#xA;

    ffmpeg&#xA;-i videoInputPath&#xA;-vcodec rawvideo&#xA;-pix_fmt yuv420p&#xA;-acodec pcm_s16le&#xA;-ar 44100&#xA;-ac 2&#xA;-s 320x240&#xA;-r 4&#xA;-f avi&#xA;aviOutputVideoPath&#xA;

    &#xA;

    For GPU I tried :

    &#xA;

    ffmpeg&#xA; -y&#xA; -hwaccel cuda&#xA; -hwaccel_output_format cuda&#xA; -i videoInputPath&#xA; -threads 1&#xA; -filter_threads 1&#xA; -c:a pcm_s16le&#xA; -ac 2&#xA; -ar 44100&#xA; -c:v h264_nvenc&#xA; -vf hwupload_cudascale_cuda=-2:320:240:format=yuv420p&#xA; -r 4&#xA; -f avi&#xA; -gpu 0&#xA; aviOutputVideoPath&#xA;

    &#xA;

    The following is the dmseg output is log

    &#xA;

      &#xA;
    1. What should be the best command for converting the GIF into Mp4 and Mp4 into AVI based on CPU configuration using the GPU(Amazon Nvidia t4) for best performance, low CPU, and moderated GPU consumption ?

      &#xA;

    2. &#xA;

    3. What are the best suggestions to Process these content pieces concurrently using GPU ?

      &#xA;

    4. &#xA;

    &#xA;

    Note : I'm using Golang to execute the FFmpeg commands.

    &#xA;