Recherche avancée

Médias (1)

Mot : - Tags -/vidéo

Autres articles (27)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (5624)

  • ffmpeg - Poll folder for files, and stream as video with rtp

    17 janvier 2019, par Omer

    (I’m a newbie when it comes to ffmpeg).
    I have an image source which saves files to a given folder in a rate of 30 fps. I want to wait for every (let’s say) 30 frames chunk, encode it to h264 and stream it with RDP to some other app.

    I thought about writing a python app which just waits for the images, and then executes an ffmpeg command. For that I wrote the following code :

    main.py :

    import os
    import Helpers
    import argparse
    import IniParser
    import subprocess
    from functools import partial

    from Queue import Queue
    from threading import Semaphore, Thread


    def Run(config):

       os.chdir(config.Workdir)
       iteration = 1

       q = Queue()
       Thread(target=RunProcesses, args=(q, config.AllowedParallelRuns)).start()

       while True:

           Helpers.FileCount(config.FramesPathPattern, config.ChunkSize * iteration)

           command = config.FfmpegCommand.format(startNumber = (iteration-1)*config.ChunkSize, vFrames=config.ChunkSize)

           runFunction = partial(subprocess.Popen, command)
           q.put(runFunction)

           iteration += 1

    def RunProcesses(queue, semaphoreSize):

       semaphore = Semaphore(semaphoreSize)

       while True:

           runFunction = queue.get()

           Thread(target=HandleProcess, args=(runFunction, semaphore)).start()

    def HandleProcess(runFunction, semaphore):

       semaphore.acquire()

       p = runFunction()
       p.wait()

       semaphore.release()

    if __name__ == '__main__':

       argparser = argparse.ArgumentParser()
       argparser.add_argument("config", type=str, help="Path for the config file")
       args = argparser.parse_args()

       iniFilePath = args.config

       config = IniParser.Parse(iniFilePath)

       Run(config)

    Helpers.py (not really relevant) :

    import os
    import time
    from glob import glob

    def FileCount(pattern, count):

       count = int(count)

       lastCount = 0
       while True:

           currentCount = glob(pattern)

           if lastCount != currentCount:
               lastCount = currentCount

           if len(currentCount) >= count and all([CheckIfClosed(f) for f in currentCount]):

               break

           time.sleep(0.05)

    def CheckIfClosed(filePath):

       try:
           os.rename(filePath, filePath)
           return True
       except:
           return False

    I used the following config file :

    Workdir = "C:\Developer\MyProjects\Streaming\OutputStream\PPM"
    ; Workdir is the directory of reference from which all paths are relative to.
    ; You may still use full paths if you wish.

    FramesPathPattern = "F*.ppm"
    ; The path pattern (wildcards allowed) where the rendered images are stored to.
    ; We use this pattern to detect how many rendered images are available for streaming.
    ; When a chunk of frames is ready - we stream it (or store to disk).

    ChunkSize = 30 ; Number of frames for bulk.
    ; ChunkSize sets the number of frames we need to wait for, in order to execute the ffmpeg command.
    ; If the folder already contains several chunks, it will first process the first chunk, then second, and so on...

    AllowedParallelRuns = 1 ; Number of parallel allowed processes of ffmpeg.
    ; This sets how many parallel ffmpeg processes are allowed.
    ; If more than one chunk is available in the folder for processing, we will execute several ffmpeg processes in parallel.
    ; Only when on of the processes will finish, we will allow another process execution.

    FfmpegCommand = "ffmpeg -re -r 30 -start_number {startNumber} -i F%08d.ppm -vframes {vFrames} -vf vflip -f rtp rtp://127.0.0.1:1234" ; Command to execute when a bulk is ready for streaming.
    ; Once a chunk is ready for processing, this is the command that will be executed (same as running it from the terminal).
    ; There is however a minor difference. Since every chunk starts with a different frame number, you can use the
    ; expression of "{startNumber}" which will automatically takes the value of the matching start frame number.
    ; You can also use "{vFrames}" as an expression for the ChunkSize which was set above in the "ChunkSize" entry.

    Please note that if I set "AllowedParallelRuns = 2" then it allows multiple ffmpeg processes to run simultaneously.

    I then tried to play it with ffplay and see if I’m doing it right.
    The first chunk was streamed fine. The following chunks weren’t so great. I got a lot of [sdp @ 0000006de33c9180] RTP: dropping old packet received too late messages.

    What should I do so I get the ffplay, to play it in the order of the incoming images ? Is it right to run parallel ffmpeg processes ? Is there a better solution to my problem ?

    Thank you !

  • interrupt and resume long running ffmpeg encoding

    17 octobre 2022, par simon

    When i have a longer high res video (full-hd or 4k) which are not compressed well, encoding to webm/vp9 can take very long even with a recent system due to the lack of hardware acceleration with webm/vp9.
Are there any options to interrupt an encoding with ffmpeg and resume which survives a reboot.
So i don't want to pause encoding using bg but save & stop encoding state and resume from there.

    


    The next best thing i could think of is to split the source into smaller subsets (by time) and process them and stitch results together again. But this only allows predefined interruption points and requires the split & merge to be done in addition.
On the pro side it could allow parallel processing if multithreading is not using all available cores yet.

    


  • PyAV Raw video to MJPEG or RTSP

    14 décembre 2020, par aris-t

    I figured I would ask this in parallel to my own searching as I am not that familiar with ffmpeg or PyAV.

    


    How might one go about reading raw video from a webcam, trans code it to either Mjpeg or RTSP and output it using PyAV ?

    


    I find plenty of examples of reading one file to another of the same format, reading RTSP and MJPEG to a file but no examples raw video to stream. My attempts at taking the raw video to file have also been unsuccessful resulting in data being written to the file yet the file is non readable and appears to have indexing issues.

    


    Any help is appreciated.