Recherche avancée

Médias (1)

Mot : - Tags -/sintel

Autres articles (94)

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

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

Sur d’autres sites (15621)

  • 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
  • How to save python compatible audio file from JavaScript blob

    16 septembre 2020, par Talha Anwar

    I am trying to save an audio blob to the backend.
Here is an audio blob

    


     const blob = new Blob(chunks, { 'type' : 'audio/wav; codecs=0' });


    


    Here is the upload function

    


    function uploadAudio( blob ) {
  var reader = new FileReader();
  reader.onload = function(event){
    var fd = {};
    fd["data"] = event.target.result;
    $.ajax({
     // contentType:"application/x-www-form-urlencoded; charset=UTF-8",
      type: 'POST',
      url: 'testing/',
      data: fd,
      dataType: 'text'
    }).done(function(data) {
        console.log(data);
        document.getElementById("response").innerHTML=data;
       // alert(data);
    });
  };


    


    Here is the function to save the file.

    


    def upload_audio(request):
    print('upload_audio')
    if request.is_ajax():
        
        req=request.POST.get('data')
        d=req.split(",")[1]
        print("Yes, AJAX!")
        #print(request.body)
        f = open('./file.wav', 'wb')
        
        f.write(base64.b64decode(d))
        #f.write(request.body)
        f.close()
    return HttpResponse('audio received')


    


    When I try to read it in python for converting to text. I got following error

    


    ValueError: Audio file could not be read as PCM WAV, AIFF/AIFF-C, or Native FLAC; check if file is corrupted or in another format


    


    I tried to convert the file

    


    import ffmpeg
stream = ffmpeg.input('file.wav')
stream = ffmpeg.output(stream, 'filen.wav')
ffmpeg.run(stream)


    


    I got following error

    


    Traceback (most recent call last):&#xA;  File "script.py", line 8, in <module>&#xA;    ffmpeg.run(stream)&#xA;  File "C:\Anaconda3\envs\VA\lib\site-packages\ffmpeg\_run.py", line 320, in run&#xA;    overwrite_output=overwrite_output,&#xA;  File "C:\Anaconda3\envs\VA\lib\site-packages\ffmpeg\_run.py", line 285, in run_async&#xA;    args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream&#xA;  File "C:\Anaconda3\envs\VA\lib\subprocess.py", line 729, in __init__&#xA;    restore_signals, start_new_session)&#xA;  File "C:\Anaconda3\envs\VA\lib\subprocess.py", line 1017, in _execute_child&#xA;    startupinfo)&#xA;FileNotFoundError: [WinError 2] The system cannot find the file specified&#xA;</module>

    &#xA;