Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (69)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (9268)

  • writing jpg images from ffmpeg pipe

    18 septembre 2024, par seandoucette

    Using php to read an rtsp stream from an ffmpeg command utilizing image2pipe, I'm finding the images are truncated in some manner and only display a partial image. My task is to write unique jpg filenames at 30fps. Below is the php code. I've simplified the filename structure in this example for clarity. The script performs as expected with no obvious errors writing out 30fps consistently. I can't figure out what extraneous or missing information in the content is causing the output images to appear corrupt.

    


    $cmd = "ffmpeg -rtsp_transport tcp -framerate 30 -i rtsp://".$camera_url." -f image2pipe pipe:1";

$fp = popen($cmd, 'r');

if (!$fp)
{
    die('Could not open ffmpeg process');
}

define('JPEG_START', "\xFF\xD8");
define('JPEG_END', "\xFF\xD9");

$buffer = '';
$jpeg = '';
$isReadingJpeg = false;

stream_set_blocking($fp, false); // Set non-blocking mode

while (!feof($fp))
{
    $chunk = fread($fp, 4096);

    if ($chunk === false)
    {
        usleep(100);
        continue;
    }

    $buffer .= $chunk;

    if (!$isReadingJpeg && ($startPos = strpos($buffer, JPEG_START)) !== false)
    {
        $isReadingJpeg = true;
        $jpeg = substr($buffer, $startPos);
        $buffer = substr($buffer, $startPos + 2);  // Move past the start marker
    }

    if ($isReadingJpeg && ($endPos = strpos($buffer, JPEG_END)) !== false)
    {
        $jpeg .= substr($buffer, 0, $endPos + 2);
        $buffer = substr($buffer, $endPos + 2);  // Move past the end marker

        file_put_contents(microtime(true),$jpeg);

        $isReadingJpeg = false;
        $jpeg = '';
    }

    if ($isReadingJpeg)
    {
        $jpeg .= $buffer;
        $buffer = '';
    }
}

pclose($fp);


    


  • ffmpeg pipe output and script [duplicate]

    27 juillet 2018, par James Magnus

    This question already has an answer here :

    I need to extract raw video and pipe it to another program. This runs perfectly in a terminal :

    ffmpeg -i SampleVideo_1280x720_5mb.mp4 -s 1920x1080 -c:v rawvideo -pix_fmt yuv420p -f rawvideo - | ffplay -f rawvideo -pix_fmt yuv420p -s 1920x1080 -

    But when I try to run this command from a script it fails. Here is a very simplified version of the script :

    #!/bin/bash

    c='ffmpeg -i SampleVideo_1280x720_5mb.mp4 -s 1920x1080 -c:v rawvideo -pix_fmt yuv420p -f rawvideo - | ffplay -f rawvideo -pix_fmt yuv420p -s 1920x1080 -'
    $c

    The output

    ~/ets/videos$ ./test.sh
    ffmpeg version N-91403-gd24c9e5 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
     configuration: --extra-cflags='-fPIC -I/home/jlbeaussart/ffmpeg_build/include' --extra-ldflags=-L/home/jlbeaussart/ffmpeg_build/lib --extra-libs='-lpthread -lm' --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-shared --enable-libcaca --enable-libxvid --enable-libxml2 --enable-opencl --enable-opengl --enable-cuvid --enable-ffnvcodec --enable-libdrm --enable-nvenc --enable-nvdec --enable-vaapi --enable-vdpau --enable-nonfree
     libavutil      56. 18.102 / 56. 18.102
     libavcodec     58. 20.104 / 58. 20.104
     libavformat    58. 17.101 / 58. 17.101
     libavdevice    58.  4.101 / 58.  4.101
     libavfilter     7. 25.100 /  7. 25.100
     libswscale      5.  2.100 /  5.  2.100
     libswresample   3.  2.100 /  3.  2.100
     libpostproc    55.  2.100 / 55.  2.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'SampleVideo_1280x720_5mb.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       creation_time   : 1970-01-01T00:00:00.000000Z
       encoder         : Lavf53.24.2
     Duration: 00:00:29.57, start: 0.000000, bitrate: 1421 kb/s
       Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1032 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
       Metadata:
         creation_time   : 1970-01-01T00:00:00.000000Z
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
       Metadata:
         creation_time   : 1970-01-01T00:00:00.000000Z
         handler_name    : SoundHandler
    [NULL @ 0x18d5d40] Unable to find a suitable output format for '|'
    |: Invalid argument
  • Problem using ffmpeg in python to decode video stream to yuv stream and send to a pipe

    30 août 2019, par 瓦达所多阿萨德阿萨德

    This command works nice and fast in shell :

    ffmpeg -c:v h264_cuvid -i ./myvideo.mp4 -f null -pix-fmt yuv420p -

    It was about 13x speed or 300 frames/sec.
    Then I tried to send the yuv stream to pipe and catch it the main process using the following code in python :

    cmd = ['ffmpeg', '-c:v', 'h264_cuvid', '-i', './myvideo.mp4', '-f', 'image2pipe', '-pix_fmt', 'yuv420p', '-']
    p = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr=subprocess.PIPE)
    size_Y = int(height * width)
    size_UV = int(size_Y / 4)
    s = time.time()
    Y = p.stdout.read(size_Y)
    U = p.stdout.read(size_UV)
    V = p.stdout.read(size_UV)
    print('read time: ', time.time() - s)

    However, this took seconds to read just one yuv frame. What wronged here ? Im not sure what ffmpeg was sending into the pipe, the yuv planar frames or just the pointers to data planes ?

    the console output :

    [('Number of Frames', 61137), ('FPS', 25.0), ('Frame Shape', (1920, 1080))]
    --Number of Frames: 61137
    --FPS: 25.0
    --Frame Shape: (1920, 1080)
    cmd:  ['ffmpeg', '-c:v', 'h264_cuvid', '-i', './myvideo.mp4', '-f', 'image2pipe', '-pix_fmt', 'yuv420p', '-']
    read time:  5.251002073287964
    1/61137 (0.00%)read time:  2.290238618850708
    2/61137 (0.00%)read time:  1.2984871864318848
    3/61137 (0.00%)read time:  2.2100613117218018
    4/61137 (0.01%)read time:  2.3444178104400635