Recherche avancée

Médias (91)

Autres articles (54)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (5052)

  • How to make a nonstreamable mp4 streamable from a JS browser client ?

    14 mai 2020, par Daniel Kobe

    For my service we are sending videos that need processing. Unfortunately some of the videos are non streamable. By that I mean the metadata information is at the end of the file and not the beginning. With ffmpeg you can make a video streamable with this command : ffmpeg -i source.mp4 -a:v copy -a:c copy -movflags faststart output.mp4

    



    Is there anyway I can replicate ffmpegs faststart logic from a JS client ?

    



    I see that there are libaries like ffmpeg.js but I was hoping to avoid having a huge library in the code.

    


  • Adjust client implementations for new demo file size restrictions.

    24 mai 2015, par blueimp
    Adjust client implementations for new demo file size restrictions.
  • 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;