Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (78)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

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

Sur d’autres sites (13217)

  • Android : FFmpeg taking high memory/cpu usage causing crash

    29 janvier 2019, par dastan

    I compiled ffmpeg for android, enabled mediacodec and jni. its works but when I merge HD video 60fps, its crash the app. this ffmpeg cmd I am using.

    [-y, -benchmark, -ss, 0.0, -t, 11.541, -i, VID_HD.mp4, -filter_complex, [0:v]setpts=PTS-STARTPTS,scale=1080.0:1920.0:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2:color=#000000, -c:v, libx264, -c:a, aac, -ac, 2, -ar, 44100, -preset, ultrafast, -strict, -2, VID_HD.ts]

    Sometimes I get these error for same cmds, but when I rerun, it works and sometimes these, if I rerun 3-4 times its restart the app. maybe because of memory is not cleaning. Help me here.

    Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

    VideoKit:Error: Failed to inject frame into filter network: Out of memory

    VideoKit:Error: Error while processing the decoded data for stream #0:0

    I need help in cleaning FFmpeg also when execution finished and I call my run(FFmpeg cmds) method for next video encoding it restart the app, I am suspecting because of memory usage.

  • Decoding NAL units in ffmpeg using C++

    10 février 2019, par Lucas Zanella

    I have a working code which receives NAL units through RTP using JRTPLIB. It saves the NAL units into a file which I can play through VLC.

    I’m willing to decode these NAL units using ffmpeg. I’ve seen all the threads of stackoverflow about NAL units and ffmpeg, and none of them answers exactly how to do it.

    As I understand, RTP is a protocol that can break a NAL unit into more than one RTP packet. Therefore, the NAL units that I’m receiving aren’t even complete. So I guess I cannot feed them directly into ffmpeg. I need somehow to acumulate them, I guess, and then send them into the right format to ffmpeg.

    Take a look at avcodec_decode_video2 function from ffmpeg library :

    attribute_deprecated int avcodec_decode_video2  (  
       AVCodecContext *    avctx,
       AVFrame *   picture,
       int *   got_picture_ptr,
       const AVPacket *    avpkt
    )  

    Here’s what is said about avpkt :

    avpkt : The input AVPacket containing the input buffer. You can create
    such packet with av_init_packet()

    I guess there’s a way to turn NAL units into AVPackets. I tried to find things related to it in the documentation but couldn’t find anything useful.

    I also read this tutorial : http://dranger.com/ffmpeg/tutorial01.html but it only talks about reading from files, and ffmpeg does some background work in convertind frames into AVPackets, so I learned nothing on that part.

    ps : my code writes the VPS, SPS and PPS information once in the beggining of the file and then only saves NAL units in sequence.

    So : how to decode NAL units with ffmpeg ?

    UPDATE :

    Here’s the code that receives NAL units. I tried to add 0x00000001 at the beggining of each NAL unit.

    const size_t BufSize = 98304;
    uint8_t buf[4 + BufSize];//4 bytes for 0x00000001 at beggining
    uint8_t* paddedBuf = buf + 4;
    /* Adds the delimiters for a h264 bitstream*/
    buf[0] = char(0x00);
    buf[1] = char(0x00);
    buf[2] = char(0x00);
    buf[3] = char(0x01);
    size_t size = 0;
    size_t write_size = 0;

    /* Get SPS, PPS, VPS manually start */
    std::cout << "writing vps" << std::endl;

    Client.SetObtainVpsSpsPpsPeriodly(false);
    if(!Client.GetVPSNalu(paddedBuf, &size)) {
       if(write(fd, paddedBuf, size) < 0) {
           perror("write");
       }
    }
    if(!Client.GetSPSNalu(paddedBuf, &size)) {
       if(write(fd, paddedBuf, size) < 0) {
           perror("write");
       }
    }
    if(!Client.GetPPSNalu(paddedBuf, &size)) {
       if(write(fd, paddedBuf, size) < 0) {
           perror("write");
       }
    }
    /* Get SPS, PPS, VPS manually end */


    while(true) {
       if(!Client.GetMediaData("video", paddedBuf+write_size, &size, BufSize)) {
           if(ByeFromServerFlag) {
               printf("ByeFromServerFlag\n");
               break;
           }
           if(try_times > 5) {
               printf("try_times > 5\n");
               break;
           }
           try_times++;
           continue;
       }
       write_size += size;
       std::cout << "gonna decode frame" << std::endl;

       ffmpegDecoder->decodeFrame(paddedBuf,size);
       std::cout << "decoded frame" << std::endl;

    Now the function decodeFrame which is giving me segmentation fault. However I don’t even know if what I’m doing is ok.

    void  FfmpegDecoder::decodeFrame(uint8_t* frameBuffer, int frameLength)
    {
       if (frameLength <= 0) return;

       int frameFinished = 0;

       AVPacket framePacket;
       av_init_packet(&framePacket);

       framePacket.size = frameLength;
       framePacket.data = frameBuffer;

       std::cout << "gonna decode video2" << std::endl;

       int ret = avcodec_decode_video2(m_pAVCodecContext, m_pAVFrame, &frameFinished, &framePacket); //GIVES SEGMENTATION FAULT HERE

    Here’s a snapshot of this code and the entire project, which can be compiled if you go into /dev and do ./build to build the docker image, then ./run to enter the docker image, then you just do cmake . and make. However you should run the binary outside of docker with ~/orwell$ LD_LIBRARY_PATH=.:./jrtplib/src ./orwell_monitor because inside docker it has a bug.

  • Re-sampling H264 video to reduce frame rate while maintaining high image quality

    4 mars 2019, par BrianTheLion

    Here’s the mplayer output for a video of interest :

    br@carina:/tmp$ mplayer foo.mov
    mplayer: Symbol `ff_codec_bmp_tags' has different size in shared object, consider re-linking
    MPlayer 1.0rc4-4.5.2 (C) 2000-2010 MPlayer Team
    mplayer: could not connect to socket
    mplayer: No such file or directory
    Failed to open LIRC support. You will not be able to use your remote control.

    Playing foo.mov.
    libavformat file format detected.
    [lavf] stream 0: video (h264), -vid 0
    [lavf] stream 1: audio (aac), -aid 0, -alang eng
    VIDEO:  [H264]  1280x720  24bpp  59.940 fps  2494.2 kbps (304.5 kbyte/s)
    ==========================================================================
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
    ==========================================================================
    ==========================================================================
    Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
    AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 15999->176400)
    Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
    ==========================================================================
    AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
    Starting playback...
    Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
    VO: [vdpau] 1280x720 => 1280x720 Planar YV12

    I’d like to use ffmpeg, mencoder, or some other command-line video transcoder to re-sample this video to a lower framerate without loss of image quality. That is, each frame should remain as crisp as possible.

    Attempts

    ffmpeg -i foo.mov -r 25 -vcodec copy bar.mov
    • The target frame rate — 25fps — is achieved but individual frames are "blocky."
    mencoder -nosound -ovc copy foo.mov -ofps 25 -o bar.mov
    • Videos are effectively un-viewable.

    Help !

    This seems like a simple enough use case. I’m very surprised that obvious things are not working. Is there something wrong with my approach ?