
Recherche avancée
Autres articles (71)
-
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 (...) -
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 (...) -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
Sur d’autres sites (7074)
-
Revision f1781e86b7 : Refactoring of rate control - part 1 Moves all rate control variables to a sepa
6 novembre 2013, par Deb MukherjeeChanged Paths :
Modify /vp9/encoder/vp9_firstpass.c
Modify /vp9/encoder/vp9_mbgraph.c
Modify /vp9/encoder/vp9_onyx_if.c
Modify /vp9/encoder/vp9_onyx_int.h
Modify /vp9/encoder/vp9_ratectrl.c
Modify /vp9/encoder/vp9_ratectrl.h
Modify /vp9/encoder/vp9_temporal_filter.c
Refactoring of rate control - part 1Moves all rate control variables to a separate structure,
removes some currently unused variables,
moves some rate control functions to vp9_ratectrl.c,
and splits the encode_frame_to_data_rate function.Change-Id : I4ed54c24764b3b6de2dd676484f01473724ab52b
-
doc/protocols : document experimental mutli-client api
3 juillet 2015, par Stephan Holljes -
Django StreamingHttpResponse : How to quit Popen process when client disconnects ?
2 avril 2022, par seriousm4xIn django, i want to convert a m3u8 playlist to mp4 and stream it to the client with ffmpeg pipe. The code works and the ffmpeg process also quits, but only when client waits till the end and received the whole file.


I want to quit the process when the client disconnects but the process keeps running forever.


I have this code :


import subprocess
from functools import partial
from django.http.response import StreamingHttpResponse
from django.shortcuts import get_object_or_404
from django.utils.text import slugify


def stream(request, uuid):
 vod = get_object_or_404(Vod, uuid=uuid)

 def iterator(proc):
 for data in iter(partial(proc.stdout.read, 4096), b""):
 if not data:
 proc.kill()
 yield data

 cmd = ["ffmpeg", "-i", "input.m3u8", "-c", "copy", "-bsf:a", "aac_adtstoasc", "-movflags", "frag_keyframe+empty_moov", "-f", "mp4", "-"]
 proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
 response = StreamingHttpResponse(iterator(proc), content_type="video/mp4")
 response["Content-Disposition"] = f"attachment; filename={slugify(vod.date)}-{slugify(vod.title)}.mp4"
 return response




I've seen this answer but I'm not sure if I could use threading to solve my problem.