Recherche avancée

Médias (91)

Autres articles (57)

  • Pas question de marché, de cloud etc...

    10 avril 2011

    Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
    sur le web 2.0 et dans les entreprises qui en vivent.
    Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
    Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
    le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
    Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

  • Activation de l’inscription des visiteurs

    12 avril 2011, par

    Il est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
    Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
    Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)

Sur d’autres sites (6078)

  • I have use the ffmpeg in my react konva project but it not import correclty ?

    5 septembre 2024, par Humayoun Saeed

    I use ffmpeg in my react konva project to record video and download it, but when i import it give me error, when i give to to gpt or google it giveme another way of export when i do this one it same give me error of import from ffpmg

    


    Error :

    


    ERROR in ./src/components/Preview.jsx 29:25-37
export 'createFFmpeg' (imported as 'createFFmpeg') was not found in '@ffmpeg/ffmpeg' (possible exports : FFmpeg)
ERROR in ./src/components/Preview.jsx 123:34-43
export 'fetchFile' (imported as 'fetchFile') was not found in '@ffmpeg/ffmpeg' (possible exports : FFmpeg)

    


    Preview.jsx :

    


    import React, { useEffect, useState, useRef } from "react";
// import { createFFmpeg } from "@ffmpeg/ffmpeg";
// import { createFFmpeg, fetchFile } from "@ffmpeg/ffmpeg/dist/ffmpeg.min.js";
// import { FFmpeg } from "@ffmpeg/ffmpeg";
// import { fetchFile } from "@ffmpeg/util";
import { createFFmpeg, fetchFile } from "@ffmpeg/ffmpeg";



const Preview = ({ layout, onClose }) => {
  const [currentContent, setCurrentContent] = useState([]);
  const [progress, setProgress] = useState(0);
  const totalDuration = useRef(0);
  const elapsedDuration = useRef(0); // Track total elapsed duration
  const progressInterval = useRef(null);
  const ffmpeg = useRef(null); // Use useRef to store ffmpeg instance
  const [ffmpegReady, setFfmpegReady] = useState(false);

  // Initialize FFmpeg instance
  useEffect(() => {
    const loadFFmpeg = async () => {
      if (!ffmpeg.current) {
        ffmpeg.current = createFFmpeg({ log: true });
        await ffmpeg.current.load();
        setFfmpegReady(true);
      }
    };
    loadFFmpeg();
  }, []);




const handleDownload = async () => {
    try {
      if (!ffmpegReady) {
        alert("FFmpeg is still loading, please wait...");
        return;
      }

      // Fetch all media files from the layout
      const inputFiles = [];

      // Process each division of the layout
      for (const division of layout.divisions) {
        for (let i = 0; i < division.imageSrcs.length; i++) {
          const src = division.imageSrcs[i];

          // Fetch and store media data
          const mediaData = await fetchFile(src);
          const fileName = `input${inputFiles.length + 1}${
            src.endsWith(".mp4") ? ".mp4" : ".png"
          }`;

          // Write file to ffmpeg virtual filesystem
          ffmpeg.current.FS("writeFile", fileName, mediaData);
          inputFiles.push(fileName);
        }
      }

      // Create a list of inputs for ffmpeg
      let concatList = "";
      inputFiles.forEach((fileName) => {
        concatList += `file '${fileName}'\n`;
      });

      // Write the concat list file to FFmpeg FS
      ffmpeg.current.FS(
        "writeFile",
        "concatList.txt",
        new TextEncoder().encode(concatList)
      );

      // Run the ffmpeg command to concatenate all files into one video
      await ffmpeg.current.run(
        "-f",
        "concat",
        "-safe",
        "0",
        "-i",
        "concatList.txt",
        "-c",
        "copy",
        "output.mp4"
      );

      // Read the result video
      const data = ffmpeg.current.FS("readFile", "output.mp4");

      // Create a Blob from the data and download it
      const videoBlob = new Blob([data.buffer], { type: "video/mp4" });
      const url = URL.createObjectURL(videoBlob);
      const link = document.createElement("a");
      link.href = url;
      link.download = `${layout.name || "layout_video"}.mp4`;
      document.body.appendChild(link);
      link.click();
      document.body.removeChild(link);

      alert("Video download completed.");
    } catch (error) {
      console.error("Error during video creation:", error);
    }
  };


 



return (
    
      
        
          Close
        
 
  {/* Download button */}
        > (e.target.style.backgroundColor = "#218838")}
          onMouseOut={(e) => (e.target.style.backgroundColor = "#28a745")}
        >
          Download Video
        
      
    
  );
};

export default Preview;



    


    Ignore all other main issue in just ffmpeg , import, declaration and in it usage in download function, if anyone solution or ability to resolve it, then check it.

    


    I try to use ffmpeg in my project for video downloading but it not importing and not use , i want to download video i made using ffmpeg.

    


  • Parse dynamic mpd file with Media Source Extensions

    17 février 2023, par FrankC

    I just started learning about adaptive streaming, and currently I'm working on a project that needs showing a live video. In order to control some of the elements in mpd file, I determined to use MSE instead of dash.js. I refer to the code at the following URL :https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/samples/dn551368(v=vs.85)
But I found out that there is no "Initialization" tag or "range" attribute in my mpd file. I don't find any relative attribute as well. By the way I'm use nginx-rtmp + ffmpeg to generate dash file.
So here is my dash file looks like

    


    &lt;?xml version="1.0"?>&#xA; &#xA;  <period start="PT0S">&#xA;    &#xA;      &#xA;        &#xA;          <segmenttimeline>&#xA;             <s t="0" d="10000"></s>&#xA;             <s t="10000" d="10000"></s>&#xA;             <s t="20000" d="5000"></s>&#xA;             <s t="25000" d="10000"></s>&#xA;          </segmenttimeline>&#xA;        &#xA;      &#xA;    &#xA;  </period>&#xA;&#xA;

    &#xA;

    My question is :&#xA;1.Did I have any missing parameters in using ffmpeg or nginx-rtmp resulting in losting tag in mpd file ?&#xA;2.Or there is other way to setup "Initialization"/"range" attribute and let my program work ?&#xA;3.I also curious about why my mpd file doesn't have a baseURL element ?

    &#xA;

    ※My mpd file works fine with dash.js, I can see the video properly

    &#xA;

    THANKS A LOT

    &#xA;

  • Conversion of H.264 media file to mp4

    2 juin 2016, par arceus

    I have a raw h264 file which I want to convert to mp4 format so that I can play them in any video player.But I am getting many errors when I use ffmpeg for this task.
    I have used the following command line to convert to mp4.

    ffmpeg -f h264 -i input.264 -vcodec output.mp4

    Below are the errors I get.

    missing picture in access unit with size 3273224
    no frame
    decoding for stream 0 failed
    could not find codec parameters for stream 0

    When I probe using ffprobe input.264 I get these errors.

    Missing picture in access unit with size 3273224
    No start code found
    Error splitting the input into NAL units
    decoding for stream 0 failed
    could not find codec parameters for stream 0

    I have checked other similar problems in this site but could not find the solution.I have added the file at http://s000.tinyupload.com/index.php?file_id=81246308569166574331

    Have a look at the video.