Recherche avancée

Médias (91)

Autres articles (20)

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

Sur d’autres sites (4555)

  • video proccesing : extract frames and encrypt them then insert them back to the video in java using xuggler

    24 juillet 2015, par Anas M. Jubara

    I’m working on a video encryption application .. the main idea is to input the video file to the application and the application should output it in an encrypted form... am using xuggler library to manipulate the video and get to the frames and AES for encryption.
    my code works fine for accessing the frames and encrypting them, what i need help with is how to write the encrypted frame back to the video file to replace the original one without corrupting the video file for the video players.
    Here is my code

    package xuggler;

    import com.xuggle.mediatool.IMediaReader;
    import com.xuggle.mediatool.IMediaWriter;
    import com.xuggle.mediatool.MediaListenerAdapter;
    import com.xuggle.mediatool.ToolFactory;
    import com.xuggle.mediatool.event.IVideoPictureEvent;
    import com.xuggle.xuggler.Global;
    import com.xuggle.xuggler.ICodec;

    import java.awt.Graphics2D;
    import java.awt.Point;
    import java.awt.Transparency;
    import java.awt.image.BufferedImage;
    import java.awt.image.ColorModel;
    import java.awt.image.ComponentColorModel;
    import java.awt.image.DataBuffer;
    import java.awt.image.DataBufferByte;
    import java.awt.image.Raster;
    import java.awt.image.WritableRaster;

    import java.io.File;

    import java.security.InvalidKeyException;
    import java.security.NoSuchAlgorithmException;
    import java.security.SecureRandom;

    import java.util.concurrent.TimeUnit;
    import java.util.logging.Level;
    import java.util.logging.Logger;

    import javax.crypto.BadPaddingException;
    import javax.crypto.Cipher;
    import javax.crypto.IllegalBlockSizeException;
    import javax.crypto.KeyGenerator;
    import javax.crypto.NoSuchPaddingException;
    import javax.crypto.SecretKey;

    import javax.imageio.ImageIO;


    public class DecodeAndCaptureFrames extends MediaListenerAdapter
    {

    // The number of seconds between frames.
         public static final double SECONDS_BETWEEN_FRAMES = 5;

     //The number of micro-seconds between frames.
     public static final long MICRO_SECONDS_BETWEEN_FRAMES =(long)      (Global.DEFAULT_PTS_PER_SECOND * SECONDS_BETWEEN_FRAMES);

     // Time of last frame write
     private static long mLastPtsWrite = Global.NO_PTS;

    private static final double FRAME_RATE = 50;

    private static final int SECONDS_TO_RUN_FOR = 20;

    private static final String outputFilename = "D:\\K.mp4";

    public static IMediaWriter writer = ToolFactory.makeWriter(outputFilename);
    //receive BufferedImage and returns its byte data
       public static byte[] get_byte_data(BufferedImage image) {
       WritableRaster raster = image.getRaster();
       DataBufferByte buffer = (DataBufferByte) raster.getDataBuffer();
       return buffer.getData();
    }


    //create new_img with the attributes of image
    public static BufferedImage user_space(BufferedImage image) {
       //create new_img with the attributes of image
       BufferedImage new_img = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_3BYTE_BGR);
       Graphics2D graphics = new_img.createGraphics();
       graphics.drawRenderedImage(image, null);
       graphics.dispose(); //release all allocated memory for this image
       return new_img;
    }

    public static BufferedImage toImage(byte[] imagebytes, int width, int height) {
       DataBuffer buffer = new DataBufferByte(imagebytes, imagebytes.length);
       WritableRaster raster = Raster.createInterleavedRaster(buffer, width, height,
          3 * width, 3, new int[]{2, 1, 0}, (Point) null);

       ColorModel cm = new ComponentColorModel(ColorModel.getRGBdefault().getColorSpace(),
               false, true, Transparency.OPAQUE, DataBuffer.TYPE_BYTE);
       return new BufferedImage(cm, raster, true, null);
    }

    public static byte[] encrypt(byte[] orgnlbytes, String key) throws NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException {
       byte[] encbytes = null;
       try {
           Cipher cipher = Cipher.getInstance("AES");
           KeyGenerator keyGen = KeyGenerator.getInstance("AES");
           SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
           // cryptograph. secure random
           random.setSeed(key.getBytes());

           keyGen.init(128, random);
           // for example
           SecretKey secretKey = keyGen.generateKey();
           try {
               cipher.init(Cipher.ENCRYPT_MODE, secretKey);
           } catch (InvalidKeyException ex) {
               Logger.getLogger(DecodeAndCaptureFrames.class.getName()).log(Level.SEVERE, null, ex);
           }
           encbytes = cipher.doFinal(orgnlbytes);
       }
       catch (NoSuchAlgorithmException ex) {
           Logger.getLogger(DecodeAndCaptureFrames.class.getName()).log(Level.SEVERE, null, ex);
       }        catch (NoSuchPaddingException ex)
       {
           System.out.print("can not encrypt buffer");
       }

       return encbytes;
    }


     /**
      * The video stream index, used to ensure we display frames from one
      * and only one video stream from the media container.
      */

     private int mVideoStreamIndex = -1;

     /**
      * Takes a media container (file) as the first argument, opens it and
      *  writes some of it's video frames to PNG image files in the
      *  temporary directory.
      *
      * @param args must contain one string which represents a filename
      */

     public static void main(String[] args)
     {
       // create a new mr. decode and capture frames


       DecodeAndCaptureFrames decodeAndCaptureFrames;
       decodeAndCaptureFrames = new DecodeAndCaptureFrames("D:\\K.mp4");
     }

     /** Construct a DecodeAndCaptureFrames which reads and captures
      * frames from a video file.
      *
      * @param filename the name of the media file to read
      */


     //makes reader to the file and read the data of it
     public DecodeAndCaptureFrames(String filename)
     {
       // create a media reader for processing video

      IMediaReader reader = ToolFactory.makeReader(filename);

    // stipulate that we want BufferedImages created in BGR 24bit color space
    reader.setBufferedImageTypeToGenerate(BufferedImage.TYPE_3BYTE_BGR);


    // note that DecodeAndCaptureFrames is derived from
    // MediaReader.ListenerAdapter and thus may be added as a listener
    // to the MediaReader. DecodeAndCaptureFrames implements
    // onVideoPicture().

    reader.addListener(this);

    // read out the contents of the media file, note that nothing else
    // happens here.  action happens in the onVideoPicture() method
    // which is called when complete video pictures are extracted from
    // the media source

    while (reader.readPacket() == null)
     do {} while(false);
     }

    /**
      * Called after a video frame has been decoded from a media stream.
      * Optionally a BufferedImage version of the frame may be passed
      * if the calling {@link IMediaReader} instance was configured to
      * create BufferedImages.
      *
      * This method blocks, so return quickly.
      */

     public void onVideoPicture(IVideoPictureEvent event)
     {
       try
       {
         // if the stream index does not match the selected stream index,
         // then have a closer look

     if (event.getStreamIndex() != mVideoStreamIndex)
     {
       // if the selected video stream id is not yet set, go ahead an
       // select this lucky video stream

       if (-1 == mVideoStreamIndex)
         mVideoStreamIndex = event.getStreamIndex();

       // otherwise return, no need to show frames from this video stream

       else
         return;
     }

     // if uninitialized, backdate mLastPtsWrite so we get the very
     // first frame

     if (mLastPtsWrite == Global.NO_PTS)
       mLastPtsWrite = event.getTimeStamp() - MICRO_SECONDS_BETWEEN_FRAMES;

     // if it's time to write the next frame

     if (event.getTimeStamp() - mLastPtsWrite >= MICRO_SECONDS_BETWEEN_FRAMES)
     {
       // Make a temporary file name

      // File file = File.createTempFile("frame", ".jpeg");

       // write out PNG

    //        ImageIO.write(event.getImage(), "png", file);

       BufferedImage orgnlimage = event.getImage();
           orgnlimage = user_space(orgnlimage);
           byte[] orgnlimagebytes = get_byte_data(orgnlimage);
           byte[] encryptedbytes = encrypt(orgnlimagebytes, "abc");
           BufferedImage encryptedimage = toImage(encryptedbytes, orgnlimage.getWidth(), orgnlimage.getHeight());


           ImageIO.write(encryptedimage, "png", File.createTempFile("frame", ".png"));
    //         indicate file written

       double seconds = ((double)event.getTimeStamp())
         / Global.DEFAULT_PTS_PER_SECOND;
    //        System.out.printf("at elapsed time of %6.3f seconds wrote: %s\n",seconds, file);

       // update last write time

       mLastPtsWrite += MICRO_SECONDS_BETWEEN_FRAMES;
     }
    }
    catch (Exception e)
    {
     e.printStackTrace();
    }
     }

    }
  • Matomo to end support for Internet Explorer 11

    21 septembre 2021, par Matomo Core Team — Community

    A lot of the Matomo user interface is built on top of a programming framework called “Angular.js”. The support for this framework will end very soon, meaning we have to migrate the Matomo user interface to an alternative framework. The Matomo development team has chosen this new framework to be “Vue.js 3”.

    Unfortunately, Vue.js does not support Internet Explorer 11 (IE 11). Therefore, we have to drop the support for IE 11. Many other popular services like Microsoft and WordPress recently did the same. This is happening because IE 11 was released about 8 years ago and is now used by less than 0.5% of the internet. 

    When will this change happen ?

    Our next release (Matomo 4.5) will still support IE 11. It will show a notification in the user interface if you are using Internet Explorer to make you aware of this upcoming change. 

    When Matomo 4.6 is released around November 2021, then IE 11 will no longer be supported.

    What does “end support” mean ?

    The Matomo user interface will work less and less over time for people using IE 11 as a browser. While Matomo 4.6 might still mostly work with IE 11, once we migrate more of the user interface the functionality will stop working completely. It’s possible that even Matomo 4.6 will no longer be functional with IE 11 at all.

    What should I do now ?

    If you are impacted by this, then we strongly recommend that you switch to a more modern browser. Preferably a privacy-friendly browser like Mozilla Firefox or Brave. But any modern browser including Microsoft Edge, Safari and Google Chrome will work just fine.

    If you can’t use a different browser and you are using Matomo On-Premise, then you can install and configure this new plugin which lets you only receive Matomo core updates that are compatible with IE 11. This will prevent you from accidentally upgrading to a Matomo core release that doesn’t work with IE 11, and you can still receive critical security updates and bug fixes until February 2022.

    Will this affect the Matomo JavaScript tracker ?

    No, all visitors using IE 11 will still be tracked and Matomo tracker will support the same browsers as before. Meaning also some older versions of Internet Explorer are still supported.

    Have any questions about this ?

    Get in touch with us 

  • Electron spawn ffmpeg ENOENT

    3 août 2022, par Menno

    I am building an Electron app to display a rtsp stream.

    


    When using the locally installed ffmpeg (/usr/local/bin/ffmpeg) on the (MacOS) Desktop all works well. Since the app needs to be distributed to different desktops and i don't want to be dependent on local installation of ffmpeg i am trying to bundle ffmpeg / fluent-ffmpeg but somehow i am missing the clue and all my attempts end up in Uncaught Error : spawn ffmpeg ENOENT

    


    I am a complete newby to Electron and nodejs and am sure i am missing a very basic concept here, somebody willing to help me out ?

    


    This is my code :

    


    main.js

    


    const { app, BrowserWindow } = require('electron');
