
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (59)
-
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 (...) -
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 -
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)
Sur d’autres sites (8002)
-
avcodec/cbs_av1 : add an option to select an operating point
15 novembre 2020, par James Almeravcodec/cbs_av1 : add an option to select an operating point
This implements the function drop_obu() as defined in Setion 6.2.1 from the
spec.
In a reading only scenario, units that belong to an operating point the
caller doesn't want should not be parsed.Signed-off-by : James Almer <jamrial@gmail.com>
-
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 !


-
Revision d1cff2deb1 : Code cleanup in bitstream code. Lower case variable names, less code. Change-I
9 avril 2013, par Dmitry KovalevChanged Paths : Modify /vp9/encoder/vp9_bitstream.c Code cleanup in bitstream code. Lower case variable names, less code. Change-Id : I1abc8f592ad2343ab5c76fe2d16262741a4a894a