Recherche avancée

Médias (0)

Mot : - Tags -/interaction

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (34)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (11015)

  • Programmatically sending bytes to ffmpeg via STDIN to create still image file

    8 octobre 2019, par Sam Marrocco

    I am attempting to use vb.net code to send individual pixel information as bytes to ffmpeg with the purpose of saving a still DPX image file. I have already successfully read DPX files and output them via STDOUT into vb.net code.

    There seem to be many examples out there of piping movie files but there are also discrepancies, such as some people using image2pipe and others using rawvideo. I am uncertain when to use one over the other. The various methods I’ve tried result in ffmpeg returned errors such as "Packet too small for DPX header" or "Error while decoding stream #0:0 : Invalid data found when processing input". As I understand it, I am not providing a header, only the raw individual pixel RGBRGBRGB.... values as a byte array.

    The arguments sent to ffmpeg via command line are :

    -f image2pipe -pix_fmt rgb24 -s 16x16 -bits_per_raw_sample 8 -c:v dpx -i - \MyPath\MyFilename.dpx

    My vb.net code is as follows :

    Dim P As New Process
    P.StartInfo.FileName = m_FFMPEGExecutable_PathFile
    P.StartInfo.Arguments = (see above arguments)
    P.StartInfo.UseShellExecute = False
    P.StartInfo.CreateNoWindow = True
    P.StartInfo.RedirectStandardInput = True
    p.Start


    'Test image: A single red, green, blue, black and white pixel followed by all black

    Dim Tiny((16 * 16) - 1) As Byte

    Tiny(0) = 255
    Tiny(1) = 0
    Tiny(2) = 0

    Tiny(3) = 0
    Tiny(4) = 255
    Tiny(5) = 0

    Tiny(6) = 0
    Tiny(7) = 0
    Tiny(8) = 255

    For i As byte = 9 To ((16x16)-1)
      Tiny(i) = 255
    Next

    'Send the rgb byte array to ffmpeg:
    P.StandardInput.BaseStream.Write(Tiny, 0, Tiny.Length)
    P.StandardInput.Flush()
    P.StandardInput.Close()

    I have tried many variations on the above ffmpeg arguments but cannot seem to avoid these errors. Any suggestions would be appreciated, including information on when to use image2pipe vs. rawvideo.

  • using file info from txt file to bull trim audio with ffmpeg

    26 juin 2018, par thirtylightbulbs

    I have found how to trim individual audio files with ffmpeg. Is there any way to do it on bulk ? I have thousands of audio files each with different segments that need to be saved separately. The input file, time to start clipping, and duration are all in separate columns, row by row, in a text/excel file.

  • Pipe video frames from ffmpeg to numpy array without loading whole movie into memory

    2 mai 2021, par marcman

    I'm not sure whether what I'm asking is feasible or functional, but I'm experimenting with trying to load frames from a video in an ordered, but "on-demand," fashion.

    


    Basically what I have now is to read the entire uncompressed video into a buffer by piping through stdout, e.g. :

    


    H, W = 1080, 1920 # video dimensions
video = '/path/to/video.mp4' # path to video

# ffmpeg command
command = [ "ffmpeg",
            '-i', video,
            '-pix_fmt', 'rgb24',
            '-f', 'rawvideo',
            'pipe:1' ]

# run ffmpeg and load all frames into numpy array (num_frames, H, W, 3)
pipe = subprocess.run(command, stdout=subprocess.PIPE, bufsize=10**8)
video = np.frombuffer(pipe.stdout, dtype=np.uint8).reshape(-1, H, W, 3)

# or alternatively load individual frames in a loop
nb_img = H*W*3 # H * W * 3 channels * 1-byte/channel
for i in range(0, len(pipe.stdout), nb_img):
    img = np.frombuffer(pipe.stdout, dtype=np.uint8, count=nb_img, offset=i).reshape(H, W, 3)


    


    I'm wondering if it's possible to do this same process, in Python, but without first loading the entire video into memory. In my mind, I'm picturing something like :

    


      

    1. open the a buffer
    2. 


    3. seeking to memory locations on demand
    4. 


    5. loading frames to numpy arrays
    6. 


    


    I know there are other libraries, like OpenCV for example, that enable this same sort of behavior, but I'm wondering :

    


      

    • Is it possible to do this operation efficiently using this sort of ffmpeg-pipe-to-numpy-array operation ?
    • 


    • Does this defeat the speed-up benefit of ffmpeg directly rather than seeking/loading through OpenCV or first extracting frames and then loading individual files ?
    •