Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

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

Autres articles (112)

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

  • 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 (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

Sur d’autres sites (28450)

  • FFMPEG generated h264/aac mp4 video first frame doesn't report a zero mediaTime using requestVideoFrameCallback html api [closed]

    12 mai 2023, par Daniel Robinson

    I have noticed that mp4 files generated using ffmpeg aren’t reporting a mediaTime of 0 via requestVideoFrameCallback for the first frame however files encoded as webm or via another encoder such as mainconcept its 0.

    


    You can see a demo of the issue here https://randomstuffdr.s3.eu-west-1.amazonaws.com/TEST-v3.HTML
As you increment the frames with video 1 you don’t see video progress until the third button press.

    


    With video 2-4, the mediaTime is 0 and a single press of the button increments the video by one frame.

    


    Browser : Chrome 113.0.5672.92 (Windows 10)

    


    FFMPEG Version : 6.0-essentials_build-www.gyan.dev or N-109421-g9adf02247c-20221216

    


    There was an interesting note on this page related to mediaTime implementation in chrome https://web.dev/requestvideoframecallback-rvfc/

    


    


    Of special interest in this list is mediaTime. In Chromium's
implementation, we use the audio clock as the time source that backs
video.currentTime, whereas the mediaTime is directly populated by the
presentationTimestamp of the frame. The mediaTime is what you should
use if you want to exactly identify frames in a reproducible way,
including to identify exactly which frames you missed.

    


    


    The led me to compare the PTS files of the video and audio stream between the ffmpeg and MC files using ffprobe however these are all zero for the first frames. The one interesting note, is that ffmpeg file seems to interleave video and audio packets in ffprobe while the mainconcept file has 8 video frames before audio, I have no idea if this is significant.

    


    What I would like to know is if there is any way I can make ffmpeg generate a file in a similar manner to mainconcept ? So far I have tried ; disabling b-frames, use baseline profile and avoid_negative_ts

    


    Video 1 – (Video : H264 /Audio : AAC / Wrapper : MP4 / Transcoder : FFMPEG)
.\ffmpeg.exe -i '720p50 Flash and Beep.mxf' -map 0:0 -map 0:1 -map_metadata -1 -c:v libx264 -crf 28 -b:v 118k -maxrate 118k -bufsize 236k -vf scale="480 :-1" -preset veryfast -c:a aac "..\low-res\720p50FlashandBeep_V_A.mp4"

    


    Video 2 – (Video : H264 /Audio : No Audio / Wrapper : MP4 / Transcoder : FFMPEG)
.\ffmpeg.exe -i '720p50 Flash and Beep.mxf' -map 0:0 -map 0:1 -map_metadata -1 -c:v libx264 -crf 28 -b:v 118k -maxrate 118k -bufsize 236k -vf scale="480 :-1" -preset veryfast -an "..\low-res\720p50FlashandBeep_V.mp4"

    


    Video 3 – (Video : vp8 /Audio : ogg / Wrapper : webm / Transcoder : FFMPEG)
.\ffmpeg.exe -i '720p50 Flash and Beep.mxf' -map 0:0 -map 0:1 -map_metadata -1 -c:v vp8 -crf 28 -b:v 118k -maxrate 118k -bufsize 236k -vf scale="480 :-1" -preset veryfast "..\low-res\720p50FlashandBeep_V_A.webm"

    


    Video 4 – (Video : H264 /Audio : AAC / Wrapper : MP4 / Transcoder : MainConcept)

    


  • ffmpeg leak detection

    24 janvier 2013, par PeterI

    I'm currently doing some conversion work with ffmpeg building with gcc under mSys for the DLLs and some plain C wrapper code which I'm then calling from C#.

    If I use the MS crtdbg.h I'm not now showing any memory leaks (I did have a couple) BUT I'd like to check if I've left behind a leak within the ffmpeg code which I assume is using a gcc libc library.

    For example I was using some AVDictionary objects which I'd forgotten to clearup afterwards, I'm worried there may be some more elsewhere that I've missed.

    Anyone got any advice on how to confirm that I'm not leaking memory in the ffmpeg DLLs ?

  • Memory leak while opening encoders in ffmpeg

    22 janvier 2014, par praks411

    I'm getting memory leaks in avcodec_find_encoder. Although I'm cleaning the resources properly
    still I'm not able to get rid of the leak. By successive commenting the code I found that memory leaks happen only after the call of avcodec_find_encoder(). I've tried my code with different video files and I found that memory leaks blocks are always same. Also if I open only audio or video then I get just one memory leaks block.
    Below is the part of Init and Clean-up code from the application.
    Note that this is just part of code which contains initialization and resource release.

    AVFormatContext *m_informat;
    AVFormatContext *m_outformat;
    AVStream *m_in_vid_strm, *m_out_vid_strm;
    AVStream *m_in_aud_strm, *m_out_aud_strm;


    int VideoClipper::Init(const wxString& filename)
    {
       int ret = 0;
       char errbuf[64];

       av_register_all();
       if ((ret = avformat_open_input( &m_informat, filename.mb_str(), 0, 0)) != 0 )
       {
           av_strerror(ret,errbuf,sizeof(errbuf));
           PRINT_VAL("Not able to Open file;; ", errbuf)
           ret = -1;
           return ret;
       }
       else
       {
           PRINT_MSG("Opened File ")
       }

       if ((ret = avformat_find_stream_info(m_informat, 0))< 0 )
       {

           av_strerror(ret,errbuf,sizeof(errbuf));
           PRINT_VAL("Not Able to find stream info:: ", errbuf)
           ret = -1;
           return ret;
       }
       else
       {
           PRINT_MSG("Got stream Info ")
       }

       for(unsigned int i = 0; inb_streams; i++)
       {
           if(m_informat->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
           {

               PRINT_MSG("Found Video Stream ")
               m_in_vid_strm_idx = i;
               m_in_vid_strm = m_informat->streams[i];
           }

           if(m_informat->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
           {
               PRINT_MSG("Found Audio Stream ")
               m_in_aud_strm_idx = i;
               m_in_aud_strm = m_informat->streams[i];
           }
       }

       AVOutputFormat *outfmt = NULL;
       std::string outfile = std::string(filename) + "clip_out.avi";
       outfmt = av_guess_format(NULL,outfile.c_str(),NULL);

       if(outfmt == NULL)
       {
           ret = -1;
           return ret;
       }
       else
       {
           m_outformat = avformat_alloc_context();
           if(m_outformat)
           {
               m_outformat->oformat = outfmt;
               _snprintf(m_outformat->filename, sizeof(m_outformat->filename), "%s", outfile.c_str());    
           }
           else
           {
               ret = -1;
               return ret;
           }
       }

       AVCodec *out_vid_codec,*out_aud_codec;
       out_vid_codec = out_aud_codec = NULL;

       if(outfmt->video_codec != AV_CODEC_ID_NONE && m_in_vid_strm != NULL)
       {
           out_vid_codec = avcodec_find_encoder(outfmt->video_codec);
           if(NULL == out_vid_codec)
           {
               PRINT_MSG("Could Not Find Vid Encoder")
               ret = -1;
               return ret;
           }
           else
           {
               PRINT_MSG("Found Out Vid Encoder ")
               m_out_vid_strm = avformat_new_stream(m_outformat, out_vid_codec);
               if(NULL == m_out_vid_strm)
               {
                    PRINT_MSG("Failed to Allocate Output Vid Strm ")
                    ret = -1;
                    return ret;
               }
               else
               {
                    PRINT_MSG("Allocated Video Stream ")
                    if(avcodec_copy_context(m_out_vid_strm->codec, m_informat->streams[m_in_vid_strm_idx]->codec) != 0)
                    {
                       PRINT_MSG("Failed to Copy Context ")
                       ret = -1;
                       return ret;
                    }
                  }
               }
         }

       if(outfmt->audio_codec != AV_CODEC_ID_NONE && m_in_aud_strm != NULL)
       {
           out_aud_codec = avcodec_find_encoder(outfmt->audio_codec);
           if(NULL == out_aud_codec)
           {
               PRINT_MSG("Could Not Find Out Aud Encoder ")
               ret = -1;
               return ret;
           }
           else
           {
               PRINT_MSG("Found Out Aud Encoder ")
               m_out_aud_strm = avformat_new_stream(m_outformat, out_aud_codec);
               if(NULL == m_out_aud_strm)
               {
                   PRINT_MSG("Failed to Allocate Out Vid Strm ")
                   ret = -1;
                   return ret;
               }
               else
               {
                   if(avcodec_copy_context(m_out_aud_strm->codec, m_informat->streams[m_in_aud_strm_idx]->codec) != 0)
                   {
                       PRINT_MSG("Failed to Copy Context ")
                       ret = -1;
                       return ret;
                   }
               }
            }
         }

         if (!(outfmt->flags & AVFMT_NOFILE))
         {
           if (avio_open2(&m_outformat->pb, outfile.c_str(), AVIO_FLAG_WRITE,NULL, NULL) < 0)
           {
                   PRINT_VAL("Could Not Open File ", outfile)
                   ret = -1;
                   return ret;
           }
         }
           /* Write the stream header, if any. */
         if (avformat_write_header(m_outformat, NULL) < 0)
         {
               PRINT_VAL("Error Occurred While Writing Header ", outfile)
               ret = -1;
               return ret;
         }
         else
         {
               PRINT_MSG("Written Output header ")
               m_init_done = true;
         }

       return ret;
    }

    Here is the Clean-up part

    void VideoClipper::ReleaseResource(void)
    {
       if(m_in_aud_strm && m_in_aud_strm->codec)
       {
           avcodec_close(m_in_aud_strm->codec);
           PRINT_MSG("Closed Input Audio Codec ")
       }

       if(m_in_vid_strm && m_in_vid_strm->codec)
       {
           avcodec_close(m_in_vid_strm->codec);
           PRINT_MSG("Closed Input Video Codec ")
       }

       if(m_informat)
       {
          avformat_close_input(&m_informat);
           PRINT_MSG("Freed Input Format Contex ")
       }

       if(m_out_aud_strm && m_out_aud_strm->codec)
       {
           avcodec_close(m_out_aud_strm->codec);
           PRINT_MSG("Closed Output Audio Codec ")
       }

       if(m_out_vid_strm && m_out_vid_strm->codec)
       {
           avcodec_close(m_out_vid_strm->codec);
           PRINT_MSG("Closed Output Audio Codec ")
       }

       if(m_outformat)
       {
           avformat_close_input(&m_outformat);
           m_outformat = NULL;
           PRINT_MSG("Closed Output Format ")
       }

    }

    Memory Leaks message

    Detected memory leaks!
    Dumping objects ->
    {13691} normal block at 0x01046A60, 4479 bytes long.
    Data: <                > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
    {13685} normal block at 0x01043FD0, 10831 bytes long.
    Data: <         ?      > CD CD CD CD CD CD CD CD D0 3F 04 01 ED ED ED ED
    Object dump complete.

    I'm using latest version of ffmpeg on Visual Studio 2012.
    Please suggest where I'm missing.

    Thanks
    Pradeep