
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (70)
-
Submit enhancements and plugins
13 avril 2011If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone. -
Les notifications de la ferme
1er décembre 2010, parAfin d’assurer une gestion correcte de la ferme, il est nécessaire de notifier plusieurs choses lors d’actions spécifiques à la fois à l’utilisateur mais également à l’ensemble des administrateurs de la ferme.
Les notifications de changement de statut
Lors d’un changement de statut d’une instance, l’ensemble des administrateurs de la ferme doivent être notifiés de cette modification ainsi que l’utilisateur administrateur de l’instance.
À la demande d’un canal
Passage au statut "publie"
Passage au (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (14461)
-
Evolution #2727 : forcer type=’MyISAM’ sur les tables MySQL
5 septembre 2013, par marcimat -Alors du coup, ça rend les dump actuellement très problématique : dès qu’un index fulltext est présent dans une base, cett table ne se restaure pas (sur un site tout neuf) en SPIP 3.0.11. Cela indique « The used table type doesn’t support FULLTEXT indexes ». Effectivement toutes les tables recrées passent au format innoDb même si les tables d’origine de la sauvegarde étaient en myisam.
-
Python asyncio subprocess code returns "pipe closed by peer or os.write(pipe, data) raised exception."
4 novembre 2022, par Duke DougalI am trying to convert a synchronous Python process to asyncio. Any ideas what I am doing wrong ?


This is the synchronous code which successfully starts ffmpeg and converts a directory of webp files into a video.


import subprocess
import shlex
from os import listdir
from os.path import isfile, join

output_filename = 'output.mp4'
process = subprocess.Popen(shlex.split(f'ffmpeg -y -framerate 60 -i pipe: -vcodec libx265 -pix_fmt yuv420p -crf 24 output.mp4'), stdin=subprocess.PIPE)

thepath = '/home/ubuntu/webpfiles/'
thefiles = [f for f in listdir(thepath) if isfile(join(thepath, f))]
for filename in thefiles:
 absolute_path = f'{thepath}{filename}'
 with open(absolute_path, 'rb') as f:
 process.stdin.write(f.read())

process.stdin.close()
process.wait()
process.terminate()



This async code fails :


from os import listdir
from os.path import isfile, join
import shlex
import asyncio

outputfilename = 'output.mp4'

async def write_stdin(proc):
 thepath = '/home/ubuntu/webpfiles/'
 thefiles = [f for f in listdir(thepath) if isfile(join(thepath, f))]
 thefiles.sort()
 for filename in thefiles:
 absolute_path = f'{thepath}{filename}'
 with open(absolute_path, 'rb') as f:
 await proc.communicate(input=f.read())

async def create_ffmpeg_subprocess():
 bin = f'/home/ubuntu/bin/ffmpeg'
 params = f'-y -framerate 60 -i pipe: -vcodec libx265 -pix_fmt yuv420p -crf 24 {outputfilename}'
 proc = await asyncio.create_subprocess_exec(
 bin,
 *shlex.split(params),
 stdin=asyncio.subprocess.PIPE,
 stdout=asyncio.subprocess.PIPE,
 stderr=asyncio.subprocess.PIPE,
 )
 return proc

async def start():
 loop = asyncio.get_event_loop()
 proc = await create_ffmpeg_subprocess()
 task_stdout = loop.create_task(write_stdin(proc))
 await asyncio.gather(task_stdout)

if __name__ == '__main__':
 asyncio.run(start())



The output for the async code is :


pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.
pipe closed by peer or os.write(pipe, data) raised exception.



etc - one line for each webp file


-
Google Analytics 4 (GA4) vs Universal Analytics (UA)
24 janvier 2022, par Erin — Analytics Tips