Recherche avancée

Médias (1)

Mot : - Tags -/censure

Autres articles (88)

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

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

Sur d’autres sites (7584)

  • How to create a video from svg files using a pipe with ffmpeg ?

    5 juillet 2023, par Max Chr.

    I want to create a video from svg graphic stored in a database. My procedure would be the following to archive that :

    &#xA;

      &#xA;
    1. connect to database
    2. &#xA;

    3. create ffmpeg command which takes a pipe as input
    4. &#xA;

    5. spawn the ffmpeg child process
    6. &#xA;

    7. Wait for the output of the process.
    8. &#xA;

    &#xA;

    start another thread :&#xA;For all svg files do :

    &#xA;

      &#xA;
    1. download the svg from the database into a byte buffer
    2. &#xA;

    3. write the byte buffer to stdin of the ffmpeg child process
    4. &#xA;

    &#xA;

    When running my code I encounter a problem when piping the svg files to ffmpeg.&#xA;Another possibility would be to download all the svg files to a temp directory and then using ffmpeg, but I want to avoid this.

    &#xA;

    I used ffmpeg -f image2pipe -c:v svg -i - -c:v libx264 -y Downloads/out.mp4. But then ffmpeg gives me the following error :

    &#xA;

    [image2pipe @ 0x562ebd74c300] Could not find codec parameters for stream 0 (Video: svg (librsvg), none): unspecified size&#xA;Consider increasing the value for the &#x27;analyzeduration&#x27; (0) and &#x27;probesize&#x27; (5000000) options&#xA;

    &#xA;

    I found out that there's a svg_pipe format in ffmpeg, so I tried that - without success, same error.

    &#xA;

    Do you have any ideas how to make this work ?

    &#xA;

  • can't pipe in numpy arrays (images) to ffmpeg subprocess in python

    21 juin 2023, par Kevin

    I'm trying to capture webcam video stream using opencv and pipe raw frames into ffmpeg subprocess, apply 3d .cube lut, bring back those lut applied frames into opencv and display it using cv2.imshow.

    &#xA;

    This is my code :

    &#xA;

    import cv2&#xA;import subprocess as sp&#xA;import numpy as np&#xA;&#xA;lut_cmd = [&#xA;            &#x27;ffmpeg&#x27;, &#x27;-f&#x27;, &#x27;rawvideo&#x27;, &#x27;-pixel_format&#x27;, &#x27;bgr24&#x27;, &#x27;-s&#x27;, &#x27;1280x720&#x27;, &#x27;-framerate&#x27;, &#x27;30&#x27;, &#x27;-i&#x27;, &#x27;-&#x27;, &#x27;-an&#x27;, &#x27;-vf&#x27;,&#xA;            &#x27;lut3d=file=lut/luts/lut.cube&#x27;, &#x27;-f&#x27;, &#x27;rawvideo&#x27;, &#x27;pipe:1&#x27;&#xA;        ]&#xA;&#xA;lut_process = sp.Popen(lut_cmd, stdin=sp.PIPE, stdout=sp.PIPE)&#xA;&#xA;width = 1280&#xA;height = 720&#xA;&#xA;video_capture = cv2.VideoCapture(0)&#xA;&#xA;while True:&#xA;    ret, frame = video_capture.read()&#xA;&#xA;    if not ret:&#xA;        break&#xA; &#xA;    # Write raw video frame to input stream of ffmpeg sub-process.&#xA;    lut_process.stdin.write(frame.tobytes())&#xA;    lut_process.stdin.flush()&#xA;    print("flushed")&#xA;&#xA;    # Read the processed frame from the ffmpeg subprocess&#xA;    raw_frame = lut_process.stdout.read(width * height * 3)&#xA;    print("read")&#xA;    frame = np.frombuffer(raw_frame, dtype=np.uint8).reshape(height, width, 3)&#xA;&#xA;    cv2.imshow(&#x27;Video&#x27;, frame)&#xA;&#xA;    if cv2.waitKey(1) &amp; 0xFF == ord(&#x27;q&#x27;):&#xA;        break&#xA;&#xA;lut_process.terminate()&#xA;video_capture.release()&#xA;&#xA;cv2.destroyAllWindows()&#xA;&#xA;

    &#xA;

    code gets stuck at reading from ffmpeg part :&#xA;raw_frame = lut_process.stdout.read(width * height * 3)

    &#xA;

    this is what i get when i run the code :

    &#xA;

    flushed&#xA;Input #0, rawvideo, from &#x27;fd:&#x27;:&#xA;  Duration: N/A, start: 0.000000, bitrate: 663552 kb/s&#xA;  Stream #0:0: Video: rawvideo (BGR[24] / 0x18524742), bgr24, 1280x720, 663552 kb/s, 30 tbr, 30 tbn&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))&#xA;Output #0, rawvideo, to &#x27;pipe:1&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf60.3.100&#xA;  Stream #0:0: Video: rawvideo (BGR[24] / 0x18524742), bgr24(progressive), 1280x720, q=2-31, 663552 kb/s, 30 fps, 30 tbn&#xA;    Metadata:&#xA;      encoder         : Lavc60.3.100 rawvideo&#xA;frame=    0 fps=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A  &#xA;

    &#xA;

    "read" never gets printed. ffmpeg is stuck at 0fps. cv2.imshow doesn't show up.

    &#xA;

    I tried changing lut_process.stdin.write(frame.tobytes()) &#xA;to lut_process.stdin.write(frame.tostring()), but result was same.

    &#xA;

    I tried adding 3 seconds pause before first write to ffmpeg begin, thinking maybe ffmpeg was not ready to process frames, but result was same.

    &#xA;

    I'm sure that my webcam is working, and I know it's video stream is 1280x720 30fps.

    &#xA;

    I was successful at&#xA;Displaying webcam stream just using opencv,&#xA;set FFmpeg input directly to my webcam and get output result using stdout.read, displaying it using opencv.

    &#xA;

    have no idea what should I try next.

    &#xA;

    I am using macOS 12.6, openCV 4.7.0, ffmpeg 6.0, python 3.10.11, and visual studio code.

    &#xA;

    Any help would be greatly appreciated.

    &#xA;

  • can't pipe in opencv frames to ffmpeg subprocess in python

    19 juin 2023, par Kevin

    I'm trying to capture webcam video stream using opencv and pipe raw frames into ffmpeg subprocess, apply 3d .cube lut, bring back those lut applied frames into opencv and display it using cv2.imshow.

    &#xA;

    This is my code :

    &#xA;

    import cv2&#xA;import subprocess as sp&#xA;import numpy as np&#xA;&#xA;lut_cmd = [&#xA;            &#x27;ffmpeg&#x27;, &#x27;-f&#x27;, &#x27;rawvideo&#x27;, &#x27;-pixel_format&#x27;, &#x27;bgr24&#x27;, &#x27;-s&#x27;, &#x27;1280x720&#x27;, &#x27;-framerate&#x27;, &#x27;30&#x27;, &#x27;-i&#x27;, &#x27;-&#x27;, &#x27;-an&#x27;, &#x27;-vf&#x27;,&#xA;            &#x27;lut3d=file=lut/luts/lut.cube&#x27;, &#x27;-f&#x27;, &#x27;rawvideo&#x27;, &#x27;pipe:1&#x27;&#xA;        ]&#xA;&#xA;lut_process = sp.Popen(lut_cmd, stdin=sp.PIPE, stdout=sp.PIPE)&#xA;&#xA;width = 1280&#xA;height = 720&#xA;&#xA;video_capture = cv2.VideoCapture(0)&#xA;&#xA;while True:&#xA;    ret, frame = video_capture.read()&#xA;&#xA;    if not ret:&#xA;        break&#xA; &#xA;    # Write raw video frame to input stream of ffmpeg sub-process.&#xA;    lut_process.stdin.write(frame.tobytes())&#xA;    lut_process.stdin.flush()&#xA;    print("flushed")&#xA;&#xA;    # Read the processed frame from the ffmpeg subprocess&#xA;    raw_frame = lut_process.stdout.read(width * height * 3)&#xA;    print("read")&#xA;    frame = np.frombuffer(raw_frame, dtype=np.uint8).reshape(height, width, 3)&#xA;&#xA;    cv2.imshow(&#x27;Video&#x27;, frame)&#xA;&#xA;    if cv2.waitKey(1) &amp; 0xFF == ord(&#x27;q&#x27;):&#xA;        break&#xA;&#xA;lut_process.terminate()&#xA;video_capture.release()&#xA;&#xA;cv2.destroyAllWindows()&#xA;&#xA;

    &#xA;

    code gets stuck at reading from ffmpeg part :&#xA;raw_frame = lut_process.stdout.read(width * height * 3)

    &#xA;

    this is what i get when i run the code :

    &#xA;

    flushed&#xA;Input #0, rawvideo, from &#x27;fd:&#x27;:&#xA;  Duration: N/A, start: 0.000000, bitrate: 663552 kb/s&#xA;  Stream #0:0: Video: rawvideo (BGR[24] / 0x18524742), bgr24, 1280x720, 663552 kb/s, 30 tbr, 30 tbn&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))&#xA;Output #0, rawvideo, to &#x27;pipe:1&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf60.3.100&#xA;  Stream #0:0: Video: rawvideo (BGR[24] / 0x18524742), bgr24(progressive), 1280x720, q=2-31, 663552 kb/s, 30 fps, 30 tbn&#xA;    Metadata:&#xA;      encoder         : Lavc60.3.100 rawvideo&#xA;frame=    0 fps=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A  &#xA;

    &#xA;

    "read" never gets printed. ffmpeg is stuck at 0fps. cv2.imshow doesn't show up.

    &#xA;

    I tried changing lut_process.stdin.write(frame.tobytes()) &#xA;to lut_process.stdin.write(frame.tostring()), but result was same.

    &#xA;

    I tried adding 3 seconds pause before first write to ffmpeg begin, thinking maybe ffmpeg was not ready to process frames, but result was same.

    &#xA;

    I'm sure that my webcam is working, and I know it's video stream is 1280x720 30fps.

    &#xA;

    I was successful at&#xA;Displaying webcam stream just using opencv,&#xA;set FFmpeg input directly to my webcam and get output result using stdout.read, displaying it using opencv.

    &#xA;

    have no idea what should I try next.

    &#xA;

    I am using macOS 12.6, openCV 4.7.0, ffmpeg 6.0, python 3.10.11, and visual studio code.

    &#xA;

    Any help would be greatly appreciated.

    &#xA;