Recherche avancée

Médias (2)

Mot : - Tags -/rotation

Autres articles (70)

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

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

Sur d’autres sites (10928)

  • Capture Video with opencv, save to ffmpeg pipe and live stream

    9 mars 2018, par Chris

    The goal is to stream an analysed live video over RTSP to some media server. To make the edits/analysis I use opencv, save the edited frames as JPEG in an FFMPEG image pipe and use the same FFMPEG to create a RTSP stream. Sorry if the terminology is not that accurate, I find it still quite confusing.

    I have the following code after quite some struggle :

    import cv2
    from subprocess import Popen, PIPE
    from PIL import Image

    # open pipe
    p = Popen('ffmpeg -y -f image2pipe -vcodec mjpeg -r 24 -i - -vcodec h264 -f rtsp -rtsp_transport tcp rtsp://localhost:8081/test.sdp', stdin=PIPE)

    video = cv2.VideoCapture(0)
    i = 0
    while video.isOpened():
       i=i+1
       ret, frame = video.read()
       if ret:
           #[...do some analysis stuff]
           im = Image.fromarray(frame)
           im.save(p.stdin, 'JPEG')

           """
           alternatively
           img_str = cv2.imencode('.jpg', frame)[1].tostring()
           p.stdin.write(img_str)
           """

       else:
           break

       print (i)
       if(i==1000):
           break


    p.stdin.close()
    p.wait()
    video.release()
    cv2.destroyAllWindows()
    print("done streaming video")

    This runs for 124 frames (i=124) then the loop hangs and I get some message from ffmpeg where I am not sure what it is about, however it does not look like an error :

    push frame
    122
    push frame
    123
    push frame
    124
    Input #0, image2pipe, from 'pipe:':
     Duration: N/A, bitrate: N/A
       Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 640x480 [SAR 1:1 DAR 4:3], 24 fps, 24 tbr, 24 tbn, 24 tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
    [libx264 @ 000002076650d980] using SAR=1/1
    [libx264 @ 000002076650d980] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 000002076650d980] profile High, level 3.0
    [libx264 @ 000002076650d980] 264 - core 155 r2893 b00bcaf - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    push frame

    The webcam seems to continue running but no more frames are pushed into the pipe. It looks like some buffer is filled or something. If I write directly to a video file instead of rtsp, it works. If I open the rtsp stream simultaneously with ffplay, it also works (although with a 5 seconds lag).
    Anyone an idea where this is coming from and how to solve it ?

  • 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)")
    }
  • Video Filters like Instagram and save in SDCARD

    7 mai 2018, par Harsh Bhavsar

    Color Channel Mixer (Info.)
    https://ffmpeg.org/ffmpeg-filters.html#colorchannelmixer

    I am trying to creating video filters using FFMpeg and OpenCV just like Instagram Video filters.
    So if I want to create Sepia Effect Then I have to use color channel mixer for that with RGBA values
    ex. colorchannelmixer=.393 :.769 :.189:0 :.349 :.686 :.168:0 :.272 :.534 :.131 (This code for Sepia Effect)
    Now I want to create more effects like Instagram. So need different color channel mixers for that
    How to create them ?

    Ref. — https://github.com/krazykira/VidEffects/wiki/Permanent-video-effects

    I got only 2 filters

    Sepia
    colorchannelmixer=.393 :.769 :.189:0 :.349 :.686 :.168:0 :.272 :.534 :.131

    Grayscale
    colorchannelmixer=.3 :.4 :.3:0 :.3 :.4 :.3:0 :.3 :.4 :.3

    I need more filters.

    private void initVideoRecorder(String path) {
    try {
    filter = new F FmpegFrameFilter("colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131", VIDEO_GRABBER.getImageWidth(), VIDEO_GRABBER.getImageHeight());
    videoRecorder = FFmpegFrameRecorder.createDefault(path, VIDEO_GRABBER.getImageWidth(), VIDEO_GRABBER.getImageHeight()); videoRecorder.start();
    }
    catch (FrameRecorder.Exception e) {
    e.printStackTrace();
    }
    }