Recherche avancée

Médias (0)

Mot : - Tags -/protocoles

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

Autres articles (74)

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

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

Sur d’autres sites (11278)

  • SDL save screenshot on iOS

    12 avril 2018, par Law Gimenez

    I am trying to save a screen or frame from the SDL’s "window" into a PNG file and so I’m using SDL_image library. My code is below

    IMG_Init(Int32(IMG_INIT_PNG.rawValue))
    let screenShot = SDL_CreateRGBSurface(0, 640, 480, 32, 0, 0, 0, 0)
    SDL_SetRenderTarget(renderer, texture)
    SDL_RenderReadPixels(renderer, nil, Uint32(SDL_PIXELFORMAT_ARGB8888), screenShot?.pointee.pixels, (screenShot?.pointee.pitch)!)
    let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as String
    IMG_SavePNG(screenShot, "\(documentsPath)/image.png")
    SDL_FreeSurface(screenShot)

    But the image.png was not saved. If anyone can lead or help me. Thank you !

    Additional code, the image saved is just black

    IMG_Init(Int32(IMG_INIT_PNG.rawValue))
    let screenShot = SDL_CreateRGBSurface(Uint32(SDL_SWSURFACE), 640, 480, 32, 0, 0, 0, 0)
    // SDL_SetRenderTarget(renderer, texture)
    SDL_RenderReadPixels(renderer, nil, Uint32(SDL_PIXELFORMAT_ARGB8888), screenShot?.pointee.pixels, (screenShot?.pointee.pitch)!)
    // Save to documents directory
    let fileManager = FileManager.default
    do {
       let documentDirectory = try fileManager.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
       let fileUrl = documentDirectory.appendingPathComponent("imageLOL.png")
       if !fileManager.fileExists(atPath: fileUrl.path) {
           print("File NO exists")
           // Create file at path
           let data = Data()
           let createFile = fileManager.createFile(atPath: fileUrl.path, contents: data, attributes: nil)
           if createFile {
               print("Create file success")
           } else {
               print("Create file failed")
           }
       } else {
           print("File exists")

       }
       let result = IMG_SavePNG(screenShot, fileUrl.path)
       print("result = \(result)")
       // After saving screenshot
       let image = UIImage(contentsOfFile: fileUrl.path)
       let imageData = UIImagePNGRepresentation(image!)
       print("image length = \(String(describing: imageData?.count))")
       UIImageWriteToSavedPhotosAlbum(image!, nil, nil, nil)
       SDL_FreeSurface(screenShot)
    } catch {
       print("Error docs = \(error)")
    }
  • FFMPEG unable to take frame and save as image

    2 mai 2013, par alex

    I'm trying to save an image from a video frame and save it as a jpeg.
    This function works for smaller video files, but if the video is over 10 minutes it won't save the jpeg image. An error comes up as before trans.

    public function VideoToJpeg($localVideoPath, $localOutImgPath)
    {
       $Name = dirname(__FILE__) . "/ffmpeg";
       $Str = "$Name -i \"$localVideoPath\" -an -ss 00:00:03 -an -r 1 -vframes 1 -y \"$localOutImgPath\"";

       exec($Str);
    }

    Here is the error I got from ffmpeg

    [NULL @ 0370e760] Unable to find a suitable output format for 'path'
    : Invalid argument
  • Matplotlib use Ffmpeg to save plot to be mp4 not include full step

    21 décembre 2020, par 昌翰余

    I use ffmpeg to store the dynamic graph drawn on matplotlib, but the output file is only 2 seconds
but It should have been 30 seconds.
I set a graph to run three curves, a total of 30 seconds of data,
the graph that ran on the py file is normal,
but the output is only the first two seconds of the output.
May I ask if I missed something

    


    Below is my code

    


    import matplotlib.pyplot as plt
from matplotlib import animation
from numpy import random 
import pandas as pd
from matplotlib.animation import FFMpegWriter

FFwriter=animation.FFMpegWriter(fps=30, extra_args=['-vcodec', 'libx264'])
data = pd.read_csv('apple1.csv', delimiter = ',', dtype = None)
data = data.values
AccX1=[]
AccY1=[]
AccZ1=[]
AccX2=[]
AccY2=[]
AccZ2=[]

time = []

for i in range(600):
        AccX1.append(data[i][8])
        AccY1.append(data[i][9])
        AccZ1.append(data[i][10])
        AccX2.append(data[i][24])
        AccY2.append(data[i][25])
        AccZ2.append(data[i][26])
        
        time.append(data[i][0])
        
fig = plt.figure()
ax1 = plt.axes(xlim=(0,3000), ylim=(6,-6))
line, = ax1.plot([], [], lw=2)
plt.xlabel('ACC')
plt.ylabel('Time')

plotlays, plotcols = [3], ["r","g","b"]
lines = []
for index in range(3):
    lobj = ax1.plot([],[],lw=2,color=plotcols[index])[0]
    lines.append(lobj)


def init():
    for line in lines:
        line.set_data([],[])
    return lines

x1,y1 = [],[]
x2,y2 = [],[]
x3,y3 = [],[]



i=0

def animate(frame):
    global i
    
    i+=1
    x = i
    y = AccX1[i]

    x1.append(x)
    y1.append(y)

    x = i
    y = AccY1[i]
    x2.append(x)
    y2.append(y)

    x = i
    y = AccZ1[i]
    x3.append(x)
    y3.append(y)
    

    xlist = [x1, x2,x3]
    ylist = [y1, y2,y3]


    for lnum,line in enumerate(lines):
        line.set_data(xlist[lnum], ylist[lnum]) 


    return lines


anim = animation.FuncAnimation(fig, animate,
                    init_func=init, blit=True,interval=10)
anim.save('test.mp4',writer=FFwriter)
plt.show()


    


    The dynamic picture ran out using plt.show is correct.
And I don't think I have set the length of storage. Did I add something ?