Recherche avancée

Médias (0)

Mot : - Tags -/navigation

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

Autres articles (80)

  • Submit enhancements and plugins

    13 avril 2011

    If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
    You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone.

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

  • Use FFMPEG to Save Live CCTV Video Streams that Has Wrong FPS Encoded, Published by Video Clips instead of Frames, and With Nonnegligible Frame Loss

    6 mars 2023, par Crear

    I want to use FFMPEG command line to archive live CCTV video stream (no audio) from Newark Citizen Virtual Patrol (https://cvp.newarkpublicsafety.org) for traffic analysis, previously I was using (I'm just a noob in these commands)
os.system('ffmpeg -t 24:00:00 -i '+address+' -hide_banner -c:v copy -s 640x360 -segment_time 00:15:00 -f segment -strftime 1 -reset_timestamps 1 "'+OutPath+camera_location+'_%Y-%m-%d-%H-%M-%S.mp4"') to archive the videos everyday and segment them into 15-min-long videos.

    


    However, there are several issues.

    


      

    1. The FPS read from the video stream is actually slower than it really is. For example, it's actually 12, but the decoded result says 8, so every time it generates a 15-min-long video, it only pasts 10 11 mins in the real world.
    2. 


    3. Due to unstable frame loss, the FPS is not a stable value either. Therefore, when I manually set the FPS, it usually make the video has wrong length, and sometimes when the stream froze, it keeps waiting because it hasn't finished 15-min-long video. Something I noticed is that it may generate a 15-min-long video, which contains both night and day, started from perhaps 2AM but ended at 8AM.
    4. 


    5. The live CCTV video stream is not frame by frame, but video clip by video clip. Therefore, when I set the -use_wallclock_as_timestamps to 1, the video will be ultra-fast playing the short video clip, then frozen for the rest of time until receiving next video clip.
    6. 


    


    The only thing I can think of is to re-distribute the frames evenly between the timestamp of receiving the current video clip and the timestamp of receiving the prior video clip. What parameters can help FFMPEG to fix the FPS and archive correctly ? I am using FFMPEG to save the video instead of using OpenCV to decode the frame and then encode a video because we have huge amounts of cameras and our legacy Xeon processor had trouble encoding so many frames simultaneously.

    


    Any suggestion is appreciated !

    


  • av_free crashes application randomly - FFMPEG C++

    12 mai 2013, par Spamdark

    I am trying to create a simple media-player for an introduction to the world of ffmpeg, the problem is that every time that I call av_freep(void*ptr) the application crashes.

    If I don't call av_freep I get a memory leak and the memory used by the program increases up to 1000MB (Already measured), here is the code :

    int16_t* audioBuffer=(int16_t*)av_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE+FF_INPUT_BUFFER_PADDING_SIZE);

    if(!audioBuffer){
       MessageBox(0,"Error allocating in audioBuffer","Error: Mem",MB_ICONWARNING | MB_OK);
       return -1;
    }

    int sz = MEDIA->DecodeAudioFrame((void*)audioBuffer,0);

    Pa_WriteStream(MEDIA->output_stream,(int16_t*)audioBuffer,MEDIA->_audio_ccontext->frame_size);

    av_freep(audioBuffer);

    Here is my 'DecodeAudioFrame' function code :

    int WbMedia::DecodeAudioFrame(void *audio_buf, int buf_size){
    static AVFrame frame;
    static AVPacket pkt;
    static uint8_t *audio_pkt_data = NULL;
    static int audio_pkt_size = 0;

    int len1=0;

    for(;;){
       bool do_rt = false;


       while(audio_pkt_size > 0){
           int obt_frame = 0;

           len1 = avcodec_decode_audio4(_audio_ccontext,&frame,&obt_frame,&pkt);
           if(len1 < 0){
               audio_pkt_size = 0;
               break;
           }

           audio_pkt_data+=len1;
           audio_pkt_size-=len1;

           if(obt_frame){
               data_size = av_samples_get_buffer_size(frame.linesize,channel_count,sample_fr,_audio_ccontext->sample_fmt,1);
               memcpy(audio_buf,frame.data[0],data_size);
           }

           if(data_size < 0){
               continue;
           }

           if(pkt.data){
               av_free_packet(&pkt);
           }
           return data_size;

       }

       if(pkt.data){
           av_free_packet(&pkt);
       }

       if(do_rt){
           return data_size;
       }

       // Try to get a new packet
       if(!audio_packets.empty()){
           WaitForSingleObject(Queue_Audio_Mutex,INFINITE);
               pkt = audio_packets.front();
               audio_packets.pop();
           ReleaseMutex(Queue_Audio_Mutex);

           audio_pkt_size = pkt.size;
           audio_pkt_data = pkt.data;
       }else{
           return -1;
       }
    }
    return 0;
    }

    I need help with this issue, I don't know if it is a bug or what I need to do. What's happening there ? Why does it crashes on the av_freep call ? How can I fix it ?

    Thanks

  • FFMPEG library usage for own C++ project

    2 août 2017, par Chien-Yu Chan

    I would like to create my own project using FFMPEG to build a player, but creating a new file to include ffmpeg library seems not easy. I have configure the ffmpeg and make build.

    ./configure

    ./make

    The ffmpeg hello world program (myffmpeg.c) :

    #include <libavformat></libavformat>avformat.h>
    int main(int argc, char *argv[]) {
     av_register_all();
     return 0;
    }

    but it shows

    clang : warning : treating ’c’ input as ’c++’ when in C++ mode, this behavior is deprecated

    Undefined symbols for architecture x86_64 :

    "av_register_all()", referenced from :

    _main in myffmpeg-61ec1b.o

    ld : symbol(s) not found for architecture x86_64

    clang : error : linker command failed with exit code 1 (use -v to see invocation

    When I try to link the allformats.o file, which has av_register_all function inside. I got :

    clang : warning : treating ’c’ input as ’c++’ when in C++ mode, this behavior is deprecated
    Undefined symbols for architecture x86_64 :
    "_av_register_input_format", referenced from :
    _register_all in allformats.o
    "_av_register_output_format", referenced from :
    _register_all in allformats.o
    "_avcodec_register_all", referenced from :
    _register_all in allformats.o
    "_ff_a64_muxer", referenced from :
    _register_all in allformats.o

    ...

    "_ff_yuv4mpegpipe_muxer", referenced from :
    _register_all in allformats.o
    ld : symbol(s) not found for architecture x86_64
    clang : error : linker command failed with exit code 1 (use -v to see invocation)

    It should be my bad Makefile knowledge, could anyone give me some hint on how to call ffmpeg library functions ? Or even how to modify the Makefile to build my own program ? Thanks !

    *Update :
    It could be my compiling command problem, is it the way to compile ?

    g++ myffmpeg.c