Recherche avancée

Médias (91)

Autres articles (111)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (9002)

  • Save the stream to mp4 files

    5 mai 2012, par Ruslan Sharipov

    How can I keep the flow (protocol rtsp, codec h264) in file (container mp4) ? That is, on input an endless stream (with CCTV camera), and the output files in mp4 format size of 5-10 minutes of recording time.

    OS : debian, ubuntu
    Software : vlc, ffmpeg (avconv)

    Currently this scheme is used :

    cvlc rtsp://admin:admin@10.1.1.1:554/ch1-s1 --sout=file/ts:stream.ts
    ffmpeg -i stream.ts -vcodec copy -f mp4 stream.mp4

    But it can not record video continuously (between restarts vlc is a loss of about 10 seconds of live video)

  • Read, process and save video and audio with FFMPEG

    3 mai 2017, par sysseon

    I want to open a video resource with ffmpeg on Python, get the read frames from the pipe, modify them (e.g. put the timestamp with OpenCV) and write the result to an output video file. I also want to save the audio source with no changes.

    My code (with no audio and two processes) :

    import subprocess as sp
    import numpy as np
    # import time
    # import cv2

    FFMPEG_BIN = "C:/ffmpeg/bin/ffmpeg.exe"
    INPUT_VID = 'input.avi'
    res = [320, 240]

    command_in = [FFMPEG_BIN,
                 '-y',  # (optional) overwrite output file if it exists
                 '-i', INPUT_VID,
                 '-f', 'image2pipe',  # image2pipe or rawvideo?
                 '-pix_fmt', 'bgr24',
                 '-vcodec', 'rawvideo',
                 '-']

    command_out = [FFMPEG_BIN,
                  '-y',  # (optional) overwrite output file if it exists
                  '-f', 'rawvideo',
                  '-vcodec', 'rawvideo',
                  '-s', '320x240',
                  '-pix_fmt', 'bgr24',
                  '-r', '25',
                  '-i', '-',
                  # '-i', INPUT_VID,    # Audio
                  '-vcodec', 'mpeg4',
                  'output.mp4']

    pipe_in = sp.Popen(command_in, stdout=sp.PIPE, stderr=sp.PIPE)
    pipe_out = sp.Popen(command_out, stdin=sp.PIPE, stderr=sp.PIPE)

    while True:
       # Read 320*240*3 bytes (= 1 frame)
       raw_image = pipe_in.stdout.read(res[0] * res[1] * 3)
       # Transform the byte read into a numpy array
       image = np.fromstring(raw_image, dtype=np.uint8)
       image = image.reshape((res[1], res[0], 3))
       # Draw some text in the image
       # draw_text(image)

       # Show the image with OpenCV (not working, gray image, why?)
       # cv2.imshow("VIDEO", image)

       # Write image to output process
       pipe_out.stdin.write(image.tostring())

    print 'done'
    pipe_in.kill()
    pipe_out.kill()
    1. Could it be done with just a process ? (Read the input from a file,
      put it in the input pipe, get the image, process it, and put it in
      the output pipe to be saved into a video file)
    2. How can I save the audio ? In this example, I could use ’-i
      INPUT_VID’ in the second process to get the audio channel, but my
      source will be a RTSP, and I don’t want to create a connection for
      each process. Could I put video+audio in the pipe and rescue and
      separate it with numpy ? How ?
    3. I use a loop to process the frames and wait until I get an error.
      How can I check if all frames are already read ?
    4. Not important, but if I try to show the images with OpenCV
      (cv2.imshow(...)), I only see a gray screen. Why ?
  • How to send encoded video (or audio) data from server to client in a way that's decodable by webcodecs API using minimal latency and data overhead

    11 janvier 2023, par Tiger Yang

    My question (read entire post for context) :

    


    Given the unique circumstance of only ever decoding data from a specifically-configured encoder, what is the best way I can send the encoded bitstream along with the bare minimum extra bytes required to properly configure the decoder on the client's end (including only things that change per stream, and omitting things that don't, such as resolution) ? I'm a sucker for zero compromises, and I think I am willing to design my own minimal container format to accomplish this.

    


    Context and problem :

    


    I'm working on a remote desktop implementation that consists of a server that captures and encodes the display and speakers using FFmpeg and forwards it via pipe to a go (language) program which sends it on two unidirectional webtransport streams to my client, which I plan to decode using the webcodecs API. According to MDN, the video decoder needs to be fed via .configure() an object containing the following : https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/configure before it's able to decode anything.

    


    same goes for the audio decoder : https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/configure

    


    What I've tried so far :

    


    Because this remote desktop will be for my personal use only, it would only ever receive streams from a specific encoder configured in a specific way encoding video at a specific resolution, framerate, color space, etc.. Therefore, I took my video capture FFmpeg command...

    


    videoString := []string{
        "ffmpeg",
        "-init_hw_device", "d3d11va",
        "-filter_complex", "ddagrab=video_size=1920x1080:framerate=60",
        "-vcodec", "hevc_nvenc",
        "-tune", "ll",
        "-preset", "p7",
        "-spatial_aq", "1",
        "-temporal_aq", "1",
        "-forced-idr", "1",
        "-rc", "cbr",
        "-b:v", "500K",
        "-no-scenecut", "1",
        "-g", "216000",
        "-f", "hevc", "-",
    }


    


    ...and instructed it to write to an mp4 file instead of outputting to pipe, and then I had this webcodecs demo https://w3c.github.io/webcodecs/samples/video-decode-display/ demux it using mp4box.js. Knowing that the demo outputs a proper .configure() object, I blindly copied it and had my client configure using that every time. Sadly, it didn't work, and I since noticed that the "description" part of the configure object changes despite the encoder and parameters being the same.

    


    I knew that mp4 files worked via mp4box, but they can't be streamed with low latency over a network, and additionally, ffmpeg's -f parameters specifies the muxer to use, but there are so many different types.

    


    At this point, I think I'm completely out of my depth, so :

    


    Given the unique circumstance of only ever decoding data from a specifically-configured encoder, what is the best way I can send the encoded bitstream along with the bare minimum extra bytes required to properly configure the decoder on the client's end (including only things that change per stream, and omitting things that don't, such as resolution) ? I'm a sucker for zero compromises, and I think I am willing to design my own minimal container format to accomplish this. (copied above)