
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (72)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)
Sur d’autres sites (9309)
-
Node.js Live Streaming : Avoid buffering
27 octobre 2012, par Shirish KamathI've written a small nodeJS server that outputs system audio captured by ffmpeg on Windows (using DirectShow) to the browser as a streaming MP3 file. The audio needs to be as live as possible, with minimum/no buffering, and a "skipping" effect in the audio is perfectly acceptable.
When I play the audio in Chrome using the HTML5 audio tag, there's a delay of about 8-10 secs over a low-latency LAN connection. I suspected this to be a client-side buffer, and used a Flash MP3 player on the client-side, which brought down the delay to 2-3 secs.
Now, the buffering seems to taking place on the server-side. The documentation for NodeJS's response.write mentions that the data is written kernel buffers. How do I go about avoiding any buffering altogether or at least getting around it, so that the client always gets the latest audio data ? Strategies for handling 'drain' events to always push live data ?
On the request object, I've used setNoDelay(true) to avoid the use of Nagle's algorithm. Following is a snippet of how data is written when the spawned ffmpeg process emits data.
var clients = []; //List of client connections currently being served
ffmpeg.stdout.on('data', function(data) {
for(var i = 0; i < clients.length; i++){
clients[i].res.write(data);
}
}); -
ffmpeg not reading stdin fast enough
5 mars 2019, par Joshua WalshI have a NodeJS program which launches ffmpeg (with child_process) and then provides realtime video data via stdin, using the pipe protocol.
ffmpeg -nostdin -i pipe:0 -codec libx264 -preset veryfast -tune zerolatency -acodec aac -b:a 128k output/index.m3u8
ffmpeg transcodes the video into h264 and muxes it into an HLS live stream.
The issue that I have is that sometimes ffmpeg refuses to accept more input. The default behaviour of NodeJS is to buffer input until the child process can accept it, but after a while this causes my application to run out of memory.
I tried a naive solution where if ffmpeg wasn’t able to read the input (if
proc.stdin.write
returns false) I would start discarding data until thedrain
event was raised on the stream, but this unsurprisingly led to badly degraded video output, with terrible artifacting.The nature of the source of the data makes it impossible for me to block, my application has to deal with it in realtime.
ffmpeg is using only a fraction of the available resources on the system (35% CPU, 1% disk), so I’m not sure why it’s blocking stdin. If I specify a more demanding preset then it happily uses more CPU, so CPU speed shouldn’t be a limiting factor.
Does anyone know why ffmpeg would be blocking stdin ? Is there a way I can tell ffmpeg to drop frames if it starts falling behind ?
-
How to upload object to a bucket in Google Cloud Platform from Python script
7 juillet 2016, par BryanThe goal of this script is to extract audio from a video file using ffmpeg and upload it into a bucket on Google Cloud Platform each time it is called. Eventually I will have to extract audio from a large list of videos, so ideally I would want my script to extract and subsequently upload it into the cloud.
My confusion is how to use GCP API to upload my object into a bucket. Any advice would be greatly appreciated !
Link for reference : https://cloud.google.com/storage/docs/json_api/v1/json-api-python-samples#setup-code
import subprocess
import sys
import re
fullVideo = sys.argv[1]
title = re.findall('^([^.]*).*', fullVideo)
title = str(title[0])
subprocess.call('ffmpeg -i ' + fullVideo + ' -vn -ab 128k ' + title + '.flac', shell = True)
def upload_object(bucket, filename, readers, owners):
service = create_service()
# This is the request body as specified:
# http://g.co/cloud/storage/docs/json_api/v1/objects/insert#request
body = {
'name': filename,
}
# If specified, create the access control objects and add them to the
# request body
if readers or owners:
body['acl'] = []
for r in readers:
body['acl'].append({
'entity': 'user-%s' % r,
'role': 'READER',
'email': r
})
for o in owners:
body['acl'].append({
'entity': 'user-%s' % o,
'role': 'OWNER',
'email': o
})
# Now insert them into the specified bucket as a media insertion.
# http://g.co/dev/resources/api-libraries/documentation/storage/v1/python/latest/storage_v1.objects.html#insert
with open(filename, 'rb') as f:
req = service.objects().insert(
bucket=bucket, body=body,
# You can also just set media_body=filename, but # for the sake of
# demonstration, pass in the more generic file handle, which could
# very well be a StringIO or similar.
media_body=http.MediaIoBaseUpload(f, 'application/octet-stream'))
resp = req.execute()
return resp