
Recherche avancée
Autres articles (87)
-
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 (...) -
Configuration spécifique pour PHP5
4 février 2011, parPHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
Modules spécifiques
Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...) -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
Sur d’autres sites (4891)
-
How to build a daemon to encode video files on S3 ?
4 avril 2013, par Yuval CohenI am interested in running a daemon to go over user uploaded video files and encode them in an optimal format (and add some watermarks).
I was considering services such as Zencoder, Encoding.com, Amazon's encoding service but some lack overlaying capabilities and some are just too expensive for our (big) volumes.
I want to build a daemon that encodes videos that are located on S3 once users upload them.
The solution I thought of would be Python Heroku servers using Celery for a task queue to keep track of the encoded files and ffmpeg to do the actual work. However, I ran into troubles compiling ffmpeg for Heroku (with libass support, so the basic ffmpeg bins aren't enough).
What approach/technology stack would you consider for this mini-project ?
Thanks !
Yuval -
How to send ffmpeg based HTTP stream to CloudFront [on hold]
5 octobre 2017, par Tarun MaheshwariI have a live streaming server, where media is available as HTTP / RTMP / HLS format.
I am able to access it and play from my desktop using following links.rtmp://52.xx.xx.192/live/tarun1 (RTMP)
http://52.xx.xx.192:8080/hls/movie.m3u8 (HLS)
http://52.xx.xx.190:7090/stream (HTTP)I want to forward any of the above streams to CloudFront with these steps.
-
Can I convert a django video upload from a form using ffmpeg before storing the video ?
5 mai 2014, par GetItDoneI’ve been stuck for weeks trying to use ffmpeg to convert user uploaded videos to flv. I use heroku to host my website, and store my static and media files on amazon S3 with s3boto. The initial video file will upload fine, however when I retrieve the video and run a celery task (in the same view where the initial video file is uploaded), the new file won’t store on S3. I’ve been trying to get this to work for over a month, with no luck, and really no good resources available for learning how to do this, so I figure maybe if I can get the ffmpeg task to run before storing the video I may be able to get it to work. Unfortunately I’m still not a very advanced at python (or django), so I don’t even know if/how this is possible. Anyone have any ideas ? I am willing to use any solution at this point no matter how ugly, as long as it successfully takes video uploads and converts to flv using ffmpeg, with the resulting file being stored on S3. It doesn’t seem that my situation is very common, because no matter where I look, I cannot find a solution that explains what I should be trying to do. Therefore I will be very appreciative of any guidance. Thanks. My relevant code follows :
#models.py
def content_file_name(instance, filename):
ext = filename.split('.')[-1]
new_file_name = "remove%s.%s" % (uuid.uuid4(), ext)
return '/'.join(['videos', instance.teacher.username, new_file_name])
class BroadcastUpload(models.Model):
title = models.CharField(max_length=50, verbose_name=_('Title'))
description = models.TextField(max_length=100, verbose_name=_('Description'))
teacher = models.ForeignKey(User, null=True, blank=True, related_name='teacher')
created_date = models.DateTimeField(auto_now_add=True)
video_upload = models.FileField(upload_to=content_file_name)
flvfilename = models.CharField(max_length=100, null=True, blank=True)
videothumbnail = models.CharField(max_length=100, null=True, blank=True)
#tasks.py
@task(name='celeryfiles.tasks.convert_flv')
def convert_flv(video_id):
video = BroadcastUpload.objects.get(pk=video_id)
print "ID: %s" % video.id
id = video.id
print "VIDEO NAME: %s" % video.video_upload.name
teacher = video.teacher
print "TEACHER: %s" % teacher
filename = video.video_upload
sourcefile = "%s%s" % (settings.MEDIA_URL, filename)
vidfilename = "%s_%s.flv" % (teacher, video.id)
targetfile = "%svideos/flv/%s" % (settings.MEDIA_URL, vidfilename)
ffmpeg = "ffmpeg -i %s %s" % (sourcefile, vidfilename)
try:
ffmpegresult = subprocess.call(ffmpeg)
#also tried separately with following line:
#ffmpegresult = commands.getoutput(ffmpeg)
print "---------------FFMPEG---------------"
print "FFMPEGRESULT: %s" % ffmpegresult
except Exception as e:
ffmpegresult = None
print("Failed to convert video file %s to %s" % (sourcefile, targetfile))
print(traceback.format_exc())
video.flvfilename = vidfilename
video.save()
@task(name='celeryfiles.tasks.ffmpeg_image')
def ffmpeg_image(video_id):
video = BroadcastUpload.objects.get(pk=video_id)
print "ID: %s" %video.id
id = video.id
print "VIDEO NAME: %s" % video.video_upload.name
teacher = video.teacher
print "TEACHER: %s" % teacher
filename = video.video_upload
sourcefile = "%s%s" % (settings.MEDIA_URL, filename)
imagefilename = "%s_%s.png" % (teacher, video.id)
thumbnailfilename = "%svideos/flv/%s" % (settings.MEDIA_URL, thumbnailfilename)
grabimage = "ffmpeg -y -i %s -vframes 1 -ss 00:00:02 -an -vcodec png -f rawvideo -s 320x240 %s" % (sourcefile, thumbnailfilename)
try:
videothumbnail = subprocess.call(grabimage)
#also tried separately following line:
#videothumbnail = commands.getoutput(grabimage)
print "---------------IMAGE---------------"
print "VIDEOTHUMBNAIL: %s" % videothumbnail
except Exception as e:
videothumbnail = None
print("Failed to convert video file %s to %s" % (sourcefile, thumbnailfilename))
print(traceback.format_exc())
video.videothumbnail = imagefilename
video.save()
#views.py
def upload_broadcast(request):
if request.method == 'POST':
form = BroadcastUploadForm(request.POST, request.FILES)
if form.is_valid():
upload=form.save()
video_id = upload.id
image_grab = ffmpeg_image.delay(video_id)
video_conversion = convert_flv.delay(video_id)
return HttpResponseRedirect('/current_classes/')
else:
form = BroadcastUploadForm(initial={'teacher': request.user,})
return render_to_response('videos/create_video.html', {'form': form,}, context_instance=RequestContext(request))
#settings.py
DEFAULT_FILE_STORAGE = 'myapp.s3utils.MediaRootS3BotoStorage'
DEFAULT_S3_PATH = "media"
STATICFILES_STORAGE = 'myapp.s3utils.StaticRootS3BotoStorage'
STATIC_S3_PATH = "static"
AWS_STORAGE_BUCKET_NAME = 'my_bucket'
CLOUDFRONT_DOMAIN = 'domain.cloudfront.net'
AWS_ACCESS_KEY_ID = 'MY_KEY_ID'
AWS_SECRET_ACCESS_KEY = 'MY_SECRET_KEY'
MEDIA_ROOT = '/%s/' % DEFAULT_S3_PATH
MEDIA_URL = 'http://%s/%s/' % (CLOUDFRONT_DOMAIN, DEFAULT_S3_PATH)
...
#s3utils.py
from storages.backends.s3boto import S3BotoStorage
from django.utils.functional import SimpleLazyObject
StaticRootS3BotoStorage = lambda: S3BotoStorage(location='static')
MediaRootS3BotoStorage = lambda: S3BotoStorage(location='media')I can add any other info if needed to help me solve my problem.