Recherche avancée

Médias (91)

Autres articles (35)

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

  • 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 ;

  • Changer son thème graphique

    22 février 2011, par

    Le thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
    Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
    Modifier le thème graphique utilisé
    Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
    Il suffit ensuite de se rendre dans l’espace de configuration du (...)

Sur d’autres sites (5053)

  • Write buffer to ffmpeg stdin and send websocket message after that

    6 septembre 2024, par alpecca

    I am working on a streaming application in which user can stream videos in real time to my server usig websocket and media recorder. I have written my backend code using fastapi python and I setup a websocket endpoint that would receive buffer data from the frontend every two second. But the problem I am facing is here :-

    


    process.stdin.write(data)
await websocket.send_json


    


    Here the code ffmpeg process write could take some time to take a buffer and write a mp4 for it, but the websocket send json won't wait for it and thus just send the message back to the client, which is causing videos being too short and currupted once the user stops the recording.

    


    Here is the full code

    


    @router.websocket("/stream")
async def websocket_endpoint(websocket: WebSocket, token: str = Query(...), videoId: str = Query(...), authorize: AuthJWT = Depends()):
    await manager.connect(websocket)
    dataNumber = 1

    recordingFile = os.path.join(temp_dir, f"recording_{videoId}.mp4")

    command = [
        'ffmpeg', 
        '-y',
        '-i', 
        '-', 
        '-codec:v', 
        'copy', 
        '-f', 'mp4',
        recordingFile,
        # "-"
        # f'output{queueNumber}.mp4',
    ]

    process = subprocess.Popen(command, stdin=subprocess.PIPE)

    try:
        while True:
            try:
                data = await websocket.receive_bytes()
                if not data:
                    break
                process.stdin.write(data)
                process.stdin.flush()
                await websocket.send_json({"chunkNumber": dataNumber, "status": 200})
                dataNumber = dataNumber + 1
            except RuntimeError:
                break      
    except WebSocketDisconnect:
        print(f"Client disconnected: {websocket.client.host}")
    finally:
        manager.disconnect(websocket)
        process.stdin.close()
        process.wait()
        process.terminate()


    


    What I want to do is on each buffer send from the client, I want to make sure that ffmpeg writes that to the filesystem compeletly and than only to send the websocket message back to the client. And also, as the request are coming from the client every 2 second no matter what, If the write is taking too long for the previous message, I want to make sure that that the ffmpeg first write that part to the file and send the message and than do the newer one

    


  • vsrc_movie : do not free avoption variables in uninit()

    20 juin 2013, par Anton Khirnov
    vsrc_movie : do not free avoption variables in uninit()
    

    The generic code frees them as well. Since av_free was used to free them
    instead of av_freep, this would result in a double free.

    • [DH] libavfilter/vsrc_movie.c
  • avcodec/libx264 : bump minimum required version to 155

    9 avril 2024, par Niklas Haas
    avcodec/libx264 : bump minimum required version to 155
    

    This version is seven years old, and present in Debian oldoldstable,
    Ubuntu 20.04 and Leap 15.0.

    Allows cleaning up the file substantially. In particular, this is
    motivated by the desire to stop relying on init_static_data.

    • [DH] configure
    • [DH] libavcodec/libx264.c