Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (74)

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

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

Sur d’autres sites (10252)

  • Fragment shader does not show any colour when compiled with vs2013

    4 septembre 2019, par 5mayfive

    When compiled with vs2010, the fragment shader works, but when I compiled and run in vs 2013, it’s grey.

    My fragment shader converts the yuv texture into rgb

    Below is my fragment code

       const char *FProgram =
       "uniform sampler2D Ytex;\n"
       "uniform sampler2D Utex;\n"
       "uniform sampler2D Vtex;\n"
       "void main(void) {\n"
       "  vec4 c = vec4((texture2D(Ytex, gl_TexCoord[0]).r - 16./255.) * 1.164);\n"
       "  vec4 U = vec4(texture2D(Utex, gl_TexCoord[0]).r - 128./255.);\n"
       "  vec4 V = vec4(texture2D(Vtex, gl_TexCoord[0]).r - 128./255.);\n"
       "  c += V * vec4(1.596, -0.813, 0, 0);\n"
       "  c += U * vec4(0, -0.392, 2.017, 0);\n"
       "  c.a = 1.0;\n"
       "  gl_FragColor = c;\n"
       "}\n";





    glClearColor(0, 0, 0, 0);

    PHandle = glCreateProgram();
    FSHandle = glCreateShader(GL_FRAGMENT_SHADER);



    glShaderSource(FSHandle, 1, &FProgram, NULL);
    glCompileShader(FSHandle);

    glAttachShader(PHandle, FSHandle);
    glLinkProgram(PHandle);


    glUseProgram(PHandle);
    glDeleteProgram(PHandle);
    glDeleteProgram(FSHandle);

    This is my texture code, I receive linesize and yuv frame data from ffmpeg and make into texture. Everything works fine in VS 2010 computer, but when compiled and run in vs2013 computer, it is grey (black n white), no colour

       /* Select texture unit 1 as the active unit and bind the U texture. */
    glPixelStorei(GL_UNPACK_ROW_LENGTH, linesize1);
    glActiveTexture(GL_TEXTURE1);
    i = glGetUniformLocation(PHandle, "Utex");
    glUniform1i(i, 1);  /* Bind Utex to texture unit 1 */
    glBindTexture(GL_TEXTURE_2D, 1);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width / 2, height / 2, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, frame1);
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);


    /* Select texture unit 2 as the active unit and bind the V texture. */
    glPixelStorei(GL_UNPACK_ROW_LENGTH, linesize2);
    glActiveTexture(GL_TEXTURE2);
    i = glGetUniformLocation(PHandle, "Vtex");
    glUniform1i(i, 2);  /* Bind Vtext to texture unit 2 */
    glBindTexture(GL_TEXTURE_2D, 2);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width / 2, height / 2, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, frame2);
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);


    /* Select texture unit 0 as the active unit and bind the Y texture. */



    glPixelStorei(GL_UNPACK_ROW_LENGTH, linesize0);
    glActiveTexture(GL_TEXTURE0);
    i = glGetUniformLocation(PHandle, "Ytex");
    glUniform1i(i, 0);
    glBindTexture(GL_TEXTURE_2D, 0);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width, height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, frame0);
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);



    glClear(GL_COLOR_BUFFER_BIT);

    /* Draw image (again and again). */

    glBegin(GL_QUADS);
    glTexCoord2i(0, 0);
    glVertex2i(-w / 2, h / 2);
    glTexCoord2i(1, 0);
    glVertex2i(w / 2, h / 2);
    glTexCoord2i(1, 1);
    glVertex2i(w / 2, -h / 2);
    glTexCoord2i(0, 1);
    glVertex2i(-w / 2, -h / 2);
    glEnd();
  • Why there is no AVFrame->data[2] data when decode h264 by ffmpeg use "h264_cuvid"

    27 juillet 2017, par Wu NL

    env : ubuntu 16.04 64 bit ; ffmpeg 3.3.2 build whih cuda cuvid libnpp...
    use ffmpeg cmd : ffmpeg -vsync 0 -c:v h264_cuvid -i test.264 -f rawvideo test.yuv works fine, the generated yuv file is ok.
    BUT When I decode this 264 file by my code use ’h264_cuvid’ decoder, something problem happens, this is my code :

    #include

    #define __STDC_CONSTANT_MACROS

    #ifdef _WIN32
    //Windows
    extern "C"
    {
    #include "libavcodec/avcodec.h"
    };
    #else
    //Linux...
    #ifdef __cplusplus
    extern "C"
    {
    #endif
    #include <libavcodec></libavcodec>avcodec.h>
    #ifdef __cplusplus
    };
    #endif
    #endif


    //test different codec
    #define TEST_H264  1
    #define TEST_HEVC  0

    int main(int argc, char* argv[])
    {
       AVCodec *pCodec;
       AVCodecContext *pCodecCtx= NULL;
       AVCodecParserContext *pCodecParserCtx=NULL;

       FILE *fp_in;
       FILE *fp_out;
       AVFrame *pFrame;

       const int in_buffer_size=4096;
       unsigned char in_buffer[in_buffer_size + FF_INPUT_BUFFER_PADDING_SIZE]= {0};
       unsigned char *cur_ptr;
       int cur_size;
       AVPacket packet;
       int ret, got_picture;


    #if TEST_HEVC
       enum AVCodecID codec_id=AV_CODEC_ID_HEVC;
       char filepath_in[]="bigbuckbunny_480x272.hevc";
    #elif TEST_H264
       AVCodecID codec_id=AV_CODEC_ID_H264;
       char filepath_in[]="2_60_265to264.264";
    #else
       AVCodecID codec_id=AV_CODEC_ID_MPEG2VIDEO;
       char filepath_in[]="bigbuckbunny_480x272.m2v";
    #endif

       char filepath_out[]="mainSend.yuv";
       int first_time=1;


       //av_log_set_level(AV_LOG_DEBUG);

       avcodec_register_all();

    //    pCodec = avcodec_find_decoder(codec_id);
       pCodec = avcodec_find_decoder_by_name("h264_cuvid");
       if (!pCodec)
       {
           printf("Codec not found\n");
           return -1;
       }
       pCodecCtx = avcodec_alloc_context3(pCodec);
       if (!pCodecCtx)
       {
           printf("Could not allocate video codec context\n");
           return -1;
       }

       pCodecParserCtx=av_parser_init(pCodec->id);
       if (!pCodecParserCtx)
       {
           printf("Could not allocate video parser context\n");
           return -1;
       }

       if (avcodec_open2(pCodecCtx, pCodec, NULL) &lt; 0)
       {
           printf("Could not open codec\n");
           return -1;
       }
       //Input File
       fp_in = fopen(filepath_in, "rb");
       if (!fp_in)
       {
           printf("Could not open input stream\n");
           return -1;
       }
       //Output File
       fp_out = fopen(filepath_out, "wb");
       if (!fp_out)
       {
           printf("Could not open output YUV file\n");
           return -1;
       }

       pFrame = av_frame_alloc();
       av_init_packet(&amp;packet);

       while (1)
       {

           cur_size = fread(in_buffer, 1, in_buffer_size, fp_in);
           if (cur_size == 0)
               break;
           cur_ptr=in_buffer;

           while (cur_size>0)
           {

               int len = av_parser_parse2(
                             pCodecParserCtx, pCodecCtx,
                             &amp;packet.data, &amp;packet.size,
                             cur_ptr, cur_size,
                             AV_NOPTS_VALUE, AV_NOPTS_VALUE, AV_NOPTS_VALUE);

               cur_ptr += len;
               cur_size -= len;

               if(packet.size==0)
                   continue;

               //Some Info from AVCodecParserContext
               printf("[Packet]Size:%6d\t",packet.size);
               switch(pCodecParserCtx->pict_type)
               {
               case AV_PICTURE_TYPE_I:
                   printf("Type:I\tNumber:%4d\n",pCodecParserCtx->output_picture_number);
                   break;
               case AV_PICTURE_TYPE_P:
                   printf("Type:P\t");
                   break;
               case AV_PICTURE_TYPE_B:
                   printf("Type:B\t");
                   break;
               default:
                   printf("Type:Other\t");
                   break;
               }
               printf("Number:%4d\n",pCodecParserCtx->output_picture_number);
               AVFrame* myFrame = av_frame_alloc();
               ret = avcodec_decode_video2(pCodecCtx, myFrame, &amp;got_picture, &amp;packet);
               if (ret &lt; 0)
               {
                   printf("Decode Error.\n");
                   return ret;
               }
               if (got_picture)
               {
                   if(first_time)
                   {
                       printf("\nCodec Full Name:%s\n",pCodecCtx->codec->long_name);
                       printf("width:%d\nheight:%d\n\n",pCodecCtx->width,pCodecCtx->height);
                       first_time=0;
                   }
                   //Y, U, V
                   for(int i=0; iheight; i++)
                   {
                       fwrite(myFrame->data[0]+myFrag-g>linesize[0]*i,1,myFrame->width,fp_out);
                   }
                   for(int i=0; iheight/2; i++)
                   {
                       fwrite(myFrame->data[1]+myFrag-g>linesize[1]*i,1,myFrame->width/2,fp_out);
                   }
                   for(int i=0; iheight/2; i++)
                   {
                       fwrite(myFrame->data[2]+myFrag-g>linesize[2]*i,1,myFrame->width/2,fp_out);
                   }
    //                printf("pframe's width height %d %d\t key frame %d\n",myFrame->width,myFrame->height,myFrame->key_frame);
                   printf("Succeed to decode 1 frame!\n");
                   av_frame_free(&amp;myFrame);
               }
           }

       }

       fclose(fp_in);
       fclose(fp_out);


       av_parser_close(pCodecParserCtx);

       av_frame_free(&amp;pFrame);
       avcodec_close(pCodecCtx);
       av_free(pCodecCtx);

       return 0;
    }

    In this demo code, I call h264_cuvid by vcodec_find_decoder_by_name("h264_cuvid");
    BUT the code crash at fwrite(myFrame->data[2]+myFrag-g>linesize[2]*i,1,myFrame->width/2,fp_out);
    So after debug with codeblocks, I found that there is no data in myFrame->data[2] codeblocks watching window

    Any suggestion ? thanks !

  • Can ffprobe return the mime type ?

    12 septembre 2021, par weird guy

    I want to get the mime type (e.g. video/mp4) of a media file using ffprobe. Is that possible or do I need another program for that ?

    &#xA;