Recherche avancée

Médias (91)

Autres articles (67)

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

  • 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" (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

Sur d’autres sites (6096)

  • php. ffmpeg. read from input stream. How to ?

    3 décembre 2020, par rzlvmp

    I trying to create mp4 file from looping jpg image. By transfer jpg image as a stdin stream.

    


    $cwd = getcwd();
$env = [];
   
$descriptorspec = array(
    0 => ["pipe", "r"],  // stdin
    1 => ["pipe", "w"],  // stdout
    2 => ["pipe", "w"]   // stderr
);

$transcode_command = 'ffmpeg -y -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -f jpeg_pipe -loop 1 -i pipe:0 -c:v libx264 -r 29.97 -t 30 -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=1" -c:a aac -shortest -movflags faststart -f mp4 /tmp/output.mp4';
$process = proc_open($transcode_command, $descriptorspec, $pipes, $cwd, $env);

$s3_client = new Aws\S3\S3Client([
    'calculate_md5' => true,
    'region' => $REGION,
    'version' => 'latest',
    'credentials' => [
        'key'    => $AWS_KEY,
        'secret' => $AWS_SECRET
    ]
]);
$s3_client->registerStreamWrapper();

if (is_resource($process)) {

    $input_stream = fopen('s3://somebucket/image.jpg', 'r');

    if ($input_stream) {

        while (!feof($input_stream)) {
            fwrite($pipes[0], fread($input_stream, 1024));
            fclose($pipes[0]);
        }
        
        $output = stream_get_contents($pipes[1]);
        $error = stream_get_contents($pipes[2]);

        fclose($input_stream);
        fclose($pipes[1]);
        fclose($pipes[2]);

        print_r($output);
        print_r($error);
    }
}


    


    And I've get response

    


    ...
Input #0, lavfi, from 'anullsrc=channel_layout=stereo:sample_rate=44100':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
[mjpeg @ 0xa705a0] EOI missing, emulating
Input #1, jpeg_pipe, from 'pipe:0':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 200x200 [SAR 72:72 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #1:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (pcm_u8 (native) -> aac (native))
[mjpeg @ 0xa70c40] overread 8
[mjpeg @ 0xa70c40] EOI missing, emulating
...


    


    Looks like ffmpeg don't wait for stream end (EOI missing, emulating) and trying to create output video after first while iteration. Resulting file is mp4 with one broken frame.