const { ipcMain } = require('electron');
const path = require('path');

const createWindow = () => {
  const win = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js'),
    },
  });
    
  win.loadFile('index.html');
};

app.whenReady().then(() => {
  createWindow();

  app.on('activate', () => {
    if (BrowserWindow.getAllWindows().length === 0) {
      createWindow();
    }
  });
});

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') {
    app.quit();
  }
});


    


    index.html

    


    &#xA;&#xA;  &#xA;    &#xA;    &#xA;    &#xA;    &#xA;    &#xA;  &#xA;  &#xA;    <div class="col-sm"><h2>RTSP stream</h2><canvas class="canvas"></canvas></div>&#xA;&#xA;    &#xA;&#xA;    <code class="echappe-js">&lt;script src='http://stackoverflow.com/feeds/tag/&amp;#38;#x27;./jsmpeg.min.js&amp;#38;#x27;'&gt;&lt;/script&gt;&#xA;    &lt;script src='http://stackoverflow.com/feeds/tag/renderer.js'&gt;&lt;/script&gt;&#xA;    &#xA;&#xA;

    &#xA;

    preload.js

    &#xA;

    const { contextBridge, ipcRenderer } = require(&#x27;electron&#x27;)&#xA;&#xA;const ffmpegPath = require("@ffmpeg-installer/ffmpeg").path;&#xA;const ffmpeg = require("fluent-ffmpeg");&#xA;ffmpeg.setFfmpegPath(ffmpegPath);&#xA;&#xA;var stream = require(&#x27;node-rtsp-stream&#x27;)&#xA;&#xA;stream3 = new stream({&#xA;    name: &#x27;stream3&#x27;,&#xA;    streamUrl: &#x27;rtsp://xxx.xxx.xxx.xxx/...........&#x27;,&#xA;    wsPort: 9993,&#xA;    ffmpegOptions: {&#xA;&#xA;  }&#xA;})&#xA;

    &#xA;

    renderer.js

    &#xA;

    const player = new JSMpeg.Player(&#x27;ws://localhost:9993&#x27;, {&#xA;      canvas: document.getElementById(&#x27;canvas3&#x27;), audio: false&#xA;    })  &#xA;

    &#xA;