
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (42)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Les thèmes de MediaSpip
4 juin 20133 thèmes sont proposés à l’origine par MédiaSPIP. L’utilisateur MédiaSPIP peut rajouter des thèmes selon ses besoins.
Thèmes MediaSPIP
3 thèmes ont été développés au départ pour MediaSPIP : * SPIPeo : thème par défaut de MédiaSPIP. Il met en avant la présentation du site et les documents média les plus récents ( le type de tri peut être modifié - titre, popularité, date) . * Arscenic : il s’agit du thème utilisé sur le site officiel du projet, constitué notamment d’un bandeau rouge en début de page. La structure (...)
Sur d’autres sites (4833)
-
How to export wave slices to the same bits per sample as the original file
23 avril 2019, par tzujanI am looping through a large wave file, via a dictionary of new file names, lengths and versions. The loop exports the individual slices as files :
mix.export(key, format='wav')
However, it converts the original 24-bit file to 32-bit slices. I have been doing a round trip to pro tools to get the files back to 24, as I can’t figure out either ffmpeg settings, or getting the slice into a subprocess.
I have tried several variations of this theme :
mix.export(key, format='wav', codec='pcm_s24le')
As well as this one :
mix.export(k, format='wav', parameters=['ffmpeg', '-i', '-acodec', 'pcm_s24le', '-ar', '48000'])
I can’t seem to get the individual slices to work in the following subprocess call.
key
is the file name from the key-value pair. This works well in the 32-bit export, but not sure how to make it work when a slice’s temp file, such as/var/folders/vc/q7jggn7900l099w45463lgx40000gn/T/tmpw_6mxyg8
needs to be called.subprocess.call(['ffmpeg', '-i', key,
'-acodec', 'pcm_s24le', '-ar', '48000', 'output.wav'])Hoping for slices of the exact same format as the original input :
mix_file = AudioSegment.from_wav(file_name)
-
How to detect a common section in a set of videos with ffmpeg [on hold]
7 août 2019, par Hans JI have a set of videos that are assumed to contain common (or very similar) sections. I want to be able to detect (with FFmpeg) how long each common section is, and where the sections are in each individual video.
An individual section can have multiple scene changes, and is continuous. A common section would also be assumed to be longer than 10 seconds (This is an arbitrary choice, it can be changed).
The final output of the command would include the various time-codes of the instance of each section in each video. Assuming a timebase 1/1, with 1 common section that is 60 seconds long, an output would along the lines of :
Video1.mp4 0 60
Video2.mp4 120 180
Video3.mp4 50 110
Video4.mp4 nullwhere video1, video2, video3, and video4 are the input videos. In this case, video4 does not contain a common section.
For example, I could have three episodes of a TV show. They all contain the same commercial. Without knowing what that commercial is, I want to be able to find where that commercial shows up in each of the episodes. Ideally the function would detect additional common commercials as well.
Edit : Another example would be removing the intro sequence in all three episodes.
Note : For the purpose of a good solution, the common sections do not have to exactly match. Because there could be artifacts or embedded subtitles in one episode and not the other.
-
Lossless trim and crop of MJPEG video
28 avril 2021, par prouastI am working on a project where I need to trim and crop MJPEG videos without any re-encoding. I have working code that accomplishes this by exporting the relevant frames as JPEGs, cropping them individually, and then joining them back together into an MJPEG.


However, this seems quite inefficient and slow. I am looking for pointers how to improve this approach. For example, would it be possible to store the JPEGs in-memory ?


import ffmpeg
import os
import shutil
import subprocess

def lossless_trim_and_crop(path, output_path, start, end, x, y, width, height, fps):
 # Trim the video in time and export all individual jpeg with ffmpeg + mjpeg2jpeg
 jpeg_folder = os.path.splitext(output_path)[0]
 jpeg_path = os.path.join(jpeg_folder, "frame_%03d.jpg")
 stream = ffmpeg.input(path, ss=start/fps, t=(end-start)/fps)
 stream = ffmpeg.output(stream, jpeg_path, vcodec='copy', **{'bsf:v': 'mjpeg2jpeg'})
 stream.run(quiet=True)
 # Crop all individual jpeg with jpegtran
 for filename in os.listdir(jpeg_folder):
 filepath = os.path.join(jpeg_folder, filename)
 out_filepath = os.path.splitext(filepath)[0] + "_c.jpg"
 subprocess.call(
 "jpegtran -perfect -crop {}x{}+{}+{} -outfile {} {}".format(
 width, height, x, y, out_filepath, filepath), shell=True)
 os.remove(filepath)
 # Join individual jpg back together
 cropped_jpeg_path = os.path.join(jpeg_folder, "frame_%03d_c.jpg")
 stream = ffmpeg.input(cropped_jpeg_path, framerate=fps)
 stream = ffmpeg.output(stream, output_path, vcodec='copy')
 stream.run(quiet=True)
 # Delete jpeg directory
 shutil.rmtree(jpeg_folder)