Recherche avancée

Médias (0)

Mot : - Tags -/metadatas

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (90)

  • 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 (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accé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 (9121)

  • avcodec/librav1e : free the RaPacket after using it

    11 novembre 2019, par James Almer
    avcodec/librav1e : free the RaPacket after using it
    

    Fixes leaks.

    Reviewed-by : Derek Buitenhuis <derek.buitenhuis@gmail.com>
    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DH] libavcodec/librav1e.c
  • Trying to get the current FPS and Frametime value into Matplotlib title

    16 juin 2022, par TiSoBr

    I try to turn an exported CSV with benchmark logs into an animated graph. Works so far, but I can't get the Titles on top of both plots with their current FPS and frametime in ms values animated.

    &#xA;

    Thats the output I'm getting. Looks like he simply stores all values in there instead of updating them ?

    &#xA;

    Screengrab of cli output&#xA;Screengrab of the final output (inverted)

    &#xA;

    from __future__ import division&#xA;import sys, getopt&#xA;import time&#xA;import matplotlib&#xA;import numpy as np&#xA;import subprocess&#xA;import math&#xA;import re&#xA;import argparse&#xA;import os&#xA;import glob&#xA;&#xA;import matplotlib.animation as animation&#xA;import matplotlib.pyplot as plt&#xA;&#xA;&#xA;def check_pos(arg):&#xA;    ivalue = int(arg)&#xA;    if ivalue &lt;= 0:&#xA;        raise argparse.ArgumentTypeError("%s Not a valid positive integer value" % arg)&#xA;    return True&#xA;    &#xA;def moving_average(x, w):&#xA;    return np.convolve(x, np.ones(w), &#x27;valid&#x27;) / w&#xA;    &#xA;&#xA;parser = argparse.ArgumentParser(&#xA;    description = "Example Usage python frame_scan.py -i mangohud -c &#x27;#fff&#x27; -o mymov",&#xA;    formatter_class=argparse.ArgumentDefaultsHelpFormatter)&#xA;parser.add_argument("-i", "--input", help = "Input data set from mangohud", required = True, nargs=&#x27;&#x2B;&#x27;, type=argparse.FileType(&#x27;r&#x27;), default=sys.stdin)&#xA;parser.add_argument("-o", "--output", help = "Output file name", required = True, type=str, default = "")&#xA;parser.add_argument("-r", "--framerate", help = "Set the desired framerate", required = False, type=float, default = 60)&#xA;parser.add_argument("-c", "--colors", help = "Colors for the line graphs; must be in quotes", required = True, type=str, nargs=&#x27;&#x2B;&#x27;, default = 60)&#xA;parser.add_argument("--fpslength", help = "Configures how long the data will be shown on the FPS graph", required = False, type=float, default = 5)&#xA;parser.add_argument("--fpsthickness", help = "Changes the line width for the FPS graph", required = False, type=float, default = 3)&#xA;parser.add_argument("--frametimelength", help = "Configures how long the data will be shown on the frametime graph", required = False, type=float, default = 2.5)&#xA;parser.add_argument("--frametimethickness", help = "Changes the line width for the frametime graph", required = False, type=float, default = 1.5)&#xA;parser.add_argument("--graphcolor", help = "Changes all of the line colors on the graph; expects hex value", required = False, default = &#x27;#FFF&#x27;)&#xA;parser.add_argument("--graphthicknes", help = "Changes the line width of the graph", required = False, type=float, default = 1)&#xA;parser.add_argument("-ts","--textsize", help = "Changes the the size of numbers marking the ticks", required = False, type=float, default = 23)&#xA;parser.add_argument("-fsM","--fpsmax", help = "Changes the the size of numbers marking the ticks", required = False, type=float, default = 180)&#xA;parser.add_argument("-fsm","--fpsmin", help = "Changes the the size of numbers marking the ticks", required = False, type=float, default = 0)&#xA;parser.add_argument("-fss","--fpsstep", help = "Changes the the size of numbers marking the ticks", required = False, type=float, default = 30)&#xA;parser.add_argument("-ftM","--frametimemax", help = "Changes the the size of numbers marking the ticks", required = False, type=float, default = 50)&#xA;parser.add_argument("-ftm","--frametimemin", help = "Changes the the size of numbers marking the ticks", required = False, type=float, default = 0)&#xA;parser.add_argument("-fts","--frametimestep", help = "Changes the the size of numbers marking the ticks", required = False, type=float, default = 10)&#xA;&#xA;arg = parser.parse_args()&#xA;status = False&#xA;&#xA;&#xA;if arg.input:&#xA;    status = True&#xA;if arg.output:&#xA;    status = True&#xA;if arg.framerate:&#xA;    status = check_pos(arg.framerate)&#xA;if arg.fpslength:&#xA;    status = check_pos(arg.fpslength)&#xA;if arg.fpsthickness:&#xA;    status = check_pos(arg.fpsthickness)&#xA;if arg.frametimelength:&#xA;    status = check_pos(arg.frametimelength)&#xA;if arg.frametimethickness:&#xA;    status = check_pos(arg.frametimethickness)&#xA;if arg.colors:&#xA;    if len(arg.output) != len(arg.colors):&#xA;        for i in arg.colors:&#xA;            if re.match(r"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", i):&#xA;                status = True&#xA;            else:&#xA;                print(&#x27;{} : Isn\&#x27;t a valid hex value!&#x27;.format(i))&#xA;                status = False&#xA;    else:&#xA;        print(&#x27;You must have the same amount of colors as files in input!&#x27;)&#xA;        status = False&#xA;if arg.graphcolor:&#xA;    if re.match(r"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", arg.graphcolor):&#xA;        status = True&#xA;    else:&#xA;        print(&#x27;{} : Isn\&#x27;t a vaild hex value!&#x27;.format(arg.graphcolor))&#xA;        status = False&#xA;if arg.graphthicknes:&#xA;    status = check_pos(arg.graphthicknes)&#xA;if arg.textsize:&#xA;    status = check_pos(arg.textsize)&#xA;if not status:&#xA;    print("For a list of arguments try -h or --help") &#xA;    exit()&#xA;&#xA;&#xA;# Empty output folder&#xA;files = glob.glob(&#x27;/output/*&#x27;)&#xA;for f in files:&#xA;    os.remove(f)&#xA;&#xA;&#xA;# We need to know the longest recording out of all inputs so we know when to stop the video&#xA;longest_data = 0&#xA;&#xA;# Format the raw data into a list of tuples (fps, frame time in ms, time from start in micro seconds)&#xA;# The first three lines of our data are setup so we ignore them&#xA;data_formated = []&#xA;for li, i in enumerate(arg.input):&#xA;    t = 0&#xA;    sublist = []&#xA;    for line in i.readlines()[3:]:&#xA;        x = line[:-1].split(&#x27;,&#x27;)&#xA;        fps = float(x[0])&#xA;        frametime = int(x[1])/1000 # convert from microseconds to milliseconds&#xA;        elapsed = int(x[11])/1000 # convert from nanosecond to microseconds&#xA;        data = (fps, frametime, elapsed)&#xA;        sublist.append(data)&#xA;    # Compare last entry of each list with the &#xA;    if sublist[-1][2] >= longest_data:&#xA;        longest_data = sublist[-1][2]&#xA;    data_formated.append(sublist)&#xA;&#xA;&#xA;max_blocksize = max(arg.fpslength, arg.frametimelength) * arg.framerate&#xA;blockSize = arg.framerate * arg.fpslength&#xA;&#xA;&#xA;# Get step time in microseconds&#xA;step = (1/arg.framerate) * 1000000 # 1000000 is one second in microseconds&#xA;frame_size_fps = (arg.fpslength * arg.framerate) * step&#xA;frame_size_frametime = (arg.frametimelength * arg.framerate) * step&#xA;&#xA;&#xA;# Total frames will have to be updated for more then one source&#xA;total_frames = int(int(longest_data) / step)&#xA;&#xA;&#xA;if True: # Gonna be honest, this only exists so I can collapse this block of code&#xA;&#xA;    # Sets up our figures to be next to each other (horizontally) and with a ratio 3:1 to each other&#xA;    fig, (ax1, ax2) = plt.subplots(1, 2, gridspec_kw={&#x27;width_ratios&#x27;: [3, 1]})&#xA;&#xA;    # Size of whole output 1920x360 1080/3=360&#xA;    fig.set_size_inches(19.20, 3.6)&#xA;&#xA;    # Make the background transparent&#xA;    fig.patch.set_alpha(0)&#xA;&#xA;&#xA;    # Loop through all active axes; saves a lot of lines in ax1.do_thing(x) ax2.do_thing(x)&#xA;    for axes in fig.axes:&#xA;&#xA;        # Set all splines to the same color and width&#xA;        for loc, spine in axes.spines.items():&#xA;            axes.spines[loc].set_color(arg.graphcolor)&#xA;            axes.spines[loc].set_linewidth(arg.graphthicknes)&#xA;&#xA;        # Make sure we don&#x27;t render any data points as this will be our background&#xA;        axes.set_xlim(-(max_blocksize * step), 0)&#xA;        &#xA;&#xA;        # Make both plots transparent as well as the background&#xA;        axes.patch.set_alpha(.5)&#xA;        axes.patch.set_color(&#x27;#020202&#x27;)&#xA;&#xA;        # Change the Y axis info to be on the right side&#xA;        axes.yaxis.set_label_position("right")&#xA;        axes.yaxis.tick_right()&#xA;&#xA;        # Add the white lines across the graphs; the location of the lines are based off set_{}ticks&#xA;        axes.grid(alpha=.8, b=True, which=&#x27;both&#x27;, axis=&#x27;y&#x27;, color=arg.graphcolor, linewidth=arg.graphthicknes)&#xA;&#xA;        # Remove X axis info&#xA;        axes.set_xticks([])&#xA;&#xA;    # Add a another Y axis so ticks are on both sides&#xA;    tmp_ax1 = ax1.secondary_yaxis("left")&#xA;    tmp_ax2 = ax2.secondary_yaxis("left")&#xA;&#xA;    # Set both to the same values&#xA;    ax1.set_yticks(np.arange(arg.fpsmin, arg.fpsmax &#x2B; 1, step=arg.fpsstep))&#xA;    ax2.set_yticks(np.arange(arg.frametimemin, arg.frametimemax &#x2B; 1, step=arg.frametimestep))&#xA;    tmp_ax1.set_yticks(np.arange(arg.fpsmin , arg.fpsmax &#x2B; 1, step=arg.fpsstep))&#xA;    tmp_ax2.set_yticks(np.arange(arg.frametimemin, arg.frametimemax &#x2B; 1, step=arg.frametimestep))&#xA;&#xA;    # Change the "ticks" to be white and correct size also change font size&#xA;    ax1.tick_params(axis=&#x27;y&#x27;, color=arg.graphcolor ,width=arg.graphthicknes, length=16, labelsize=arg.textsize, labelcolor=arg.graphcolor)&#xA;    ax2.tick_params(axis=&#x27;y&#x27;, color=arg.graphcolor ,width=arg.graphthicknes, length=16, labelsize=arg.textsize, labelcolor=arg.graphcolor)&#xA;    tmp_ax1.tick_params(axis=&#x27;y&#x27;, color=arg.graphcolor ,width=arg.graphthicknes, length=8, labelsize=0) # Label size of 0 disables the fps/frame numbers&#xA;    tmp_ax2.tick_params(axis=&#x27;y&#x27;, color=arg.graphcolor ,width=arg.graphthicknes, length=8, labelsize=0)&#xA;&#xA;&#xA;    # Limits Y scale&#xA;    ax1.set_ylim(arg.fpsmin,arg.fpsmax &#x2B; 1)&#xA;    ax2.set_ylim(arg.frametimemin,arg.frametimemax &#x2B; 1)&#xA;&#xA;    # Add an empty plot&#xA;    line = ax1.plot([], lw=arg.fpsthickness)&#xA;    line2 = ax2.plot([], lw=arg.frametimethickness)&#xA;&#xA;    # Sets all the data for our benchmark&#xA;    for benchmarks, color in zip(data_formated, arg.colors):&#xA;        y = moving_average([x[0] for x in benchmarks], 25)&#xA;        y2 = [x[1] for x in benchmarks]&#xA;        x = [x[2] for x in benchmarks]&#xA;        line &#x2B;= ax1.plot(x[12:-12],y, c=color, lw=arg.fpsthickness)&#xA;        line2 &#x2B;= ax2.step(x,y2, c=color, lw=arg.fpsthickness)&#xA;    &#xA;    # Add titles with values&#xA;    ax1.set_title("Avg. frames per second: {}".format(y2), color=arg.graphcolor, fontsize=20, fontweight=&#x27;bold&#x27;, loc=&#x27;left&#x27;)&#xA;    ax2.set_title("Frametime in ms: {}".format(y2), color=arg.graphcolor, fontsize=20, fontweight=&#x27;bold&#x27;, loc=&#x27;left&#x27;)  &#xA;&#xA;    # Removes unwanted white space; also controls the space between the two graphs&#xA;    plt.tight_layout(pad=0, h_pad=0, w_pad=2.5)&#xA;    &#xA;    fig.canvas.draw()&#xA;&#xA;    # Cache the background&#xA;    axbackground = fig.canvas.copy_from_bbox(ax1.bbox)&#xA;    ax2background = fig.canvas.copy_from_bbox(ax2.bbox)&#xA;&#xA;&#xA;# Create a ffmpeg instance as a subprocess we will pipe the finished frame into ffmpeg&#xA;# encoded in Apple QuickTime (qtrle) for small(ish) file size and alpha support&#xA;# There are free and opensource types that will also do this but with much larger sizes&#xA;canvas_width, canvas_height = fig.canvas.get_width_height()&#xA;outf = &#x27;{}.mov&#x27;.format(arg.output)&#xA;cmdstring = (&#x27;ffmpeg&#x27;,&#xA;                &#x27;-stats&#x27;, &#x27;-hide_banner&#x27;, &#x27;-loglevel&#x27;, &#x27;error&#x27;, # Makes ffmpeg less annoying / to much console output&#xA;                &#x27;-y&#x27;, &#x27;-r&#x27;, &#x27;60&#x27;, # set the fps of the video&#xA;                &#x27;-s&#x27;, &#x27;%dx%d&#x27; % (canvas_width, canvas_height), # size of image string&#xA;                &#x27;-pix_fmt&#x27;, &#x27;argb&#x27;, # format cant be changed since this is what  `fig.canvas.tostring_argb()` outputs&#xA;                &#x27;-f&#x27;, &#x27;rawvideo&#x27;,  &#x27;-i&#x27;, &#x27;-&#x27;, # tell ffmpeg to expect raw video from the pipe&#xA;                &#x27;-vcodec&#x27;, &#x27;qtrle&#x27;, outf) # output encoding must support alpha channel&#xA;pipe = subprocess.Popen(cmdstring, stdin=subprocess.PIPE)&#xA;&#xA;def render_frame(frame : int):&#xA;&#xA;    # Set the bounds of the graph for each frame to render the correct data&#xA;    start = (frame * step) - frame_size_fps&#xA;    end = start &#x2B; frame_size_fps&#xA;    ax1.set_xlim(start,end)&#xA;     &#xA;     &#xA;    start = (frame * step) - frame_size_frametime&#xA;    end = start &#x2B; frame_size_frametime&#xA;    ax2.set_xlim(start,end)&#xA;    &#xA;&#xA;    # Restore background&#xA;    fig.canvas.restore_region(axbackground)&#xA;    fig.canvas.restore_region(ax2background)&#xA;&#xA;    # Redraw just the points will only draw points with in `axes.set_xlim`&#xA;    for i in line:&#xA;        ax1.draw_artist(i)&#xA;        &#xA;    for i in line2:&#xA;        ax2.draw_artist(i)&#xA;&#xA;    # Fill in the axes rectangle&#xA;    fig.canvas.blit(ax1.bbox)&#xA;    fig.canvas.blit(ax2.bbox)&#xA;    &#xA;    fig.canvas.flush_events()&#xA;&#xA;    # Converts the finished frame to ARGB&#xA;    string = fig.canvas.tostring_argb()&#xA;    return string&#xA;&#xA;&#xA;&#xA;&#xA;#import multiprocessing&#xA;#p = multiprocessing.Pool()&#xA;#for i, _ in enumerate(p.imap(render_frame, range(0, int(total_frames &#x2B; max_blocksize))), 20):&#xA;#    pipe.stdin.write(_)&#xA;#    sys.stderr.write(&#x27;\rdone {0:%}&#x27;.format(i/(total_frames &#x2B; max_blocksize)))&#xA;#p.close()&#xA;&#xA;#Signle Threaded not much slower then multi-threading&#xA;if __name__ == "__main__":&#xA;    for i , _ in enumerate(range(0, int(total_frames &#x2B; max_blocksize))):&#xA;        render_frame(_)&#xA;        pipe.stdin.write(render_frame(_))&#xA;        sys.stderr.write(&#x27;\rdone {0:%}&#x27;.format(i/(total_frames &#x2B; max_blocksize)))&#xA;

    &#xA;

  • doc/ffprobe : fix rendering of the timecode chapter in the man page

    12 mai 2012, par Stefano Sabatini

    doc/ffprobe : fix rendering of the timecode chapter in the man page