Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (68)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

Sur d’autres sites (4955)

  • Revision 35243 : suivre [35095]

    16 février 2010, par brunobergot@… — Log

    suivre [35095]

  • Why is ffmpeg biased when converting to 16-bit integer or 32-bit float RGB output ?

    8 mars 2023, par F.X.

    Consider the following Python invocations, that exercise ffmpeg's ability to convert a 8-bit input into 16-bit integer values or 32-bit float values :

    


    import cv2
import subprocess
import numpy as np

ffmpeg = "ffmpeg -hide_banner -loglevel error -y"
flags = "-sws_flags accurate_rnd+bitexact+full_chroma_int+neighbor -sws_dither none"

for input_color_range in ("tv", "pc"):

    # Generate YUV444 video and encode it losslessly
    subprocess.check_call(rf"{ffmpeg} -y {flags} -color_range {input_color_range} -f lavfi -i yuvtestsrc {flags} -pix_fmt yuv444p -color_range {input_color_range} -x264-params qp=0 -frames 1 -c:v libx264 video_temp.mp4")

    # Extract YUV444 frame, as well as 8-bit int, 16-bit int and 32-bit float frame
    subprocess.check_call(rf"{ffmpeg} -y {flags} -i video_temp.mp4 {flags} -f rawvideo video_temp_444_frame1.yuv")
    subprocess.check_call(rf"{ffmpeg} -y {flags} -i video_temp.mp4 {flags} -color_range pc -pix_fmt rgb24 video_temp_444_frame1_8u.png")
    subprocess.check_call(rf"{ffmpeg} -y {flags} -i video_temp.mp4 {flags} -color_range pc -pix_fmt rgb48be video_temp_444_frame1_16u.png")
    subprocess.check_call(rf"{ffmpeg} -y {flags} -i video_temp.mp4 {flags} -color_range pc -pix_fmt gbrpf32be -f rawvideo video_temp_444_frame1_32f.gbrpf32be")

    # Reead these frames into (height, width, 3) Numpy arrays containing YUV or RGB data
    data_8u = cv2.imread("video_temp_444_frame1_8u.png", cv2.IMREAD_UNCHANGED)[..., ::-1]
    data_16u = cv2.imread("video_temp_444_frame1_16u.png", cv2.IMREAD_UNCHANGED)[..., ::-1]
    data_yuv = np.rollaxis(np.frombuffer(open("video_temp_444_frame1.yuv", "rb").read()).view(np.uint8).reshape((3, 240, 320)), 0, 3).copy()
    data_32f = np.rollaxis(np.frombuffer(open("video_temp_444_frame1_32f.gbrpf32be", "rb").read()).view(np.dtype(">f4")).reshape((3, 240, 320)), 0, 3).copy()
    data_32f[..., (0, 1, 2)] = data_32f[..., (2, 0, 1)]

    # This pixel in yuvtestsrc corresponds to limited-range YUV=(235, 128,
    # 128)=(100%, 0.0, 0.0), which should correspond to 100% white, i.e.
    # RGB=(100%, 100%, 100%).
    if input_color_range == "tv":
        i, j = 10, 294
    # This pixel in yuvtestsrc corresponds to full-range YUV=(255, 128,
    # 128)=(100%, 0.0, 0.0), which should correspond to 100% white, i.e.
    # RGB=(100%, 100%, 100%).
    elif input_color_range == "pc":
        i, j = 10, 319
    else:
        raise Exception(input_color_range)

    # Print pixel values
    print("")
    print(f"Values for {input_color_range}-range input video at ({i}, {j}):")
    print("- 8-bit YUV input   = %s" % data_yuv[i, j, :])
    print("- 8-bit RGB output  = %s (= %s)" % (data_8u[i, j, :], data_8u[i, j, :] / 255))
    print("- 16-bit RGB output = %s (= %s)" % (data_16u[i, j, :], data_16u[i, j, :] / 65535))
    print("- Float RGB output  = %s" % data_32f[i, j, :])


    


    The script first generates a video frame from ffmpeg's YUV test source, encoded with no chroma subsampling (4:4:4) as losslessly as possible.

    


    That video is then used as a reference source to extract the following frames :

    


      

    • The input reference YUV data
    • 


    • A 8-bit RGB conversion
    • 


    • A 16-bit RGB conversion
    • 


    • A 32-bit floating-point RGB conversion
    • 


    


    One pixel is extracted from each frame, which should contain a 100% white value. The output of the last series of print statements is the following :

    


    Values for tv-range input video at (10, 294):
- 8-bit YUV input   = [235 128 128]
- 8-bit RGB output  = [255 255 255] (= [1. 1. 1.])
- 16-bit RGB output = [65283 65283 65283] (= [0.99615473 0.99615473 0.99615473])
- Float RGB output  = [0.9961547 0.9961547 0.9961547]

Values for pc-range input video at (10, 319):
- 8-bit YUV input   = [255 128 128]
- 8-bit RGB output  = [255 255 255] (= [1. 1. 1.])
- 16-bit RGB output = [65280 65280 65280] (= [0.99610895 0.99610895 0.99610895])
- Float RGB output  = [0.99610895 0.99610895 0.99610895]


    


    While the 8-bit RGB output values are correct, none of the others correctly output a 100% white signal. Why is that ?

    


  • Revision 3327 : Le modèle pour les images prenant en compte les largeurs et autres ...

    25 avril 2010, par kent1 — Log

    Le modèle pour les images prenant en compte les largeurs et autres hauteurs fixées au modèle