Recherche avancée

Médias (0)

Mot : - Tags -/masques

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

Autres articles (92)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (7483)

  • Long Overdue MediaWiki Upgrade

    5 février 2014, par Multimedia Mike — General

    What do I do ? What I do ? This library book is 42 years overdue !
    I admit that it’s mine, yet I can’t pay the fine,
    Should I turn it in or should I hide it again ?
    What do I do ? What do I do ?

    I internalized the forgoing paean to the perils of procrastination by Shel Silverstein in my formative years. It’s probably why I’ve never paid a single cent in late fees in my entire life.

    However, I have been woefully negligent as the steward of the MediaWiki software that drives the world famous MultimediaWiki, the internet’s central repository of obscure technical knowledge related to multimedia. It is currently running of version 1.6 software. The latest version is 1.22.

    The Story So Far
    According to my records, I first set up the wiki late in 2005. I don’t know which MediaWiki release I was using at the time. I probably conducted a few upgrades in the early days, but that went by the wayside perhaps in 2007. My web host stopped allowing shell access and the MediaWiki upgrade process pretty much requires running a PHP script from a command line. Upgrade time came around and I put off the project. Weeks turned into months turned into years until, according to some notes, the wiki abruptly stopped working in July, 2011. Suddenly, there were PHP errors about “Namespace” being a reserved word.

    While I finally laid out a plan to upgrade the wiki after all these years, I eventually found that the problem had been caused when my webhost upgraded from PHP 5.2 -> 5.3. I also learned of a small number of code changes that caused the problem to go away, thus kicking the can down the road once more.

    Then a new problem showed up last week. I think it might be related to a new version of PHP again. This time, a few other things on my site broke, and I learned that my webhost now allows me to select a PHP version to use (with the version then set to “auto”, which didn’t yield much information). Rolling back to an earlier version of PHP might have solved the problem easily.

    But NO ! I made the determination that this goes no further. I want this wiki upgraded.

    The Arduous Upgrade Path
    There are 2 general upgrade paths I can think of :

    1. Upgrade in place on the server
    2. Upgrade offline and put the site back on the server

    Approach #1 is problematic since I don’t have direct shell access, though I considered using something like PHP Shell. Approach #2 involves getting the entire set of wiki files and a backup of the MySQL tables. This is workable since I keep automated backups of these items anyway.

    In fairly short order, I was able to set up a working copy of the MultimediaWiki hosted on a local Linux machine. Now what’s the move ? The MediaWiki software I’m running is 1.6.10. The very latest, as of this upgrade project is 1.22.2. I suppose it’s way too much to hope that the software will upgrade cleanly from 1.6.x straight to 1.22.x, but I guess it’s worth a shot…

    HA ! No chance. Okay, next idea is to march through the various versions and upgrade each in turn. MediaWiki has all their historic releases online, all the way back to the 1.3 lineage. I decided that the latest of each lineage should upgrade cleanly from anything in the previous version of lineage. E.g., 1.6.10 should upgrade cleanly to 1.7.3 (last in the 1.7 series). This seemed to be a workable strategy. So I downloaded the latest of each series, unpacked, and copied all the wiki files over the working installation and ran ‘php update.php’ in the maintenance/ directory.

    The process is tedious and not without its obstacles. I consider this penance for my years of wiki neglect. First, I run into the “PHP Parse error : syntax error, unexpected T_NAMESPACE, expecting T_STRING” issue, the same that I saw years ago after the webhost transitioned from PHP 5.2 -> 5.3. I could solve this by editing assorted files and changing “Namespace” -> “MWNamespace” (which is what MediaWiki did by version 1.13). But I would prefer not to.

    Instead, I downloaded the source for PHP 5.2 and compiled it in a separate directory, then called ‘/path/to/php/5.2/bin/php update.php’. Problem solved.

    The next problem is that a bunch of the database update scripts are specifying “Type=InnoDB”. This isn’t supported by modern MySQL databases. Now, it’s “Engine=InnoDB”. A quick search & replace at the command line fixes this for 1.6.x… and 1.7.x… and 1.8 through 1.12. Finally, at 1.13, it was no longer necessary. As a bonus, at 1.13, I was able to test the installation since Namespace had been renamed to MWNamespace. I would later learn that the table type modifications probably could have been simplified in by changing “$wgDBmysql4 = true ;” to “$wgDBmysql5 = true ;” somewhere in LocalSettings.php.

    Command line upgrading worked smoothly up through 1.18 series when I got a new syntax error :

    <br />
    PHP Fatal error:  Call to a member function addMessages() on a non-object in /mnt/sdb1/archive/wiki/extensions/Cite.php on line 68<br />

    Best I could do was comment out that line. I hope that doesn’t break anything important.

    In the home stretch, the very last transition (1.21 -> 1.22) failed :

    PHP Fatal error :  Cannot redeclare wfProfileIn() (previously declared in 
    /mnt/sdb1/archive/wiki/includes/profiler/Profiler.php:33) in 
    /mnt/sdb1/archive/wiki/includes/ProfilerStub.php on line 25
    

    Apparently, this problem arises occasionally since 1.18. I found a way around it thanks to this page : Deleted the file StartProfiler.php. Who am I to argue ?

    Upon completing the transition to 1.22, the wiki doesn’t look correct– the pictures aren’t showing up. The solution was to fix the temporary directory via LocalSettings.php.

    Back To Production
    Okay, it all works again ! Locally, that is. How to get it back to the server ? My first idea was that, knowing that this upgrade process can succeed, try stepping through the upgrade process again, but tell the update.php scripts to access the database tables on multimedia.cx. This seemed to be working for awhile, even though the database update phase often took 4-5 minutes. However, the transition from 1.8.5 -> 1.9.6 took 75 minutes and then timed out. According to my notes, “This isn’t going to work.”

    The new process :

    1. Dump the database tables from the local database.
    2. Create a new database remotely (melanson_wiki_ng).
    3. Dump the database table into melanson_wiki_ng.
    4. Move the index.php file out of the wiki files directory temporarily (or rename).
    5. Modify the LocalSettings.php to talk to the new database.
    6. Perform a lftp mirror operation in order to send all the files up to the server.
    7. Send the index.php file and hope beyond hope that everything magically works.

    And that’s the story of how the updated MultimediaWiki came back online. Despite the database dump file being over 110 MB, it only tool MySQL 1m45s to transmit it all to the remote server (let’s hear it for the ‘–compress’ option). For comparison, inserting the tables back into a fresh local database took 1m07s.

    When the MultimediaWiki was first live again, it loaded, but ever so slowly. This is when I finally looked into optimization and found that I was lacking any caching. So as a bonus, the MultimediaWiki should be much faster now.

    Going Forward
    For all I know, I did everything described here in the hardest way possible. But at least I got it done. Unless I learn of a better process, future upgrades will probably look similar to this.

    Additionally, I should probably take some time to figure out what new features are part of the standard MediaWiki distribution nowadays.

  • Parsing xml with perl and libXML

    2 mai 2014, par user3589690

    I have an XML file which I would like to parse and use to create an arguments set for ffmpeg encoding.

    This is what a dump of the xml looks like :

    $VAR1 = {
             'profile' => [
                          {
                            'enodingParam' => {
                                              'videoFrameRate' => {
                                                                  'arg' => '-r',
                                                                  'content' => '25'
                                                                },

                                              'audioCodec' => {
                                                              'arg' => '-acodec',
                                                              'content' => 'libfaac'
                                                            },
                                              'videoCodec' => {
                                                              'arg' => '-vcodec',
                                                              'content' => 'libx264'
                                                            },
                                              'videoSize' => {
                                                             'arg' => '-s',
                                                             'content' => '640x360'
                                                           },
                                              'audioBitrate' => {
                                                                'arg' => '-ab',
                                                                'content' => '96k'
                                                              },

                                              'videoGOP' => {
                                                            'arg' => '-g',
                                                            'content' => '90'
                                                          },
                                              'audioRate' => {
                                                             'arg' => '-ar',
                                                             'content' => '22050'
                                                           },
                                              'audioChannels' => {
                                                                 'arg' => '-ac',
                                                                 'content' => '2'
                                                               },
                                              'videoPreset' => {
                                                               'arg' => '-vpre',
                                                               'content' => 'slow'
                                                             },
                                              'videoBitrate' => {
                                                                'arg' => '-b',
                                                                'content' => '1200k'
                                                              }
                                            },
                            'metadat' => {
                                        'fileContainer' => '.mp4',
                                        'profileName' => 'testpfrof1'
                                      }
                          },
                          {
                            'enodingParam' => {
                                              'videoFrameRate' => {
                                                                  'arg' => '-r',
                                                                  'content' => '25'
                                                                },

                                              'audioCodec' => {
                                                              'arg' => '-acodec',
                                                              'content' => 'libfaac'
                                                            },
                                              'videoCodec' => {
                                                              'arg' => '-vcodec',
                                                              'content' => 'libx264'
                                                            },
                                              'videoSize' => {
                                                             'arg' => '-s',
                                                             'content' => '320x180'
                                                           },
                                              'audioBitrate' => {
                                                                'arg' => '-ab',
                                                                'content' => '96k'
                                                              },

                                                             },
                                              'videoGOP' => {
                                                            'arg' => '-g',
                                                            'content' => '90'
                                                          },
                                              'audioRate' => {
                                                             'arg' => '-ar',
                                                             'content' => '22050'
                                                           },
                                              'audioChannels' => {
                                                                 'arg' => '-ac',
                                                                 'content' => '2'
                                                               },
                                              'videoPreset' => {
                                                               'arg' => '-vpre',
                                                               'content' => 'slow'
                                                             },
                                              'videoBitrate' => {
                                                                'arg' => '-b',
                                                                'content' => '400k'
                                                              }
                                            },
                            'metadat' => {
                                        'fileContainer' => '.mp4',
                                        'profileName' => 'testProfile2'
                                      }
                          }
                        ]
           };

    I would like to use a foreach loop for the encodingparam node/tagname and end up with a string which looks something like this :

    -acodec libfaac -vcodec libx264 -s 640x360 -ab 96k

    I am kind of stuck . This is what I have put together so far :

    #!/usr/bin/perl

    use warnings;
    use strict;
    use Data::Dumper;
    use XML::LibXML;
    my $filename = "xml/profile.xml";
    my $parser = XML::LibXML->new;
    my $doc    = $parser->parse_file($filename)
                   or die "can't parse profile file: $@";
    my $root = $doc->documentElement();
    my @nodeList = $doc->getElementsByTagName('enodingParam');

    here is the xml file

    &lt;?xml version="1.0"?>
    <profiles>
           <profile>
                           <metadt>
                                   <profilename>testp1</profilename>
                                   <filecontainer>.mp4</filecontainer>
                           </metadt>
                           <enodingparam>
                                   <videocodec arg="-vcodec">libx264</videocodec>
                                   <videopreset arg="-vpre">slow</videopreset>
                                   <videobitrate arg="-b">1200k</videobitrate>
                                   <videowidth arg="-w">640</videowidth>
                                   <videoheight arg="-h">360</videoheight>
                                   <videosize arg="-s">640x360</videosize>
                                   <videoframerate arg="-r">25</videoframerate>
                                   <videogop arg="-g">90</videogop>
                                   <audiobitrate arg="-ab">ab 96k</audiobitrate>
                                   <audiocodec arg="-acodec">-acodec libfaac</audiocodec>
                                   <audiochannels arg="-ac">2</audiochannels>
                                   <audiorate arg="-ar">"22050"</audiorate>
                           </enodingparam>
           </profile>
           <profile>
                           <metadt>
                                   <profilename>testProfile22</profilename>
                                   <filecontainer>.mp4</filecontainer>
                           </metadt>
                           <enodingparam>
                                   <videocodec arg="-vcodec">libx264</videocodec>
                                   <videopreset arg="-vpre">slow</videopreset>
                                   <videobitrate arg="-b">1200k</videobitrate>
                                   <videowidth arg="-w">640</videowidth>
                                   <videoheight arg="-h">360</videoheight>
                                   <videosize arg="-s">640x360</videosize>
                                   <videoframerate arg="-r">25</videoframerate>
                                   <videogop arg="-g">90</videogop>
                                   <audiobitrate arg="-ab">96k</audiobitrate>
                                   <audiocodec arg="-acodec">libfaac</audiocodec>
                                   <audiochannels arg="-ac">2</audiochannels>
                                   <audiorate arg="-ar">22050</audiorate>
                           </enodingparam>
           </profile>

    </profiles>

    Modified the pl script to

    use warnings;
    use strict;
    use Data::Dumper;
    use XML::LibXML;
    my $filename = "xml/book.xml";
    my $parser = XML::LibXML->new;
    my @ffmpegargs;
    my $fileName="filename";
    my $doc    = $parser->parse_file($filename)
                   or die "can't parse profile file: $@";
    my $root = $doc->documentElement();
    my @paramList = $doc->getElementsByTagName('enodingParam');

    for my $ele (@paramList)
    {
       # You then need to iterate over all the children of that node...

       for my $param ($ele->nonBlankChildNodes())
       {

           my $inparams = " " . $param->getAttribute('arg') . " " . $param->textContent ;
           push ( @ffmpegargs, $inparams);

       }
       my $ffmpeg = join(" ", @ffmpegargs);
       print "ffmpeg" . $ffmpeg, "\n";
    }

    It is printing out correctly. Now how do i add the following to the string
    $filename , profileName, containerName (from the metadat node) to the same string so that my final output looks like :

    ffmpeg -vcodec libx264  -vpre slow  -b 1200k  -w 640  -h 360  -s 640x360 filename_profileName_containerName

    ok tried zooming ue to profile. Not sure how to traverse the child nodes. Tried this. But its nor printing the right values

    use warnings;
    use strict;
    use Data::Dumper;
    use XML::LibXML;
    my $filename = "xml/book.xml";
    my $parser = XML::LibXML->new;
    my @ffmpegargs;
    my $fileName="filename";
    my $doc    = $parser->parse_file($filename)
                   or die "can't parse profile file: $@";
    my $root = $doc->documentElement();
    my @paramList = $doc->getElementsByTagName('profile');

    for my $ele (@paramList)
    {
       # You then need to iterate over all the children of that node...

       for my $param ($ele->findnodes('/encodingParam/*'))
       {

           my $inparams = " " . $param->getAttribute('arg') . " " . $param->textContent ;
           push ( @ffmpegargs, $inparams);

       }
       my $ffmpeg = join(" ", @ffmpegargs);
       print "ffmpeg" . $ffmpeg, "\n";
    }
  • 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>