Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (68)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur

    8 février 2011, par

    La visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
    Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
    Configuration de la boite multimédia
    Dès (...)

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

Sur d’autres sites (9046)

  • Can the outputFile of MediaRecorder be a named pipe ?

    13 avril 2017, par Harrison

    Following
    Android Camera Capture using FFmpeg
    and
    feed raw yuv frame to ffmpeg with timestamp

    I successfully put raw frames of Android phone camera into a named pipe made by mkfifo, and used ffmpeg to process them and generated a video file.

    But the problem is that by ffmpeg, the encoding is very slow, it can only process 3 5 frames per second. The reason I have to use ffmpeg instead of MediaRecorder is that later I need to use ffmpeg to generate HLS segments and m3u8 file.

    So I have to turn to use native encoder like MediaRecorder and try to set its OutputFile to a named pipe following
    How to use unix pipes in Android

    My code likes this,

    private String pipe = "/data/data/com.example/v_pipe1";
    ...
    mMediaRecorder.setOutputFile(pipe);
    ...
    mMediaRecorder.start();

    Also I have a ffmpeg thread to use this pipe as the input.

    But when I call mMediaRecorder.start() ; It will throw java.lang.IllegalStateException. I’ve tried to put ffmpeg thread before or after calling mMediaRecorder.start(), but with the same error.

    I have no idea about this now. Could someone tell me how to solve this ?
    Any suggestions are welcome and appreciated. Thanks.

  • OpenCV python, reading video frames from ffmpeg pipe

    26 avril 2017, par codefame

    I’m trying to use ffmpeg to pipe a video to opencv frame by frame.

    Structure :

    1. main script calls threaded process to obtain video & pipe video to
      image2pipe
    2. main script calls threaded process to read stdout for
      frame info
    3. main script calls function to continuously check for
      frame data

    Video Capture Function :

    def recordstream(self):
       global pipe
       # start video capture process
       pipe = Popen([VIDEO_CAPTURE_SOURCE + " | ffmpeg -i pipe:0 -pix_fmt bgr24 -r 1 -f image2pipe -"], stdout = PIPE, bufsize=10**8, shell=True)

    This ffmpeg code seems to work just fine when the capture source was tested with a single frame, but it doesn’t work using the video stream.

    Buffer Read Function :

    def rawImage(self):
       global pipe, raw_image
       raw_image = pipe.stdout.read() # save output for opencv

    I gave this its own thread because it seems to be a blocking function.

    OpenCV Function :

    def checkframe(self):
       time.sleep(2)
       global raw_image

       while(True):
           array = numpy.frombuffer(raw_image, dtype='uint8')
           frame = cv2.imdecode(array, 1)

           if frame is None:
               print("Image not found")
           else:
               print("FOUND IMAGE")
               cv2.imshow(frame)
               if cv2.waitKey(1) & 0xFF == ord('q'):
                   break

    This function fails at frame = cv2.imdecode(array, 1) as the array seems to be empty.

    Error :

    !buf.empty() && buf.isContinuous() in function imdecode_

    I see lots of discussion around piping data from OpenCV to ffmpeg, but not much the other way around. What am I missing here ?

    Thanks in advance.

  • Pipe PIL images to ffmpeg stdin - Python

    9 mai 2017, par bluesummers

    I’m trying to convert an html5 video to mp4 video and am doing so by screen shooting through PhantomJS over time

    I’m also cropping the images using PIL so eventually my code is roughly :

    while time() < end_time:
       screenshot_list.append(phantom.get_screenshot_as_base64())
    .
    .
    for screenshot in screenshot_list:
       im = Image.open(BytesIO(base64.b64decode(screenshot)))
       im = im.crop((left, top, right, bottom))

    Right now I’m saving to disc all those images and using ffmpeg from saved files :

    os.system('ffmpeg -r {fps} -f image2 -s {width}x{height} -i {screenshots_dir}%04d.png -vf scale={width}:-2 '
         '-vcodec libx264 -crf 25 -vb 20M -pix_fmt yuv420p {output}'.format(fps=fps, width=width,
                                                                     screenshots_dir=screenshots_dir,
                                                                     height=height, output=output))

    But I want instead of using those saved files, to be able to pipe the PIL.Images directy to ffmpeg, how can I do that ?