
Recherche avancée
Médias (1)
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
Autres articles (91)
-
Amélioration de la version de base
13 septembre 2013Jolie 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, parCe 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, parLe 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 dhingraI am using the following ffmpeg command to trim and select certain portions of the video.


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



The above command errors out with the following trace


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




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 ?
Note : Using trim is important as per my current flow.


-
Unable to Play Video Stream on Flask-FFmpeg Media Server on Subsequent Requests
12 juin 2024, par yternalProblem Description :


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.


I am using the following command to test with ffplay :


ffplay http://127.0.0.1:8000/flv/0



My current Flask code:


import queue
import subprocess
import threading

from flask import Flask, Response, stream_with_context
from gevent import monkey
from gevent.pool import Pool
from gevent.pywsgi import WSGIServer
from geventwebsocket.handler import WebSocketHandler
from loguru import logger

monkey.patch_all()
app = Flask(__name__)

stream_queue = queue.Queue(maxsize=10000)


def update_stream():
 process = subprocess.Popen(
 ['ffmpeg', '-i', 'rtsp://192.168.1.168/0', '-f', 'flv', '-'],
 stdout=subprocess.PIPE,
 stderr=subprocess.PIPE
 )
 while True:
 data = process.stdout.read(4096)
 if not data:
 break
 if stream_queue.full():
 stream_queue.get()
 stream_queue.put(data)
 logger.debug(f"stream_queue size: {stream_queue.qsize()}")


@app.route('/flv/')
def flv_stream(stream_id):
 @stream_with_context
 def generate():

 while True:
 data = stream_queue.get()
 yield data

 return Response(generate(), mimetype='video/x-flv')


if __name__ == '__main__':
 HOST = "0.0.0.0"
 PORT = 8000

 threading.Thread(target=update_stream, daemon=True).start()

 logger.info(f"listen in: {HOST}:{PORT}")
 pool = Pool(10000)
 http_serve = WSGIServer((HOST, PORT), app, handler_class=WebSocketHandler, spawn=pool)
 http_serve.max_accept = 30000
 http_serve.serve_forever()



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


http://127.0.0.1:8000/flv/0: Invalid data found when processing input



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


-
Gstreamer video increases latency with decresed FPS
19 novembre 2024, par Ri DiI am using RPI 5 to stream the video :


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



View it with :


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



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


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


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.


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


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


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


ffplay -i -probesize 3000 tcp://0.0.0.0:1234/?listen