Recherche avancée

Médias (29)

Mot : - Tags -/Musique

Autres articles (77)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (6251)

  • javacv FFMPEG decode memory leak ?

    25 mars 2015, par Liquan Nie

    I’m new to JAVACV and I am using FFMPEG to play some video file as follows
    My enviroument is windows 8 with jdk7 and javacv0.10.

               String file_path ="D:\\1.mp4";
                   
                    // regist all format and codec
                    avformat.av_register_all();
                    avcodec.avcodec_register_all();
                   
                    // open file
                    avformat.AVFormatContext avFormatCtx = avformat.avformat_alloc_context();
                    if (avformat.avformat_open_input(avFormatCtx, file_path, null, null) != 0)
                    {
                            System.out.println("cann't open file\r\n");
                            return;
                    }
                    // find stream info
                    if (avformat.avformat_find_stream_info(avFormatCtx, (AVDictionary)null) < 0)
                    {
                            System.out.println("can't find stream info\r\n");
                            return;
                    }

                    int videoIndex = -1;
                    for(int i=0; i< avFormatCtx.nb_streams();i++)
                    {
                            if(avFormatCtx.streams(i).codec().codec_type() == avutil.AVMEDIA_TYPE_VIDEO)
                            {
                                    videoIndex = i;
                            }
                    }
                    // determ codec
                    avcodec.AVCodecContext avCodecCtx = avFormatCtx.streams(videoIndex).codec();
                    avcodec.AVCodec codec = avcodec.avcodec_find_decoder(avCodecCtx.codec_id());
                    if (codec == null)
                    {
                            System.out.println("codec not found");
                            return;
                    }
                    if(avcodec.avcodec_open2(avCodecCtx, codec, (AVDictionary)null) < 0)
                    {
                            System.out.println("cann't open avcodec\r\n");
                    }
                    avutil.AVFrame frame    = avcodec.avcodec_alloc_frame();
                    avutil.AVFrame frameRGB = avcodec.avcodec_alloc_frame();
                    int numByte = avcodec.avpicture_get_size(avutil.AV_PIX_FMT_RGB24, avCodecCtx.width(), avCodecCtx.height());
                    Pointer outBuffer = avutil.av_malloc(numByte);
                   
                    avcodec.avpicture_fill(new AVPicture(frameRGB), outBuffer.asByteBuffer(), avutil.AV_PIX_FMT_RGB24, avCodecCtx.width(), avCodecCtx.height());
                    avformat.av_dump_format(avFormatCtx, 0, file_path, 0);
                    System.out.println(avFormatCtx.duration());
                    SwsContext img_convert_ctx = swscale.sws_getContext(avCodecCtx.width(), avCodecCtx.height(), avCodecCtx.pix_fmt(), avCodecCtx.width(), avCodecCtx.height(), avutil.AV_PIX_FMT_RGB24, swscale.SWS_BICUBIC, null, null, (double[])null);

                    AVPacket pkt = new AVPacket();
                    int y_size = avCodecCtx.width()*avCodecCtx.height();
                    avcodec.av_new_packet(pkt, y_size);
                    opencv_highgui.cvNamedWindow(WINDOW_NAME);
                   
                    IplImage showImage = opencv_core.cvCreateImage(opencv_core.cvSize(avCodecCtx.width(), avCodecCtx.height()), opencv_core.IPL_DEPTH_8U, 3);
                    // read frames loop
                    int frameNumbers = avformat.av_read_frame(avFormatCtx, pkt);
                System.out.println("frame number is "+frameNumbers);
               
                while (avformat.av_read_frame(avFormatCtx, pkt) >= 0)
                    {
                        //System.out.println(pkt.asByteBuffer());
                            if (pkt.stream_index() == videoIndex)
                            {
                                    IntPointer ip = new IntPointer();
                                    int ret = avcodec.avcodec_decode_video2(avCodecCtx, frame, ip, pkt);
                                    if (ret < 0)
                                    {
                                            System.out.println("codec error\r\n");
                                            return;
                                    }
                                   
                                    if (ip.get()!= 0)
                                    {
                                            swscale.sws_scale(img_convert_ctx, frame.data(), frame.linesize(), 0, avCodecCtx.height(), frameRGB.data(), frameRGB.linesize());
                                            showImage.imageData(frameRGB.data(0));
                                           
                                            showImage.widthStep(frameRGB.linesize().get(0));
                                            opencv_highgui.cvShowImage(WINDOW_NAME, showImage);
                                            opencv_highgui.cvWaitKey(25);
                                    }
                            }
                    }
                   
                    showImage.release();
                    opencv_highgui.cvDestroyWindow(WINDOW_NAME);
                    avutil.av_free(frameRGB);
                    avcodec.avcodec_close(avCodecCtx);
                    avformat.avformat_close_input(avFormatCtx);

    but i run into get this error

    # A fatal error has been detected by the Java Runtime Environment:
    #
    #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000767c35ed, pid=11884, tid=3960
    #
    # JRE version: 7.0_13-b20
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (23.7-b01 mixed mode windows-amd64 compressed oops)
    # Problematic frame:
    # C  [avcodec-56.dll+0x4835ed]  avcodec_decode_video2+0xbd
    #
    # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
    #
    # An error report file with more information is saved as:
    # E:\code\android\TestJAVACV\hs_err_pid11884.log
    #
    # If you would like to submit a bug report, please visit:
    #   http://bugreport.sun.com/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\1.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       creation_time   : 1970-01-01 00:00:00
       encoder         : Lavf53.29.100
     Duration: 00:08:30.27, start: 0.000000, bitrate: 160 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x540 [SAR 1:1 DAR 16:9], 28 kb/s, 15 fps, 15 tbr, 15 tbn, 30 tbc (default)
       Metadata:
         creation_time   : 1970-01-01 00:00:00
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
       Metadata:
         creation_time   : 1970-01-01 00:00:00
         handler_name    : SoundHandler

    and in the log file i found that the enden space heap in jvm has been used 98%. but I don’t know where is the issue, since the document of ffmpeg is not that enough, I feel difficult to know more about how to use it well ,any suggestions ??

    Heap
    PSYoungGen      total 23872K, used 20250K [0x00000000e5600000, 0x00000000e70a0000, 0x0000000100000000)
     eden space 20480K, 98% used [0x00000000e5600000,0x00000000e69c69f8,0x00000000e6a00000)
  • Revision 37456 : rha ... c’est vraiment du hack là

    20 avril 2010, par kent1@… — Log

    rha ... c’est vraiment du hack là

  • Nexus One

    19 mars 2010, par Mans — Uncategorized

    I have had a Nexus One for about a week (thanks Google), and naturally I have an opinion or two about it.

    Hardware

    With the front side dominated by a touch-screen and a lone, round button, the Nexus One appearance is similar to that of most contemporary smartphones. The reverse sports a 5 megapixel camera with LED flash, a Google logo, and a smaller HTC logo. Power button, volume control, and headphone and micro-USB sockets are found along the edges. It is with appreciation I note the lack of a front-facing camera ; the silly idea of video calls is finally put to rest.

    Powering up the phone (I’m beginning to question the applicability of that word), I am immediately enamoured with the display. At 800×480 pixels, the AMOLED display is crystal-clear and easily viewable even in bright light. In a darker environment, the display automatically dims. The display does have one quirk in that the subpixel pattern doesn’t actually have a full RGB triplet for each pixel. The close-up photo below shows the pattern seen when displaying a solid white colour.

    Nexus One display close-up

    The result of this is that fine vertical lines, particularly red or blue ones, look a bit jagged. Most of the time this is not much of a problem, and I find it an acceptable compromise for the higher effective resolution it provides.

    Basic interaction

    The Android system is by now familiar, and the Nexus offers no surprises in basic usage. All the usual applications come pre-installed : browser, email, calendar, contacts, maps, and even voice calls. Many of the applications integrate with a Google account, which is nice. Calendar entries, map placemarks, etc. are automatically shared between desktop and mobile. Gone is the need for the bug-ridden custom synchronisation software with which mobile phones of the past were plagued.

    Launching applications is mostly speedy, and recently used apps are kept loaded as long as memory needs allow. Although this garbage-collection-style of application management, where you are never quite sure whether an app is still running, takes a few moments of acclimatisation, it works reasonably well in day to day use. Most of the applications are well-behaved and save their data before terminating.

    Email

    Two email applications are included out of the box : one generic and one Gmail-only. As I do not use Gmail, I cannot comment on this application. The generic email client supports IMAP, but is rather limited in functionality. Fortunately, a much-enhanced version, K-9, is available for download. The main feature I find lacking here is threaded message view.

    The features, or lack thereof, in the email applications is not, however, of huge importance, as composing email, or any longer piece of text, is something one rather avoids on a system like this. The on-screen keyboard, while falling among the better of its kind, is still slow to use. Lack of tactile feedback means accidentally tapping the wrong key is easily done, and entering numbers or punctuation is an outright chore.

    Browser

    Whatever the Nexus lacks in email abilities, it makes up for with the browser. Surfing the web on a phone has never been this pleasant. Page rendering is quick, and zooming is fast and simple. Even pages not designed for mobile viewing are easy to read with smart reformatting almost entirely eliminating the sideways scrolling which hampered many a mobile browser of old.

    Calls and messaging

    Being a phone, the Nexus One is obviously able to make and receive calls, and it does so with ease. Entering a number or locating a stored contact are both straight-forward operations. During a call, audio is clear and of adequate loudness, although I have yet to use the phone in really noisy surroundings.

    The other traditional task of a mobile phone, messaging, is also well-supported. There isn’t really much to say about this.

    Multimedia

    Having a bit of an interest in most things multimedia, I obviously tested the capabilities of the Nexus by throwing some assorted samples at it, revealing ample space for improvement. With video limited to H.264 and MPEG4, and the only supported audio codecs being AAC, MP3, Vorbis, and AMR, there are many files which will not play.

    To make matters worse, only selected combinations of audio and video will play together. Several video files I tested played without sound, yet when presented with the very same audio data alone, it was correctly decoded. As for container formats, it appears restricted to MP4/MOV, and Ogg (for Vorbis). AVI files are recognised as media files, but I was unable to find an AVI file which would play.

    With a device clearly capable of so much more, the poor multimedia support is nothing short of embarrassing.

    The Market

    Much of the hype surrounding Android revolves around the Market, Google’s virtual marketplace for app authors to sell or give away their creations. The thousands of available applications are broadly categorised, and a search function is available.

    The categorised lists are divided into free and paid sections, while search results, disappointingly, are not. To aid the decision, ratings and comments are displayed alongside the summary and screenshots of each application. Overall, the process of finding and installing an application is mostly painless. While it could certainly be improved, it could also have been much worse.

    The applications themselves are, as hinted above, beyond numerous. Sadly, quality does not quite match up to quantity. The vast majority of the apps are pointless, though occasionally mildly amusing, gimmicks of no practical value. The really good ones, and they do exist, are very hard to find unless one knows precisely what to look for.

    Battery

    Packing great performance into a pocket-size device comes with a price in battery life. The battery in the Nexus lasts considerably shorter time than that in my older, less feature-packed Nokia phone. To some extent this is probably a result of me actually using it a lot more, yet the end result is the same : more frequent recharging. I should probably get used to the idea of recharging the phone every other night.

    Verdict

    The Nexus One is a capable hardware platform running an OS with plenty of potential. The applications are still somewhat lacking (or very hard to find), although the basic features work reasonably well. Hopefully future Android updates will see more and better core applications integrated, and I imagine that over time, I will find third-party apps to solve my problems in a way I like. I am not putting this phone on the shelf just yet.