Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (10)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • ANNEXE : Les extensions, plugins SPIP des canaux

    11 février 2010, par

    Un plugin est un ajout fonctionnel au noyau principal de SPIP. MediaSPIP consiste en un choix délibéré de plugins existant ou pas auparavant dans la communauté SPIP, qui ont pour certains nécessité soit leur création de A à Z, soit des ajouts de fonctionnalités.
    Les extensions que MediaSPIP nécessite pour fonctionner
    Depuis la version 2.1.0, SPIP permet d’ajouter des plugins dans le répertoire extensions/.
    Les "extensions" ne sont ni plus ni moins que des plugins dont la particularité est qu’ils se (...)

Sur d’autres sites (2980)

  • Converting RGB frames to YUV420P using FFmpeg/C++ [duplicate]

    20 mars 2014, par learner

    This question already has an answer here :

    I tried a code based on this tutorial. What this does is it writes first 5 frames of a video into memory in RGB format. I need to convert these RGB frames to YUV420P format so that I can pass them to YUV420P encoder. I tried using the sws_scale but then the resulting frames lose color information and also suffer from scaling issues. Also, looked at various questions but none gives a working solution. I am completely new to FFmpeg library and working on various tutorials to get a grip on it. I hope somebody can suggest a nice solution. Many thanks for your inputs !

    Following is the code :

    #include <ffmpeg></ffmpeg>avcodec.h>
    #include <ffmpeg></ffmpeg>avformat.h>

    #include

    void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame) {
     FILE *pFile;
     char szFilename[32];
     int  y;

     // Open file
     sprintf(szFilename, "frame%d.ppm", iFrame);
     pFile=fopen(szFilename, "wb");
     if(pFile==NULL)
       return;

     // Write header
     fprintf(pFile, "P6\n%d %d\n255\n", width, height);

     // Write pixel data
     for(y=0; ydata[0]+y*pFrame->linesize[0], 1, width*3, pFile);

     // Close file
     fclose(pFile);
    }

    int main(int argc, char *argv[]) {
     AVFormatContext *pFormatCtx;
     int             i, videoStream;
     AVCodecContext  *pCodecCtx;
     AVCodec         *pCodec;
     AVFrame         *pFrame;
     AVFrame         *pFrameRGB;
     AVPacket        packet;
     int             frameFinished;
     int             numBytes;
     uint8_t         *buffer;

     if(argc &lt; 2) {
       printf("Please provide a movie file\n");
       return -1;
     }
     // Register all formats and codecs
     av_register_all();

     // Open video file
     if(av_open_input_file(&amp;pFormatCtx, argv[1], NULL, 0, NULL)!=0)
       return -1; // Couldn&#39;t open file

     // Retrieve stream information
     if(av_find_stream_info(pFormatCtx)&lt;0)
       return -1; // Couldn&#39;t find stream information

     // Dump information about file onto standard error
     dump_format(pFormatCtx, 0, argv[1], 0);

     // Find the first video stream
     videoStream=-1;
     for(i=0; inb_streams; i++)
       if(pFormatCtx->streams[i]->codec->codec_type==CODEC_TYPE_VIDEO) {
         videoStream=i;
         break;
       }
     if(videoStream==-1)
       return -1; // Didn&#39;t find a video stream

     // Get a pointer to the codec context for the video stream
     pCodecCtx=pFormatCtx->streams[videoStream]->codec;

     // Find the decoder for the video stream
     pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
     if(pCodec==NULL) {
       fprintf(stderr, "Unsupported codec!\n");
       return -1; // Codec not found
     }
     // Open codec
     if(avcodec_open(pCodecCtx, pCodec)&lt;0)
       return -1; // Could not open codec

     // Allocate video frame
     pFrame=avcodec_alloc_frame();

     // Allocate an AVFrame structure
     pFrameRGB=avcodec_alloc_frame();
     if(pFrameRGB==NULL)
       return -1;

     // Determine required buffer size and allocate buffer
     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
     // Note that pFrameRGB is an AVFrame, but AVFrame is a superset
     // of AVPicture
     avpicture_fill((AVPicture *)pFrameRGB, buffer, PIX_FMT_RGB24,
            pCodecCtx->width, pCodecCtx->height);

     // Read frames and save first five frames to disk
     i=0;
     while(av_read_frame(pFormatCtx, &amp;packet)>=0) {
       // Is this a packet from the video stream?
       if(packet.stream_index==videoStream) {
         // Decode video frame
         avcodec_decode_video(pCodecCtx, pFrame, &amp;frameFinished,
                  packet.data, packet.size);

         // Did we get a video frame?
         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);

       // Save the frame to disk
       if(++i&lt;=5)
         SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height,
               i);
         }
       }

       // Free the packet that was allocated by av_read_frame
       av_free_packet(&amp;packet);
     }

     // Free the RGB image
     av_free(buffer);
     av_free(pFrameRGB);

     // Free the YUV frame
     av_free(pFrame);

     // Close the codec
     avcodec_close(pCodecCtx);

     // Close the video file
     av_close_input_file(pFormatCtx);

     return 0;
    }
  • JavaCV on Android with ARMv6

    26 février 2014, par xoidberg

    I got problems getting JavaCV (http://code.google.com/p/javacv/) to run on my Samsung Galaxy S5570i device. According to this site http://www.gsmarena.com/samsung_galaxy_pop_plus_s5570i-4544.php this device has an ARMv6 CPU. I tried several deprecated versions of JavaCV that still include builds for ARMv5, because I had problems building it on my own. None of this versions worked on my device. I also tried running this on a virtual device which should simulate ARMv5 as long as I know. I always get exceptions that libraries couldn't be found, e.g. : "Caused by : java.lang.UnsatisfiedLinkError : Cannot load library : reloc_library[1312] : 1306 cannot locate '_ZNK2cv6KDTree14findOrthoRangeERKNS_11_InputArrayES3_RKNS_12_OutputArrayES6_S6_'.
    I know that it is not recommended to use JavaCV on ARMv5 or ARMv6 CPUs, but I want to implement a feature in my app and provide it also for older CPUs, even if it's slower than on newer ones.
    So what could be the problem ? Did I use wrong versions or what versions should I use ?
    Hope to get an answer here.

    Thanks in advance !

    xoidberg

  • Export dynamic metadata using x265

    28 août 2018, par nam

    I am working on ffmpeg and x265 for video encoding. From the release note of x265 :

    HDR10+ supported. Dynamic metadata may be either supplied as a bitstream via the userSEI field of x265_picture, or as a json jile that can be parsed by x265 and inserted into the bitstream ; use —dhdr10-info to specify json file name, and —dhdr10-opt to enable optimization of inserting tone-map information only at IDR frames, or when the tone map information changes.

    But I dont know how to export the dynamic metadata from a video sequence as a userSEI or json file. Hope to get solution from you.