Recherche avancée

Médias (0)

Mot : - Tags -/navigation

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

Autres articles (71)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (15332)

  • avio_open() function returns -138

    8 avril 2024, par checkright

    When I use ffmpeg4.4.1 to push rtmp to the desktop, the program returns -138 when running avio_open().I use dshow's screen-capture-recorder on the input side. My purpose is to capture the desktop in real time and use rtmp to push the stream.

    


        avdevice_register_all();
    avformat_network_init();

    AVFormatContext* pFmtCtx_In = nullptr;
    AVFormatContext* pFmtCtx_Out = nullptr;
    AVInputFormat*   pInFmt  = nullptr;
    AVDictionary* options = nullptr;
    int nVideoIndex          = -1;
    int              ret     = 0;

    AVCodecParameters* pCodecParam = nullptr;
    AVCodecContext   * pCodecCtx   = nullptr;
    AVCodec          * pCodec      = nullptr;

    AVFrame* pFrame    = av_frame_alloc();
    AVFrame* pFrameRGB = av_frame_alloc();
    AVPacket* pkt      = nullptr;

    pFrame    = av_frame_alloc();
    pFrameRGB = av_frame_alloc();
    pkt       = nullptr;
    img_convert_ctx = nullptr;

    pFmtCtx_In = avformat_alloc_context();
    if(!pFmtCtx_In)
    {
        qDebug() << "create AVFormatContext failed." ;
        return;
    }

    QString urlString = QString("video=screen-capture-recorder");
    const char* rtmpAddress = "rtmp://192.168.0.136:8554/myapp/test";
    
    if(1){
        pInFmt = const_cast(av_find_input_format("dshow"));
        ret = avformat_open_input(&pFmtCtx_In, urlString.toStdString().c_str(), pInFmt, nullptr);
    }else{
        pInFmt = const_cast(av_find_input_format("gdigrab"));
        av_dict_set(&options, "video_device_index", "1", 0);  
        av_dict_set(&options, "offset_x", "1920", 0);
        av_dict_set(&options, "offset_y", "0", 0);
        av_dict_set(&options, "draw_mouse", "1", 0);
        av_dict_set(&options, "video_size", "1920x1080", 0);
        ret = avformat_open_input(&pFmtCtx_In, "desktop", pInFmt, &options);
    }

    if(!pInFmt)
    {
        qDebug() << "find AVInputFormat failed." ;
        return;
    }

    if(ret < 0)
    {
        qDebug() << "open camera failed."<nb_streams; i++){
        if(pFmtCtx_In->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO){
            nVideoIndex = i;
            continue;
        }
    }

    if(nVideoIndex == -1){
        qDebug() << "cannot find video stream." ;
        return;
    }


    pCodecParam = pFmtCtx_In->streams[nVideoIndex]->codecpar;
    pCodec = avcodec_find_decoder(pCodecParam->codec_id);
    if(!pCodec)
    {
        qDebug() << "cannot find codec." ;
        return;
    }

    ret = avformat_alloc_output_context2(&pFmtCtx_Out, NULL, "flv", rtmpAddress);
    //    ret = avformat_alloc_output_context2(&pFmtCtx_Out, NULL, "rtsp", rtmpAddress);
    if (ret < 0) {
        qDebug() << "cannot avformat_alloc_output_context2." ;
        return ;
    }

    for (int i = 0; i < pFmtCtx_In->nb_streams; i++) {
        AVStream *outStream = avformat_new_stream(pFmtCtx_Out, pFmtCtx_In->streams[i]->codec->codec);
        if (!outStream) {
            qDebug() << "cannot outStream." ;

            return ;
        }

        ret = avcodec_parameters_copy(outStream->codecpar, pFmtCtx_In->streams[i]->codecpar);
        if (ret < 0) {
             qDebug() << "cannot avcodec_parameters_copy." ;
            return ;
        }
        outStream->codec->codec_tag = 0;
    }
  
    av_dump_format(pFmtCtx_Out, 0, rtmpAddress, 1);

    ret = avio_open(&pFmtCtx_Out->pb, rtmpAddress, AVIO_FLAG_WRITE);
    if (ret < 0) {
        qDebug() << "cannot avio_open." <code>

    


    An error occurs here.According to the data, the problem occurs at the input end, and the input end can display the desktop normally. How can I make it run successfully ? How do I need to modify the above code ?

    


  • FFmpeg : avcodec_open2 returns "Permission denied" (-13)

    24 avril 2019, par maxest

    I wanted to open an encoder, H264, C++, Android. This :

    encoderH264 = avcodec_find_encoder(AV_CODEC_ID_H264);

    works. This one :

    codecContext = avcodec_alloc_context3(encoderH264);

    also works. But I get error "Permission denied" (-13) on that :

    avcodec_open2(codecContext, encoderH264, NULL);

    I’d suppose that my FFmpeg lib does support H264 encoding as avcodec_find_encoder returns valid value (when I used some other FFmpeg lib this function returned null).

    Any ideas ?

  • How to Replace Duplicate Frames in a Video with Black Frames using ffmpeg ?

    21 mars 2021, par Yam Shargil

    I'm trying to trim all "no action, no movement" frames out of my screen recording. Some of my screen recordings are really long (like 100 hours long).

    


    I found this :
How to Simply Remove Duplicate Frames from a Video using ffmpeg

    


    ffmpeg -i in.mp4 -vf
"select='if(gt(scene,0.01),st(1,t),lte(t-ld(1),1))',setpts=N/FRAME_RATE/TB"
trimmed.mp4


    


    I don't want to lose any important frames, so for testing the threshold purposes, I want to replace (not remove) all the "no action" frames with black frames.

    


    That's my best shot so far, not my proudest work :

    


    ffmpeg -i in.mp4 -vf "select='if(gt(scene,0.01),st(1,t),lte(t-ld(1),1))',drawbox=color=black:t=fill" out.mp4