If I set chunk size (1024) bigger than image size, ffmpeg creates only one completed frame.

    


    ffmpeg command working pretty good if I use aws cli (see my answer). But when I try to send input stream via PHP ffmpeg failing.

    


    What problem may be ?..

    


  • Revision 32042af14b : Renaming of segment constants. Renamed : MAX_MB_SEGMENTS to MAX_SEGMENTS MB_

    23 juillet 2013, par Paul Wilkins

    Changed Paths :
     Modify /vp9/common/vp9_loopfilter.c


     Modify /vp9/common/vp9_loopfilter.h


     Modify /vp9/common/vp9_onyx.h


     Modify /vp9/common/vp9_pred_common.c


     Modify /vp9/common/vp9_seg_common.h


     Modify /vp9/decoder/vp9_decodemv.c


     Modify /vp9/decoder/vp9_decodframe.c


     Modify /vp9/encoder/vp9_bitstream.c


     Modify /vp9/encoder/vp9_onyx_if.c


     Modify /vp9/encoder/vp9_onyx_int.h


     Modify /vp9/encoder/vp9_segmentation.c



    Renaming of segment constants.

    Renamed :
    MAX_MB_SEGMENTS to MAX_SEGMENTS
    MB_SEG_TREE_PROBS to SEG_TREE_PROBS

    The minimum unit for segmentation in the segment map
    is now 8x8 so it is misleading to use MB_ as macro-block
    traditionally refers to a 16x16 region.

    Change-Id : I0b55a6f0426bb46dd13435fcfa5bae0a30a7fa22

  • C# Bitmap to AVI / WMV with Compression

    18 juillet 2016, par Digitalsa1nt

    Prelude :

    I’m going to preface this with, I have been learning C# in my spare time at work, and that I have been staring at code for a solid two days trying to wrap my head around this problem. I am developing some software to be used with a visualiser that connects by USB to a standard Desktop PC, the software detects the capture device and loads frames into bitmap using a New Frame Event, this is then displayed in a ’picture box’ as a live video stream. The problem as it sits is trying to encorporate the ability to record the stream and save to file, preferably a WMV or a compressed AVI.

    What’s been tried :

    I have considered and looked into the following :

    SharpAVI - cant seem to get this to compress or save the frames properly as it appears to mainly look at existing AVI files.

    AForge.Video.VFW - AVI files can be created but are far too large to be used, due to restrictions on the user areas of the individuals who will be using this software.

    AForge.Video.FFMPEG - Again due to considerations of those using this software I can’t have unmanaged DLL’s sat in the output folder with the Executable file, and unfortunately this particular DLL cant be compiled properly using Costura Fody.

    AVIFile Library Wrapper (From Code Project) - Again can’t seem to get this to compress a stream correctly from Bitmaps from the New Frame Events.

    DirectShow - Appears to use C++ and unfortunately is beyond my skill level at this time.

    The Relevant Code Snippets :

    Current References :

    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Resources;
    using System.Drawing.Imaging;
    using System.IO;
    //Aforge Video DLL's
    using AForge.Video;
    using AForge.Video.VFW;
    using AForge.Video.DirectShow;
    //Aforge Image DLL's
    using AForge.Imaging;
    using AForge.Imaging.Formats;
    using AForge.Imaging.Filters;
    //AviLibrary
    using AviFile;

    Global Variables :

       #region Global Variables

       private FilterInfoCollection CaptureDevice; // list of available devices
       private VideoCaptureDevice videoSource;
       public System.Drawing.Image CapturedImage;

       bool toggleMic = false;

       bool toggleRec = false;
       //aforge
       AVIWriter aviWriter;
       Bitmap image;


       #endregion

    Code for Displaying Stream

       #region Displays the Stream

       void videoSource_NewFrame(object sender, NewFrameEventArgs eventArgs)
       {
           picBoxStream.SizeMode = PictureBoxSizeMode.Zoom;
           picBoxStream.Image = (Bitmap)eventArgs.Frame.Clone();// clones the bitmap


           if (toggleRec == true)
           {
               image = (Bitmap)eventArgs.Frame.Clone();
               aviWriter.AddFrame(image);
           }
       }

       #endregion

    Current Code for Recording Stream

       #region Record Button

       private void btnRecord_Click(object sender, EventArgs e)
       {
           if (toggleRec == false)
           {
               saveAVI = new SaveFileDialog();
               saveAVI.Filter = "AVI Files (*.avi)|*.avi";

               if (saveAVI.ShowDialog() == DialogResult.OK)
               {
                   aviWriter = new AVIWriter();
                   aviWriter.Open(saveAVI.FileName, 1280, 720);

                   toggleRec = true;
                   Label lblRec = new Label();
               }

           }
           else if (toggleRec == true)
           {
               aviWriter.Close();
               toggleRec = false;
           }
       }

       #endregion

    I apoligise if the above code doesn’t look quite right, I have been swapping, changing and recoding those three sections a lot in order to find a working combination. This means that it’s rather untidy but I didn’t see the point in cleaning it all up until I had the code working. That being said really any help that you can provide is greatfully recieved, even if it’s a case of what I want to do just cannot be done.

    Thank you in advance.

    EDIT : PostScript :

    I will be actively working on this monday to friday, so If I make any breakthroughs I will update this Question accordingly, this seems to be a frequently sort after answer so hopefully we can overcome the issues.