Recherche avancée

Médias (0)

Mot : - Tags -/diogene

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

Autres articles (106)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

Sur d’autres sites (14106)

  • Nextjs/React/JS How compress video file uploaded by user through input (client side preferred)

    1er novembre 2022, par vana22

    I have made a basic app where the user can upload a video file through an input.
As you can see in the code i also retrieve the duration and the size of the initial video.

    


    Now the question is, how i can compress the video file in the function "compressvid" so that the size of the video becomes massively smaller (at later stage i want to upload these videos to firebase firestore).
I'e read something about ffmpeg but wasn't able to figure out how to use it here.
I prefer it to be client side as the videos a client can upload are at max 30sec long.
If client side is not possible how would it work server side ?

    


    import Head from &#x27;next/head&#x27;&#xA;import styles from &#x27;../styles/Home.module.css&#x27;&#xA;import { useState, useEffect } from &#x27;react&#x27;&#xA;&#xA;export default function Home() {&#xA;&#xA;  const [videofile, setVideo] = useState("")&#xA;  const [viddur, setviddur] = useState("")&#xA;&#xA;&#xA;  useEffect(() => {&#xA;    // only run this if videofile exists&#xA;    if (videofile != "") {&#xA;      console.log("compress video now ")&#xA;      console.log(videofile.type)&#xA;&#xA;&#xA;      // get duration of video by creating a theoretical video component&#xA;      var video = document.createElement(&#x27;video&#x27;);&#xA;      video.preload = &#x27;metadata&#x27;;&#xA;      video.onloadedmetadata = function() {&#xA;        window.URL.revokeObjectURL(video.src);&#xA;        // here now can check if video is too long&#xA;        setviddur(video.duration)&#xA;      }&#xA;      video.src = URL.createObjectURL(videofile)&#xA;      &#xA;    }&#xA;  }, [videofile]);&#xA;&#xA;  const clickedvideo = () => {&#xA;    console.log("clicked video")&#xA;  }&#xA;&#xA;  const compressvid = () => {&#xA;    // here need to compress the video so that the size is smaller: preferred client-side; if that&#x27;s not possible howis it posssible server side or with a cheap api&#xA;  }&#xA;&#xA;  return (&#xA;    <div classname="{styles.container}">&#xA;      &#xA;        &#xA;        &#xA;        &#xA;      &#xA;&#xA;      <main classname="{styles.main}">&#xA;        <h1 classname="{styles.title}">&#xA;          Video compressor&#xA;        </h1>&#xA;        <p>Size of video before: {videofile.size}</p>&#xA;        <p>Duration of video: {viddur}</p>&#xA;        <p>Size of video after: { }</p>&#xA;        <input classname="{styles.videoinput}" type="file" accept="video/mp4,video/x-m4v,video/*" />> setVideo(e.target.files[0])}>&#xA;        <div>&#xA;          {(videofile != "") ? <video autoplay="autoplay" loop="loop" src="{URL.createObjectURL(videofile)}" width="300px" height="300px"></video> : null}&#xA;        </div>&#xA;      </main>&#xA;    </div>&#xA;  )&#xA;}&#xA;

    &#xA;

    I tried to compress a video uploaded by a user but didn't figure out how to solve it.

    &#xA;

  • rtmp : Set the client buffer time to 3s instead of 0.26s

    13 juin 2012, par Samuel Pitoiset

    rtmp : Set the client buffer time to 3s instead of 0.26s

  • rtmp : Set the client buffer time to 3s instead of 0.26s

    13 juin 2012, par Samuel Pitoiset

    rtmp : Set the client buffer time to 3s instead of 0.26s