Recherche avancée

Médias (0)

Mot : - Tags -/utilisateurs

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

Autres articles (77)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

Sur d’autres sites (9285)

  • avcodec/cdtoons : Correct several end of data checks in cdtoons_render_sprite()

    20 février 2020, par Michael Niedermayer
    avcodec/cdtoons : Correct several end of data checks in cdtoons_render_sprite()
    

    No testcases, found by code review when debuging issue found by oss-fuzz

    Reviewed-by : Paul B Mahol <onemda@gmail.com>
    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavcodec/cdtoons.c
  • What is the correct way to write Frames in ffmpeg

    6 février 2020, par hagor

    I am working on some ffmpeg writer implementation and I can not undrestand what do I do wrong.
    I have a mdf (media digital file) file which I need to convert to avi and I have a software that does it. The test case : Avi file I get from my software and avi file I get from software are identical.
    I can get frames from input mdf file, and can convert them to bmps correctly. So I suppose I do something wrong with ffmpeg.
    I also need to use raw RGB codec in ffmpeg.

    Here is the code I wrote to fill avi files with frames :

    if (hOffLoaderDVR &amp;&amp; m_hDeviceCollection &amp;&amp; device &amp;&amp; hDriveSetDVR &amp;&amp; hFile)
                       {
                           std::string camSuffix = "_cam_";
                           std::string cameraName = hFile->streamByIndex(streamC)->cameraPortName().c_str();
                           std::string fileName = pathToAviDir + hFile->parameters()->name.c_str() + camSuffix + cameraName + std::to_string(streamC).c_str() + ".avi";

                           Offload::Request request;
                           Common::DataTypeHandle cameraParams = hFile->streamByIndex(streamC)->streamView()->dataType();

                           AVFrame* frame = m_ffwriter.alloc_picture(AV_PIX_FMT_BGR24, cameraParams->width(), cameraParams->height());

                           size_t datasize = hFile->streamByIndex(streamC)->streamView()->frameAtIndex(0)->buffer()->size();  // size in bytes

                           RecordingParams params(fileName, cameraParams->width(), cameraParams->height(), 50,
                               AV_PIX_FMT_BGR24, datasize);

                           frame->pkt_size = datasize;
                           m_ffwriter.delayedOpen(params);

                           for (unsigned int frameC = 0; frameC &lt; hFile->streamByIndex(streamC)->streamView()->frameCount(); frameC++)
                           {
                               m_ffwriter.fill_rgb_image(frame, hFile->streamByIndex(streamC)->streamView()->frameAtIndex(frameC)->buffer()->data());
                               m_ffwriter.putImage(frame);
                           }
                           m_ffwriter.close();
                           av_frame_free(&amp;frame);

                       }

    To open the AVI file I use the function ffmpegWriter::delayedOpen :

    bool FfmpegWriter::delayedOpen(const RecordingParams &amp; params) {

       unsigned int w = params.getWidth();
       unsigned int h = params.getHeight();
       unsigned int framerate = params.getFramerate();
       unsigned int datasize = params.getDataSize();
       m_filename = params.getPath();

       unsigned int sample_rate = 0; //default
       unsigned int channels = 0;    //default

       m_delayed = false;
       if (w &lt;= 0 || h &lt;= 0) {
           m_delayed = true;
           return true;
       }
       m_ready = true;

       // auto detect the output format from the name. default is mpeg.
       m_fmt = av_guess_format(nullptr, m_filename.c_str(), nullptr);
       m_fmt->video_codec = AV_CODEC_ID_RAWVIDEO; //can be moved to a parameter if required

       if (!m_fmt) {
           printf("Could not deduce output format from file extension: using MPEG.\n");
           m_fmt = av_guess_format("mpeg", nullptr, nullptr);
       }

       if (!m_fmt) {
           fprintf(stderr, "Could not find suitable output format\n");
           ::exit(1);
       }


       // allocate the output media context
       m_oc = avformat_alloc_context();
       if (!m_oc) {
           fprintf(stderr, "Memory error\n");
           ::exit(1);
       }
       m_oc->oformat = m_fmt;
       m_fmt->flags = AVFMT_NOTIMESTAMPS;


       snprintf(m_oc->filename, sizeof(m_oc->filename), "%s", m_filename.c_str());

       // add the audio and video streams using the default format codecs
       // and initialize the codecs
       m_video_st = nullptr;
       m_audio_st = nullptr;

       if (m_fmt->video_codec != AV_CODEC_ID_NONE) {
           m_video_st = add_video_stream(m_oc, m_fmt->video_codec, w, h, framerate);
       }

       av_dump_format(m_oc, 0, m_filename.c_str(), 1);

       // now that all the parameters are set, we can open
       // video codecs and allocate the necessary encode buffers

       if (m_video_st) {
           open_video(m_oc, m_video_st, datasize);
       }

       // open the output file, if needed
       if (!(m_fmt->flags &amp; AVFMT_NOFILE)) {
           if (avio_open(&amp;m_oc->pb, m_filename.c_str(), AVIO_FLAG_WRITE) &lt; 0) {
               fprintf(stderr, "Could not open '%s'\n", m_filename.c_str());
               ::exit(1);
           }
       }

       // write the stream header, if any
       avformat_write_header(m_oc, NULL);
       return true;
    }

    And to fill images and put them into the AVI I use these functions :

    void FfmpegWriter::fill_rgb_image(AVFrame *pict, void *p)
    {

       memcpy(pict->data[0], p, pict->pkt_size);

    }
    bool FfmpegWriter::putImage(AVFrame * newFrame) {
       if (m_delayed) {
           // savedConfig.put("width",Value((int)image.width()));
          //  savedConfig.put("height",Value((int)image.height()));
       }
       if (!isOk()) {
           return false;
       }

       if (m_video_st) {
           m_video_pts = (double)av_stream_get_end_pts(m_video_st) *m_video_st->time_base.num / m_video_st->time_base.den;
       }
       else {
           m_video_pts = 0.0;
       }

       if (!(m_video_st)) {
           return false;
       }

       // write interleaved video frame
       write_video_frame(m_oc, m_video_st, newFrame);

       return true;
    }

    Do I not open context correctly ? Or where might be the problem ? The problems I can see are that the output AVI has around minute delay in the beginning with no frames changing, and the video channels behave differently(it seems that red and blue dissapeared). Does it make any difference to use other format ? I currently use AV_PIX_FMT_BGR24 which seems to be correct (I can visualize frames from the same pointer correctly).

    Thank you for your help !

  • Correct layout for FFMPEG scripts inside Powershell

    24 juin 2019, par Virgosh

    I’ve found several FFMPEG scripts I want to run on Windows10 using powershell.
    I’m not so skilled so I can’t understand why I receive some errors and what is the correct way I can launch those scripts.

    for example I’ve just grabbed this script

    ffmpeg -i input0 -i input1 -filter_complex \
    "[1:v][0:v]blend=all_expr=if(gt(X\,Y*(W/H))\,A\,B)" output

    and I receive this error as both when I just paste into powershell or making a .bat file containint the code

    At line:1 char:53
    + "[1:v][0:v]blend=all_expr=if(gt(X\,Y*(W/H))\,A\,B)" output.mov
    +                                                     ~~~~~~~~~~
    Unexpected token 'output.mov' in expression or statement.
       + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
       + FullyQualifiedErrorId : UnexpectedToken

    How can I use this script inside powershell ?
    Is there any guide about "formatting" scripts for W10 ?

    best