Recherche avancée

Médias (91)

Autres articles (74)

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

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (12794)

  • How do I correctly convert .avi to .flv with ffmpeg ? [closed]

    25 septembre 2012, par terbooter

    UPDATE
    Shame on me )
    I chacked red5 logs again and found that I placed converted files to wrong place.
    Now all works fine

    I have two red5 apps.

    1. Recorder. It can record live stream and save it to flv file to disk

      private void startRecord(String uid, String name, IConnection connection) {
         // Get a reference to the current broadcast stream.
         ClientBroadcastStream stream = (ClientBroadcastStream) this.getBroadcastStream(
                 connection.getScope(), name);
         try {
             // Save the stream to disk.
             String path = uid + "/" + name;
             stream.saveAs(path, true);

             System.out.println("file..:" + stream.getSaveFilename());

         } catch (Exception e) {
             System.out.println("Error while saving stream: " + name + e);
         }
      }

      private void stopRecord(String name) {
         IConnection conn = Red5.getConnectionLocal();
         System.out.println("Stop recording show for: {}" + conn.getScope().getContextPath());

         ClientBroadcastStream stream = (ClientBroadcastStream) this.getBroadcastStream(conn.getScope(), name);
         // Stop recording.
         if (stream != null) {
             stream.stopRecording();
         }
      }
    2. Second red5 app (Chat) streams recorded flv file to flash client

      public static String serverStreamCreate(String path, String streamName) {

         IServerStream serverStream = StreamUtils.createServerStream(Red5.getConnectionLocal().getScope(), streamName);
         SimplePlayItem item = SimplePlayItem.build(path);

         IPlaylistController controller = new MyPlayListController();

         serverStream.setPlaylistController(controller);
         serverStream.setRepeat(false);
         serverStream.addItem(item);
         serverStream.addItem(item);
         serverStream.start();
         return streamName;
      }

    If I record stream from flash client to flv file with Recorder and after that stream this flv file back to client with Chat, all works fine.

    Now I want to convert avi file to flv and stream it from red5 app to flash client.
    I used ffmpeg

    ffmpeg -i 24.avi -ar 22050 -an -f flv -b 500k -s 320x240 -y 24_c.flv

    But if I stream 24_c.flv from Chat app flash client have no video.
    24_c.flv cant be playd by VLC player and have same code information as flv file created by Recorder red5 app.

    I really dont know where to dig.

  • libavcodec decode AVFrames to FIFO buffer

    6 novembre 2012, par user1175197

    My aim is to decode multiple frames of a video file, accumulate the decoded frames into a FIFO buffer and read them later on. I decode the packet to my AVFRame mFrame :

    avcodec_decode_video2(mCodecContext,mFrame,&frameFinished,&mPacket) ;

    Normally I can just copy the YUV frames from the mFrame->data[n][0] to my FIFO buffer but I am just trying to reduce the memcpy 's as much as possible. So instead of copying mFrame->data[n][0] I just want to store the mFrame (which is much smaller than the frames it points to) in the buffer and when it comes to reading I can just fetch it and reach the data.

    I tried to do this but it did not work. The AVFrames are fetched from the buffer but when you show them on the screen the video is like frozen. You may think that I am using the same mFrame and overwriting it each time I decode a packet but I am not. I am creating a new AVFrame* each time in the decode loop.

    Is this problem related to how avcodec works ? Any ideas ?

    Thanks
    mike

  • ffmpeg get RGB values ?

    13 novembre 2012, par Nav

    I've seen this, this and this but I still can't figure out how to get the RGB values from the tutorial code.

    if(avcodec_open(pCodecCtx, pCodec)<0) {_getch();return -1;}
    pFrame = avcodec_alloc_frame();
    pFrameRGB=avcodec_alloc_frame();
    if(pFrameRGB==NULL)    {_getch();return -1;}
    numBytes=avpicture_get_size(PIX_FMT_RGB24, pCodecCtx->width, pCodecCtx->height);
    buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));
    // Assign appropriate parts of buffer to image planes in pFrameRGB
    avpicture_fill((AVPicture *)pFrameRGB, buffer, PIX_FMT_RGB24, pCodecCtx->width, pCodecCtx->height);

    i=0;
    int framecounter=0;
    while(av_read_frame(pFormatCtx, &packet)>=0)
    {
     if(packet.stream_index==videoStream)
       {
         // Decode video frame
         //int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const AVPacket *avpkt);
         avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);

         if(frameFinished)
         {
            // Convert the image from its native format to RGB
        //img_convert((AVPicture *)pFrameRGB, PIX_FMT_RGB24, (AVPicture*)pFrame, pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height);
            if(++i<=5)  {SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height, i);}
         }
       }
     av_free_packet(&packet);
    }

    Since img_convert wasn't available, I took it from here but it threw an unhandled exception error. Why is the RGB format so tough to understand ? Why assign zero to G and B of RGB, as shown here ?

    How can I get my RGB values as a simple R, G and B which spans between 0 and 255 ? Also, I don't understand the use of x and y, when video width and height are already given. y is an increment of height, but what about x ?

    Can anyone please show me a complete working code of obtaining rgb values from a video or at least explain how data and linesize help in storing RGB info ? The lack of tutorials is appalling and the complexity of the API is surprising, after having worked on Processing videos.