
Recherche avancée
Autres articles (38)
-
Les statuts des instances de mutualisation
13 mars 2010, parPour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...) -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users. -
L’espace de configuration de MediaSPIP
29 novembre 2010, parL’espace de configuration de MediaSPIP est réservé aux administrateurs. Un lien de menu "administrer" est généralement affiché en haut de la page [1].
Il permet de configurer finement votre site.
La navigation de cet espace de configuration est divisé en trois parties : la configuration générale du site qui permet notamment de modifier : les informations principales concernant le site (...)
Sur d’autres sites (7059)
-
How to install ffmpeg for PHP
1er mai 2021, par Julie BsdI've successfully installed ffmpeg using ssh, as root, on my dedicated server (CentOS 7).

ffmpeg works fine - but now I need to use it without root access.


When i try to use ffmpeg without root access, I get the following error :



ffmpeg: error while loading shared libraries: libx264.so.148: 
 cannot open shared object file: No such file or directory




The final goal is to be able to use ffmpeg inside my PHP scripts which do not root access.


-
Unable to use Multithread for librosa melspectrogram
15 avril 2019, par Raven CheukI have over 1000 audio files (it’s just a initial development, in the future, there will be even more audio files), and would like to convert them to melspectrogram.
Since my workstation has a Intel® Xeon® Processor E5-2698 v3, which has 32 threads, I would like to use multithread to do my job.
My code
import os
import librosa
from librosa.display import specshow
from natsort import natsorted
import numpy as np
import sys
# Libraries for multi thread
from multiprocessing.dummy import Pool as ThreadPool
import subprocess
pool = ThreadPool(20)
songlist = os.listdir('../opensmile/devset_2015/')
songlist= natsorted(songlist)
def get_spectrogram(song):
print("start")
y, sr = librosa.load('../opensmile/devset_2015/' + song)
## Add some function to cut y
y_list = y
##
for i, y_i in enumerate([y_list]): # can remove for loop if no audio is cut
S = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=128,fmax=8000)
try:
np.save('./Test/' + song + '/' + str(i), S)
except:
os.makedirs('./Test/' + song)
np.save('./Test/' + song + '/' + str(i), S)
print("done saving")
pool.map(get_spectrogram, songlist)My Problem
However, my script freezes after finished the first conversion.
To debug what’s going on, I commented out
S = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=128,fmax=8000)
and replace it byS=0
.
Then the multi-thread code works fine.What’s wrong with the
librosa.feature.melspectrogram
function ? Does it not support multi-thread ? Or is it a problem of ffmpeg ? (When using librosa, it asks me to install ffmpeg before.) -
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.