Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (106)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

Sur d’autres sites (13968)

  • Reading video frame by frame using php, ffmpeg and proc_open

    29 avril 2020, par Tom

    I want to use proc_open to read every frame from a video using ffmpeg and then use PHP to do something with the frames.
Here's the example that does the opposite- it sends frame by frame from PHP to ffmpeg :

    



    $descriptors = array(
    0 => array("pipe", "r"),

    1 => array("pipe", "w"), 
    2 => array("file", "C:/error-output.txt", "a")  
);

$frames = glob('Q:/images/*.jpg');


$command = "ffmpeg -f image2pipe -pix_fmt rgb24 -framerate 10 -c:v mjpeg -i - ".
                "-r 10 -vcodec libx264 -pix_fmt yuv420p  -preset faster -crf 17 ".
                "-y test.mp4";

$ffmpeg = proc_open($command, $descriptors, $pipes);

if (!is_resource($ffmpeg))
{
    die('Could not run ffmpeg');

}

foreach ($frames AS $frame)
{

    fwrite($pipes[0], file_get_contents($frame) );
}

fclose($pipes[0]);


    



    And here's how I am trying but can't get it right :

    



    $descriptors = array(
    0 => array("pipe", "r"),

    1 => array("pipe", "w"),  write to
    2 => array("file", "C:/error-output.txt", "a") 
);


$command = "ffmpeg -i 1.gif -ss 00:00:3 -s 650x390 -vframes 100 -c:v png -f image2pipe -";

$ffmpeg = proc_open($command, $descriptors, $pipes);

if (!is_resource($ffmpeg))
{
    die('Could not run ffmpeg');

}

while (!feof($pipes[1]))
{
    $frame = fread($pipes[1], 5000);
}

fclose($pipes[1]);


    



    The biggest issue is I don't know how much data to read from ffmpeg to get a whole frame.

    


  • FFmpeg video is very distorted after a pixel-perfect start

    7 septembre 2022, par AlvinfromDiaspar

    I am using the following FFMpeg command to convert a H.264 UDP streamed video from a Tello drone to another address.

    



    ffmpeg -i udp://0.0.0.0:11111 -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f h264 udp://127.0.0.1:5000


    



    Then I simply use the following OpenCv to read from that new address :

    



    this.Capture = new OpenCvSharp.VideoCapture("udp://127.0.0.1:5000", OpenCvSharp.VideoCaptureAPIs.FFMPEG);


    



    From this Capture reference, i obtain the next frame by calling this.Capture.Read(mat).
When i assigned the convert image to the UI, the image is pixel perfect !

    



    However, after the initial rendering, i am not seeing immediate updates. But i do see very laggy video updates that is very distorted. It looks like each consecutive frame is just the delta/difference drawn on top of the previous frame.

    



    Is there anything i can tweak/modify in my FFMpeg command to resolve this distorted video rendering ?

    



    Update 1
I was able to make some progress. The video updates, still with distortion, but overall distortion is a bit less. And the frames update more responsively.

    



    To get to this point, i simply added this parameter to my FFMpeg command :

    



    -g 100


    



    I also tried :

    



    -g 300


    


  • Using GStreamer to receive and send h264 video (from OBS)

    16 mars 2020, par Ivorius

    I’ve been trying to set up using GStreamer to get support for some input I can output from OBS.

    OBS : rtp_mpegts to udp ://localhost:5000

    http-launch 8080 webmmux streamable=true name=stream udpsrc uri=udp://localhost:5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T-ES, payload=(int)
    33" ! gstrtpjitterbuffer latency=200 ! application/x-rtp ! rtpmp2tdepay ! video/mpegts ! mpegtsdemux ! video/x-h264 ! queue ! decodebin ! vp8enc ! stream.   audiotestsrc ! vorbisenc ! stream.

    However, using this it seems to accept connections, but just closes them again after a while. Any clues on what I am doing wrong ? I am open to any format changes as long as they’re supported by OBS / ffmpeg.

    As a bonus, how do I add support for audio as well ?

    Background

    I’ve found https://github.com/sdroege/http-launch, which works well in displaying a GStreamer video over http:

    <video autoplay="autoplay" controls="">
       <source src="https://localhost:8080" type="video/mp4" codecs="avc1.4D401E, mp4a.40.2">
       You browser doesn't support element <code>video

    .

    I’ve managed to set up a pipeline where I can use a GStreamer source to pipe into a http-launch
    pipeline and display it on video :

    http-launch 8080 webmmux streamable=true name=stream udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! mpegtsdemu
    x ! h264parse ! TIViddec2 ! videoconvert ! vp8enc ! stream.   audiotestsrc ! vorbisenc ! stream.

    gst-launch-1.0 -v videotestsrc ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000

    However, I don’t think OBS supports rpt over UDP. It uses ffmpeg to send these packets, which can stream rtp_mpegts. I’ve found some code snippets which claim to support the format, and stitch together the above pipeline.