
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (50)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, 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 (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)
Sur d’autres sites (5525)
-
ffmpeg module saving not working after compression
27 août 2022, par nickcoding2I'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 seriouslyI 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 hencep.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):
 File "C:\Users\blah\blah\test.py", line 52, in <module>
 p = subprocess.Popen(command, stdin=subprocess.PIPE, shell=False)
 File "C:\Python310\lib\subprocess.py", line 969, in __init__
 self._execute_child(args, executable, preexec_fn, close_fds,
 File "C:\Python310\lib\subprocess.py", line 1378, in _execute_child
 args = list2cmdline(args)
 File "C:\Python310\lib\subprocess.py", line 561, in list2cmdline
 for arg in map(os.fsdecode, seq):
 File "C:\Python310\lib\os.py", line 822, in fsdecode
 filename = fspath(filename) # Does type-checking of `filename`.
TypeError: expected str, bytes or os.PathLike object, not module
</module>


import cv2
import numpy as np
import face_recognition
import os
import subprocess
import ffmpeg

path = '../attendance_imgs'
imgs = []
classNames = []
myList = os.listdir(path)

for cls in myList:
 curruntImg = cv2.imread(f'{path}/{cls}')
 imgs.append(curruntImg)
 classNames.append(os.path.splitext(cls)[0])

def findEncodings(imgs):
 encodeList = []
 for img in imgs:
 img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
 encode = face_recognition.face_encodings(img)[0]
 encodeList.append(encode)
 return encodeList

encodeListKnown = findEncodings(imgs)
print('Encoding Complete')

cap = cv2.VideoCapture(0)

rtmp_url = "rtmp://127.0.0.1:1935/stream/webcam"

fps = int(cap.get(cv2.CAP_PROP_FPS))
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))

# command and params for ffmpeg
command = [ffmpeg,
 '-y',
 '-f', 'rawvideo',
 '-vcodec', 'rawvideo',
 '-pix_fmt', 'bgr24',
 '-s', "{}x{}".format(width, height),
 '-r', str(fps),
 '-i', '-',
 '-c:v', 'libx264',
 '-pix_fmt', 'yuv420p',
 '-preset', 'ultrafast',
 '-f', 'flv',
 'rtmp://127.0.0.1:1935/stream/webcam']

p = subprocess.Popen(command, stdin=subprocess.PIPE, shell=False)


while True:
 ret, frame, success, img = cap.read()
 if not ret:
 print("frame read failed")
 break
 imgSmall = cv2.resize(img, (0,0), None, 0.25, 0.25)
 imgSmall = cv2.cvtColor(imgSmall, cv2.COLOR_BGR2RGB)

 currentFrameFaces = face_recognition.face_locations(imgSmall)
 currentFrameEncodings = face_recognition.face_encodings(imgSmall, currentFrameFaces)

 for encodeFace, faceLocation in zip(currentFrameEncodings, currentFrameFaces):
 matches = face_recognition.compare_faces(encodeListKnown, encodeFace)
 faceDistance = face_recognition.face_distance(encodeListKnown, encodeFace)
 matchIndex = np.argmin(faceDistance)

 if matches[matchIndex]:
 name = classNames[matchIndex].upper()
 y1, x2, y2, x1 = faceLocation
 y1, x2, y2, x1 = y1 * 4, x2 * 4, y2 * 4, x1 * 4 
 cv2.rectangle(img, (x1, y1), (x2, y2), (0, 255, 0), 2)
 cv2.rectangle(img, (x1, y2 - 35), (x2, y2), (0, 255, 0), cv2.FILLED)
 cv2.putText(img, name, (x1 + 6, y2 - 6), cv2.FONT_HERSHEY_DUPLEX, 1, (255, 255, 255), 2) 

 # write to pipe
 p.stdin.write(frame.tobytes())



-
Using ffmpeg with frei0r on windows 10. Can't find module from frei0r
21 février 2023, par DenisI 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 :


Could not find module 'glow'.
Error initializing filter 'frei0r' with args 'glow:20'



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 :


set FREI0R_PATH=C:\WINDOWS\system32\frei0r-1



In cmd I enter the following command :


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



help me


I tried everything I saw online and nothing helped.