Recherche avancée

Médias (1)

Mot : - Tags -/publicité

Autres articles (91)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

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

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

Sur d’autres sites (6061)

  • How to correctly apply select filter after trim in ffpeg ? [closed]

    29 mai 2024, par lakhan dhingra

    I am using the following ffmpeg command to trim and select certain portions of the video.

    &#xA;

    ffmpeg -v verbose -i test.mp4 -filter_complex \&#xA;"[0:v]trim=start=5:end=40,setpts=PTS-STARTPTS[v_trimmed]; \&#xA; [v_trimmed]select=&#x27;between(t,10,20)&#x27;,setpts=N/FRAME_RATE/TB[v]; \&#xA; [0:a]atrim=start=5:end=40,asetpts=PTS-STARTPTS[a_trimmed]; \&#xA; [a_trimmed]aselect=&#x27;between(t,10,20)&#x27;,asetpts=N/SR/TB[a]" \&#xA;-map "[v]" -map "[a]" -y -r 30 output_video.mp4&#xA;

    &#xA;

    The above command errors out with the following trace

    &#xA;

    [h264 @ 0x12570a0e0] Reinit context to 1280x720, pix_fmt: yuv420p&#xA;[graph 0 input from stream 0:0 @ 0x600001ff8000] w:1280 h:720 pixfmt:yuv420p tb:1/30000 fr:30000/1001 sar:1/1 csp:bt709 range:tv&#xA;[graph_0_in_0:1 @ 0x600001ff80b0] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:stereo&#xA;[Parsed_trim_0 @ 0x600001ffc420] TB:0.000033 FRAME_RATE:29.970030 SAMPLE_RATE:nan&#xA;[Parsed_select_2 @ 0x600001ffc580] TB:0.000033 FRAME_RATE:nan SAMPLE_RATE:nan&#xA;[Parsed_atrim_4 @ 0x600001ffc630] TB:0.000023 FRAME_RATE:nan SAMPLE_RATE:44100.000000&#xA;[Parsed_aselect_6 @ 0x600001ffc790] TB:0.000023 FRAME_RATE:nan SAMPLE_RATE:44100.000000&#xA;[graph 0 input from stream 0:0 @ 0x600001ff8000] video frame properties congruent with link at pts_time: 0&#xA;[vost#0:0/libx264 @ 0x125707800] *** dropping frame 0 at ts -9223372036854775808&#xA;    Last message repeated 298 times&#xA;[fc#0 @ 0x600001ae81b0] Input 1 no longer accepts new data&#xA;[aist#0:1/aac @ 0x1257100b0] [dec:aac @ 0x12570ea40] Decoder returned EOF, finishing&#xA;[aist#0:1/aac @ 0x1257100b0] [dec:aac @ 0x12570ea40] Terminating thread with return code 0 (success)&#xA;[aist#0:1/aac @ 0x1257100b0] All consumers of this stream are done&#xA;[fc#0 @ 0x600001ae81b0] Filtergraph returned EOF, finishing&#xA;[fc#0 @ 0x600001ae81b0] All consumers returned EOF&#xA;[vost#0:0/libx264 @ 0x125707800] *** dropping frame 0 at ts -9223372036854775808&#xA;[vost#0:0/libx264 @ 0x125707800] Encoder thread received EOF&#xA;[vost#0:0/libx264 @ 0x125707800] Could not open encoder before EOF&#xA;[vost#0:0/libx264 @ 0x125707800] Task finished with error code: -22 (Invalid argument)&#xA;[vost#0:0/libx264 @ 0x125707800] Terminating thread with return code -22 (Invalid argument)&#xA;[aost#0:1/aac @ 0x1257084b0] Encoder thread received EOF&#xA;[fc#0 @ 0x600001ae81b0] Terminating thread with return code 0 (success)&#xA;[vist#0:0/h264 @ 0x12570ecf0] [dec:h264 @ 0x1257094e0] Decoder returned EOF, finishing&#xA;[vist#0:0/h264 @ 0x12570ecf0] [dec:h264 @ 0x1257094e0] Terminating thread with return code 0 (success)&#xA;[vist#0:0/h264 @ 0x12570ecf0] All consumers of this stream are done&#xA;[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x6000014ec100] All consumers are done&#xA;[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x6000014ec100] Terminating thread with return code 0 (success)&#xA;[aost#0:1/aac @ 0x1257084b0] Terminating thread with return code 0 (success)&#xA;[out#0/mp4 @ 0x600001de8000] Nothing was written into output file, because at least one of its streams received no packets.&#xA;frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A dup=0 drop=301 speed=N/A    &#xA;[aac @ 0x1257087b0] Qavg: 645.507&#xA;[AVIOContext @ 0x125708d60] Statistics: 0 bytes written, 0 seeks, 0 writeouts&#xA;[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x6000014ec100] Input file #0 (test.mp4):&#xA;[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x6000014ec100]   Input stream #0:0 (video): 1219 packets read (1479521 bytes); 1201 frames decoded; 0 decode errors; &#xA;[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x6000014ec100]   Input stream #0:1 (audio): 1741 packets read (646974 bytes); 1732 frames decoded; 0 decode errors (1773568 samples); &#xA;[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x6000014ec100]   Total: 2960 packets (2126495 bytes) demuxed&#xA;[AVIOContext @ 0x125705640] Statistics: 2699615 bytes read, 0 seeks&#xA;Conversion failed!&#xA;&#xA;

    &#xA;

    If I remove the setpts step after the trim, the above command will work as expected. What is the problem with using trim and setpts, and then, passing the output to the select filter ?&#xA;Note : Using trim is important as per my current flow.

    &#xA;

  • Unable to Play Video Stream on Flask-FFmpeg Media Server on Subsequent Requests

    12 juin 2024, par yternal

    Problem Description :

    &#xA;

    I am trying to create a media server using Flask and FFmpeg. The server converts an RTSP stream to FLV format for playback in a web browser, and I am testing it using ffplay. The server starts successfully, and the data returned from the first request can be played using ffplay. However, when I interrupt the ffplay request and make it again, ffplay is unable to play the video and displays an "Invalid data found when processing input" error.

    &#xA;

    I am using the following command to test with ffplay :

    &#xA;

    ffplay http://127.0.0.1:8000/flv/0&#xA;

    &#xA;

    My current Flask code:

    &#xA;

    import queue&#xA;import subprocess&#xA;import threading&#xA;&#xA;from flask import Flask, Response, stream_with_context&#xA;from gevent import monkey&#xA;from gevent.pool import Pool&#xA;from gevent.pywsgi import WSGIServer&#xA;from geventwebsocket.handler import WebSocketHandler&#xA;from loguru import logger&#xA;&#xA;monkey.patch_all()&#xA;app = Flask(__name__)&#xA;&#xA;stream_queue = queue.Queue(maxsize=10000)&#xA;&#xA;&#xA;def update_stream():&#xA;    process = subprocess.Popen(&#xA;        [&#x27;ffmpeg&#x27;, &#x27;-i&#x27;, &#x27;rtsp://192.168.1.168/0&#x27;, &#x27;-f&#x27;, &#x27;flv&#x27;, &#x27;-&#x27;],&#xA;        stdout=subprocess.PIPE,&#xA;        stderr=subprocess.PIPE&#xA;    )&#xA;    while True:&#xA;        data = process.stdout.read(4096)&#xA;        if not data:&#xA;            break&#xA;        if stream_queue.full():&#xA;            stream_queue.get()&#xA;        stream_queue.put(data)&#xA;        logger.debug(f"stream_queue size: {stream_queue.qsize()}")&#xA;&#xA;&#xA;@app.route(&#x27;/flv/&#x27;)&#xA;def flv_stream(stream_id):&#xA;    @stream_with_context&#xA;    def generate():&#xA;&#xA;        while True:&#xA;            data = stream_queue.get()&#xA;            yield data&#xA;&#xA;    return Response(generate(), mimetype=&#x27;video/x-flv&#x27;)&#xA;&#xA;&#xA;if __name__ == &#x27;__main__&#x27;:&#xA;    HOST = "0.0.0.0"&#xA;    PORT = 8000&#xA;&#xA;    threading.Thread(target=update_stream, daemon=True).start()&#xA;&#xA;    logger.info(f"listen in: {HOST}:{PORT}")&#xA;    pool = Pool(10000)&#xA;    http_serve = WSGIServer((HOST, PORT), app, handler_class=WebSocketHandler, spawn=pool)&#xA;    http_serve.max_accept = 30000&#xA;    http_serve.serve_forever()&#xA;

    &#xA;

    The error message when attempting to play the stream again with ffplay is :

    &#xA;

    http://127.0.0.1:8000/flv/0: Invalid data found when processing input&#xA;

    &#xA;

    I tried adding some parameters to FFmpeg, such as analyzeduration and probesize, but it had no effect.

    &#xA;

  • Gstreamer video increases latency with decresed FPS

    19 novembre 2024, par Ri Di

    I am using RPI 5 to stream the video :

    &#xA;

    rpicam-vid -t 0 --camera 0 --nopreview --mode 2304:1296:10:P --codec yuv420 --width 640 --height 360 --framerate 10 --rotation 0 --autofocus-mode manual --inline --listen -o - | ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 640x360 -r 10 -i /dev/stdin -c:v libx264 -preset ultrafast -tune zerolatency -maxrate 300k -bufsize 50k -g 30000 -f mpegts tcp://192.168.0.147:1234&#xA;

    &#xA;

    View it with :

    &#xA;

    gst-launch-1.0 -v tcpserversrc host=0.0.0.0 port=1234 ! queue ! tsdemux ! h264parse ! avdec_h264 ! videorate ! video/x-raw,framerate=10/1 ! videoconvert ! autovideosink sync=false&#xA;

    &#xA;

    Problem is that with 10 FPS I get around 2s of latency ! While 56 or 120 FPS results in below 300ms latency.

    &#xA;

    Is the problem in sender or reader side ? Or both ?

    &#xA;

    I am not planning to use the 10 FPS, its only for demonstration of problem. But I would like to get lower latency at 56 FPS - just like at 120 FPS (around 80-100 ms difference) or maybe even better, as it seems to get lower with higher FPS.

    &#xA;

    Maybe there is some kind of buffering parameter which holds frames ?

    &#xA;

    (of course, when testing with higher FPS I change both numbers in sender and the one in reader command. The camera is v3 RPI official)

    &#xA;

    Also I'd like to mention that same thing happens with ffplay :

    &#xA;

    ffplay -i -probesize 3000 tcp://0.0.0.0:1234/?listen&#xA;

    &#xA;