
Recherche avancée
Médias (2)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (94)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
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
Sur d’autres sites (13612)
-
How to use the actual frame numbers in filenames using ffmpeg when extracting frames ? [closed]
2 juin 2024, par Joan VengeBasically I am using ffmpeg to extract every Nth frame from a video. But the filenames appear sequentially from 1 to X. I want to use the actual frame numbers so if it's every 30th frame, then the filenames should be 0, 30, 60, etc. Is this possible ?


I am doing this in Python using this function :


def extract_and_compress_frames(directory, frame_interval=1, crop_width=192, crop_height=108, offset_x=0, offset_y=0):
 for filename in os.listdir(directory):
 if filename.endswith(".trec"):
 # Construct full file path
 trec_path = os.path.join(directory, filename)
 mp4_path = os.path.join(directory, filename.replace(".trec", ".mp4"))
 frames_dir = os.path.join(directory, filename.replace(".trec", ""))
 
 # Rename .trec to .mp4
 os.rename(trec_path, mp4_path)
 
 # Create directory for frames
 os.makedirs(frames_dir, exist_ok=True)
 
 if frame_interval == 1:
 # Calculate crop positions for bottom-right corner after scaling to 1080p
 scaled_width = 1920
 scaled_height = 1080
 crop_x = scaled_width - crop_width - offset_x
 crop_y = scaled_height - crop_height - offset_y
 
 # Extract and compress all frames using ffmpeg with quality adjustment
 ffmpeg_cmd = [
 'ffmpeg', 
 '-i', mp4_path,
 '-vf', f"fps=60,scale=1920:1080,crop={crop_width}:{crop_height}:{crop_x}:{crop_y}", 
 '-q:v', '10', # Adjust the quality, 1 (best) to 31 (worst), 2 for good quality
 os.path.join(frames_dir, '%06d.jpg') # 6 digits for padding, starting from 0
 ]
 else:
 # Use frame interval and scale to 720p
 ffmpeg_cmd = [
 'ffmpeg',
 '-reinit_filter', '0',
 '-i', mp4_path,
 '-vf', f"fps=60,scale=1920:1080,crop={crop_width}:{crop_height}:{1920-crop_width-offset_x}:{1080-crop_height-offset_y},drawtext=text='%{{n}}':start_number=1:fontcolor=white:bordercolor=black:borderw=3:fontsize=50,select='not(mod(n\\,{frame_interval}))'",
 '-fps_mode', 'vfr',
 '-q:v', '10', # Adjust the quality, 1 (best) to 31 (worst), 2 for good quality
 os.path.join(frames_dir, '%06d.jpg') # 6 digits for padding, starting from 0
 ]
 
 subprocess.run(ffmpeg_cmd)
 
 # Rename back to .trec
 os.rename(mp4_path, trec_path)
 
 print(f"Processed {filename}")



But this gives me sequential numbers, not the actual frame numbers but the frame numbers I draw over the images, they represent the actual frame numbers.


Basically ffmpeg is able to get the current frame and draw it on the image using :


drawtext=text='%{{n}}'



The question is about getting that value out to the filenames.


-
avcodec/pixlet : Fix reading invalid numbers of bits
18 mai 2017, par Michael Niedermayeravcodec/pixlet : Fix reading invalid numbers of bits
Fixes : asertion failure
Fixes : 1664/clusterfuzz-testcase-minimized-6587801187385344Found-by : continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by : Michael Niedermayer <michael@niedermayer.cc> -
tests/swscale : print speedup numbers in color
4 mars, par Niklas Haas