Recherche avancée

Médias (1)

Mot : - Tags -/ipad

Autres articles (95)

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

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (11515)

  • what is wrong about the I420 render from ffmpeg ?

    9 mai 2022, par DLKUN

    I use glfw render YUV from ffmpeg ;the Y is ok(only use data Y ,and frag texture2D Y is ok ,the color is Grayscale).but when I add U,V ;the display show pink and green ; I try to change frag shader or the imgtexture ,there have no use .

    


    #include <glad></glad>glad.h>&#xA;#include <glfw></glfw>glfw3.h>&#xA;&#xA;#include<string>&#xA;#include<fstream>&#xA;#include<sstream>&#xA;#include<iostream>&#xA;#include&#xA;&#xA;#include &#xA;&#xA;// settings&#xA;const unsigned int SCR_WIDTH = 544;&#xA;const unsigned int SCR_HEIGHT = 960;&#xA;const int len = 544 * 960 * 3/2;&#xA;BYTE YUVdata [len];//&#xA;BYTE Ydata [544 * 960];//&#xA;BYTE Udata [272 * 480];//&#xA;BYTE Vdata [272 * 480];//&#xA;unsigned int VBO = 0;&#xA;unsigned int VAO = 0;&#xA;unsigned int EBO = 0;&#xA;unsigned int texturePIC = 0;&#xA;int shaderProgram = 0;&#xA;&#xA;GLuint texIndexarray[3];&#xA;GLuint texUniformY = 99;&#xA;GLuint texUniformU = 99;&#xA;GLuint texUniformV = 99;&#xA;&#xA;void LoadPicture()&#xA;{&#xA;&#xA;&#xA;    glGenTextures(3, texIndexarray);&#xA;&#xA;    glBindTexture(GL_TEXTURE_2D, texIndexarray[0]);&#xA;    &#xA;    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);&#xA;    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);&#xA;    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);&#xA;    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);&#xA;&#xA;    glBindTexture(GL_TEXTURE_2D, texIndexarray[1]);&#xA;    &#xA;    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);&#xA;    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);&#xA;    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);&#xA;    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);&#xA;    glBindTexture(GL_TEXTURE_2D, texIndexarray[2]);&#xA;    &#xA;    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);&#xA;    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);&#xA;    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);&#xA;    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);&#xA;&#xA;&#xA;    glValidateProgram(shaderProgram);&#xA;&#xA;    texUniformY = glGetUniformLocation(shaderProgram, "dataY");//2&#xA;    texUniformU = glGetUniformLocation(shaderProgram, "dataU");//0&#xA;    texUniformV = glGetUniformLocation(shaderProgram, "dataV");//1&#xA;&#xA;    &#xA;    FILE* fp = fopen("./output544_960.yuv","rb&#x2B;");//I420&#xA;    int returns  =fread(YUVdata,1,len,fp);&#xA;    int w = 544;&#xA;    int h = 960;&#xA;    int ysize = w*h;&#xA;    int uvsize = w * h / 4;&#xA;&#xA;    void* uptr = &amp;YUVdata[ysize];&#xA;    void* vptr = &amp;YUVdata[ysize * 5 / 4];&#xA;&#xA;    memcpy(Ydata,YUVdata,ysize);&#xA;    memcpy(Udata, uptr,uvsize);&#xA;    memcpy(Vdata, vptr,uvsize);&#xA;    glActiveTexture(GL_TEXTURE0);&#xA;    glBindTexture(GL_TEXTURE_2D, texIndexarray[0]);&#xA;    &#xA;    glTexImage2D(GL_TEXTURE_2D, 0 , GL_RED, w, h ,0, GL_RED,GL_UNSIGNED_BYTE ,Ydata);&#xA;    glUniform1i(texUniformY, texIndexarray[0]);               &#xA;&#xA;&#xA;    glActiveTexture(GL_TEXTURE1);&#xA;    glBindTexture(GL_TEXTURE_2D, texIndexarray[1]);&#xA;    glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, w/2, h/2, 0, GL_RED, GL_UNSIGNED_BYTE,Udata );&#xA;&#xA;    glUniform1i(texUniformU, texIndexarray[1]);&#xA;&#xA;&#xA;    glActiveTexture(GL_TEXTURE2);&#xA;    glBindTexture(GL_TEXTURE_2D, texIndexarray[2]);&#xA;    glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, w/2, h/2, 0, GL_RED, GL_UNSIGNED_BYTE,Vdata);&#xA;    glUniform1i(texUniformV, texIndexarray[2]);&#xA;&#xA;}&#xA;&#xA;&#xA;void render()&#xA;{&#xA;    glBindVertexArray(VAO);&#xA;    glUseProgram(shaderProgram);&#xA;    glDrawElements(GL_TRIANGLES,6,GL_UNSIGNED_INT,0);&#xA;    //glDrawArrays(GL_TRIANGLE_FAN,0,4);&#xA;    glUseProgram(0);&#xA;    glBindVertexArray(0);&#xA;}&#xA;&#xA;void initmodule()&#xA;{&#xA;    &#xA;    float vertexs[] = {&#xA;        &#xA;        1.0f,  1.0f, 0.0f,  1.0f, 0.0f,   &#xA;        1.0f, -1.0f, 0.0f,  1.0f, 1.0f,   &#xA;        -1.0f, -1.0f, 0.0f,  0.0f, 1.0f,   &#xA;        -1.0f,  1.0f, 0.0f,  0.0f, 0.0f    &#xA;    &#xA;    &#xA;    };&#xA;    &#xA;    unsigned int indexs[] = {&#xA;        0,1,3,&#xA;        1,2,3,&#xA;    };&#xA;&#xA;    &#xA;    glGenVertexArrays(1,&amp;VAO);&#xA;    glBindVertexArray(VAO);&#xA;&#xA;    &#xA;&#xA;    glGenBuffers(1, &amp;VBO);&#xA;    glBindBuffer(GL_ARRAY_BUFFER, VBO);&#xA;    &#xA;    glBufferData(GL_ARRAY_BUFFER,sizeof(vertexs), vertexs, GL_STATIC_DRAW);&#xA;&#xA;    &#xA;    glGenBuffers(1,&amp;EBO);&#xA;    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,EBO);&#xA;    glBufferData(GL_ELEMENT_ARRAY_BUFFER,sizeof(indexs),indexs,GL_STATIC_DRAW);&#xA;    &#xA;    LoadPicture();&#xA;&#xA;    glVertexAttribPointer(0,3,GL_FLOAT,GL_FALSE,5*sizeof(float),(void*)0);&#xA;    &#xA;    glEnableVertexAttribArray(0);&#xA;    &#xA;    glVertexAttribPointer(1,2, GL_FLOAT, GL_FALSE, 5 * sizeof(float), (void*)(3 * sizeof(float)));&#xA;    &#xA;    glEnableVertexAttribArray(1);&#xA;&#xA;    &#xA;    glBindBuffer(GL_ARRAY_BUFFER,0);&#xA;&#xA;    &#xA;    glBindVertexArray(0);&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;void initshader(const char* verpath,const char* fragpath)&#xA;{&#xA;    &#xA;    std::string VerCode("");&#xA;    std::string fregCode("");&#xA;    &#xA;    std::ifstream  vShaderFile;&#xA;    std::ifstream  fShaderFile;&#xA;&#xA;    vShaderFile.exceptions(std::ifstream::failbit | std::ifstream::badbit);&#xA;    fShaderFile.exceptions(std::ifstream::failbit | std::ifstream::badbit);&#xA;&#xA;    try&#xA;    {&#xA;        vShaderFile.open(verpath);&#xA;        fShaderFile.open(fragpath);&#xA;&#xA;        std::stringstream vsstream, fsstream;&#xA;        vsstream &lt;&lt; vShaderFile.rdbuf();&#xA;        fsstream &lt;&lt; fShaderFile.rdbuf();&#xA;        VerCode = vsstream.str();&#xA;        fregCode = fsstream.str();&#xA;    &#xA;    }&#xA;    catch (const std::exception&amp;)&#xA;    {&#xA;        std::cout &lt;&lt; "read file error" &lt;&lt; std::endl;&#xA;    }&#xA;&#xA;    const char* vshader = VerCode.c_str();&#xA;    const char* fshader = fregCode.c_str();&#xA;&#xA;    &#xA;    unsigned int vertexID = 0, fragID = 0;&#xA;    char infoLog[512];&#xA;    int  successflag = 0;&#xA;    vertexID = glCreateShader(GL_VERTEX_SHADER);&#xA;    glShaderSource(vertexID,1,&amp;vshader,NULL );&#xA;    glCompileShader(vertexID);&#xA;    &#xA;    glGetShaderiv(vertexID,GL_COMPILE_STATUS,&amp;successflag);&#xA;    if (!successflag)&#xA;    {&#xA;        glGetShaderInfoLog(vertexID,512,NULL,infoLog);&#xA;        std::string errstr(infoLog);&#xA;        std::cout &lt;&lt; "v shader err"&lt;/frag&#xA;    fragID = glCreateShader(GL_FRAGMENT_SHADER);&#xA;    glShaderSource(fragID, 1, &amp;fshader, NULL);&#xA;    glCompileShader(fragID);&#xA;    &#xA;    glGetShaderiv(fragID, GL_COMPILE_STATUS, &amp;successflag);&#xA;    if (!successflag)&#xA;    {&#xA;        glGetShaderInfoLog(fragID, 512, NULL, infoLog);&#xA;        std::string errstr(infoLog);&#xA;        std::cout &lt;&lt; "f shader err"&lt;/&#xA;    initmodule();&#xA;&#xA;&#xA;    &#xA;    while (!glfwWindowShouldClose(window))&#xA;    {&#xA;        &#xA;        processInput(window);&#xA;&#xA;        glClearColor(0.0f,0.0f,0.0f,1.0f);&#xA;        glClear(GL_COLOR_BUFFER_BIT);&#xA;        render();&#xA;    &#xA;        &#xA;        glfwSwapBuffers(window);&#xA;        &#xA;        glfwPollEvents();&#xA;    }&#xA;&#xA;    &#xA;    glfwTerminate();&#xA;    return 0;&#xA;}&#xA;</iostream></sstream></fstream></string>

    &#xA;

    I get the Y data ,and run the code is ok ;the color is gray ;but when I add the U ,the color is Light green;and when i add the V is pink and green ;

    &#xA;

        #version 330 core&#xA;layout(location = 0) out vec4 FragColor;&#xA;in vec2 TexCoord;&#xA;uniform sampler2D dataY;&#xA;uniform sampler2D dataU;&#xA;uniform sampler2D dataV;&#xA;vec3 yuv;&#xA;vec3 rgb;&#xA;void main()&#xA;{&#xA;&#xA;&#xA;   yuv.x = texture2D(dataY, TexCoord).r-0.0625;&#xA;   yuv.y = texture2D(dataU, TexCoord).r-0.5;&#xA;   yuv.z = texture2D(dataV, TexCoord).r-0.5;&#xA;&#xA;   rgb = mat3(1,              1,      1,     &#xA;            0,       -0.18732, 1.8556,    &#xA;            1.57481, -0.46813,      0) * yuv;   &#xA;    FragColor = vec4(rgb.x, rgb.y,rgb.z,1); &#xA;};&#xA;

    &#xA;

  • how to remove the default http headers which are set by ffmpeg ?

    9 juin 2022, par user19264607

    Overwriting the default http headers is no problem.

    &#xA;

    But I want to remove the default http headers which ffmpeg sets.

    &#xA;

    There are many options for http headers in the man page but I can not find a solution to remove headers.

    &#xA;

    Is it at all possible to delete the default headers in ffmpeg ?

    &#xA;

  • 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;