Recherche avancée

Médias (1)

Mot : - Tags -/wave

Autres articles (94)

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

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

Sur d’autres sites (7145)

  • FFmpeg : Jpeg file to AVFrame

    24 octobre 2012, par darja

    I need to join several jpg files into video using FFmpeg library. But I have a problem with reading this files. Here is a function which reads image file and makes AVFrame :

    AVFrame* OpenImage(const char* imageFileName)
    {
       AVFormatContext *pFormatCtx;

       if(av_open_input_file(&pFormatCtx, imageFileName, NULL, 0, NULL)!=0)
       {
           printf("Can't open image file '%s'\n", imageFileName);
           return NULL;
       }      

       dump_format(pFormatCtx, 0, imageFileName, false);

       AVCodecContext *pCodecCtx;

       pCodecCtx = pFormatCtx->streams[0]->codec;
       pCodecCtx->width = W_VIDEO;
       pCodecCtx->height = H_VIDEO;
       pCodecCtx->pix_fmt = PIX_FMT_YUV420P;

       // Find the decoder for the video stream
       AVCodec *pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
       if (!pCodec)
       {
           printf("Codec not found\n");
           return NULL;
       }

       // Open codec
       if(avcodec_open(pCodecCtx, pCodec)<0)
       {
           printf("Could not open codec\n");
           return NULL;
       }

       //
       AVFrame *pFrame;

       pFrame = avcodec_alloc_frame();

       if (!pFrame)
       {
           printf("Can't allocate memory for AVFrame\n");
           return NULL;
       }

       int frameFinished;
       int numBytes;

       // Determine required buffer size and allocate buffer
       numBytes = avpicture_get_size(PIX_FMT_YUVJ420P, pCodecCtx->width, pCodecCtx->height);
       uint8_t *buffer = (uint8_t *) av_malloc(numBytes * sizeof(uint8_t));

       avpicture_fill((AVPicture *) pFrame, buffer, PIX_FMT_YUVJ420P, pCodecCtx->width, pCodecCtx->height);

       // Read frame

       AVPacket packet;

       int framesNumber = 0;
       while (av_read_frame(pFormatCtx, &packet) >= 0)
       {
           if(packet.stream_index != 0)
               continue;

           int ret = avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);
           if (ret > 0)
           {
               printf("Frame is decoded, size %d\n", ret);
               pFrame->quality = 4;
               return pFrame;
           }
           else
               printf("Error [%d] while decoding frame: %s\n", ret, strerror(AVERROR(ret)));
       }
    }

    This causes no error but creates only black frame, no image. What is wrong ?

  • Running ffmpeg commands from android ffmpeg syntax error in logcat

    30 septembre 2015, par Chaitanya Chandurkar

    I have successfully compiled ffmpeg for android and have ported it.

    I placed

    1. libffmpeg.so in /system/lib directory
    2. ffmpeg executable in /system/bin and /system/xbin directory (i was not sure where to place it). i directly copied ffmpeg executable from source directory (Not sure whether it’s a correct way)

    Now i am executing commands from android with following code !!

    imports *
    public class LatestActivity extends Activity {

       private Process process;
       String command,text;

       static {
           System.loadLibrary("ffmpeg");
       }

     @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.activity_latest);

             //Execute Command !!  
             try {
                  Execute();
             } catch (IOException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
             } catch (InterruptedException e) {
                  // TODO Auto-generated catch block
                   e.printStackTrace();
             }
        }




    public void Execute() throws IOException, InterruptedException{
           try {
               File dir=new File("/system/bin");
               String[] cmd= {"ffmpeg","-codecs"};

               process=Runtime.getRuntime().exec(cmd,null,dir);
           } catch (IOException e) {
               // TODO Auto-generated catch block
               Log.d("Process IOException starts:",e.getMessage());
               e.printStackTrace();
               Log.d("System Manual exit !!",e.getMessage());
               System.exit(MODE_PRIVATE);
           }

           BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()),16384);

            BufferedReader stdError = new BufferedReader(new InputStreamReader(process.getErrorStream()));

              // read the output from the command
              Log.d("Application output: ","Output if any !");
               while ((text = stdInput.readLine()) != null) {
                   Log.d("Output: ",text); //$NON-NLS-1$
                  }


           text="";
              // read any errors from the attempted command
           Log.d("Application output: ","Errors if any !");  //$NON-NLS-1$
              while ((text = stdError.readLine()) != null) {

                  Log.d("Error: ",text);  //$NON-NLS-1$
              }



              stdInput.close();
              stdError.close();

              process.waitFor();
              process.getOutputStream().close();
              process.getInputStream().close();
              process.getErrorStream().close();
              destroyProcess(process);
              //process.destroy();

       }

       private static void destroyProcess(Process process) {
           try {
               if (process != null) {
                   // use exitValue() to determine if process is still running.
                   process.exitValue();
               }
           } catch (IllegalThreadStateException e) {
               // process is still running, kill it.
               process.destroy();
           }
       }

     }

    And Here is the logcat output :

    09-05 15:29:13.287: D/dalvikvm(2670): No JNI_OnLoad found in /system/lib/libffmpeg.so 0x44e7e910, skipping init
    09-05 15:29:29.117: I/global(2670): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
    09-05 15:29:29.117: D/Application output:(2670): Output if any !
    09-05 15:29:29.117: D/Application output:(2670): Errors if any !
    09-05 15:29:29.127: D/Error:(2670): /system/bin/ffmpeg: 1: Syntax error: "(" unexpected

    m neither getting any errors nor output of command.
    At the end it shows syntax error.
    I want to know what kind of syntax error it is. how to tackle it ?

    m i doing something wrong ?

  • Merge commit ’5ecabd3c54b7c802522dc338838c9a4c2dc42948’

    30 mai 2015, par Michael Niedermayer
    Merge commit ’5ecabd3c54b7c802522dc338838c9a4c2dc42948’
    

    * commit ’5ecabd3c54b7c802522dc338838c9a4c2dc42948’ :
    msrle : Use FFABS to determine the frame size in msrle_decode_pal4

    Conflicts :
    libavcodec/msrledec.c

    See : f7e1367f58263593e6cee3c282f7277d7ee9d553
    Merged-by : Michael Niedermayer <michaelni@gmx.at>