Recherche avancée

Médias (1)

Mot : - Tags -/blender

Autres articles (20)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (5678)

  • Problem importing whatsapp-web.js nodejs module in electron react app

    26 mai 2021, par Sunil Shah

    I am trying to build an electron react app. I need to integrate this node modules https://www.npmjs.com/package/whatsapp-web.js in my electron react app. My main.js of electron looks like this :

    


    

    

    // Modules to control application life and create native browser window
const { app, BrowserWindow } = require("electron");
const path = require("path");

function createWindow() {
  // Create the browser window.
  const mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      webSecurity: false,
    },
  });

  // and load the index.html of the app.
  mainWindow.loadURL("your ip address:3000");

  // Open the DevTools.
  // mainWindow.webContents.openDevTools()
}

app.whenReady().then(() => {
  createWindow();

  app.on("activate", function () {
    // On macOS it's common to re-create a window in the app when the
    // dock icon is clicked and there are no other windows open.
    if (BrowserWindow.getAllWindows().length === 0) createWindow();
  });
});

// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on("window-all-closed", function () {
  if (process.platform !== "darwin") app.quit();
});

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

    


    


    



    And the React code where i want to import whatsapp-web.js module looks like

    


    

    

    import React from "react";&#xA;import styled from "styled-components";&#xA;const qrcode = require(&#x27;qrcode-terminal&#x27;);&#xA;const Client = require(&#x27;whatsapp-web.js&#x27;);&#xA;function Error() {&#xA;  var client = new Client();&#xA;  client.initialize();&#xA;  console.log(client);&#xA;  console.log(qrcode);&#xA;  return (&#xA;    <container>&#xA;      <errorimage src="https://cdn4.iconfinder.com/data/icons/smiley-vol-3-2/48/134-512.png"></errorimage>&#xA;      <errormessage>Oops, you are not connected to any number.</errormessage>&#xA;    </container>&#xA;  );&#xA;}&#xA;&#xA;export default Error;&#xA;&#xA;const Container = styled.div`&#xA;  display: flex;&#xA;  height: 100vh;&#xA;  width: 100%;&#xA;  padding-top: 20vh;&#xA;  position: center;&#xA;  /* align-items: center; */&#xA;  justify-content: center;&#xA;`;&#xA;&#xA;const ErrorImage = styled.img`&#xA;  background-color: transparent;&#xA;  background-repeat: no-repeat;&#xA;  background-size: cover;&#xA;  object-fit: contain;&#xA;&#xA;  width: 25%;&#xA;  height: 25%;&#xA;&#xA;  /* border: 2px solid black; */&#xA;`;&#xA;&#xA;const ErrorMessage = styled.div`&#xA;  margin: 10px;&#xA;  width: 50%;&#xA;  height: 25%;&#xA;  /* top: 20px; */&#xA;  font-size: 30px;&#xA;  align-items: center;&#xA;  font-family: "Lucida Console", "Courier New", monospace;&#xA;  /* font-weight: bold; */&#xA;`;

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;

    Now everytime I try to import const Client = require('whatsapp-web.js') It throws error like this :&#xA;**&#xA;[0] ./node_modules/fluent-ffmpeg/index.js&#xA;[0] Module not found : Can't resolve './lib-cov/fluent-ffmpeg' in 'D :\Sunil\Zarir_app-main\Zarir_app-main\node_modules\fluent-ffmpeg'&#xA;[0] Compiling...&#xA;[0] Failed to compile.

    &#xA;

    and I tried the solution&#xA;https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/issues/573#issuecomment-305408048&#xA;and other resources but still nothing works and just loops in errors and errors.&#xA;Please help if you have any information related to it.&#xA;Thank you.

    &#xA;

  • Merge commit ’3176217c60ca7828712985092d9102d331ea4f3d’

    12 juin 2016, par Clément Bœsch
    Merge commit ’3176217c60ca7828712985092d9102d331ea4f3d’
    

    * commit ’3176217c60ca7828712985092d9102d331ea4f3d’ :
    h264 : decouple h264_ps from the h264 decoder

    Main changes :

    - a local GetBitContext is created for the various
    ff_h264_decode_seq_parameter_set() attempts

    - just like the old code, remove_sps() is adjusted so it doesn’t remove
    the pps.

    Fixes decode with Ticket #631
    http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20111108/dae58f17/attachment.mp4
    but see next point as well.

    - ff_h264_update_thread_context() is updated to work even when SPS
    isn’t set as it breaks current skip_frame code. This makes sure we
    can still decode the sample from ticket #631 without the need for
    -flags2 +chunks. (Thanks to Michael)

    - keep sps,pps_ref pointers that stay alive even when the active
    pps/sps get removed from the available lists (patch by michaelni with
    additionnal frees in ff_h264_free_context() from mateo)

    - added a check on sps in avpriv_h264_has_num_reorder_frames() to fix
    crashes with mpegts_with_dvbsubs.ts from Ticket #4074
    http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket4074/mpegts_with_dvbsubs.ts

    - in h264_parser.c:h264_parse(), after the ff_h264_decode_extradata() is
    called, the pps and sps from the local parser context are updated with
    the pps and sps from the used h264context. This fixes fate-flv-demux.

    - in h264_slice.c, "PPS changed between slices" error is not triggered
    anymore in one condition as it makes fate-h264-xavc-4389 fails with
    THREADS=N (Thanks to Michael)

    Merged-by : Clément Bœsch <clement@stupeflix.com>
    Merged-by : Michael Niedermayer <michael@niedermayer.cc>
    Merged-by : Matthieu Bouron <matthieu.bouron@stupeflix.com>

    • [DH] libavcodec/dxva2_h264.c
    • [DH] libavcodec/h264.c
    • [DH] libavcodec/h264.h
    • [DH] libavcodec/h264_cabac.c
    • [DH] libavcodec/h264_cavlc.c
    • [DH] libavcodec/h264_direct.c
    • [DH] libavcodec/h264_loopfilter.c
    • [DH] libavcodec/h264_mb.c
    • [DH] libavcodec/h264_mb_template.c
    • [DH] libavcodec/h264_mvpred.h
    • [DH] libavcodec/h264_parser.c
    • [DH] libavcodec/h264_ps.c
    • [DH] libavcodec/h264_refs.c
    • [DH] libavcodec/h264_sei.c
    • [DH] libavcodec/h264_slice.c
    • [DH] libavcodec/vaapi_h264.c
    • [DH] libavcodec/vdpau.c
    • [DH] libavcodec/vdpau_h264.c
    • [DH] libavcodec/videotoolbox.c
  • How to make high smooth, high resolution particle motion animations

    5 décembre 2019, par algae

    For some time I have been having trouble with producing short movies/animations/gifs which are of sufficiently high resolution. I’m going to use R to generate some frames as a random example, but if there is somewhere else I should be creating frames from to give better results I would be interested in that too.

    Creating frames

    The kinds of animations I’m interested involve some cloud of ’particles’ moving about the page. There are usually a large number of particles and I would like their motion be as smooth as possible. As a random example, consider the R code (using base graphics and not ggplot2 as it is far quicker for saving a large number of frames)

    N &lt;- 500
    nFrames &lt;- 250
    points &lt;- pracma::randp(n=N, r=1)
    rot &lt;- function(p, a) { return(cbind(p[,1]*cos(a) - p[,2]*sin(a), p[,1]*sin(a) + p[,2]*cos(a))) }
    cols &lt;- colorRampPalette(c("red", "green", "blue"))(nFrames)
    ang &lt;- seq(0, pi, length=N)

    # Save frames
    png(filename="%d.png")
    par(mar=c(0,0,0,0))
    for (i in seq(1,N,length=nFrames))
           plot(sqrt(i)*rot(points, ang[i]), xlim=sqrt(N)*c(-1,1),  ylim=sqrt(N)*c(-1,1), cex=0.5, pch=19, col=cols[i], asp=1, xaxs="i")

    dev.off()

    Frames to animation

    There are a number of tools available to chain each frame together into an animation (in R there are also things like gganimate which I have tried but did not find convenient or better than the following). I also don’t have any requirements for the resulting file size or time taken to get everything looking as crisp as possible.

    convert

    For short gif style animations a common solution is to do something like convert -delay 1 -loop 0 *.png g.gif which gives

    enter image description here

    gifski

    Running gifski -o g.gif *.png produces

    boring_gif

    There is an annoying amount of ’jitter’ happening in the transition between frames in both of the above (though less noticeable with gifski).

    ffmpeg

    Being gifs, the above will be have limited options for tweaking so I suspect part of the solution lies in using ffmpeg. All I would like to know is how to make the animation appear totally smooth without any kind of noticeable blurriness. Here the resulting movies tend to be quite smooth, but resolution is lacking.. e.g. after setting height=1080 and width=1080 in png() of the above code we can run

    fmpeg -i %d.png -s 1080x1080 -c:v libx264 -vf fps=250 -pix_fmt yuv444p out.mp4

    If the particles move on a time/space scale smaller than is visible to the naked eye, and we set the frames per second to be the total number of frames, the transition between frames should be seamless, right ? At around the 2 second mark in out.mp4 you will see some kind of frame drop and similarly right at the beginning. Why does this happen ?

    Questions

    1. Is there a standard documented approach to generating high quality animations/movies involving large numbers of ’point-like’ particles ? Do we need more an more frames ?
    2. How to improve resolution of movies using ffmpeg ? Should I change from .png format to something vectorised (if so, how) ?

    Running Fedora v31.