
Recherche avancée
Médias (91)
-
Head down (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Echoplex (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Discipline (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Letting you (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
1 000 000 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
999 999 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (74)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Dépôt de média et thèmes par FTP
31 mai 2013, parL’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...) -
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)
Sur d’autres sites (7064)
-
Revision 36889 : Le début d’une page d’info concernant la configuration de FFMPEG sur le ...
3 avril 2010, par kent1@… — LogLe début d’une page d’info concernant la configuration de FFMPEG sur le serveur.
On vire le PHP du squelette du formulaire de configuration
On prépare le passage aux pressets -
Revision 34625 : un lien dans un lien, ca cree des liens
21 janvier 2010, par cedric@… — Logun lien dans un lien, ca cree des liens
-
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.