
Recherche avancée
Médias (3)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
-
Creativecommons informational flyer
16 mai 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (111)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (10663)
-
Allowing downloads of partial video files from Django
18 janvier 2019, par DataVisI have a Django app that allows users to make/save ’clips’ of video files, that is keep timestamps of start and end times of video files to save in playlists. I would like users to be able to download clips (and playlists as well) they have saved.
I have done quite a bit of research on the topic and have gotten ffmpeg working from my terminal to save partial clips (though I’ve struggled to figure out pathnames for using subprocess.call with ffmpeg), and I have also gotten moviepy working via the terminal to save partial clips.
I’m struggling to figure out how to incorporate this into my Django app so that users can click a link and subsequently begin a download of a specific clip (or playlist). I believe I will want to use celery to avoid tying up the server but I’m not even to the point where I can offload a task as I can’t figure out how to :
- ’Clip’ the original, longer video file to make it shorter (do I need to make a local copy of a new file first ?).
- Send a response as a download to the user.
Here is my models.py :
class Match(models.Model):
game_id = models.IntegerField(primary_key=True,
validators=[MinValueValidator(1)],db_column="game_id")
wide = models.FileField(upload_to='games/2018/',blank=True,null=True)
class Playlist(models.Model):
name = models.CharField(default='',null=True,blank=True,max_length=200)
created_by = models.ForeignKey(User,related_name="playlists",on_delete=models.CASCADE)
created = models.DateTimeField(editable=False)
modified = models.DateTimeField()
def save(self, *args, **kwargs):
''' On save, update timestamps '''
if not self.id:
entries = Playlist.objects.order_by('-id')
try:
self.id = entries[0].id + 1
except IndexError:
# we don't have any PlaylistEntries yet, so we just start @ 0
self.id = 0
self.created = timezone.now()
self.modified = timezone.now()
return super(Playlist, self).save(*args, **kwargs)
class Clip(models.Model):
name = models.CharField(default='',null=True,blank=True,max_length=200)
game_id = models.ForeignKey(Match,related_name="clips",on_delete=models.CASCADE,
db_column="game_id",null=True,blank=True)
clipstart = models.IntegerField(null=True,blank=True)
clipend = models.IntegerField(null=True,blank=True)
playlist = models.ForeignKey(Playlist,related_name="clips",on_delete=models.CASCADE,
db_column="playlist",null=True,blank=True)
created_by = models.ForeignKey(User,related_name="clips",on_delete=models.CASCADE)
created = models.DateTimeField(editable=False)
modified = models.DateTimeField()
duration = models.IntegerField(null=True,blank=True)
def save(self, *args, **kwargs):
''' On save, update timestamps '''
if not self.id:
entries = Clip.objects.order_by('-id')
try:
self.id = entries[0].id + 1
except IndexError:
# we don't have any PlaylistEntries yet, so we just start @ 0
self.id = 0
self.created = timezone.now()
self.modified = timezone.now()
self.duration = int(self.clipend) - int(self.clipstart)
return super(Clip, self).save(*args, **kwargs)And views.py where I’m struggling (I’m not sure if I’m working with FileField properly etc) :
from moviepy.editor import *
def ClipDownload(request,pk,*args,**kwargs):
this_clip = models.Clip.objects.filter(pk=pk)
file_name = this_clip[0].game_id.wide
p = VideoFileClip(file_name,audio=False).subclip(this_clip.clipstart,this_clip.clipend)
response = HttpResponse(p, content_type='application/force-download')
response['Content-Disposition'] = 'attachment; filename=%s' % this_clip.name
response['Content-Length'] = os.path.getsize(file_name)
return responseThe current code is not working, I’m getting the proper Clip but I’m not able to make a subclip of the FileField as I’m getting an attribute error :
AttributeError: 'FieldFile' object has no attribute 'endswith'
I would be very appreciative if someone can point me in the right direction to get the file downloading so I can move on to trying to incorporate it into celery ?
-
FFMPEG : How do I maintain the aspect ratio of various images used in a slideshow ?
7 mars 2019, par Kimberly WI’m just starting out with FFMPEG and trying to use it to make a slideshow. Ideally, I’d like to get it where I can input an arbitrary number of images, and each image is shown for (example) 2 seconds and them moves on to the next. Each image also maintains it’s original aspect ratio and is not stretched in any way (they can of course be scaled up/down to fit the resolution of the output video).
I started off with a basic command like the following.
ffmpeg -r 1/9 -pattern_type glob -i "*.jpg" -c:v libx264 -y -pix_fmt yuv420p -vf scale="720:trunc(ow/a/2)*2" out.mp4
In this example, the first image is a wide (landscape) image and some of the others are tall (portrait) images. The portrait ones get squished in output video. Also the images aren’t displayed for equal amount of times.
A couple of problems I’ve been running into :
- There’s an error for
width not divisible by 2
, because the images can be literally any random width. To resolve that, I’ve been trying various-vf
options I’ve found through googling (like the one above). They take care of the error, but don’t solve my aspect ratio issue. - All the images seem to be stretch or squished to fit the dimensions of the first input image. In reality, the images are of various different dimensions (like frames in a comic book). There’s no pattern to them.
Is there a
ffmpeg
command for just taking images and creating as slideshow, while preserving their original aspect ratios ? - There’s an error for
-
ffmpeg unicast vs multicast bandwidth usage
14 février 2019, par user2884023Assuming there are no errors on this code below to (convert mpeg2.ts to h264) :
$ ffmpeg
-i playlist1.txt
-vcodec h264
-acodec mp3
-s 1280x720
-b:v 4808k
-b:a 192k
-bufsize 8000k
-maxrate 5000k
-r 30
-muxdelay 0.1
-f mpegts udp_multicast "rtp://hostname[:port]/path"If I have qty - 10, h.264 decoders receiving the RTP stream, is the bandwidth consumption (@5mb/s maxrate from FFMPEG) 50mb/s uploaded from my server (unicast) or because of the multicast protocol actually only 5mb/s uploaded / consumed at my server to all 10 decoders which are all capable of receiving the multicast transmission via RTP ?
Also if I am not erroring by attempting to send the RTP feed out of FFMPEG assuimg my server is acting as a (tx) so it can be picked up directly as input by the h.264 decoders acting as receivers.
Question : 5mb/s or 50mb/s being uploaded on my server end to 10 decoders with assigned FFMPEG command ?