Recherche avancée

Médias (0)

Mot : - Tags -/protocoles

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (79)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • 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 ;

Sur d’autres sites (11646)

  • FFmpeg apply multiple filters (Logo overlay, Brightness change and text overlay)

    4 octobre 2018, par A.Butakidis

    I am trying to add three filters to a png file using ffmpeg in Android (I am using the writing mind lib).

    So far I managed to pull together the cmd :

    -i /storage/emulated/0/videoApp/temp/firstFrameOfMergedVideo.png

    -i /storage/emulated/0/videoApp/temp/logo.png

    -filter_complex

    FIRST FILTER

    [1:v]scale=h=-1:w=100[overlay_scaled],[0:v][overlay_scaled]overlay=eval=init:x=W-100-W*0.1:y=W*0.1,

    SECOND FILTER

    drawtext=fontfile=/system/fonts/Roboto-Regular.ttf:text='xbsg':fontcolor=white:fontsize=60:box=1:boxcolor=0x7FFFD4@0.5:boxborderw=20:x=20:y=h-(text_h*2)-(h*0.1):enable='between(t,0,2)',

    THIRD FILTER

    drawtext=fontfile=/system/fonts/Roboto-Regular.ttf:text='cbeh':fontcolor=white:fontsize=30:box=1:boxcolor=0x7FFFD4@0.5:boxborderw=20:x=20:y=h-text_h-(h*0.1)+25:enable='between(t,0,2)',

    FOURTH FILTER

    eq=contrast=1:brightness=0.26180276:saturation=1:gamma=1:gamma_r=1:gamma_g=1:gamma_b=1:gamma_weight=1
    -c:a
    copy
    /storage/emulated/0/videoApp/temp/frameWithFilters.png

    Right now I am trying to separate the filters using , but I also tried ;

    It throws me back :

    Input #0, png_pipe, from '/storage/emulated/0/videoApp/temp/firstFrameOfMergedVideo.png':
     Duration: N/A, bitrate: N/A
       Stream #0:0: Video: png, rgb24(pc), 1080x1920, 25 tbr, 25 tbn, 25 tbc

    Input #1, png_pipe, from '/storage/emulated/0/videoApp/temp/logo.png':
     Duration: N/A, bitrate: N/A
       Stream #1:0: Video: png, rgba(pc), 528x582, 25 tbr, 25 tbn, 25 tbc

    [NULL @ 0xf265d800] Unable to find a suitable output format for ','
    ,: Invalid argument

    If I apply them individual they work.

    I am new to ffmpeg so any help would be appreciated.

  • Anomalie #4713 : Sites : logo et Titre+Slogan

    5 avril 2021, par b b

    Hop,

    Mais justement concernant les Logos, serait-ce possible d’y appliquer le même traitement qu’aux autres Logos,
    à savoir le chargement par une URL internet ou serveur, ou depuis la médiathèque, en plus du téléchargement classique depuis l’ordinateur...

    Tu veux parler des documents je suppose ? Ça sera peut-être le cas en 3.4, mais le chantier de bascule des logos en documents est en cours, et la version 3.3 est un entre deux sur ce point. J’assigne donc le ticket à SPIP 3.4.

    Concernant l’ajout d’un champ slogan_site aux sites, je doute car aucune balise html ne porte cette info, et on ne syndique pas que des sites en SPIP, amha cette partie de la demande peut-être oubliée.

  • Black screen when playing a video with ffmpeg and SDL on iOS

    1er avril 2012, par patrick

    I'm attempting to create a video player on iOS using ffmpeg and SDL. I'm decoding the video stream and attempting to convert the pixel data into a SDL_Surface and then convert that over to an SDL_Texture and render it on screen. However, all I'm getting is a black screen. I know the video file is good and can be viewed fine from VLC. Any idea what I'm missing here ?

    Initialization code :

       // initialize SDL (Simple DirectMedia Layer) to playback the content
       if( SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) )
       {
           DDLogError(@"Unable to initialize SDL");
           return NO;
       }

       // create window and renderer
       window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
                                 SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS |
                                 SDL_WINDOW_SHOWN);
       if ( window == 0 )
       {
           DDLogError(@"Unable to initialize SDL Window");
       }

       renderer = SDL_CreateRenderer(window, -1, 0);
       if ( !renderer )
       {
           DDLogError(@"Unable to initialize SDL Renderer");
       }

       // Initialize the FFMpeg and register codecs and their respected file formats
       av_register_all();

    Playback code :
    AVFormatContext *formatContext = NULL ;

    DDLogInfo(@"Opening media file at location:%@", filePath);

    const char *filename = [filePath cStringUsingEncoding:NSUTF8StringEncoding];
    // Open media file
    if( avformat_open_input(&formatContext, filename, NULL, NULL) != 0 )
    {
       DDLogWarn(@"Unable to open media file. [File:%@]", filePath);

       NSString *failureReason = NSLocalizedString(@"Unable to open file.", @"Media playback failed, unable to open file.");

       if ( error != NULL )
       {
           *error = [NSError errorWithDomain:MediaPlayerErrorDomain
                                        code:UNABLE_TO_OPEN
                                    userInfo:[NSDictionary dictionaryWithObject:failureReason
                                                                         forKey:NSLocalizedFailureReasonErrorKey]];
       }

       return NO; // Couldn't open file
    }

    // Retrieve stream information
    if( avformat_find_stream_info(formatContext, NULL) <= 0 )
    {
       DDLogWarn(@"Unable to locate stream information for file. [File:%@]", filePath);

       NSString *failureReason = NSLocalizedString(@"Unable to find audio/video stream information.", @"Media playback failed, unable to find stream information.");

       if ( error != NULL )
       {
           *error = [NSError errorWithDomain:MediaPlayerErrorDomain
                                        code:UNABLE_TO_FIND_STREAM
                                    userInfo:[NSDictionary dictionaryWithObject:failureReason
                                                                         forKey:NSLocalizedFailureReasonErrorKey]];
       }

       return NO;  // Missing stream information
    }

    // Find the first video or audio stream
    int videoStream = -1;
    int audioStream = -1;

    DDLogInfo(@"Locating stream information for media file");

    for( int index=0; index<(formatContext->nb_streams); index++)
    {
       if( formatContext->streams[index]->codec->codec_type==AVMEDIA_TYPE_VIDEO )
       {
           DDLogInfo(@"Found video stream");
           videoStream = index;
           break;
       }
       else if( mediaType == AUDIO_FILE &&
               (formatContext->streams[index]->codec->codec_type==AVMEDIA_TYPE_AUDIO) )
       {
           DDLogInfo(@"Found audio stream");
           audioStream = index;
           break;
       }
    }

    if( videoStream == -1 && (audioStream == -1) )
    {
       DDLogWarn(@"Unable to find video or audio stream for file");

       NSString *failureReason = NSLocalizedString(@"Unable to locate audio/video stream.", @"Media playback failed, unable to locate media stream.");

       if ( error != NULL )
       {
           *error = [NSError errorWithDomain:MediaPlayerErrorDomain
                                        code:UNABLE_TO_FIND_STREAM
                                    userInfo:[NSDictionary dictionaryWithObject:failureReason
                                                                         forKey:NSLocalizedFailureReasonErrorKey]];
       }

       return NO; // Didn't find a video or audio stream
    }

    // Get a pointer to the codec context for the video/audio stream
    AVCodecContext *codecContext;

    DDLogInfo(@"Attempting to locate the codec for the media file");

    if ( videoStream > -1 )
    {
       codecContext = formatContext->streams[videoStream]->codec;

    }
    else
    {
       codecContext = formatContext->streams[audioStream]->codec;
    }

    // Now that we have information about the codec that the file is using,
    // we need to actually open the codec to decode the content

    DDLogInfo(@"Attempting to open the codec to playback the media file");

    AVCodec *codec;

    // Find the decoder for the video stream
    codec = avcodec_find_decoder(codecContext->codec_id);
    if( codec == NULL )
    {
       DDLogWarn(@"Unsupported codec! Cannot playback meda file [File:%@]", filePath);

       NSString *failureReason = NSLocalizedString(@"Unsupported file format. Cannot playback media.", @"Media playback failed, unsupported codec.");
       if ( error != NULL )
       {
           *error = [NSError errorWithDomain:MediaPlayerErrorDomain
                                        code:UNSUPPORTED_CODEC
                                    userInfo:[NSDictionary dictionaryWithObject:failureReason
                                                                         forKey:NSLocalizedFailureReasonErrorKey]];
       }

       return NO; // Codec not found
    }

    // Open codec
    if( avcodec_open2(codecContext, codec, NULL) < 0 )
    {
       DDLogWarn(@"Unable to open codec! Cannot playback meda file [File:%@]", filePath);

       NSString *failureReason = NSLocalizedString(@"Unable to open media codec. Cannot playback media.", @"Media playback failed, cannot open codec.");
       if ( error != NULL )
       {
           *error = [NSError errorWithDomain:MediaPlayerErrorDomain
                                        code:UNABLE_TO_LOAD_CODEC
                                    userInfo:[NSDictionary dictionaryWithObject:failureReason
                                                                         forKey:NSLocalizedFailureReasonErrorKey]];
       }

       return NO; // Could not open codec
    }

    // Allocate player frame
    AVFrame *playerFrame=avcodec_alloc_frame();

    // Allocate an AVFrame structure
    AVFrame *RGBframe=avcodec_alloc_frame();
    if( RGBframe==NULL )
    {
       // could not create a frame to convert our video frame
       // to a 16-bit RGB565 frame.

       DDLogWarn(@"Unable to convert video frame. Cannot playback meda file [File:%@]", filePath);

       NSString *failureReason = NSLocalizedString(@"Problems interpreting video frame information.", @"Media playback failed, cannot convert frame.");
       if ( error != NULL )
       {
           *error = [NSError errorWithDomain:MediaPlayerErrorDomain
                                        code:UNABLE_TO_LOAD_FRAME
                                    userInfo:[NSDictionary dictionaryWithObject:failureReason
                                                                         forKey:NSLocalizedFailureReasonErrorKey]];
       }

       return NO; // Could not open codec
    }

    int frameFinished = 0;
    AVPacket packet;

    // Figure out the destination width/height based on the screen size
    int destHeight = codecContext->height;
    int destWidth  = codecContext->width;
    if ( destHeight > SCREEN_HEIGHT || (destWidth > SCREEN_WIDTH) )
    {
       if ( destWidth > SCREEN_WIDTH )
       {
           float percentDiff = ( destWidth - SCREEN_WIDTH ) / (float)destWidth;
           destWidth  = destWidth  - (int)(destWidth * percentDiff );
           destHeight = destHeight - (int)(destHeight * percentDiff );
       }

       if ( destHeight > SCREEN_HEIGHT )
       {
           float percentDiff = (destHeight - SCREEN_HEIGHT ) / (float)destHeight;
           destWidth  = destWidth  - (int)(destWidth * percentDiff );
           destHeight = destHeight - (int)(destHeight * percentDiff );
       }
    }

    SwsContext *swsContext = sws_getContext(codecContext->width, codecContext->height, codecContext->pix_fmt, destWidth, destHeight, PIX_FMT_RGB565, SWS_BICUBIC, NULL, NULL, NULL);

    while( av_read_frame(formatContext, &packet) >= 0 )
    {
       // Is this a packet from the video stream?
       if( packet.stream_index == videoStream )
       {
           // Decode video frame
           avcodec_decode_video2(codecContext, playerFrame, &frameFinished, &packet);

           // Did we get a video frame?
           if( frameFinished != 0 )
           {
               // Convert the content over to RGB565 (16-bit RGB) to playback with SDL

               uint8_t *dst[3];
               int dstStride[3];

               // Set the destination stride
               for (int plane = 0; plane < 3; plane++)
               {
                   dstStride[plane] = codecContext->width*2;
                   dst[plane]= (uint8_t*) malloc(dstStride[plane]*destHeight);
               }

               sws_scale(swsContext, playerFrame->data,
                         playerFrame->linesize, 0,
                         destHeight,
                         dst, dstStride);

               // Create the SDL surface frame that we are going to use to draw our video

               // 16-bit RGB so 2 bytes per pixel (pitch = width*(bytes per pixel))
               int pitch = destWidth*2;
               SDL_Surface *frameSurface = SDL_CreateRGBSurfaceFrom(dst[0], destWidth, destHeight, 16, pitch, 0, 0, 0, 0);

               // Clear the old frame first
               SDL_RenderClear(renderer);

               // Move the frame over to a texture and render it on screen
               SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer, frameSurface);
               SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);

               // Draw the new frame on the screen
               SDL_RenderPresent(renderer);

               SDL_DestroyTexture(texture);
               SDL_FreeSurface(frameSurface);
           }