Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

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

Autres articles (64)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (6831)

  • FFmpeg dnn_processing with tensorflow backend : difficulties applying a filter on an image

    9 avril 2023, par ArnoBen

    I am trying to perform a video segmentation for background blurring similar to Google Meet or Zoom using FFmpeg, and I'm not very familiar with it.

    


    Google's MediaPipe model is available as a tensorflow .pb file here (using download_hhxwww.sh).

    


    I can load it in python and it works as expected, though I do need to format the input frames : scaling to the model input dimension, adding a batch dimension, dividing the pixel values by 255 to have a range 0-1.

    


    FFmpeg has a filter that can use tensorflow models thanks to dnn_processing, but I'm wondering about these preprocessing steps. I tried to read the dnn_backend_tf.c file in ffmpeg's github repo, but C is not my forte. I'm guessing it adds a batch dimension somewhere otherwise the model wouldn't run, but I'm not sure about the rest.

    


    Here is my current command :

    


    ffmpeg \
    -i $FILE -filter_complex \
    "[0:v]scale=160:96,format=rgb24,dnn_processing=dnn_backend=tensorflow:model=$MODEL:input=input_1:output=segment[masks];[masks]extractplanes=2[mask]" \
    -map "[mask]" output.png


    


      

    • I'm already applying a scaling to match the input dimension.
    • 


    • I wrote this [masks]extractplanes=2[mask] because the model outputs a HxWx2 tensor (background mask and foreground mask) and I want to keep the foreground mask.
    • 


    


    The result I get with this command is the following (input-output) :

    


    Output example

    


    I'm not sure how to interpret the problems in this output. In python I can easily get a nice grayscale output :

    


    enter image description here

    


    I'm trying to obtain something similar with FFmpeg.

    


    Any suggestion or insights to obtain a correct output with FFmpeg would be greatly appreciated.

    


    PS : If I try to apply this on a video file, it hits a Segmentation Fault somewhere before getting any output so I stick with testing on an image for now.

    


  • PHP : Return response immediately, but run multiple lengthy shell_exec functions in the background

    15 janvier 2016, par Jake

    I am creating a simple web service that accepts a video upload, runs multiple different encodes on the video (mp4, webm, ogv), and then uploads the newly created files to our video host.

    Let’s say I have multiple commands..

    shell_exec('ffmpeg -i input.mp4 -f mp4 -c:v libx264 -preset slow -crf 24 -s 1280x720 -c:a libfdk_aac -profile:a aac_he -ar 22050 -b:a 64k -movflags +faststart output-1280x720.mp4');

    shell_exec('ffmpeg -i input.mp4 -f mp4 -c:v libx264 -preset slow -crf 24 -s 1920x1080 -c:a libfdk_aac -profile:a aac_he -ar 22050 -b:a 64k -movflags +faststart output-1920x1080.mp4');

    shell_exec('ffmpeg -i input.mp4 -f ogg -c:v libtheora -q:v 5 -s 1280x720 -c:a libvorbis -ar 22050 -b:a 64k -movflags +faststart output-1280x720.ogv');

    shell_exec('ffmpeg -i input.mp4 -f ogg -c:v libtheora -q:v 5 -s 1920x1080 -c:a libvorbis -ar 22050 -b:a 64k -movflags +faststart output-1920x1080.ogv');

    In summary, I want to...

    1. Print an immediate response : success : true
    2. Kick off multiple ffmpeg jobs synchronously.
    3. After each job is complete, send a POST to another server (one POST for each shell_exec).

    It would also be nice to only send the POST if the job was successful, but I could easily work around that by just checking to see if the output file exists on the server.

    I know that I can force shell_exec to run in the background by simply appending >/dev/null 2>/dev/null & to each command — which would allow me to print a response immediately — but I think by doing this, this would cause all of the jobs to run in parallel, and also, since this is diverting the output, I do not get any true callbacks when jobs are complete.

    Any ideas ??

  • pthread : Avoid spurious wakeups

    18 octobre 2013, par Ben Jackson
    pthread : Avoid spurious wakeups
    

    pthread_wait_cond can wake up unexpectedly (Wikipedia : Spurious_wakeup).

    The FF_THREAD_SLICE thread mechanism could spontaneously execute
    jobs or allow the caller of avctx->execute to return before all
    jobs were complete.

    Test both cases to ensure the wakeup is real.

    Signed-off-by : Ben Jackson <ben@ben.com>
    Signed-off-by : Michael Niedermayer <michaelni@gmx.at>
    Signed-off-by : Derek Buitenhuis <derek.buitenhuis@gmail.com>
    Signed-off-by : Luca Barbato <lu_zero@gentoo.org>

    • [DBH] libavcodec/pthread.c