Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (30)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (6180)

  • Revision 28933 : on bouge

    31 mai 2009, par ben.spip@… — Log

    on bouge

  • Why doesn't the ffmpeg output display the stream in the browser ? [closed]

    10 mai 2024, par Tebyy

    Why is it that when I create a livestream in Python using ffmpeg, and then I open the browser and visit the page, the page keeps loading continuously, and in PyCharm logs, I see binary data ? There are no errors displayed, and the code seems correct to me. I even tried saving to a file for testing purposes, and when I play the video, everything works fine. Does anyone know what might be wrong here ?

    


    Code :

    


    def generate_frames():
    cap = cv2.VideoCapture(os.path.normpath(app_root_dir().joinpath("data/temp", "video-979257305707693982.mp4")))
    while cap.isOpened():
        ret, frame = cap.read()
        if not ret:
            break

        yield frame


@app.route('/video_feed')
def video_feed():
    ffmpeg_command = [
        'ffmpeg', '-f', 'rawvideo', '-pix_fmt', 'bgr24',
        '-s:v', '1920x1080', '-r', '60',
        '-i', '-', '-vf', 'setpts=2.5*PTS', # Video Speed
        '-c:v', 'libvpx-vp9', '-g', '60', '-keyint_min', '60',
        '-b:v', '6M', '-minrate', '4M', '-maxrate', '12M', '-bufsize', '8M',
        '-crf', '0', '-deadline', 'realtime', '-tune', 'psnr', '-quality', 'good',
        '-tile-columns', '6', '-threads', '8', '-lag-in-frames', '16',
        '-f', 'webm', '-'
    ]
    ffmpeg_process = subprocess.Popen(ffmpeg_command, stdin=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=-1)
    frames_generator = generate_frames()
    for frame in frames_generator:
        ffmpeg_process.stdin.write(frame)
        ffmpeg_process.stdin.flush()

    ffmpeg_process.stdin.close()
    ffmpeg_process.wait()

    def generate_video_stream(process):
        startTime = time.time()
        buffer = []
        sentBurst = False
        for chunk in iter(lambda: process.stderr.read(4096), b''):
            buffer.append(chunk)

            # Minimum buffer time, 3 seconds
            if sentBurst is False and time.time() > startTime + 3 and len(buffer) > 0:
                sentBurst = True
                for i in range(0, len(buffer) - 2):
                    print("Send initial burst #", i)
                    yield buffer.pop(0)

            elif time.time() > startTime + 3 and len(buffer) > 0:
                yield buffer.pop(0)

            process.poll()
            if isinstance(process.returncode, int):
                if process.returncode > 0:
                    print('FFmpeg Error', process.returncode)

                break

    return Response(stream_with_context(generate_video_stream(ffmpeg_process)), mimetype='video/webm', content_type="video/webm; codecs=vp9", headers=Headers([("Connection", "close")]))



    


  • avfilter/pthread : use slice threading from avutil

    12 juillet 2017, par Muhammad Faiz
    avfilter/pthread : use slice threading from avutil
    

    Benchmark (with 2 cpus) :
    ./ffmpeg -f rawvideo -s 1280x720 -t 1000 -i /dev/zero \
    -filter_threads $threads -vf transpose=clock -f null null
    threads=2 :
    old : 31.129s 31.446s 31.574s
    new : 29.602s 29.636s 29.656s
    threads=3 (nb_threads = nb_cpus + 1 is bad choice at this situation) :
    old : 40.132s 40.279s 40.279s
    new : 39.308s 39.570s 39.693s
    threads=4 :
    old : 31.306s 31.366s 31.654s
    new : 30.231s 30.360s 30.451s

    Signed-off-by : Muhammad Faiz <mfcc64@gmail.com>

    • [DH] libavfilter/pthread.c