Advanced search

Medias (1)

Tag: - Tags -/ogg

Other articles (92)

  • Amélioration de la version de base

    13 September 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 (...)

  • Le profil des utilisateurs

    12 April 2011, by

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configuration spécifique pour PHP5

    4 February 2011, by

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

On other websites (4786)

  • Pass ffmpeg Stream to OpenCV

    29 April 2021, by Georg

    I would like to use the redirection operator to bring the stream from ffmpeg to cv2 so that I can recognize or mark the faces on the stream and redirect this stream again so that it runs under another stream.

    


    One withoutfacedetect and One withfacedetect.

    


    raspivid -w 1920 -h 1080 -fps 30 -o - -t 0 -vf -hf -b 6000000 | ffmpeg -f h264 -i - -vcodec copy -g 50 -strict experimental -f tee -map 0:v "[f=flv]rtmp://xx.xx.xx.xx/live/withoutfacedetect |[f=h264]pipe:1" > test.mp4


    


    I then read up on CV2 and came across the article.

    


    https://www.bogotobogo.com/python/OpenCV_Python/python_opencv3_Image_Object_Detection_Face_Detection_Haar_Cascade_Classifiers.php

    


    I then ran the script with my picture and was very amazed that there was a square around my face.

    


    But now back to business. What is the best way to do this?

    


    thanks to @Mark Setchell, forgot to mention that I'm using a Raspberry Pi 4.

    


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

    30 November 2022, by 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;

  • FFMPEG rotate command show black color on edges

    11 December 2022, by Najih Zidan

    i am using command ffmpeg -i NoAudio.mp4 -i cat-face-emoji.png -filter_complex "[1]rotate=a=140[ov1];[0][ov1]overlay=480:270" -c:a copy output.mp4 -y to rotate image 140 degree but black background show on edges.

    &#xA;

    Here output video: https://app.dadan.io/video/share/nmmU8uiyCl2YVYm4

    &#xA;

    I am expecting to rotate image without any additional edges as the image in png.

    &#xA;