Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (76)

  • Le profil des utilisateurs

    12 avril 2011, par

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

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (7634)

  • avcodec_decode_audio3 of FFmpeg return -1

    10 janvier 2015, par user1325717

    I use FFmpeg on android to decode mp3. I set all decoder enable on configure and make the .so file correctly. Here’s the .sh which add parameter for configure file :

    NDK=~/android-ndk-r5b
    PLATFORM=$NDK/platforms/android-8/arch-arm/
    PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86


    function build_one
    {
    ./configure --target-os=linux \
       --prefix=$PREFIX \
       --enable-cross-compile \
       --extra-libs="-lgcc" \
       --arch=arm \
       --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
       --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
       --nm=$PREBUILT/bin/arm-linux-androideabi-nm \
       --sysroot=$PLATFORM \
       --extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums  -fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS " \
       --disable-shared \
       --enable-static \
       --extra-ldflags="-Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib  -nostdlib -lc -lm -ldl -llog" \
       --enable-demuxer=mov \
       --enable-demuxer=h264 \
       --disable-ffplay \
       --enable-protocol=file \
       --enable-avformat \
       --enable-avcodec \
       --enable-decoder=rawvideo \
       --enable-decoder=mjpeg \
       --enable-decoder=h263 \
       --enable-decoder=mpeg4 \
       --enable-decoder=h264 \
       --enable-decoder=mp3 \
       --enable-decoder=mp3adu \
       --enable-decoder=mp3adufloat \
       --enable-decoder=mp3float \
       --enable-decoder=mp3on4 \
       --enable-decoder=mp3on4float \
       --enable-parser=h264 \
       --disable-network \
       --enable-zlib \
       --disable-avfilter \
       --disable-avdevice \
       $ADDITIONAL_CONFIGURE_FLAG


    make clean
    make  -j4 install

    $PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o

    $PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib  -soname libffmpeg.so -shared -nostdlib  -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog  --warn-once  --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a
    }

    #arm v7vfpv3
    CPU=armv7-a
    OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=$CPU "
    PREFIX=./android/$CPU
    ADDITIONAL_CONFIGURE_FLAG=
    build_one

    I can read file and get info (decode type\ format type), then I follow the FFmpeg’s sample to call avcodec_decode_audio3 to decode audio file, it return -1, decoding failed. Is some body can tell me what is happened, thanks !

    #include
    #include
    #include
    #include <android></android>log.h>
    #include "libavcodec/avcodec.h"
    #include "libavformat/avformat.h"

    #define AUDIO_INBUF_SIZE 20480
    #define AUDIO_REFILL_THRESH 4096
    #define LOG_TAG "FFmpegTest"
    #define LOG_LEVEL 10
    #define LOGI(level, ...) if (level &lt;= LOG_LEVEL) {__android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__);}
    #define LOGE(level, ...) if (level &lt;= LOG_LEVEL) {__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__);}

    char *sourceFileName;
    char *resultFileName;
    AVFormatContext *gFormatCtx;
    int audioStreamIndex;
    AVCodec *gCodec;
    AVCodecContext *gCodecCtx;
    FILE *sourceFile, *resultFile;
    int out_size, len;
    uint8_t *outbuf;
    uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
    AVPacket avpkt;

    JNIEXPORT void JNICALL Java_roman10_ffmpegTest_VideoBrowser_naDecode(JNIEnv *pEnv, jobject pObj, jstring source_file_name, jstring result_file_name)
    {
       LOGI(10, "start decode.");
       /* get source file's name */
       sourceFileName = (char *)(*pEnv)->GetStringUTFChars(pEnv, source_file_name, NULL);
       if (sourceFileName == NULL) {
           LOGE(1, "cannot get the source file name!");
           exit(1);
       }
       LOGI(10, "source file name is %s", sourceFileName);

       avcodec_init();

       av_register_all();

       /* get format somthing of source file to AVFormatContext */
       int lError;
       if ((lError = av_open_input_file(&amp;gFormatCtx, sourceFileName, NULL, 0, NULL)) !=0 ) {
           LOGE(1, "Error open source file: %d", lError);
           exit(1);
       }
       if ((lError = av_find_stream_info(gFormatCtx)) &lt; 0) {
           LOGE(1, "Error find stream information: %d", lError);
           exit(1);
       }
       LOGI(10, "audio format: %s", gFormatCtx->iformat->name);
       LOGI(10, "audio bitrate: %d", gFormatCtx->bit_rate);

       /* ???get audio stream's id and codec of source file??? */
       audioStreamIndex = av_find_best_stream(gFormatCtx, AVMEDIA_TYPE_AUDIO, -1, -1, &amp;gCodec, 0);
       LOGI(10, "audioStreamIndex %d", audioStreamIndex);
       if (audioStreamIndex == AVERROR_STREAM_NOT_FOUND) {
           LOGE(1, "cannot find a audio stream");
           exit(1);
       } else if (audioStreamIndex == AVERROR_DECODER_NOT_FOUND) {
           LOGE(1, "audio stream found, but no decoder is found!");
           exit(1);
       }
       LOGI(10, "audio codec: %s", gCodec->name);

       /* get codec somthing of audio stream to AVCodecContext */
       gCodecCtx = gFormatCtx->streams[audioStreamIndex]->codec;
       if (avcodec_open(gCodecCtx, gCodec) &lt; 0) {
       LOGE(1, "cannot open the audio codec!");
           exit(1);
       }

       /* ???gCodec = avcodec_find_decoder(gCodecCtx->codec_id);
       if (!gCodec) {
       LOGE(1, "codec not found");
           return;
       }

       gCodecCtx= avcodec_alloc_context();

       if (avcodec_open(gCodecCtx, gCodec) &lt; 0) {
       LOGE(1, "could not open codec");
           exit(1);
       }??? */

       outbuf = malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);

       sourceFile = fopen(sourceFileName, "rb");
       if (!sourceFile) {
       LOGE(1, "could not open %s", sourceFileName);
           exit(1);
       }
       /* get result file's name */
       resultFileName = (char *)(*pEnv)->GetStringUTFChars(pEnv, result_file_name, NULL);
       LOGI(10, "result file name is %s", resultFileName);
       resultFile = fopen(resultFileName, "wb");
       if (!resultFile) {
       LOGE(1, "could not create result file");
           av_free(gCodecCtx);
           exit(1);
       }

       av_init_packet(&amp;avpkt);

       avpkt.data = inbuf;
       avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, sourceFile);
       LOGI(10, "avpkt.size: %d", avpkt.size);
       /* decode file */
       while (avpkt.size > 0) {
           out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
           len = avcodec_decode_audio3(gCodecCtx, (short *)outbuf, &amp;out_size, &amp;avpkt);
           if (len &lt; 0) {
               LOGE(1, "Error while decoding: %d", len);
               exit(1);
           }
           if (out_size > 0) {
               fwrite(outbuf, 1, out_size, resultFile);
           }
           avpkt.size -= len;
           avpkt.data += len;
           if (avpkt.size &lt; AUDIO_REFILL_THRESH) {
               memmove(inbuf, avpkt.data, avpkt.size);
               avpkt.data = inbuf;
               len = fread(avpkt.data + avpkt.size, 1,
                           AUDIO_INBUF_SIZE - avpkt.size, sourceFile);
               if (len > 0)
                   avpkt.size += len;
           }
       }

       fclose(resultFile);
       fclose(sourceFile);
       free(outbuf);

       avcodec_close(gCodecCtx);
       av_free(gCodecCtx);

       LOGI(10, "end decode.");
    }
  • Convert PRORES PCM S24LE to H.264 AAC

    23 septembre 2014, par Adam Walker

    I’m a rookie when it comes to media conversions. I’m trying use ffmpeg to convert raw PCM S24LE audio to something usable by Premiere. I also have raw video in the same format. PRORES.

    Here is the code I currently have.

    cd ../ffmpeg/bin
    :again
    if "%~1" == "" goto done
    ffmpeg -f  s24le -i "%~1" -strict experimental -acodec aac ../../2Ready4Premiere/%~n1.mp3
    shift
    goto again
    :done
    pause
    exit
  • stout to textarea from ffmpeg command

    21 septembre 2014, par Brett

    Hi im trying to get the output of a ffmpeg command into a text level here is my code i am posting the lot as im brand new to java and am not sure where ive gone wrong i want to run the command and have the progress bar update and the output to show on a text area.
    any help would appreciated

    package MyPackage;
    import java.util.*;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.logging.Level;
    import java.util.logging.Logger;


    /**
    *
    * @author brett
    */
    public class NumberAdditionUI extends javax.swing.JFrame {
       private static final long serialVersionUID = 1L;

       /**
        * Creates new form NumberAdditionUI
        */
       public NumberAdditionUI() {
           initComponents();
       }

       /**
        * This method is called from within the constructor to initialize the form.
        * WARNING: Do NOT modify this code. The content of this method is always
        * regenerated by the Form Editor.
        */
       @SuppressWarnings("unchecked")
       //
       private void initComponents() {

           db = new javax.swing.JFileChooser();
           jButton1 = new javax.swing.JButton();
           jButton2 = new javax.swing.JButton();
           jTextField1 = new javax.swing.JTextField();
           jButton3 = new javax.swing.JButton();
           jLabel1 = new javax.swing.JLabel();
           jProgressBar1 = new javax.swing.JProgressBar();
           jScrollPane1 = new javax.swing.JScrollPane();
           jTextArea1 = new javax.swing.JTextArea();

           db.setBackground(java.awt.Color.white);
           db.setCurrentDirectory(new java.io.File("C:\\Users\\brett\\Documents\\convert"));
           db.setDialogTitle("grabAFile");

           setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
           setTitle("Smoke Goobies");
           setMaximumSize(getPreferredSize());

           jButton1.setText("Exit");
           jButton1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
           jButton1.addActionListener(new java.awt.event.ActionListener() {
               public void actionPerformed(java.awt.event.ActionEvent evt) {
                   jButton1ActionPerformed(evt);
               }
           });

           jButton2.setText("Browse");
           jButton2.addActionListener(new java.awt.event.ActionListener() {
               public void actionPerformed(java.awt.event.ActionEvent evt) {
                   jButton2ActionPerformed(evt);
               }
           });

           jTextField1.setText("Select A File To Covert");

           jButton3.setText("Run This Puppy");
           jButton3.addActionListener(new java.awt.event.ActionListener() {
               public void actionPerformed(java.awt.event.ActionEvent evt) {
                   jButton3ActionPerformed(evt);
               }
           });

           jLabel1.setFont(new java.awt.Font("Goudy Old Style", 1, 56)); // NOI18N
           jLabel1.setIcon(jLabel1.getIcon());
           jLabel1.setText("   MASHiTuP");

           jProgressBar1.setValue(50);
           jProgressBar1.setBorder(new javax.swing.border.MatteBorder(null));

           jTextArea1.setColumns(20);
           jTextArea1.setRows(5);
           jTextArea1.setAutoscrolls(false);
           jScrollPane1.setViewportView(jTextArea1);

           javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
           getContentPane().setLayout(layout);
           layout.setHorizontalGroup(
               layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
               .addGroup(layout.createSequentialGroup()
                   .addContainerGap()
                   .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                       .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                       .addGroup(layout.createSequentialGroup()
                           .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                               .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 355, javax.swing.GroupLayout.PREFERRED_SIZE)
                               .addGroup(layout.createSequentialGroup()
                                   .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 282, javax.swing.GroupLayout.PREFERRED_SIZE)
                                   .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                   .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))
                               .addGroup(layout.createSequentialGroup()
                                   .addComponent(jButton3)
                                   .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                   .addComponent(jButton1)))
                           .addGap(0, 0, Short.MAX_VALUE))
                       .addComponent(jScrollPane1))
                   .addContainerGap())
           );
           layout.setVerticalGroup(
               layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
               .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                   .addContainerGap()
                   .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                   .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                   .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                       .addComponent(jButton2)
                       .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                   .addGap(34, 34, 34)
                   .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                   .addGap(18, 18, 18)
                   .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                   .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 48, Short.MAX_VALUE)
                   .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                       .addComponent(jButton1)
                       .addComponent(jButton3))
                   .addContainerGap())
           );

           jProgressBar1.getAccessibleContext().setAccessibleName("MYsTATUS");

           pack();
       }//

       private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
           System.exit(0);
       }                                        

       private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
          int returnVal = db.showOpenDialog( this );
          File f = db.getSelectedFile();
           String filename = f.getAbsolutePath();
          jTextField1.setText(filename);

       }                                        

       private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                        
           java.lang.Runtime rt = java.lang.Runtime.getRuntime();
           java.lang.Process proc = null;
           try {
               proc = rt.exec("ipconfig");

               //proc = rt.exec("ffmpeg -i C:\\Users\\brett\\Documents\\MASH_02.avi C:\\Users\\brett\\Documents\\mash09.avi");
           } catch (IOException ex) {
               Logger.getLogger(NumberAdditionUI.class.getName()).log(Level.SEVERE, null, ex);
           }
           BufferedReader stdInput = new BufferedReader(new InputStreamReader(proc.getInputStream()));
           BufferedReader stdError = new BufferedReader(new InputStreamReader(proc.getErrorStream()));

           // read the output from the command
           System.out.println("Here is the standard output of the command:\n");
           String s;
           try {
               while ((s = stdInput.readLine()) != null) {
                   System.out.println(s);

                   jTextArea1.append(s+"\n\n");

               }
           } catch (IOException ex) {
               Logger.getLogger(NumberAdditionUI.class.getName()).log(Level.SEVERE, null, ex);
           }

           // read any errors from the attempted command
           System.out.println("Here is the standard error of the command (if any):\n");
           try {
               while ((s = stdError.readLine()) != null) {
                   System.out.println(s);
               }
           } catch (IOException ex) {
               Logger.getLogger(NumberAdditionUI.class.getName()).log(Level.SEVERE, null, ex);
           }
       }                                        

       /**
        *
        * @param args the command line arguments
        */
       public static void main(String args[])
    {
           /*
            * Set the Nimbus look and feel
            */
           //
           /*
            * If Nimbus (introduced in Java SE 6) is not available, stay with the
            * default look and feel. For details see
            * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
            */
           try {
               for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                   if ("Nimbus".equals(info.getName())) {
                       javax.swing.UIManager.setLookAndFeel(info.getClassName());
                       break;
                   }
               }
           } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
               java.util.logging.Logger.getLogger(NumberAdditionUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
           }
           //

           /*
            * Create and display the form
            */
           java.awt.EventQueue.invokeLater(new Runnable() {

               @Override
               public void run() {
                   new NumberAdditionUI().setVisible(true);
               }
           });
       }
       // Variables declaration - do not modify
       private javax.swing.JFileChooser db;
       private javax.swing.JButton jButton1;
       private javax.swing.JButton jButton2;
       private javax.swing.JButton jButton3;
       private javax.swing.JLabel jLabel1;
       private javax.swing.JProgressBar jProgressBar1;
       private javax.swing.JScrollPane jScrollPane1;
       private javax.swing.JTextArea jTextArea1;
       private javax.swing.JTextField jTextField1;
       // End of variables declaration
    }