Recherche avancée

Médias (91)

Autres articles (42)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (6775)

  • error when I try to seek on a streaming with ffmpeg and flask

    29 juillet 2021, par Martin Oller Exposito

    I want to get a seekable stream from a google drive file but
When calling 127.0.0.1:500/, it works and it returns the video stream but it does not show me the duration of the video nor does it allow me to advance or rewind it

    


    img of stream in vlc

    


    I have also done tests using an html player and it gives me an error in the content length and it seems that after 8 seconds it starts to upload the duration of the file up to 10 seconds (the total duration of the file is 10s)

    


    img of stream in player web

    


    import threading&#xA;from flask import Flask, request&#xA;from flask.helpers import stream_with_context&#xA;import requests&#xA;import subprocess&#xA;from requests import Response&#xA;&#xA;from flask import request, make_response, Response, stream_with_context, send_file&#xA;&#xA;&#xA;&#xA;app = Flask(__name__)&#xA;&#xA;@app.route(&#x27;/<id>&#x27;)&#xA;def index(id):&#xA;   &#xA;    range = request.headers.get(&#x27;Range&#x27;)&#xA;   &#xA;    &#xA;    token = "ya29.a0ARrdaM8vW_pKmGhIRleJiZ9fuoprk2-zS0bgJPaslD3V4idJ6wK52_iwJE8MOYnj7kCOWl5m2oHlEWc3LEWcPt5-b4nemoC7SKy7l-4QO1DviJnPBfVeHruAU27I_UE3gMPRV4H-Tk1ZLrNp56UfxyR-ObAx"&#xA;&#xA;    headers = {&#xA;        "Authorization":"Bearer "&#x2B;token&#xA;    }&#xA;    if (range != None):&#xA;        headers = {&#xA;            "Authorization": "Bearer " &#x2B; token,&#xA;            "Range":range&#xA;        }&#xA;&#xA;    url = "https://www.googleapis.com/drive/v3/files/"&#x2B;id&#x2B;"?alt=media"&#xA;    r = requests.get(url, headers=headers, stream=True)&#xA;    &#xA;    &#xA;    def getVideoStreaming():&#xA;        for chunck in r.iter_content(1024):&#xA;            if chunck:&#xA;                process.stdin.write(chunck)&#xA;        process.stdin.close()&#xA;&#xA;    thread = threading.Thread(target=getVideoStreaming)&#xA;    &#xA;&#xA;&#xA;    command = ("ffmpeg","-i", "-","-y","-vcodec","copy","-movflags", "frag_keyframe&#x2B;empty_moov","-f","mp4","pipe:1")&#xA;    process = subprocess.Popen(command,shell=True,stdout = subprocess.PIPE,stdin=subprocess.PIPE)&#xA;&#xA;    thread.start()&#xA;    &#xA;  &#xA;    def readingFfmpeg():&#xA;        &#xA;        for data in iter(process.stdout.readline, b&#x27;&#x27;):&#xA;            if not data:&#xA;                break&#xA;            yield data&#xA;        &#xA;      &#xA;    &#xA;    response =  Response(stream_with_context(readingFfmpeg()),mimetype=r.headers.get(&#x27;Content-Type&#x27;))&#xA;    &#xA;    response.headers.set(&#x27;Content-Range&#x27;,r.headers.get(&#x27;Content-Range&#x27;))&#xA;    response.headers.set(&#x27;Cache-Control&#x27;, r.headers.get(&#x27;Cache-Control&#x27;))&#xA;    response.headers.set(&#x27;Content-Length&#x27;, r.headers.get(&#x27;Content-Length&#x27;))&#xA;    &#xA;    &#xA;  &#xA;    if(range != None):&#xA;        return response,200&#xA;    else:&#xA;        return response,206&#xA;    &#xA;</id>

    &#xA;

  • hls.js unable to maintain seek with live video [only] stream

    15 décembre 2024, par Rob

    I am encoding a live 25 FPS 950x540 H.264 video-only stream using the latest (built from source) FFmpeg, 10 segments in the manifest, each of 5 seconds, and consuming that stream on another machine on my local LAN in [incognito to avoid cache issues] Chrome with the latest hls.js (cdn.jsdelivr.net/npm/hls.js@latest). The encoded video plays but not reliably ; I have two problems :

    &#xA;

      &#xA;
    1. When the stream is running, the hls.js client starts to be unable to sync with the video stream after a few minutes, complaining of being beyond the end of the sync window and, on re-sync, getting empty buffers.
    2. &#xA;

    3. The hls.js client will not sync to the stream unless I start the stream and the client at the same time : if the hls.js client tries to use the stream a few 10's of seconds after it has started it again fails to sync with the stream. The only way I can start the stream successfully is if the .m3u8 file is deleted first, so the browser cannot find the file, then the client reads the file and begins streaming. Chrome's F12 window says things like "[stream-controller] : Playback : 0.000 is located too far from the end of live sliding playlist : 49.92, reset currentTime to : 44.920", which might be expected but then more mysteriously says "[abr] buffer is empty, optimal quality level 0", something which definitely doesn't happen in the succese case.
    4. &#xA;

    &#xA;

    Obviously I have something fundamentally wrong, I just can't figure out what. My HLS flags to FFmpeg are discont_start and omit_endlist and the client has been directed not to cache. Here is a sample .m3u8 output file :

    &#xA;

    #EXTM3U&#xA;#EXT-X-VERSION:3&#xA;#EXT-X-ALLOW-CACHE:NO&#xA;#EXT-X-TARGETDURATION:5&#xA;#EXT-X-MEDIA-SEQUENCE:30&#xA;#EXTINF:5.120000,&#xA;http://10.10.1.16/watchdog30.ts&#xA;#EXTINF:4.880000,&#xA;http://10.10.1.16/watchdog31.ts&#xA;#EXTINF:5.120000,&#xA;http://10.10.1.16/watchdog32.ts&#xA;#EXTINF:4.880000,&#xA;http://10.10.1.16/watchdog33.ts&#xA;#EXTINF:5.120000,&#xA;http://10.10.1.16/watchdog34.ts&#xA;#EXTINF:4.880000,&#xA;http://10.10.1.16/watchdog35.ts&#xA;#EXTINF:5.120000,&#xA;http://10.10.1.16/watchdog36.ts&#xA;#EXTINF:4.880000,&#xA;http://10.10.1.16/watchdog37.ts&#xA;#EXTINF:5.120000,&#xA;http://10.10.1.16/watchdog38.ts&#xA;#EXTINF:4.880000,&#xA;http://10.10.1.16/watchdog39.ts&#xA;

    &#xA;

    I've tried also adding the flags independent_segments and inclusion of program_date_time, which have not helped.

    &#xA;

    What have I missed ?

    &#xA;

    My full code (FFMpeg is driven at its C API) can be found here : https://github.com/RobMeades/watchdog/blob/83e718390f779a7ef98d2be009784e8be5deaf5f/software/watchdog.cpp#L933. This code is running on a Raspberry Pi 5 under Raspbian latest.

    &#xA;

  • FFMPEG : Encoding WEBM with fast-seek and copyts leads to wrong video lenght

    1er février 2020, par TheOverlord2D

    I’m trying to convert a scene from a soft-subbed MKV file into a hard-subbed WEBM file with two-pass. The video encodes fine, but the file shows the wrong length when opened on a media player (it’s showing as if I had encoded the original file from the starting point all the way to the end).

    This is the command I’m using :

    set timestamp=-ss 12:59.069 -to 16:14.277

    ffmpeg -y %timestamp% -copyts -i source.mkv -shortest -c:v libvpx-vp9 -pass 1 -b:v 0 -crf 33 -threads 8 -speed 4 -tile-columns 6 -frame-parallel 1 -an -sn -vf scale=-1:720,subtitles=source.mkv -f webm NUL
    ffmpeg -y %timestamp% -copyts -i source.mkv -shortest -c:v libvpx-vp9 -pass 2 -b:v 0 -crf 33 -threads 8 -speed 2 -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 -c:a libopus -b:a 64k -sn -vf scale=-1:720,subtitles=source.mkv -f webm out.webm

    When opening the video in MPC-BE, the video plays regularly until around the point shown on https://i.stack.imgur.com/6bRwc.png (which is where the scene I wanted to cut out ends) then it just skips to the end of the file, and this wrong length is giving me all sorts of issues when I try to use the encoded video.