Recherche avancée

Médias (0)

Mot : - Tags -/alertes

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

Autres articles (100)

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

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

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

Sur d’autres sites (15145)

  • cv2/ffmpeg "grabFrame packet read max attempts exceeded" error after exactly reading certain number of frames

    26 juin, par banjaxing

    I am using OpenCV to extract frames from videos, run a segmentation AI model, and save the frames and masks to a folder. When I run my code to extract the frame from I encounter the error "grabFrame packet read max attempts exceeded" after processing a certain number of frames. This issue occurs consistently for the same videos across multiple environments.

    


    Error message :

    


    [ WARN:0@379.898] global cap_ffmpeg_impl.hpp:1541 grabFrame packet read max attempts exceeded, if your video have multiple streams (video, audio) try to increase attempt limit by setting environment variable OPENCV_FFMPEG_READ_ATTEMPTS (current value is 10000)


    


    Minimum Reproducible Example

    


    import os
import cv2

videofilename = "test.mp4"
capture = cv2.VideoCapture(videofilename)
frameNum = 0

createfolder = os.getcwd() + '/' + videofilename.split(".")[0] + '/'
if not os.path.exists(createfolder):
    os.makedirs(createfolder)
    os.makedirs(createfolder + "/frames/")

while True:
    success, frame = capture.read()
    if success is False:
        break
    frameNum += 1
    framedownloadname = videofilename.split(".")[0] + '-fr' + str(frameNum) + '.jpg'
    framedownloadloc = createfolder + '/frames/' + framedownloadname
    print(framedownloadloc)
    cv2.imwrite(framedownloadloc, frame)
    img = cv2.imread(framedownloadloc)
    img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

capture.release()


    


    As suggested in error, I increased the OPENCV_FFMPEG_READ_ATTEMPTS env variable up to 10000. However, this seems to have little to no effect on the number of frames before the error appears.

    


  • the "non-monotonic DTS in output stream " error while concatenation even after reencoded input files

    19 juin 2024, par nish

    hi I am trying to write a Python program that is trying to first edit different videos separately under the heading "intro" "story" and "byte" with the help of FFmpeg and Python subprocess module and then concatenate them in the function named "bind". At first, I encountered this "Non-monotonic DTS in output stream" then i reencoded the input files before concatenating them but i am still getting this error

    


    # function to assemble all the videos 


    


    def bind() :

    


    bunch = ["final_intro.mp4","final_story.mp4","finalbite.mp4"]
new_bunch =[]
for video in bunch:
    name = f"re_{video}"
    re_command =[
        "ffmpeg", "-y",
        "-i", video,
        "-c:v", "libx264",
        "-c:a", "aac",
        "-strict", "experimental",
        "-b:a", "192k",
        name
    ]
    subprocess.run(re_command)
    new_bunch.append(name)
    

with open("concat_list_final.txt", "w") as f:
    for video in new_bunch:
        f.write(f"file './{video}'\n")
  
command_final = [ 
    "ffmpeg", "-y",
    "-f", "concat",
    "-safe", "0",
    "-i", "concat_list_final.txt",
    "-c", "copy",
    "done.mp4"
]
subprocess.run(command_final)
for video in new_bunch:
    os.remove(video)
os.remove("final.mp4")
os.remove("updated_final.mp4")
os.remove("concat_list_final.txt")


return "done.mp4"


    


    for reference this is the error messages :-

    


    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x14cf16040] Auto-inserting h264_mp4toannexb bitstream filter [mp4 @ 0x12ce06880] Non-monotonic DTS in output stream 0:0 ; previous : 152933, current : 127760 ; changing to 152934. This may result in incorrect timestamps in the output file. [mp4 @ 0x12ce06880] Non-monotonic DTS in output stream 0:0 ; previous : 152934, current : 128272 ; changing to 152935. This may result in incorrect timestamps in the output file..........

    


  • FFmpeg error with ffmpeg.FS("readfile", "output.mp4"). trying to get ffmpeg to work in the react app

    21 juin 2024, par Paul Tham
     const stackVideos = useCallback(
    async (video1) => {
      try {
        console.log("Fetching video2 from storage...");
        const video2Ref = ref(storage, "video2.mp4");
        const video2Url = await getDownloadURL(video2Ref);
        const video2Blob = await (await fetch(video2Url)).blob();

        console.log("Writing video1 to FFmpeg FS...");
        await ffmpeg.FS("writeFile", "video1.mp4", await fetchFile(video1));

        console.log("Writing video2 to FFmpeg FS...");
        await ffmpeg.FS("writeFile", "video2.mp4", await fetchFile(video2Blob));

        console.log("Files in FFmpeg FS after write:");
        const files = await ffmpeg.FS("readdir", "/");
        console.log(files);

        const { start, end } = inputs[0];
        const startSeconds = new Date(`1970-01-01T${start}Z`).getTime() / 1000;
        const endSeconds = new Date(`1970-01-01T${end}Z`).getTime() / 1000;
        const duration = endSeconds - startSeconds;

        console.log("Running FFmpeg command...");
        await ffmpeg.run(
          "-i",
          "video1.mp4",
          "-ss",
          startSeconds.toString(),
          "-t",
          duration.toString(),
          "-i",
          "video2.mp4",
          "-filter_complex",
          "[0:v]scale=1080:-1[v1];[1:v]scale=-1:1920/2[v2scaled];[v2scaled]crop=1080:1920/2[v2cropped];[v1][v2cropped]vstack=inputs=2,scale=1080:1920[vid]",
          "-map",
          "[vid]",
          "-map",
          "0:a",
          "-c:v",
          "libx264",
          "-crf",
          "23",
          "-preset",
          "veryfast",
          "-shortest",
          "output1.mp4"
        );

        console.log("Files in FFmpeg FS after run:");
        const filesAfterRun = await ffmpeg.FS("readdir", "/");
        console.log(filesAfterRun);

        console.log("Reading output1.mp4 from FFmpeg FS...");
        const data = await ffmpeg.FS("readfile", "output1.mp4");
        console.log("after the FS readfile");
        const url = URL.createObjectURL(
          new Blob([data.buffer], { type: "video/mp4" })
        );
        setStackedVideo(url);
        setOutputFileReady(true); // Mark output file as ready
      } catch (err) {
        console.error("FFmpeg error output:", err);
        setError(`FFmpeg run error: ${err.message}`);
        setIsProcessing(false);
      }
    },
    [inputs]
  );


    


    My error seems to be stemming from this line :

    


     const data = await ffmpeg.FS("readfile", "output1.mp4");


    


    Seeing the ffmpeg.wasm documentation i thought the functions for some of the functions had changed, but when I changed it, it seemed like they did not recognise the new functions. Sometimes this will also give me some other errors like worker.js which I dont understand enough to debug this myself.

    


    words word words words words words word words words wordswords word words words wordswords word words words wordswords word words words wordswords word words words wordswords word words words words