Recherche avancée

Médias (33)

Mot : - Tags -/creative commons

Autres articles (33)

  • 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

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (6106)

  • How does one correctly avoid the avcodec_alloc_context3 leak from avformat_new_stream ?

    14 avril 2017, par Tom Seddon

    This maddening thread describes the problem I’m having : a memory leak on shutdown due to some stuff allocated when avformat_new_stream is called.

    Here’s the valgrind stack trace from the leak :

    • 1,447 (1,440 direct, 7 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 4
    • at 0x4C2FFC6 : memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    • by 0x4C300D1 : posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    • by 0x690DEFF : av_malloc (mem.c:87)
    • by 0x690E09D : av_mallocz (mem.c:224)
    • by 0x533D28A : init_context_defaults (options.c:128)
    • by 0x533D325 : avcodec_alloc_context3 (options.c:164)
    • by 0x663D09E : avformat_new_stream (utils.c:4384)
    • by 0x4204B6 : main (test_ffmpeg.cpp:918)

    So clearly the problem is that when a AVFormatContext’s stream’s codec context’s priv_data field is somehow not being freed.

    My code frees the AVFormatContext with avformat_free_context. This calls ff_free_stream, which calls free_stream, which frees a few of the stream’s codec context fields itself - but not the priv_data field !

    Compared and contrast with the corresponding code in avcodec_close.

    The suggested solution to the problem from the thread : "close the codec firstly before calling av_format_free_context". Presumably this refers to calling avcodec_free_context ? - but I’m already doing this ! Roughly following the structure in the muxing example, I have an encoder context created by my code, that’s used to track the uncompressed input data. Then there’s another encoder context created internally by avformat_new_stream (as above), which is used internally by FFmpeg. I close the former, because it was opened using avcodec_open2, but I don’t close the latter, because it wasn’t. I am following the maddening thread’s advice, and yet here I am.

    Furthermore, reading between the lines, using avcodec_free_context to free the AVStream’s codec context is no good anyway, because when doing this (a) AVStream’s codec field is deprecated, so this gives a bunch of warnings, and (b) there are no NULL checks in free_stream, so this crashes at runtime.

    What I have done for now is drag in the appropriate bit of code from avcodec_close, and put it in my own code just ahead of the call to avformat_free_context :

    #ifdef __GNUC__
    #pragma GCC diagnostic push
    #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
    #endif
       for(unsigned i=0;inb_streams;++i) {
           AVStream *st=avf_context->streams[i];

           if(st->codec->priv_data&&
              st->codec->codec&&
              st->codec->codec->priv_class)
           {
               av_opt_free(st->codec->priv_data);
           }

           av_freep(&st->codec->priv_data);
       }
    #ifdef __GNUC__
    #pragma GCC diagnostic pop
    #endif

    So that fixes the leak, and it’s clearly (to my eyes) a bug, and I need to file a bug report or something.

    However the corresponding bug report is marked as fixed and closed... along with a link back to the maddening thread, and no further explanation. (This is why it is maddening !) So maybe I’m just using FFmpeg wrongly ?

    Can anybody confirm whether this is actually a bug in FFmpeg or not ?

    If it isn’t a bug, what’s the right sequence of calls to make ?

    (I’m using FFmpeg built locally from commit 03eb0515c12637dbd20c2e3ca8503d7b47cf583a. I had similar-looking problems with the one you get from the Ubuntu 16 package manager, which prompted me to build it myself with symbols and so on.)

  • Process is being paused until I close the program

    27 mai 2017, par user924

    I made a simple program and UI for it.
    It has one button for starting ffmpeg.exe to decode a video :

       button.addActionListener(new ActionListener() {
           @Override
           public void actionPerformed(ActionEvent e) {
               ProcessBuilder pb = new ProcessBuilder("D:\\ffmpeg.exe", "-i", "\"D:\\video\\input.mp4\"", "\"output.mp4\"");
               try {
                   Process p = pb.start();
               } catch (IOException error) {
                   //
               }
           }
       }

    The problem is that after clicking the button ffmpeg starts but it doesn’t do anything (in task manager it doesn’t use cpu - 0%) until I close the program (UI) and then ffmpeg process starts to decode a video (only after closing the program ffmpeg starts using cpu - e.g. 24%)

    It’s not duplicate : older questions proposed by Andy Thomas doesn’t have an answer (solution) for my problem

  • how to add text to the video in android ?

    4 octobre 2024, par Sajad Norouzi

    In my app I record a video and I wanna overlay the url of my company on the right bottom of that video. I record video with MediaRecorder and there is no problem with the recording, but for adding text to the video I haven't been successful. I searched and found some library like FFmpeg and JavaCV which let user overlay a text on the video but I don't know if there is any way for using them in Android. after that found OnPreviewFrame which returns each frame of the camerapreivew. I want to get all frames after user touch record button and draw text using canvas to each frame and then save all those frame together until recording video stops, and videos duration are fix and 15 seconds. Is it a good solution ? if it is, how should I implement OnPreviewFrame function ? I know how to draw canvas but I don't know how to convert data[] to the bitmap.