
Recherche avancée
Médias (91)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
-
avec chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
sans chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
config chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
Autres articles (44)
-
Emballe Médias : Mettre en ligne simplement des documents
29 octobre 2010, parLe plugin emballe médias a été développé principalement pour la distribution mediaSPIP mais est également utilisé dans d’autres projets proches comme géodiversité par exemple. Plugins nécessaires et compatibles
Pour fonctionner ce plugin nécessite que d’autres plugins soient installés : CFG Saisies SPIP Bonux Diogène swfupload jqueryui
D’autres plugins peuvent être utilisés en complément afin d’améliorer ses capacités : Ancres douces Légendes photo_infos spipmotion (...) -
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 (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)
Sur d’autres sites (6027)
-
With ffmpeg print onto clipped video hh:mm:ss time *from original* and hh:mm:ss total duration from original
25 mai 2023, par KesI am using arch linux and bash and ffmpeg, all are up to date and the latest versions.


I am clipping a video that is 30 seconds long and wish to clip from 5 secs to 10 seconds to a new file, from the original.


In the bottom right hand corner of the clip I wish to show timestamps from the original video as follows


- 

- in the 5th second "00:00:05/ 00:00:30"
- in the 6th second "00:00:06/ 00:00:30"

etc - in the 10th second "00:00:10/ 00:00:30"








This is an apparentley simple question(?) but the syntax of the command is not at all obvious and I am hoping an expert may shed some light on this.


All I have so far for the drawtext part, which does not do what I want as it only counts the elapsed time from t=0 of the new clip, whereas I want it to show the timestamp and total duration of the original clip


drawtext
I started with

"drawtext=text='%{pts\:gmtime\:0\:%M\\\\\:%S}':fontsize=24:fontcolor=black:x=(w-text_w-10):y=(h-text_h-10)"



ffmpeg line with drawtext I have started with


ffmpeg -ss 00:00:05 -i "$in_file" -filter_complex "drawtext=fontfile=font.ttf:text='sample text':x=10:y=10:fontsize=12:fontcolor=white:box=1:boxcolor=black@0.5:boxborderw=5,drawtext=text='%{duration\:hms}':fontsize=12:fontcolor=black:x=(w-text_w-10):y=(h-text_h-10)" -t 5 -c:a copy -c:v libx264 out_file.mp4



-
mp4 video written with ffmpeg has different first frame based on total number of frames
26 janvier 2023, par Nitzan WeissmanI'm trying to read and write videos using ffmpeg, and I got an interesting phenomenon where the first frame is not the same in videos I create that are made from the same frames, only with different lengths.


The commands I'm running to reproduce the problem :


ffmpeg -i .mp4 -frames:v 20 -q:v 3 resource_images/00%04d.png

ffmpeg -hide_banner -loglevel error -framerate 30 -y -i resource_images/00%04d.png -c:v libx264 -pix_fmt yuv420p -frames:v 20 long_video.mp4 -y

ffmpeg -hide_banner -loglevel error -framerate 30 -y -i resource_images/00%04d.png -c:v libx264 -pix_fmt yuv420p -frames:v 10 short_video.mp4 -y

ffmpeg -i long_video.mp4 -vf "select=eq(n,0)" -q:v 3 long_frame0.png -y

ffmpeg -i short_video.mp4 -vf "select=eq(n,0)" -q:v 3 short_frame0.png -y



The images long_frame0.png and short_frame0.png are different (I loaded them using Python and compared them, there are many differences).


I find it very peculiar, since I create very short videos, it's those videos first frames, and they are keyframes of those videos (I checked it using ffprobe)


What is the cause of this issue and how do I overcome it to create a consistent first frame for a video, regardless of the video length ?


-
mp4 video written with ffmpeg has different first frame based on total number of frames
25 janvier 2023, par Nitzan WeissmanI have a code that writes and reads videos in Python, I'm doing the writing using ffmpeg. I noticed a weird phenomenon, where the first frame changes based on the total number of frames in the video. I find it weird because the first frame is a key frame (I checked it using ffprobe)


The code I'm using :


The writing function


import shutil
import subprocess
def write_h264_video(video_path: str, images: np.ndarray, fps: float):
 image_name_template = '00%04d.png'
 tmp_image_dir = (Path(video_path).parent / 'tmp_imgs')
 tmp_image_dir.mkdir()

 for ii, image in enumerate(images):
 cv2.imwrite(f'{str(tmp_image_dir / str(ii).zfill(6))}.png', image[..., ::-1]) 
 command = f'ffmpeg -hide_banner -loglevel error -framerate {fps} -y -i {tmp_image_dir}/{image_name_template} ' \
 f' -c:v libx264 -pix_fmt yuv420p {video_path} -y'
 subprocess.call(command, shell=True)
 shutil.rmtree(tmp_image_dir)



The main code


import numpy as np
from pathlib import Path
import decord
decord.bridge.set_bridge('torch')

input_video_path = Path('')
tmp_path = Path('')
input_video = decord.VideoReader(str(input_video_path))

frames = np.zeros((20, 512, 512, 3), dtype = np.uint8)
for i in range(20):
 frames[i] = input_video[i].detach().cpu().numpy()
 
long_video_path = tmp_path / 'long_video.mp4'
short_video_path = tmp_path / 'short_video.mp4'

fps = 30
write_h264_video(str(long_video_path), frames, fps=fps)
write_h264_video(str(short_video_path), frames[:10], fps=fps)


long_video = decord.VideoReader(str(long_video_path))
short_video = decord.VideoReader(str(short_video_path))

long_frame_0 = long_video[0]
short_frame_0 = short_video[0]
(long_frame_0 == short_frame_0).all()



I am supposed to get True, but I'm getting False.
I tried reading using other methods, using opencv for example, and the issue persists.
There are other ways to write videos of course, but I'm interested in ffmpeg-based ways.


Thanks !