Recherche avancée

Médias (91)

Autres articles (33)

  • Pas question de marché, de cloud etc...

    10 avril 2011

    Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
    sur le web 2.0 et dans les entreprises qui en vivent.
    Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
    Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
    le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
    Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (2755)

  • WebM file not seekable in Chrome, when generated with ffmpeg

    11 avril 2014, par Zoon

    I am having a mind-boggling problem, I just can't seem to resolve.

    Providing a WebM file through PHP is nothing new in my world, and I even know how to work with HTTP 206 Partial Content. But for some reason Chrome does not like it.

    A simple HTML5 video playback

    <video width="640" height="360" poster="picture/preview/V00000006.jpg" controls="controls" preload="preload">
       <source type="video/webm" src="/video/V00000006.webm">
    </source></video>

    where /video/V00000006.webm is rewritten to a PHP-file in Apache, will playback just fine.
    But in Chrome the seekbar is not effective. When clicking on the seekbar the player will freeze and no longer playback until page is refreshed. Firefox handles it just fine !

    If I change /video/V00000006.webm to be a direct link to the same video it works just fine. I even compared the network requests between the two versions (with and without PHP) and there is barely any difference in the first request, but the second is failing in the PHP-delivered video.

    Initial request and seek request for Apache-delivered video file :

        Request URL :http://mytestserver.net/movie1152x720.webm
        Request Method:GET
        Status Code:206 Partial Content
        Request Headers
        Accept :*/*
        Accept-Encoding:identity ;q=1, * ;q=0
        Accept-Language:da-DK,da ;q=0.8,en-US ;q=0.6,en ;q=0.4
        Cache-Control:no-cache
        Connection:keep-alive
        Cookie:PHPSESSID=i562540rek172mnv3nk528acj0 ; userPassword= ; userEmail=
        Host:mytestserver.net
        Pragma:no-cache
        Range:bytes=0-
        Referer :http://mytestserver.net/video.html
        User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36
        Response Headers
        Accept-Ranges:bytes
        Connection:close
        Content-Length:4446451
        Content-Range:bytes 0-4446450/4446451
        Content-Type:video/webm
        Date:Fri, 11 Apr 2014 13:07:30 GMT
        ETag :"d2d0027-43d8f3-b91417c0"
        Last-Modified:Fri, 11 Apr 2014 12:46:31 GMT
        Server:Apache/2.2.3 (CentOS)
    

    Request URL :http://mytestserver.net/movie1152x720.webm
    Request Method:GET
    Status Code:206 Partial Content
    Request Headers
    Accept :*/*
    Accept-Encoding:identity ;q=1, * ;q=0
    Accept-Language:da-DK,da ;q=0.8,en-US ;q=0.6,en ;q=0.4
    Cache-Control:no-cache
    Connection:keep-alive
    Cookie:PHPSESSID=i562540rek172mnv3nk528acj0 ; userPassword= ; userEmail=
    Host:mytestserver.net
    Pragma:no-cache
    Range:bytes=4445881-
    Referer :http://mytestserver.net/video.html
    User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36
    Response Headers
    Accept-Ranges:bytes
    Connection:close
    Content-Length:570
    Content-Range:bytes 4445881-4446450/4446451
    Content-Type:video/webm
    Date:Fri, 11 Apr 2014 13:09:02 GMT
    ETag :"d2d0027-43d8f3-b91417c0"
    Last-Modified:Fri, 11 Apr 2014 12:46:31 GMT
    Server:Apache/2.2.3 (CentOS)

    Initial request and seek request for PHP-streamed video :

        Request URL :http://mytestserver.net/video/V00000006.webm
        Request Method:GET
        Status Code:206 Partial Content
        Request Headers
        Accept :*/*
        Accept-Encoding:identity ;q=1, * ;q=0
        Accept-Language:da-DK,da ;q=0.8,en-US ;q=0.6,en ;q=0.4
        Cache-Control:no-cache
        Connection:keep-alive
        Cookie:PHPSESSID=i562540rek172mnv3nk528acj0 ; userPassword= ; userEmail=
        Host:mytestserver.net
        Pragma:no-cache
        Range:bytes=0-
        Referer :http://mytestserver.net/video.html
        User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36
        Response Headers
        Accept-Ranges:bytes
        Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
        Connection:close
        Content-Length:8566268
        Content-Range:bytes 0-8566267/8566268
        Content-Type:video/webm
        Date:Fri, 11 Apr 2014 13:31:27 GMT
        Expires:Thu, 19 Nov 1981 08:52:00 GMT
        Pragma:no-cache
        Server:Apache/2.2.3 (CentOS)
        X-Powered-By:PHP/5.3.27
    

    Request URL :http://mytestserver.net/video/V00000006.webm
    Request Headers CAUTION : Provisional headers are shown.
    Accept-Encoding:identity ;q=1, * ;q=0
    Cache-Control:no-cache
    Pragma:no-cache
    Range:bytes=4338314-
    Referer :http://mytestserver.net/video.html
    User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36

    Notice how the second request does not complete, Provisional headers are shown.

    I have tried altering the cache headers, setting it to the future, setting them blank and using file attachment headers.

    I tried fiddling around a lot with the serving code, but lately I have ended up with a simple example.

    &lt;?php

    $path = &#39;test.webm&#39;;

    $size=filesize($path);

    $fm=@fopen($path,&#39;rb&#39;);
    if(!$fm) {
     header ("HTTP/1.0 404 Not Found");
     die();
    }

    $begin=0;
    $end = $size-1;

    if(isset($_SERVER[&#39;HTTP_RANGE&#39;])) {
     if(preg_match(&#39;/bytes=\h*(\d+)-(\d*)[\D.*]?/i&#39;, $_SERVER[&#39;HTTP_RANGE&#39;], $matches)) {
       $begin=intval($matches[0]);
       if(!empty($matches[1])) {
         $end=intval($matches[1]);
       }
     }
    }

    if($begin>0||$end&lt;$size)
     header(&#39;HTTP/1.0 206 Partial Content&#39;);
    else
     header(&#39;HTTP/1.0 200 OK&#39;);

    header("Content-Type: video/webm");
    header(&#39;Accept-Ranges: bytes&#39;);
    header(&#39;Content-Length:&#39;.($end-$begin+1));
    header("Content-Disposition: inline;");
    header("Content-Range: bytes $begin-$end/$size");
    header("Content-Transfer-Encoding: binary\n");
    header(&#39;Connection: close&#39;);

    ob_get_clean();
    flush();

    $f = fopen($path, &#39;r&#39;);
    fseek($f, $offset);

    $pos = 0;
    $length = $end-$begin;

    while($pos &lt; $length)
    {
       $chunk = min($length-$pos, 1024);

       echo fread($f, $chunk);
       flush();

       $pos += $chunk;
    }
    ?>

    Please note, entering the PHP-delivered video URL directly into the browser does not make a difference from showing it in a HTML page.

    I hope someone has an answer to why seeking might not work. Let me know if you have any suggestions.

    Thanks !

  • How to pipe live video frames from ffmpeg to PIL ?

    30 janvier 2017, par Ryan Martin

    I need to use ffmpeg/avconv to pipe jpg frames to a python PIL (Pillow) Image object, using gst as an intermediary*. I’ve been searching everywhere for this answer without much luck. I think I’m close - but I’m stuck. Using Python 2.7

    My ideal pipeline, launched from python, looks like this :

    1. ffmpeg/avconv (as h264 video)
    2. Piped ->
    3. gst-streamer (frames split into jpg)
    4. Piped ->
    5. Pil Image Object

    I have the first few steps under control as a single command that writes .jpgs to disk as furiously fast as the hardware will allow.

    That command looks something like this :

    command = [
           "ffmpeg",
           "-f video4linux2",
           "-r 30",
           "-video_size 1280x720",
           "-pixel_format 'uyvy422'",
           "-i /dev/video0",
           "-vf fps=30",
           "-f H264",
           "-vcodec libx264",
           "-preset ultrafast",
           "pipe:1 -",
           "|", # Pipe to GST
           "gst-launch-1.0 fdsrc !",
           "video/x-h264,framerate=30/1,stream-format=byte-stream !",
           "decodebin ! videorate ! video/x-raw,framerate=30/1 !",
           "videoconvert !",
           "jpegenc quality=55 !",
           "multifilesink location=" + Utils.live_sync_path + "live_%04d.jpg"
         ]

    This will successfully write frames to disk if ran with popen or os.system.

    But instead of writing frames to disk, I want to capture the output in my subprocess pipe and read the frames, as they are written, in a file-like buffer that can then be read by PIL.

    Something like this :

       import subprocess as sp
       import shlex
       import StringIO

       clean_cmd = shlex.split(" ".join(command))
       pipe = sp.Popen(clean_cmd, stdout = sp.PIPE, bufsize=10**8)

       while pipe:

           raw = pipe.stdout.read()
           buff = StringIO.StringIO()
           buff.write(raw)
           buff.seek(0)

           # Open or do something clever...
           im = Image.open(buff)
           im.show()

           pipe.flush()

    This code doesn’t work - I’m not even sure I can use "while pipe" in this way. I’m fairly new to using buffers and piping in this way.

    I’m not sure how I would know that an image has been written to the pipe or when to read the ’next’ image.

    Any help would be greatly appreciated in understanding how to read the images from a pipe rather than to disk.

    • This is ultimately a Raspberry Pi 3 pipeline and in order to increase my frame rates I can’t (A) read/write to/from disk or (B) use a frame by frame capture method - as opposed to running H246 video directly from the camera chip.
  • using ffmpeg to capture the screen why it's not saving the output file to the folder and not saving the output file at all ?

    17 juillet 2023, par Shelly Ron

    at the top

    &#xA;

    private bool recordFullScreen = true;&#xA;private Process ffmpegProcess;&#xA;

    &#xA;

    Load event

    &#xA;

    private void Form1_Load(object sender, EventArgs e)&#xA;        {&#xA;            // Hide the FFmpeg console window&#xA;            var ffmpegStartInfo = new ProcessStartInfo&#xA;            {&#xA;                FileName = @"D:\Captured Videos\ffmpeg.exe",&#xA;                Arguments = "-hide_banner -loglevel panic",&#xA;                UseShellExecute = false,&#xA;                CreateNoWindow = true,&#xA;                RedirectStandardInput = true&#xA;            };&#xA;&#xA;            ffmpegProcess = Process.Start(ffmpegStartInfo);&#xA;        }&#xA;

    &#xA;

    Closing event

    &#xA;

    private void Form1_FormClosing(object sender, FormClosingEventArgs e)&#xA;        {&#xA;            // Terminate FFmpeg process before closing the application&#xA;            ffmpegProcess.StandardInput.WriteLine("q");&#xA;            ffmpegProcess.WaitForExit();&#xA;            ffmpegProcess.Close();&#xA;        }&#xA;

    &#xA;

    recording button click event

    &#xA;

    private void btnRecord_Click(object sender, EventArgs e)&#xA;        {&#xA;            if (recordFullScreen)&#xA;            {&#xA;                // Record the whole screen&#xA;                RecordScreen();&#xA;            }&#xA;        }&#xA;

    &#xA;

    the method recordscreen

    &#xA;

    private void RecordScreen()&#xA;        {&#xA;            // Set the output folder path&#xA;            string outputFolder = @"D:\Captured Videos\";&#xA;&#xA;            // Generate a unique file name based on the current date and time&#xA;            string fileName = DateTime.Now.ToString("Screen_yyyyMMdd_HHmmss") &#x2B; ".mp4";&#xA;&#xA;            // Set the output file path&#xA;            string outputFile = Path.Combine(outputFolder, fileName);&#xA;&#xA;            // FFmpeg command to record the whole screen&#xA;            string ffmpegCommand = $"-f gdigrab -framerate 24 -i desktop -preset ultrafast -pix_fmt yuv420p \"{outputFile}\"";&#xA;&#xA;            StartFFmpeg(ffmpegCommand);&#xA;        }&#xA;

    &#xA;

    the method startffmpeg

    &#xA;

    private void StartFFmpeg(string command)&#xA;        {&#xA;            // Send the FFmpeg command to the process for execution&#xA;            ffmpegProcess.StandardInput.WriteLine(command);&#xA;            ffmpegProcess.StandardInput.Flush();&#xA;        }&#xA;

    &#xA;

    but when running the application pressing the button to record after some seconds i click the form red X on the top right to close it but it's not saving the mp4 output file. not sure if it's even recording at all.

    &#xA;