Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (48)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (6218)

  • ffmpeg module saving not working after compression

    27 août 2022, par nickcoding2

    I'm just trying to save an mp4 to a different mp4 (before I even start playing around with the different compression settings). What exactly is going wrong here ?

    


    const ffmpeg = require('ffmpeg');

try {
    var process = new ffmpeg('./original.mp4');
    process.then(function (video) {
        video
        .save('./new.mp4', function (error, file) {
            if (!error) {
                console.log('Video file: ' + file);
            } else {
                console.log(error)
            }
        });
    }, function (err) {
        console.log('Error: ' + err);
    });
} catch (e) {
    console.log(e.code);
    console.log(e.msg);
}


    


    I get the following error :

    


    Error: Command failed: ffmpeg -i ./original.mp4  ./new.mp4
/bin/sh: ffmpeg: command not found

    at ChildProcess.exithandler (child_process.js:390:12)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1055:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) {
  killed: false,
  code: 127,
  signal: null,
  cmd: 'ffmpeg -i ./original.mp4  ./new.mp4'
}


    


  • TypeError : expected str, bytes or os.PathLike object, not module when trying to sream openCv frames to rtmp server

    30 novembre 2022, par seriously

    I am using openCv and face-recognition api to detect a face using a webcam then compare it with a previously taken image to check and see if the people on both images are the same and the openCv and face-recognition part of the code works properly now what I am trying to achieve is to stream the openCv processed video frames to an rtmp server so for this I am trying to use ffmpeg and running the command using subprocess but when I run the code I get error TypeError: expected str, bytes or os.PathLike object, not module. But I am writing the frames as bytes to stdin hence p.stdin.write(frame.tobytes()). How can I fix it and properly stream my openCv frames to an rtmp server using ffmpeg. Thanks in advance.

    


    Traceback (most recent call last):&#xA;  File "C:\Users\blah\blah\test.py", line 52, in <module>&#xA;    p = subprocess.Popen(command, stdin=subprocess.PIPE, shell=False)&#xA;  File "C:\Python310\lib\subprocess.py", line 969, in __init__&#xA;    self._execute_child(args, executable, preexec_fn, close_fds,&#xA;  File "C:\Python310\lib\subprocess.py", line 1378, in _execute_child&#xA;    args = list2cmdline(args)&#xA;  File "C:\Python310\lib\subprocess.py", line 561, in list2cmdline&#xA;    for arg in map(os.fsdecode, seq):&#xA;  File "C:\Python310\lib\os.py", line 822, in fsdecode&#xA;    filename = fspath(filename)  # Does type-checking of `filename`.&#xA;TypeError: expected str, bytes or os.PathLike object, not module&#xA;</module>

    &#xA;

    import cv2&#xA;import numpy as np&#xA;import face_recognition&#xA;import os&#xA;import subprocess&#xA;import ffmpeg&#xA;&#xA;path = &#x27;../attendance_imgs&#x27;&#xA;imgs = []&#xA;classNames = []&#xA;myList = os.listdir(path)&#xA;&#xA;for cls in myList:&#xA;    curruntImg = cv2.imread(f&#x27;{path}/{cls}&#x27;)&#xA;    imgs.append(curruntImg)&#xA;    classNames.append(os.path.splitext(cls)[0])&#xA;&#xA;def findEncodings(imgs):&#xA;    encodeList = []&#xA;    for img in imgs:&#xA;        img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)&#xA;        encode = face_recognition.face_encodings(img)[0]&#xA;        encodeList.append(encode)&#xA;    return encodeList&#xA;&#xA;encodeListKnown = findEncodings(imgs)&#xA;print(&#x27;Encoding Complete&#x27;)&#xA;&#xA;cap = cv2.VideoCapture(0)&#xA;&#xA;rtmp_url = "rtmp://127.0.0.1:1935/stream/webcam"&#xA;&#xA;fps = int(cap.get(cv2.CAP_PROP_FPS))&#xA;width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))&#xA;height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))&#xA;&#xA;# command and params for ffmpeg&#xA;command = [ffmpeg,&#xA;           &#x27;-y&#x27;,&#xA;           &#x27;-f&#x27;, &#x27;rawvideo&#x27;,&#xA;           &#x27;-vcodec&#x27;, &#x27;rawvideo&#x27;,&#xA;           &#x27;-pix_fmt&#x27;, &#x27;bgr24&#x27;,&#xA;           &#x27;-s&#x27;, "{}x{}".format(width, height),&#xA;           &#x27;-r&#x27;, str(fps),&#xA;           &#x27;-i&#x27;, &#x27;-&#x27;,&#xA;           &#x27;-c:v&#x27;, &#x27;libx264&#x27;,&#xA;           &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;,&#xA;           &#x27;-preset&#x27;, &#x27;ultrafast&#x27;,&#xA;           &#x27;-f&#x27;, &#x27;flv&#x27;,&#xA;           &#x27;rtmp://127.0.0.1:1935/stream/webcam&#x27;]&#xA;&#xA;p = subprocess.Popen(command, stdin=subprocess.PIPE, shell=False)&#xA;&#xA;&#xA;while True:&#xA;    ret, frame, success, img = cap.read()&#xA;    if not ret:&#xA;        print("frame read failed")&#xA;        break&#xA;    imgSmall = cv2.resize(img, (0,0), None, 0.25, 0.25)&#xA;    imgSmall = cv2.cvtColor(imgSmall, cv2.COLOR_BGR2RGB)&#xA;&#xA;    currentFrameFaces = face_recognition.face_locations(imgSmall)&#xA;    currentFrameEncodings = face_recognition.face_encodings(imgSmall, currentFrameFaces)&#xA;&#xA;    for encodeFace, faceLocation in zip(currentFrameEncodings, currentFrameFaces):&#xA;        matches = face_recognition.compare_faces(encodeListKnown, encodeFace)&#xA;        faceDistance = face_recognition.face_distance(encodeListKnown, encodeFace)&#xA;        matchIndex = np.argmin(faceDistance)&#xA;&#xA;        if matches[matchIndex]:&#xA;            name = classNames[matchIndex].upper()&#xA;            y1, x2, y2, x1 = faceLocation&#xA;            y1, x2, y2, x1 = y1 * 4, x2 * 4, y2 * 4, x1 * 4 &#xA;            cv2.rectangle(img, (x1, y1), (x2, y2), (0, 255, 0), 2)&#xA;            cv2.rectangle(img, (x1, y2 - 35), (x2, y2), (0, 255, 0), cv2.FILLED)&#xA;            cv2.putText(img, name, (x1 &#x2B; 6, y2 - 6), cv2.FONT_HERSHEY_DUPLEX, 1, (255, 255, 255), 2) &#xA;&#xA;    # write to pipe&#xA;    p.stdin.write(frame.tobytes())&#xA;

    &#xA;

  • Using ffmpeg with frei0r on windows 10. Can't find module from frei0r

    21 février 2023, par Denis

    I am trying to add a filter to my video using ffmpeg and frei0r filters on windows 10. ffmpeg.exe is located in the system32 folder. ffmpeg works fine on other tasks. As soon as I try to add the frei0r filter, I get an error :

    &#xA;

    Could not find module &#x27;glow&#x27;.&#xA;Error initializing filter &#x27;frei0r&#x27; with args &#x27;glow:20&#x27;&#xA;

    &#xA;

    I downloaded the frei0r dll files from the official site and placed them in the system32 folder, and then placed them in another folder. Additionally, I registered the path :

    &#xA;

    set FREI0R_PATH=C:\WINDOWS\system32\frei0r-1&#xA;

    &#xA;

    In cmd I enter the following command :

    &#xA;

    ffmpeg -loglevel debug -i 1.mp4 -vf "frei0r=glow:20" -t 10 1out.mp4&#xA;

    &#xA;

    help me

    &#xA;

    I tried everything I saw online and nothing helped.

    &#xA;