Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (110)

  • Diogene : création de masques spécifiques de formulaires d’édition de contenus

    26 octobre 2010, par

    Diogene est un des plugins ? SPIP activé par défaut (extension) lors de l’initialisation de MediaSPIP.
    A quoi sert ce plugin
    Création de masques de formulaires
    Le plugin Diogène permet de créer des masques de formulaires spécifiques par secteur sur les trois objets spécifiques SPIP que sont : les articles ; les rubriques ; les sites
    Il permet ainsi de définir en fonction d’un secteur particulier, un masque de formulaire par objet, ajoutant ou enlevant ainsi des champs afin de rendre le formulaire (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (13317)

  • Pipe and regex bash ouput

    13 mars 2013, par Wes

    I'm trying to get the dimensions of a video with ffmpeg. I use the command ffprobe video.mov to get the following data :

    ffprobe version 1.0 Copyright (c) 2007-2012 the FFmpeg developers
     built on Jan 14 2013 10:18:07 with Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/1.0 --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
     libavutil      51. 73.101 / 51. 73.101
     libavcodec     54. 59.100 / 54. 59.100
     libavformat    54. 29.104 / 54. 29.104
     libavdevice    54.  2.101 / 54.  2.101
     libavfilter     3. 17.100 /  3. 17.100
     libswscale      2.  1.101 /  2.  1.101
     libswresample   0. 15.100 /  0. 15.100
     libpostproc    52.  0.100 / 52.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'linebubble.mov':
     Metadata:
       major_brand     : qt
       minor_version   : 0
       compatible_brands: qt
       creation_time   : 2013-03-12 02:59:34
     Duration: 00:00:14.05, start: 0.050000, bitrate: 135 kb/s
       Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 502x288 [SAR 1:1 DAR 251:144], 137 kb/s, 7.84 fps, 60 tbr, 6k tbn, 12k tbc
       Metadata:
         creation_time   : 2013-03-12 02:59:34
         handler_name    : Core Media Data Handler

    Now I want to pipe that into a regex to just get 502x288 on the fourth last line.

    I've seen some solutions with python and perl, but I want this to be in plain bash. How would I go about this ?

  • Jitsi and ffplay

    15 juin 2014, par Kotkot

    I’m playing with jitsi. Got examples form source code. I modified it a bit.
    Here is what I’ve got.
    I am trying to play the transmitted stream in VLC of ffplay or any other player,
    but I cannot.

    I use these application parameters to run the code :

    --local-port-base=5000 --remote-host=localhost --remote-port-base=10000

    What am I doing wrong ?

    package com.company;


       /*
        * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
        *
    * Distributable under LGPL license.
    * See terms of license at gnu.org.
    */

    import org.jitsi.service.libjitsi.LibJitsi;
    import org.jitsi.service.neomedia.*;
    import org.jitsi.service.neomedia.device.MediaDevice;
    import org.jitsi.service.neomedia.format.MediaFormat;
    import org.jitsi.service.neomedia.format.MediaFormatFactory;

    import java.io.PrintStream;
    import java.net.DatagramSocket;
    import java.net.InetAddress;
    import java.net.InetSocketAddress;
    import java.util.HashMap;
    import java.util.Map;

    /**
    * Implements an example application in the fashion of JMF's AVTransmit2 example
    * which demonstrates the use of the <tt>libjitsi</tt> library for the purposes
    * of transmitting audio and video via RTP means.
    *
    * @author Lyubomir Marinov
    */
    public class VideoTransmitter {
       /**
        * The port which is the source of the transmission i.e. from which the
        * media is to be transmitted.
        *
        * @see #LOCAL_PORT_BASE_ARG_NAME
        */
       private int localPortBase;

       /**
        * The <tt>MediaStream</tt> instances initialized by this instance indexed
        * by their respective <tt>MediaType</tt> ordinal.
        */
       private MediaStream[] mediaStreams;

       /**
        * The <tt>InetAddress</tt> of the host which is the target of the
        * transmission i.e. to which the media is to be transmitted.
        *
        * @see #REMOTE_HOST_ARG_NAME
        */
       private InetAddress remoteAddr;

       /**
        * The port which is the target of the transmission i.e. to which the media
        * is to be transmitted.
        *
        * @see #REMOTE_PORT_BASE_ARG_NAME
        */
       private int remotePortBase;

       /**
        * Initializes a new <tt>AVTransmit2</tt> instance which is to transmit
        * audio and video to a specific host and a specific port.
        *
        * @param localPortBase  the port which is the source of the transmission
        *                       i.e. from which the media is to be transmitted
        * @param remoteHost     the name of the host which is the target of the
        *                       transmission i.e. to which the media is to be transmitted
        * @param remotePortBase the port which is the target of the transmission
        *                       i.e. to which the media is to be transmitted
        * @throws Exception if any error arises during the parsing of the specified
        *                   <tt>localPortBase</tt>, <tt>remoteHost</tt> and <tt>remotePortBase</tt>
        */
       private VideoTransmitter(
               String localPortBase,
               String remoteHost, String remotePortBase)
               throws Exception {
           this.localPortBase
                   = (localPortBase == null)
                   ? -1
                   : Integer.valueOf(localPortBase).intValue();
           this.remoteAddr = InetAddress.getByName(remoteHost);
           this.remotePortBase = Integer.valueOf(remotePortBase).intValue();
       }

       /**
        * Starts the transmission. Returns null if transmission started ok.
        * Otherwise it returns a string with the reason why the setup failed.
        */
       private String start()
               throws Exception {
           /*
            * Prepare for the start of the transmission i.e. initialize the
            * MediaStream instances.
            */
           MediaType[] mediaTypes = MediaType.values();
           MediaService mediaService = LibJitsi.getMediaService();
           int localPort = localPortBase;
           int remotePort = remotePortBase;

           mediaStreams = new MediaStream[mediaTypes.length];
           for (MediaType mediaType : mediaTypes) {
               if(mediaType != MediaType.VIDEO) continue;
               /*
                * The default MediaDevice (for a specific MediaType) is configured
                * (by the user of the application via some sort of UI) into the
                * ConfigurationService. If there is no ConfigurationService
                * instance known to LibJitsi, the first available MediaDevice of
                * the specified MediaType will be chosen by MediaService.
                */
               MediaDevice device
                       = mediaService.getMediaDeviceForPartialDesktopStreaming(100,100,100,100);
               if (device == null) {
                   continue;
               }
               MediaStream mediaStream = mediaService.createMediaStream(device);

               // direction
               /*
                * The AVTransmit2 example sends only and the AVReceive2 receives
                * only. In a call, the MediaStream's direction will most commonly
                * be set to SENDRECV.
                */
               mediaStream.setDirection(MediaDirection.SENDONLY);

               // format
               String encoding;
               double clockRate;
               /*
                * The AVTransmit2 and AVReceive2 examples use the H.264 video
                * codec. Its RTP transmission has no static RTP payload type number
                * assigned.
                */
               byte dynamicRTPPayloadType;

               switch (device.getMediaType()) {
                   case AUDIO:
                       encoding = "PCMU";
                       clockRate = 8000;
                   /* PCMU has a static RTP payload type number assigned. */
                       dynamicRTPPayloadType = -1;
                       break;
                   case VIDEO:
                       encoding = "H264";
                       clockRate = MediaFormatFactory.CLOCK_RATE_NOT_SPECIFIED;
                   /*
                    * The dymanic RTP payload type numbers are usually negotiated
                    * in the signaling functionality.
                    */
                       dynamicRTPPayloadType = 99;
                       break;
                   default:
                       encoding = null;
                       clockRate = MediaFormatFactory.CLOCK_RATE_NOT_SPECIFIED;
                       dynamicRTPPayloadType = -1;
               }

               if (encoding != null) {
                   MediaFormat format
                           = mediaService.getFormatFactory().createMediaFormat(
                           encoding,
                           clockRate);

                   /*
                    * The MediaFormat instances which do not have a static RTP
                    * payload type number association must be explicitly assigned
                    * a dynamic RTP payload type number.
                    */
                   if (dynamicRTPPayloadType != -1) {
                       mediaStream.addDynamicRTPPayloadType(
                               dynamicRTPPayloadType,
                               format);
                   }

                   mediaStream.setFormat(format);
               }

               // connector
               StreamConnector connector;

               if (localPortBase == -1) {
                   connector = new DefaultStreamConnector();
               } else {
                   int localRTPPort = localPort++;
                   int localRTCPPort = localPort++;

                   connector
                           = new DefaultStreamConnector(
                           new DatagramSocket(localRTPPort),
                           new DatagramSocket(localRTCPPort));
               }
               mediaStream.setConnector(connector);

               // target
               /*
                * The AVTransmit2 and AVReceive2 examples follow the common
                * practice that the RTCP port is right after the RTP port.
                */
               int remoteRTPPort = remotePort++;
               int remoteRTCPPort = remotePort++;

               mediaStream.setTarget(
                       new MediaStreamTarget(
                               new InetSocketAddress(remoteAddr, remoteRTPPort),
                               new InetSocketAddress(remoteAddr, remoteRTCPPort)));

               // name
               /*
                * The name is completely optional and it is not being used by the
                * MediaStream implementation at this time, it is just remembered so
                * that it can be retrieved via MediaStream#getName(). It may be
                * integrated with the signaling functionality if necessary.
                */
               mediaStream.setName(mediaType.toString());

               mediaStreams[mediaType.ordinal()] = mediaStream;
           }

           /*
            * Do start the transmission i.e. start the initialized MediaStream
            * instances.
            */
           for (MediaStream mediaStream : mediaStreams) {
               if (mediaStream != null) {

                   mediaStream.start();
               }
           }



           return null;
       }

       /**
        * Stops the transmission if already started
        */
       private void stop() {
           if (mediaStreams != null) {
               for (int i = 0; i &lt; mediaStreams.length; i++) {
                   MediaStream mediaStream = mediaStreams[i];

                   if (mediaStream != null) {
                       try {
                           mediaStream.stop();
                       } finally {
                           mediaStream.close();
                           mediaStreams[i] = null;
                       }
                   }
               }

               mediaStreams = null;
           }
       }

       /**
        * The name of the command-line argument which specifies the port from which
        * the media is to be transmitted. The command-line argument value will be
        * used as the port to transmit the audio RTP from, the next port after it
        * will be to transmit the audio RTCP from. Respectively, the subsequent
        * ports will be used to transmit the video RTP and RTCP from."
        */
       private static final String LOCAL_PORT_BASE_ARG_NAME
               = "--local-port-base=";

       /**
        * The name of the command-line argument which specifies the name of the
        * host to which the media is to be transmitted.
        */
       private static final String REMOTE_HOST_ARG_NAME = "--remote-host=";

       /**
        * The name of the command-line argument which specifies the port to which
        * the media is to be transmitted. The command-line argument value will be
        * used as the port to transmit the audio RTP to, the next port after it
        * will be to transmit the audio RTCP to. Respectively, the subsequent ports
        * will be used to transmit the video RTP and RTCP to."
        */
       private static final String REMOTE_PORT_BASE_ARG_NAME
               = "--remote-port-base=";

       /**
        * The list of command-line arguments accepted as valid by the
        * <tt>AVTransmit2</tt> application along with their human-readable usage
        * descriptions.
        */
       private static final String[][] ARGS
               = {
               {
                       LOCAL_PORT_BASE_ARG_NAME,
                       "The port which is the source of the transmission i.e. from"
                               + " which the media is to be transmitted. The specified"
                               + " value will be used as the port to transmit the audio"
                               + " RTP from, the next port after it will be used to"
                               + " transmit the audio RTCP from. Respectively, the"
                               + " subsequent ports will be used to transmit the video RTP"
                               + " and RTCP from."
               },
               {
                       REMOTE_HOST_ARG_NAME,
                       "The name of the host which is the target of the transmission"
                               + " i.e. to which the media is to be transmitted"
               },
               {
                       REMOTE_PORT_BASE_ARG_NAME,
                       "The port which is the target of the transmission i.e. to which"
                               + " the media is to be transmitted. The specified value"
                               + " will be used as the port to transmit the audio RTP to"
                               + " the next port after it will be used to transmit the"
                               + " audio RTCP to. Respectively, the subsequent ports will"
                               + " be used to transmit the video RTP and RTCP to."
               }
       };

       public static void main(String[] args)
               throws Exception {
           // We need two parameters to do the transmission. For example,
           // ant run-example -Drun.example.name=AVTransmit2 -Drun.example.arg.line="--remote-host=127.0.0.1 --remote-port-base=10000"
           if (args.length &lt; 2) {
               prUsage();
           } else {
               Map argMap = parseCommandLineArgs(args);

               LibJitsi.start();
               try {
                   // Create a audio transmit object with the specified params.
                   VideoTransmitter at
                           = new VideoTransmitter(
                           argMap.get(LOCAL_PORT_BASE_ARG_NAME),
                           argMap.get(REMOTE_HOST_ARG_NAME),
                           argMap.get(REMOTE_PORT_BASE_ARG_NAME));
                   // Start the transmission
                   String result = at.start();

                   // result will be non-null if there was an error. The return
                   // value is a String describing the possible error. Print it.
                   if (result == null) {
                       System.err.println("Start transmission for 600 seconds...");

                       // Transmit for 60 seconds and then close the processor
                       // This is a safeguard when using a capture data source
                       // so that the capture device will be properly released
                       // before quitting.
                       // The right thing to do would be to have a GUI with a
                       // "Stop" button that would call stop on AVTransmit2
                       try {
                           Thread.sleep(600_000);
                       } catch (InterruptedException ie) {
                       }

                       // Stop the transmission
                       at.stop();

                       System.err.println("...transmission ended.");
                   } else {
                       System.err.println("Error : " + result);
                   }
               } finally {
                   LibJitsi.stop();
               }
           }
       }

       /**
        * Parses the arguments specified to the <tt>AVTransmit2</tt> application on
        * the command line.
        *
        * @param args the arguments specified to the <tt>AVTransmit2</tt>
        *             application on the command line
        * @return a <tt>Map</tt> containing the arguments specified to the
        * <tt>AVTransmit2</tt> application on the command line in the form of
        * name-value associations
        */
       static Map parseCommandLineArgs(String[] args) {
           Map argMap = new HashMap();

           for (String arg : args) {
               int keyEndIndex = arg.indexOf('=');
               String key;
               String value;

               if (keyEndIndex == -1) {
                   key = arg;
                   value = null;
               } else {
                   key = arg.substring(0, keyEndIndex + 1);
                   value = arg.substring(keyEndIndex + 1);
               }
               argMap.put(key, value);
           }
           return argMap;
       }

       /**
        * Outputs human-readable description about the usage of the
        * <tt>AVTransmit2</tt> application and the command-line arguments it
        * accepts as valid.
        */
       private static void prUsage() {
           PrintStream err = System.err;

           err.println("Usage: " + VideoTransmitter.class.getName() + " <args>");
           err.println("Valid args:");
           for (String[] arg : ARGS)
               err.println("  " + arg[0] + " " + arg[1]);
       }
       }
    </args>
  • Logic and lawyers

    22 mai 2013, par Mans — Law and liberty

    Reading about various patent litigation cases, I am struck by the frequency with which common logical fallacies such as the Appeal to Consequences are committed. We shall look at a couple of recent examples. In conjunction with the Federal Circuit ruling in CLS Bank v. Alice Corp., Judge Moore, joined … Continue reading