Recherche avancée

Médias (91)

Autres articles (90)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    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 (...)

Sur d’autres sites (4956)

  • AVCodecContex returns zero for width and height in android

    7 mars 2014, par Whoami

    Not sure what was my mistake in the below code. I m trying with ffmpeg 0.11 and SDL2.0 in android.

    QUESTION :
    Why Width and Height of the CodecContext gives me always zero ?..

    int main(int argc, char *argv[])
    {

       int flags;
       flags = SDL_INIT_VIDEO | SDL_INIT_TIMER;

       if (SDL_Init (flags)) {
           LOGD ("Could not intialize Video for SDL: %s \n", SDL_GetError());
       }
       else
           LOGD (" SUCCESS: SDL_Init ");

       // ffmpeg Register all services..
       ffmpeg_register_all ();


       pFrame = avcodec_alloc_frame ();
       context = avformat_alloc_context();

       err = avformat_open_input (&context, "rtsp:ip:port", NULL, NULL);
       if ( err < 0) {
           __android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "Unable to open rtsp... ");

           return -1;
       }

       for (i = 0; i < context->nb_streams; i++)
       {              
           // Find the Decoder.
           codec = avcodec_find_decoder(context->streams[i]->codec->codec_id);
           if (codec->type  == AVMEDIA_TYPE_VIDEO ) {
               __android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "Found Video Streaming..  ");
               videoStreamIndex = i;

           }
       }

       // Play RTSP
       av_read_play(context);

       // Get Codec Context.
       pCodecCtx = context->streams[videoStreamIndex]->codec;
       if ( pCodecCtx == NULL )
           __android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "CodecCtx is NULL>>> ");
       else
           __android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "CodecCtx is &lt;&lt;<ok>>> ");


       //Find the Decoder.
       pCodec = avcodec_find_decoder (pCodecCtx->codec_id);
       avcodec_open2 (pCodecCtx, pCodec, NULL);


       int w = pCodecCtx->width;  // Why me getting 0 ?
       int h = pCodecCtx->height;

       window = SDL_CreateWindow ("Test ffmpeg",SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, SDL_WINDOW_SHOWN|SDL_WINDOW_ALLOW_HIGHDPI);
       // What this HIGHDPI Means ??

       if ( window != NULL )
       {
           LOGD (" WINDOW CREATED.. , create Renderer ..");
           renderer = SDL_CreateRenderer (window, -1, 0);  
       }
       else
       {
           LOGD (" Invalid SDL Window ");  
       }
    __android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "Width and Height of PCodeccCtx.. %d .. %d " , w, h);
       return 0;
    }
    </ok>
  • FFMPEG screen recording by gdigrab "can't find input device." on Windows 10

    7 juillet 2021, par Mateusz Bugaj

    I need to implement screen recording in my software but I have a problem with getting gdigrab in windows 10. This code return

    &#xA;

    &#xA;

    "can't find input device." (av_find_input_format("gdigrab") return NULL).

    &#xA;

    &#xA;

    If I try to record desktop by ffmpeg.exe using ffmpeg -f gdigrab -i desktop out.avi, the desktop is recording correctly.

    &#xA;

    #define _CRT_SECURE_NO_WARNINGS&#xA;#include &#xA;&#xA;extern "C"&#xA;{&#xA;#include "ffmpeg-x86-4.4/include/libavcodec/avcodec.h" &#xA;#include "ffmpeg-x86-4.4/include/libavformat/avformat.h"&#xA;#include "ffmpeg-x86-4.4/include/libswscale/swscale.h"&#xA;#include "ffmpeg-x86-4.4/include/libavdevice/avdevice.h"&#xA;#include "ffmpeg-x86-4.4/include/libavutil/imgutils.h"&#xA;#include "ffmpeg-x86-4.4/include/libavutil/dict.h"&#xA;#include "SDL2/include/SDL.h"&#xA;}&#xA;&#xA;&#xA;#define OUTPUT_YUV420P 1&#xA;#define OUTPUT_H264 1&#xA;&#xA;int main(int argc, char* argv[])&#xA;{&#xA;    AVFormatContext* pFormatCtx;&#xA;    AVStream* videoStream;&#xA;    AVCodecContext* pCodecCtx;&#xA;    AVCodec* pCodec;&#xA;    AVFrame* pFrame, * pFrameYUV;&#xA;    AVPacket* pPacket;&#xA;    SwsContext* pImgConvertCtx;&#xA;&#xA;    int videoIndex = -1;&#xA;    unsigned int i = 0;&#xA;&#xA;    SDL_Window* screen;&#xA;    SDL_Renderer* sdlRenderer;&#xA;    SDL_Texture* sdlTexture;&#xA;    SDL_Rect sdlRect;&#xA;&#xA;    int screen_w = 0;&#xA;    int screen_h = 0;&#xA;&#xA;    printf("Starting...\n");&#xA;&#xA;&#xA;&#xA;    //AVInputFormat* p = NULL;&#xA;&#xA;    //register device&#xA;    avdevice_register_all();&#xA;    &#xA;    //use gdigrab&#xA;    AVInputFormat* ifmt = av_find_input_format("gdigrab");&#xA;&#xA;    if (!ifmt)&#xA;    {&#xA;        printf("can&#x27;t find input device.\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    AVDictionary* options = NULL;&#xA;    if (avformat_open_input(&amp;pFormatCtx, "desktop", ifmt, &amp;options) != 0)&#xA;    {&#xA;        printf("can&#x27;t open input stream.\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    if (avformat_find_stream_info(pFormatCtx, NULL) &lt; 0)&#xA;    {&#xA;        printf("can&#x27;t find stream information.\n");&#xA;        return -1;&#xA;    }&#xA;

    &#xA;

  • FFMPEG Can't Display The Duration Of a Video

    30 août 2021, par Malkavian

    I'm trying to use ffmpeg to capture frames from a video file, but I can't even get the duration of a video. everytime when I try to access it with pFormatCtx->duration I'm getting 0. I know the pointer initialized and contains the correct duration because if I use av_dump_format(pFormatCtx, 0, videoName, 0); then I actually get the duration data along with other information about the video.&#xA;This is what I get when I use av_dump_format(pFormatCtx, 0, videoName, 0); :

    &#xA;

    Input #0, avi, from &#x27;futurama.avi&#x27;:&#xA;Duration: 00:21:36.28, start: 0.000000, bitrate: 1135 kb/s&#xA;Stream #0.0: Video: mpeg4 (Advanced Simple Profile), yuv420p, 512x384&#xA;[PAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc&#xA;Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s &#xA;

    &#xA;

    I don't understand why av_dump_format can display duration and I can't. I checked the function definition, to display the duration, the function also uses pFormatCtx->duration. It's not just the duration other member variables also don't display the proper data when I call them in main.cpp

    &#xA;

    Here's my code :

    &#xA;

    extern "C" {&#xA;    #include<libavcodec></libavcodec>avcodec.h>&#xA;    #include<libavformat></libavformat>avformat.h>&#xA;    #include<libswscale></libswscale>swscale.h>&#xA;}&#xA;&#xA;int main(int argc, char *argv[]) {&#xA;    AVFormatContext *pFormatCtx = NULL;&#xA;&#xA;    const char videoName[] = "futurama.avi";&#xA;&#xA;    // Register all formats and codecs.&#xA;    av_register_all();&#xA;    cout &lt;&lt; "Opening the video file";&#xA;    // Open video file&#xA;    int ret = avformat_open_input(&amp;pFormatCtx, videoName, NULL, NULL) != 0;&#xA;    if (ret != 0) {&#xA;        cout &lt;&lt; "Couldn&#x27;t open the video file." &lt;&lt; ret ;&#xA;        return -1;&#xA;    }&#xA;    if(avformat_find_stream_info(pFormatCtx, 0) &lt; 0) {&#xA;        cout &lt;&lt; "problem with stream info";&#xA;        return -1;&#xA;    }&#xA;&#xA;    av_dump_format(pFormatCtx, 0, videoName, 0);&#xA;    cout &lt;&lt; pFormatCtx->bit_rate &lt;&lt; endl; // different value each time, not initialized properly.&#xA;    cout &lt;&lt; pFormatCtx->duration &lt;&lt; endl; // 0&#xA;    return 0;&#xA;}&#xA;

    &#xA;

    I don't know if it helps but, I use QtCreator on Ubuntu and linked the libraries statically.

    &#xA;