Recherche avancée

Médias (91)

Autres articles (100)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

Sur d’autres sites (14186)

  • Revision 33afddadb9 : Merge "Add variance based mode/skipping"

    6 août 2013, par Deb Mukherjee

    Changed Paths :
     Modify /vp9/encoder/vp9_block.h


     Modify /vp9/encoder/vp9_encodeframe.c


     Modify /vp9/encoder/vp9_onyx_if.c


     Modify /vp9/encoder/vp9_onyx_int.h


     Modify /vp9/encoder/vp9_rdopt.c



    Merge "Add variance based mode/skipping"

  • Revision 0daadeb60c : Enable motion field based mode seach skip This commit allows the encoder to che

    12 août 2014, par Jingning Han

    Changed Paths :
     Modify /vp9/encoder/vp9_rdopt.c


     Modify /vp9/encoder/vp9_speed_features.c


     Modify /vp9/encoder/vp9_speed_features.h



    Enable motion field based mode seach skip

    This commit allows the encoder to check the above and left neighbor
    blocks’ reference frames and motion vectors. If they are all
    consistent, skip checking the NEARMV and ZEROMV modes. This is
    enabled in speed 3. The coding performance is improved :

    pedestrian area 1080p at 2000 kbps,
    from 74773 b/f, 41.101 dB, 198064 ms
    to 74795 b/f, 41.099 dB, 193078 ms

    park joy 1080p at 15000 kbps,
    from 290727 b/f, 30.640 dB, 609113 ms
    to 290558 b/f, 30.630 dB, 592815 ms

    Overall compression performance of speed 3 is changed
    derf -0.171%
    stdhd -0.168%

    Change-Id : I8d47dd543a5f90d7a1c583f74035b926b6704b95

  • mp4 video written with ffmpeg has different first frame based on total number of frames

    25 janvier 2023, par Nitzan Weissman

    I 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 !