Recherche avancée

Médias (0)

Mot : - Tags -/signalement

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

Autres articles (19)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

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

Sur d’autres sites (4097)

  • Opencv Java VideoCapture image corruption, possibly frame rate driven

    30 septembre 2019, par A. Scientist

    I’m having difficulty with OpenCV java cleanly capturing an image from a video stream from a video capture card. So far none of the other advice around here has helped me (I’ve spent a whole day looking through it). Each time it returns a corrupt or blank image so I suspect frame rate issues, although I am able to use ffmpeg to capture an image of it cleanly (for project reasons I strongly prefer to this in Java). Both ffmpeg and opencv report they are capturing at 30 fps and using the YUYV format through v4l2.
    My code :

    Mat frame = new Mat();
    VideoCapture camera = new VideoCapture(0);
    int fcc = VideoWriter.fourcc('Y', 'U', 'Y', 'V');
    System.out.println(camera.get(Videoio.CAP_PROP_FPS)+
    " "+camera.get(Videoio.CAP_PROP_FOURCC)+" "+fcc);
    wait_for(10000);//wrapper for TimeUnit.MILLISECONDS.sleep()
    while (!camera.isOpened()){//this part never runs
       wait_for(50);
       if(c++>500){
           break;
       }
    }
    while (true) {
           if (camera.read(frame)) {
               if(Core.sumElems(nframe).val[0]>Math.pow(10, 4)){
                   Imgcodecs.imwrite("/home/anon/testimg.jpg", frame);
                   break;
               }
           }
    }

    Example picture of my USB drive

  • How to ensure that ffmpeg libraries uses/ not uses GPU

    31 mai 2021, par zimopisec

    My library ( Linux, Debian) uses FFMpeg libraries ( avformat, avcodec, swscale etc) for reading video stream from network cameras. Actually, I need to capture each video frame from network camera, decode it, scale and store in memory- and other thread pass this data to calling program for display.

    


    Problem is, that all works in CPU and take a huge amount of CPU resource. How can I enforce usage of GPU accelerator for processing ?

    


    I have video card : VGA compatible controller : Intel Corporation HD Graphics 620 (rev 02)

    


    My decode thread look like this ( I omit declarations, error handling etc, so pls don't look for grammar mistakes :)))

    


    fmt = avformat_alloc_context(); 
//initialising, setting option by av_dict_set
// finding video stream index
***
 // finding decoder and allocate its contexts

    frame = av_frame_alloc();

    while ( av_read_frame(ctx->fmt, &pkt) >= 0) 
    {
        AVPacket orig_pkt = pkt;

         avcodec_send_packet(ctx->dec_ctx, pkt);
         avcodec_receive_frame(ctx->dec_ctx, frame);
            *** 
// get buffer allocated for store of frame data
             buff = get_free_buffer(ctx);
        sws_scale(ctx->sws, (const uint8_t * const*)frame->data, 
        frame->linesize, 0, ctx->dec_ctx->height, buff->data,
        buff->linesize);
            ret = decode_packet(ctx, frame, &pkt, &got_frame);
            if (ret < 0)
                break;
            pkt.data += ret;
            pkt.size -= ret;
        }
        while (pkt.size > 0);

        av_packet_unref(&orig_pkt);
    }
*****  


    


  • JavaCV FFMpegRecorder streams video not displayed properly

    20 août 2015, par Mo Adel

    I have been in loop for 5 days trying to implement JavaCV with FFmpegRecorder, Having figured out that i have to use OpenCvFrameConverter to conert IplImage to frame, I finally managed to see some video over the stream. but now the problem seems to be that the audio works perfect and clearly, but video is not displayed properly.

    enter image description here

    Beside that there is a massive delay on the stream, well over 40sec, when i thought RTMP had 2-4sec delay,

    Here is some code :

    FFmpegFrameRecorder Initialization

    recorder = new FFmpegFrameRecorder(ffmpeg_link, screenWidth, screenHeight, 1);
       recorder.setFormat("flv");
       recorder.setSampleRate(44100);
       recorder.setAudioCodec(avcodec.AV_CODEC_ID_AAC);
       recorder.setVideoCodec(avcodec.AV_CODEC_ID_FLV1);// AV_CODEC_ID_FLV1
       recorder.setVideoOption("preset", "ultrafast");
       recorder.setFrameRate(30);

    And here is my SurfaceChanged and PreviewFrame Methods

    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {

           Camera.Parameters camParams = mCamera.getParameters();
           List sizes = camParams.getSupportedPreviewSizes();        

           android.hardware.Camera.Size z = getOptimalPreviewSize(sizes, screenWidth, screenHeight);
           int imageWidth = z.width;
           int imageHeight = z.height;
           camParams.setPreviewSize(imageWidth, imageHeight);
           mCamera.setParameters(camParams);

           for(int[] arr : camParams.getSupportedPreviewFpsRange()){
               Log.e(LOG_TAG, "Supported range: " + arr[0] + " - " + arr[1]);
           }

           Camera.Parameters framerateAttempts = mCamera.getParameters();
           camParams.setPreviewFrameRate(frameRate);
           Log.v(LOG_TAG,"Preview Framerate: " + camParams.getPreviewFrameRate());
           Display display = ((WindowManager)getSystemService(WINDOW_SERVICE)).getDefaultDisplay();

           if(display.getRotation() == Surface.ROTATION_0)
           {
               mCamera.setDisplayOrientation(90);
           }

           if(display.getRotation() == Surface.ROTATION_90)
           {
           }

           if(display.getRotation() == Surface.ROTATION_180)
           {
           }

           if(display.getRotation() == Surface.ROTATION_270)
           {
               mCamera.setDisplayOrientation(180);
           }
           camParams.setFocusMode(Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
           mCamera.setParameters(framerateAttempts);

           startPreview();
       }

    @Override
       public void onPreviewFrame(byte[] data, Camera camera) {
           /* get video data */
           if (yuvIplimage != null && recording) {
               yuvIplimage.getByteBuffer().put(data);

               Log.v(LOG_TAG,"Writing Frame");
               try {
                   long t = 1000 * (System.currentTimeMillis() - startTime);
                   if (t > recorder.getTimestamp()) {
                       recorder.setTimestamp(t);
                   }

                   OpenCVFrameConverter.ToIplImage converterToMat = new OpenCVFrameConverter.ToIplImage();
                   Frame f = converterToMat.convert(yuvIplimage);
                   recorder.record(f);
               } catch (FFmpegFrameRecorder.Exception e) {
                   Log.v(LOG_TAG,e.getMessage());
                   e.printStackTrace();
               }
           }
       }