Recherche avancée

Médias (91)

Autres articles (74)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

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

  • bigbluebutton ...

    7 mars 2015, par signo

    Hello i have a BigBlueButton (0.9.0-beta (622)) installation on Debian Wheezy (7.8) all is ok except archiving recordings...

    in the log (/var/log/bigbluebutton/archive-488052dc7c095c74bf8992ec51a66298db04b765-1425642166675.log) i have always same message :

    I, [2015-03-06T11:48:19.320704 #4550]  INFO -- : Archiving events for 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675.
    W, [2015-03-06T11:48:19.851280 #4550]  WARN -- : Failed to archive events for 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675. Permission denied - /var/bigbluebutton/recording/raw/488052dc7c095c74bf8992ec51a66298db04b765-1425642166675/events.xml (complete error below...)

    but all directory are writable by right user (tomcat7).

    More Info :

    bbb packages installed

    ii  bbb-apps                              0.9.0-1ubuntu88               amd64        BigBlueButton applications for Red5
    ii  bbb-apps-deskshare                    0.9.0-1ubuntu25               amd64        BigBlueButton deskshare module for Red5
    ii  bbb-apps-sip                          0.9.0-1ubuntu19               amd64        BigBlueButton SIP module for Red5
    ii  bbb-apps-video                        0.9.0-1ubuntu18               amd64        BigBlueButton video module for Red5
    ii  bbb-client                            0.9.0-1ubuntu235              all          BigBlueButton Flash client
    ii  bbb-config                            0.9.0-1ubuntu42               all          BigBlueButton configuration
    rc  bbb-demo                              0.9.0-1ubuntu8                amd64        BigBlueButton API demos
    ii  bbb-freeswitch                        0.9.0-1ubuntu38               amd64        BigBlueButton build of FreeSWITCH 1.5.x
    ii  bbb-mkclean                           0.8.7-1                       amd64        tool to clean and optimize Matroska and WebM files
    ii  bbb-office                            0.9.0-1ubuntu6                amd64        BigBlueButton wrapper for LibreOffice
    ii  bbb-playback-presentation             0.9.0-1ubuntu11               amd64        BigBluebutton playback of presentation
    ii  bbb-record-core                       0.9.0-1ubuntu37               amd64        BigBlueButton record and playback
    ii  bbb-red5                              0.9.0-1ubuntu25               amd64        The Red5 server for bbb
    ii  bbb-swftools                          0.9.2-1ubuntu14               amd64        The swftools files for bbb
    ii  bbb-web                               0.9.0-1ubuntu54               all          BigBlueButton API
    ii  bigbluebutton                         0.9.0-1ubuntu2                amd64        Open source web conferencing platform (bbb)

    bbb-conf —check

    BigBlueButton Server 0.9.0-beta (622)
                       Kernel version: 3.16.0-4-amd64(64-bit)
                               Memory: 12044 MB

    /var/www/bigbluebutton/client/conf/config.xml (bbb-client)
           Port test (tunnel): 2xx.xxx.xxx.xx
                                 Red5: 2xx.xxx.xxx.xx
                 useWebrtcIfAvailable: true

    /opt/freeswitch/conf/sip_profiles/external.xml (FreeSWITCH)
                       websocket port: 5066
                       WebRTC enabled: true

    /etc/nginx/sites-available/bigbluebutton (nginx)
                          server name: 2xx.xxx.xxx.xx
                                 port: 80
                       bbb-client dir: /var/www/bigbluebutton

    /var/lib/tomcat7/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties (bbb-web)
                         bbb-web host: 2xx.xxx.xxx.xx

    /usr/share/red5/webapps/bigbluebutton/WEB-INF/red5-web.xml (red5)
                     voice conference: FreeSWITCH
                        capture video: true
                      capture desktop: true

    /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml (record and playback)
                        playback host: 2xx.xxx.xxx.xx


    * Potential problems described below **
       # IP does not match:
       #                           IP from ifconfig: 172.xx.xxx.xx
       #   /etc/nginx/sites-available/bigbluebutton: 2xx.xxx.xxx.xx
       # Error: Unable to connect to port 1935 (RTMP) 2xx.xxx.xxx.xx

       # Error: Unable to connect to port 9123 (desktop sharing) on 212.xxx.xxx.xx

    ls -l /var/freeswitch/meetings/

    -rw-r--r-- 1 freeswitch daemon 5139984 Mar  6 11:44 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675-81976383.wav

    ls -l /usr/share/red5/webapps/video/streams/488052dc7c095c74bf8992ec51a66298db04b765-1425642166675/

    -rw-rw-r-- 1 red5 red5 438342 Mar  6 11:44 320x240-cztd6nyzasaz_1-1425642114164.flv

    ls -l /usr/share/red5/webapps/video/streams/488052dc7c095c74bf8992ec51a66298db04b765-1425642166675/

    -rw-rw-r-- 1 red5 red5 438342 Mar  6 11:44 320x240-cztd6nyzasaz_1-1425642114164.flv

    cat /usr/share/red5/webapps/video/WEB-INF/red5-web.xml

    <bean class="org.bigbluebutton.app.video.VideoApplication">
           <property value="true"></property>
           <property ref="redisRecorder"></property>
    </bean>

    cat /usr/share/red5/webapps/deskshare/WEB-INF/red5-web.xml

    <bean class="org.bigbluebutton.deskshare.server.stream.StreamManager">
       
       
    </bean>

    bbb-record —watch

    Every 2.0s: bbb-record --list20                                                                                                                                   Fri Mar  6 11:53:58 2015

    Internal MeetingID                                               Time                APVD APVDE RAS Slides Processed            Published           External MeetingID
    ------------------------------------------------------  ---------------------------- ---- ----- --- ------ -------------------- ------------------  -------------------
    57d9849193299cebe9409d1c98d175958331d34a-1425642748807  Fri 6 Mar 11:52:28 GMT 2015   X                  5
    488052dc7c095c74bf8992ec51a66298db04b765-1425642166675  Fri 6 Mar 11:42:46 GMT 2015  XXX         X       6

    bbb-record —debug

    E, [2015-03-06T11:48:20.335578 #4548] ERROR -- : Sanity check failed on 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675

    cat /var/log/bigbluebutton/archive-488052dc7c095c74bf8992ec51a66298db04b765-1425642166675.log

    # Logfile created on 2015-03-06 11:48:19 +0000 by logger.rb/31641
    I, [2015-03-06T11:48:19.320704 #4550]  INFO -- : Archiving events for 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675.
    W, [2015-03-06T11:48:19.851280 #4550]  WARN -- : Failed to archive events for 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675. Permission denied - /var/bigbluebutton/recording/raw/488052dc7c095c74bf8992ec51a66298db04b765-1425642166675/events.xml
    I, [2015-03-06T11:48:19.851428 #4550]  INFO -- : Fetching the recording marks for 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675.
    I, [2015-03-06T11:48:19.851501 #4550]  INFO -- : Getting record status events
    W, [2015-03-06T11:48:19.851585 #4550]  WARN -- : Failed to fetch the recording marks for 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675. Permission denied - /var/bigbluebutton/recording/raw/488052dc7c095c74bf8992ec51a66298db04b765-1425642166675/events.xml
    I, [2015-03-06T11:48:19.851645 #4550]  INFO -- : Archiving audio /var/freeswitch/meetings/488052dc7c095c74bf8992ec51a66298db04b765-1425642166675*.wav.
    W, [2015-03-06T11:48:19.851920 #4550]  WARN -- : Failed to archive audio for 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675. Permission denied - /var/bigbluebutton/recording/raw/488052dc7c095c74bf8992ec51a66298db04b765-1425642166675/audio
    I, [2015-03-06T11:48:19.851981 #4550]  INFO -- : Archiving presentation for 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675.
    W, [2015-03-06T11:48:19.852257 #4550]  WARN -- : Failed to archive presentations for 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675. Permission denied - /var/bigbluebutton/recording/raw/488052dc7c095c74bf8992ec51a66298db04b765-1425642166675/presentation
    I, [2015-03-06T11:48:19.852322 #4550]  INFO -- : Archiving deskshare for 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675.
    W, [2015-03-06T11:48:19.852561 #4550]  WARN -- : Failed to archive deskshare for 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675. Permission denied - /var/bigbluebutton/recording/raw/488052dc7c095c74bf8992ec51a66298db04b765-1425642166675/deskshare
    I, [2015-03-06T11:48:19.852620 #4550]  INFO -- : Archiving video for 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675.
    W, [2015-03-06T11:48:19.852834 #4550]  WARN -- : Failed to archive video for 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675. Permission denied - /var/bigbluebutton/recording/raw/488052dc7c095c74bf8992ec51a66298db04b765-1425642166675/video

    all folder under /var/bigbluebutton/ have same rights (drwxrwxrwx tomcat7 tomcat7)

    ls -l /var/bigbluebutton/

    total 40
    drwxr-xr-x 3 tomcat7 tomcat7 4096 Mar  6 11:42 488052dc7c095c74bf8992ec51a66298db04b765-1425642166675
    drwxr-xr-x 3 tomcat7 tomcat7 4096 Mar  6 11:52 57d9849193299cebe9409d1c98d175958331d34a-1425642748807
    drwxrwxrwx 2 tomcat7 tomcat7 4096 Mar  3 15:52 blank
    drwxrwxrwx 2 tomcat7 tomcat7 4096 Feb 17 17:17 configs
    drwxrwxrwx 2 tomcat7 tomcat7 4096 Mar  3 15:57 deskshare
    drwxrwxrwx 2 tomcat7 tomcat7 4096 Mar  3 15:57 meetings
    drwxrwxrwx 3 tomcat7 tomcat7 4096 Mar  3 15:52 playback
    drwxrwxrwx 3 tomcat7 tomcat7 4096 Mar  3 15:57 published
    drwxrwxrwx 6 tomcat7 tomcat7 4096 Mar  3 15:57 recording
    drwxrwxrwx 2 tomcat7 tomcat7 4096 Mar  3 15:57 unpublished

  • How to expose new API methods in the HTTP Reporting API – Introducing the Piwik Platform

    26 février 2015, par Thomas Steur — Development

    This is the next post of our blog series where we introduce the capabilities of the Piwik platform (our previous post was How to write UI tests for your plugin). This time you’ll learn how to extend our Reporting API. For this tutorial you will need to have basic knowledge of PHP.

    What is Piwik’s Reporting API ?

    It allows third party applications to access analytics data and manipulate miscellaneous data (such as users or websites) through HTTP requests.

    What is it good for ?

    The Reporting API is used by the Piwik UI to render reports, to manage users, and more. If you want to add a feature to the Piwik UI, you might have to expose a method in the API to access this data. As the API is called via HTTP it allows you to fetch or manipulate any Piwik related data from anywhere. In these exposed API methods you can do pretty much anything you want, for example :

    • Enhance existing reports with additional data
    • Filter existing reports based on custom rules
    • Access the database and generate custom reports
    • Persist and read any data
    • Request server information

    Getting started

    In this series of posts, we assume that you have already set up your development environment. If not, visit the Piwik Developer Zone where you’ll find the tutorial Setting up Piwik.

    To summarize the things you have to do to get setup :

    • Install Piwik (for instance via git).
    • Activate the developer mode : ./console development:enable.
    • Generate a plugin : ./console generate:plugin --name="MyApiPlugin". There should now be a folder plugins/MyApiPlugin.
    • And activate the created plugin : ./console plugin:activate "MyApiPlugin"

    Let’s start creating an API

    We start by using the Piwik Console to create a new API :

    ./console generate:api

    The command will ask you to enter the name of the plugin the created API should belong to. I will simply use the above chosen plugin name “MyApiPlugin”. There should now be a file plugins/MyApiPlugin/API.php which contains already an example to get you started easily :

    1. class API extends \Piwik\Plugin\API
    2. {
    3.     public function getAnswerToLife($truth = true)
    4.     {
    5.         if ($truth) {
    6.             return 42;
    7.         }
    8.  
    9.         return 24;
    10.     }
    11.  
    12.     public function getExampleReport($idSite, $period, $date, $wonderful = false)
    13.     {
    14.         $table = DataTable::makeFromSimpleArray(array(
    15.             array('label' =&gt; 'My Label 1', 'nb_visits' =&gt; '1'),
    16.             array('label' =&gt; 'My Label 2', 'nb_visits' =&gt; '5'),
    17.         ));
    18.  
    19.         return $table;
    20.     }
    21. }

    Télécharger

    Any public method in that file will be available via the Reporting API. For example the method getAnswerToLife can be called via this URL : index.php?module=API&amp;method=MyApiPlugin.getAnswerToLife. The URL parameter method is a combination of your plugin name and the method name within this class.

    Passing parameters to your method

    Both example methods define some parameters. To pass any value to a parameter of your method simply specify them by name in the URL. For example ...&amp;method=MyApiPlugin.getExampleReport&amp;idSite=1&amp;period=week&amp;date=today&amp;wonderful=1 to pass values to the parameters of the method getExampleReport.

    Returning a value

    In an API method you can return any boolean, number, string or array value. A resource or an object cannot be returned unless it implements the DataTableInterface such as DataTable (the primary data structure used to store analytics data in Piwik), DataTable\Map (stores a set of DataTables) and DataTable\Simple (a DataTable where every row has two columns : label and value).

    Did you know ? You can choose the response format of your API request by appending a parameter &amp;format=JSON|XML|CSV|... to the URL. Check out the Reporting API Reference for more information.

    Best practices

    Check user permissions

    Do not forget to check whether a user actually has permissions to access data or to perform an action. If you’re not familiar with Piwik’s permissions and how to check them read our User Permission guide.

    Keep API methods small

    At Piwik we aim to write clean code. Therefore, we recommend to keep API methods small (separation of concerns). An API pretty much acts like a Controller :

    1. public function createLdapUser($idSite, $login, $password)
    2. {
    3.     Piwik::checkUserHasAdminAccess($idSite);
    4.     $this-&gt;checkLogin($login);
    5.     $this-&gt;checkPassword($password);
    6.    
    7.     $myModel = new LdapModel();
    8.     $success = $myModel-&gt;createUser($idSite, $login, $password);
    9.    
    10.     return $success;
    11. }

    Télécharger

    This is not only easy to read, it will also allow you to create simple tests for LdapModel (without having to bootstrap the whole Piwik layer) and you will be able to reuse it in other places if needed.

    Calling APIs of other plugins

    For example if you want to fetch an existing report from another plugin, say a list of all Page URLs, do not request this report by calling that method directly :

    \Piwik\Plugins\Actions\API::getInstance()-&gt;getPageUrls($idSite, $period, $date);

    . Instead, issue a new API request :

    $report = \Piwik\API\Request::processRequest('Actions.getPageUrls', array(
       'idSite' =&gt; $idSite,
       'period' =&gt; $period,
       'date'   =&gt; $date,
    ));

    This has several advantages :

    • It avoids a fatal error if the requested plugin is not available on a Piwik installation
    • Other plugins can extend the called API method via events (adding additional report data to a report, doing additional permission checks) but those events will be only triggered when requesting the report as suggested
    • If the method parameters change, your request will most likely still work

    Publishing your Plugin on the Marketplace

    In case you want to share your API with other Piwik users you can do this by pushing your plugin to a public GitHub repository and creating a tag. Easy as that. Read more about how to distribute a plugin and best practices when publishing a plugin.

    Isn’t it easy to create a API ? We never even created a file ! If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.

  • Muxing Android MediaCodec encoded H264 packets into RTMP

    31 décembre 2015, par Vadym

    I am coming from a thread Encoding H.264 from camera with Android MediaCodec. My setup is very similar. However, I attempt to write mux the encoded frames and with javacv and broadcast them via rtmp.

    RtmpClient.java

    ...
    private volatile BlockingQueue mFrameQueue = new LinkedBlockingQueue(MAXIMUM_VIDEO_FRAME_BACKLOG);
    ...
    private void startStream() throws FrameRecorder.Exception, IOException {
       if (TextUtils.isEmpty(mDestination)) {
           throw new IllegalStateException("Cannot start RtmpClient without destination");
       }

       if (mCamera == null) {
           throw new IllegalStateException("Cannot start RtmpClient without camera.");
       }

       Camera.Parameters cameraParams = mCamera.getParameters();

       mRecorder = new FFmpegFrameRecorder(
               mDestination,
               mVideoQuality.resX,
               mVideoQuality.resY,
               (mAudioQuality.channelType.equals(AudioQuality.CHANNEL_TYPE_STEREO) ? 2 : 1));

       mRecorder.setFormat("flv");

       mRecorder.setFrameRate(mVideoQuality.frameRate);
       mRecorder.setVideoBitrate(mVideoQuality.bitRate);
       mRecorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);

       mRecorder.setSampleRate(mAudioQuality.samplingRate);
       mRecorder.setAudioBitrate(mAudioQuality.bitRate);
       mRecorder.setAudioCodec(avcodec.AV_CODEC_ID_AAC);

       mVideoStream = new VideoStream(mRecorder, mVideoQuality, mFrameQueue, mCamera);
       mAudioStream = new AudioStream(mRecorder, mAudioQuality);

       mRecorder.start();

       // Setup a bufferred preview callback
       setupCameraCallback(mCamera, mRtmpClient, DEFAULT_PREVIEW_CALLBACK_BUFFERS,
               mVideoQuality.resX * mVideoQuality.resY * ImageFormat.getBitsPerPixel(
                       cameraParams.getPreviewFormat())/8);

       try {
           mVideoStream.start();
           mAudioStream.start();
       }
       catch(Exception e) {
           e.printStackTrace();
           stopStream();
       }
    }
    ...
    @Override
    public void onPreviewFrame(byte[] data, Camera camera) {
       boolean frameQueued = false;

       if (mRecorder == null || data == null) {
           return;
       }

       frameQueued = mFrameQueue.offer(data);

       // return the buffer to be reused - done in videostream
       //camera.addCallbackBuffer(data);
    }
    ...

    VideoStream.java

    ...
    @Override
    public void run() {
       try {
           mMediaCodec = MediaCodec.createEncoderByType("video/avc");
           MediaFormat mediaFormat = MediaFormat.createVideoFormat("video/avc", mVideoQuality.resX, mVideoQuality.resY);
           mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, mVideoQuality.bitRate);
           mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, mVideoQuality.frameRate);
           mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar);
           mediaFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 1);
           mMediaCodec.configure(mediaFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
           mMediaCodec.start();
       }
       catch(IOException e) {
           e.printStackTrace();
       }

       long startTimestamp = System.currentTimeMillis();
       long frameTimestamp = 0;
       byte[] rawFrame = null;

       try {
           while (!Thread.interrupted()) {
               rawFrame = mFrameQueue.take();

               frameTimestamp = 1000 * (System.currentTimeMillis() - startTimestamp);

               encodeFrame(rawFrame, frameTimestamp);

               // return the buffer to be reused
               mCamera.addCallbackBuffer(rawFrame);
           }
       }
       catch (InterruptedException ignore) {
           // ignore interrup while waiting
       }

       // Clean up video stream allocations
       try {
           mMediaCodec.stop();
           mMediaCodec.release();
           mOutputStream.flush();
           mOutputStream.close();
       } catch (Exception e){
           e.printStackTrace();
       }
    }
    ...
    private void encodeFrame(byte[] input, long timestamp) {
       try {
           ByteBuffer[] inputBuffers = mMediaCodec.getInputBuffers();
           ByteBuffer[] outputBuffers = mMediaCodec.getOutputBuffers();

           int inputBufferIndex = mMediaCodec.dequeueInputBuffer(0);

           if (inputBufferIndex >= 0) {
               ByteBuffer inputBuffer = inputBuffers[inputBufferIndex];
               inputBuffer.clear();
               inputBuffer.put(input);
               mMediaCodec.queueInputBuffer(inputBufferIndex, 0, input.length, timestamp, 0);
           }

           MediaCodec.BufferInfo bufferInfo = new MediaCodec.BufferInfo();

           int outputBufferIndex = mMediaCodec.dequeueOutputBuffer(bufferInfo, 0);

           if (outputBufferIndex >= 0) {
               while (outputBufferIndex >= 0) {
                   ByteBuffer outputBuffer = outputBuffers[outputBufferIndex];

                   // Should this be a direct byte buffer?
                   byte[] outData = new byte[bufferInfo.size - bufferInfo.offset];
                   outputBuffer.get(outData);

                   mFrameRecorder.record(outData, bufferInfo.offset, outData.length, timestamp);

                   mMediaCodec.releaseOutputBuffer(outputBufferIndex, false);
                   outputBufferIndex = mMediaCodec.dequeueOutputBuffer(bufferInfo, 0);
               }
           }
           else if (outputBufferIndex == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {
               outputBuffers = mMediaCodec.getOutputBuffers();
           } else if (outputBufferIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
               // ignore for now
           }
       } catch (Throwable t) {
           t.printStackTrace();
       }

    }
    ...

    FFmpegFrameRecorder.java

    ...
    // Hackish codec copy frame recording function
    public boolean record(byte[] encodedData, int offset, int length, long frameCount) throws Exception {
       int ret;

       if (encodedData == null) {
           return false;
       }

       av_init_packet(video_pkt);

       // this is why i wondered whether I should get outputbuffer data into direct byte buffer
       video_outbuf.put(encodedData, 0, encodedData.length);

       video_pkt.data(video_outbuf);
       video_pkt.size(video_outbuf_size);

       video_pkt.pts(frameCount);
       video_pkt.dts(frameCount);

       video_pkt.stream_index(video_st.index());

       synchronized (oc) {
           /* write the compressed frame in the media file */
           if (interleaved &amp;&amp; audio_st != null) {
               if ((ret = av_interleaved_write_frame(oc, video_pkt)) &lt; 0) {
                   throw new Exception("av_interleaved_write_frame() error " + ret + " while writing interleaved video frame.");
               }
           } else {
               if ((ret = av_write_frame(oc, video_pkt)) &lt; 0) {
                   throw new Exception("av_write_frame() error " + ret + " while writing video frame.");
               }
           }
       }
       return (video_pkt.flags() &amp; AV_PKT_FLAG_KEY) == 1;
    }
    ...

    When I try to stream the video and run ffprobe on it, I get the following output :

    ffprobe version 2.5.3 Copyright (c) 2007-2015 the FFmpeg developers
     built on Jan 19 2015 12:56:57 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-55)
     configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-libass --enable-libdc1394 --enable-libfaac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --enable-libcaca --shlibdir=/usr/lib64 --enable-runtime-cpudetect
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Metadata:
     Server                NGINX RTMP (github.com/arut/nginx-rtmp-module)
     width                 320.00
     height                240.00
     displayWidth          320.00
     displayHeight         240.00
     duration              0.00
     framerate             0.00
     fps                   0.00
     videodatarate         261.00
     videocodecid          7.00
     audiodatarate         62.00
     audiocodecid          10.00
     profile
     level
    [live_flv @ 0x1edb0820] Could not find codec parameters for stream 0 (Video: none, none, 267 kb/s): unknown codec
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, live_flv, from 'rtmp://<server>/input/<stream>':
     Metadata:
       Server          : NGINX RTMP (github.com/arut/nginx-rtmp-module)
       displayWidth    : 320
       displayHeight   : 240
       fps             : 0
       profile         :
       level           :
     Duration: 00:00:00.00, start: 16.768000, bitrate: N/A
       Stream #0:0: Video: none, none, 267 kb/s, 1k tbr, 1k tbn, 1k tbc
       Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp, 63 kb/s
    Unsupported codec with id 0 for input stream 0
    </stream></server>

    I am not, by any means, an expert in H264 or video encoding. I know that the encoded frames that come out from MediaCodec contain SPS NAL, PPS NAL, and frame NAL units. I’ve also written the MediaCodec output into a file and was able to play it back (I did have to specify the format and framerate as otherwise it would play too fast).

    My assumption is that things should work (see how little I know :)). Knowing that SPS and PPS are written out, decoder should know enough. Yet, ffprobe fails to recognize codec, fps, and other video information. Do I need to pass packet flag information to FFmpegFrameRecorder.java:record() function ? Or should I use direct buffer ? Any suggestion will be appreciated ! I should figure things out with a hint.

    PS : I know that some codecs use Planar and other SemiPlanar color formats. That distinction will come later if I get past this. Also, I didn’t go the Surface to MediaCodec way because I need to support API 17 and it requires more changes than this route, which I think helps me understand the more basic flow. Agan, I appreciate any suggestions. Please let me know if something needs to be clarified.

    Update #1

    So having done more testing, I see that my encoder outputs the following frames :

    000000016742800DDA0507E806D0A1350000000168CE06E2
    0000000165B840A6F1E7F0EA24000AE73BEB5F51CC7000233A84240...
    0000000141E2031364E387FD4F9BB3D67F51CC7000279B9F9CFE811...
    0000000141E40304423FFFFF0B7867F89FAFFFFFFFFFFCBE8EF25E6...
    0000000141E602899A3512EF8AEAD1379F0650CC3F905131504F839...
    ...

    The very first frame contains SPS and PPS. From what I was able to see, these are transmitted only once. The rest are NAL types 1 and 5. So, my assumption is that, for ffprobe to see stream info not only when the stream starts, I should capture SPS and PPS frames and re-transmit them myself periodically, after a certain number of frames, or perhaps before every I-frame. What do you think ?

    Update #2

    Unable to validate that I’m writing frames successfully. After having tried to read back the written packet, I cannot validate written bytes. As strange, on successful write of IPL image and streaming, I also cannot print out bytes of encoded packet after avcodec_encode_video2. Hit the official dead end.