
Recherche avancée
Médias (1)
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
Autres articles (25)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (6158)
-
How to calculate byte/index ranges for mpeg-dash MPD file ?
7 avril 2016, par TheSHEEEPI basically know how an .mpd file would have to be structured to support streaming from separate .mp4 (or webm) files.
However, I would like to implement the "static" (aka "on-demand") method, thus only having one file per quality that I want to offer in the stream.
In all samples, this is done by supplying the indexRange & range values within a Representation like this :
<representation bandwidth="2073921" codecs="avc1.4d401f" height="720" mimetype="video/mp4" width="1280">
<baseurl>car-20120827-88.mp4</baseurl>
<segmentbase indexrange="708-1183">
<initialization range="0-707"></initialization>
</segmentbase>
</representation>What I could not find out anywhere is how one would calculate the indexRange/range values here, using only ffmpeg (or ffprobe).
What exactly would one have to do to get those numbers right for arbitrary (yet supported, of course) video files to create the .mpd file for them ?Or am I trying to figure out something in vain here and those values are just arbitrary ?
-
ffmpeg : video to images with pts in filename
12 février 2016, par ntgI am trying to extract images of exact times (say every second) from a mp4 video of an experiment. There are a lot of methods to do that using ffmpeg out there, but surprisingly enough the time accuracy is off.
To measure accuracy, I have first time-stamped the video using pts, e.g. :
-vf "[in] scale=640:-2 , drawtext=fontcolor=white:fontsize=22:fontfile='times.ttf':timecode='22\:10\:55\:00:text='03/12/15__':r=23.976023976:x=0:y=0 [out]"
And as a result I got a millisecond precision time-stamp on the video. I checked the video and it seems the time-stamps are very accurate. I then tried all the methods I could find out there including :
-Using
-ss [timestamp]
to go to an exact time and-vframes 1
to get the first frame at that time : this method is extremely slow since it involves calling ffmpeg once for each second of the video. Furthermore, seems to work fine for the first minutes, but then gets out of sync.-Using
fps=1
and usingout_%05d.jpg
as the output. This was probably the most inaccurate, as it went off by whole seconds, plus it never got exactly the 0th millisecond.-Using a fast fps, and then selecting only the ones I need, e.g.
-vf "fps=10, framestep=10, select=not(mod(n\,40))"
was promising for the first minutes, but also became inaccurate after that.-I tried writing the pts/date as metadata, but (do not know how to /cannot) write to the metadata of a .jpg from ffmpeg...
The problem is that after some time, if we are using
out_%05d.jpg
, the numbers get completely out of sinc, while the -ss gets inaccurate, and takes forever.Ideally there should be a way to write the %pts or the date as part of the filename... Does anyone know a method to extract images from an .mp4 file with millisecond precision, preferably using ffmpeg (or its library ? I am using python and getting desperate...)
[Edit : as explained in the comment by Mulvya, the pts is calculated by using the fps of the video, ffmpeg can give it to you. In my case some of the videos have 30 and others 24*(100/1001) fps. Bellow is an example, which was produced by :
args = ['ffmpeg',
'-i',
'c:\\Temp\\scr_cam.mp4',
'-y',
'-vf',
"[in] drawtext=fontcolor=black:fontsize=22:fontfile='times.ttf':timecode='17\\:00\\:29\\:00':text='09/02/16__':r=30.0:x=0:y=0, drawtext=fontcolor=black:fontsize=22:fontfile='times.ttf':timecode='00\\:00\\:00\\:00':text='':r=30.0 :x=0:y=30, drawtext=fontcolor=black:fontsize=22:fontfile='times.ttf':text='n\\: %{n} pts\\:%{pts}':r=30.0:x=0:y=60 [out]",
'-c:a',
'copy',
'-metadata',
'creation_time=2016-02-09T17:00:29',
'-preset',
'ultrafast',
'-threads',
'3',
'c:\\Temp\\stamped_scr_cam.mp4']
subprocess.call(args)In it we see that indeed pts = n/30 (n is the frame no). I have tried many combinations of the params of the commands I talk in the beginning, so listing all my efforts would take too much space. As we see, the drawtext seems to be very accurate, so it does not seem to be a problem of incorrect fps.
To get the fps I am using :
def get_frame_rate_and_duration(filename):
if not os.path.exists(filename):
sys.stderr.write("ERROR: filename %r was not found!" % (filename,))
return -1
args = ["ffprobe",filename,"-v","0","-select_streams","v","-print_format","flat"]
args.extend(["-show_entries","stream=r_frame_rate"])
args.extend(["-show_entries","format=duration"])
out = subprocess.check_output(args).split("\n")
rate = out[0].split('=')[1].strip()[1:-1].split('/')
duration = pd.Timedelta("{0} sec".format(out[1].split('=')[1].strip()[1:-1]))
if len(rate)==1:
rate = float(rate[0])
if len(rate)==2:
rate = float(rate[0])/float(rate[1])
else:
rate = -1
return rate, duration -
Create a gif of given duration from a set of images with ffmpeg
7 septembre 2020, par LukeTheWalkerAt the moment I have a variable number of frame numerically ordered from
gif-00000.png
to the last frame namedgif-xxxxx.png
.

I'd like to create a gif using ffmpeg of exactly 25 seconds, which means changing according to the numbers of frames, the framerate of the gif.


Since I do not know the exact number of frames, is there an option to force the framerate to fit into a given duration ?