Recherche avancée

Médias (0)

Mot : - Tags -/flash

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 ;

  • 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

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

Sur d’autres sites (15604)

  • Issue with image rotation using JavaCV library

    26 février 2015, par intrepidkarthi

    I am writing an Android application which records video for a specified amount of time. Everything works fine if I record using the smartphone’s back camera. The app has a feature to pause/record feature like in Vine app. The issue comes when recording using the device’s front camera. The video surface frame looks fine when storing/playing the video the video is upside down. There is a lot of things discussed about this issue everywhere. But I didn’t find any solution that WORKS.

    Have a look at the code and image mentioned below.

    Here is the original image taken from front camera. I have turned it upside down for a better view.

    enter image description here

    Here is what I actually get after rotation :

    enter image description here

    Method :

        IplImage copy = cvCloneImage(image);
        IplImage rotatedImage = cvCreateImage(cvGetSize(copy), copy.depth(), copy.nChannels());
        //Define Rotational Matrix
        CvMat mapMatrix = cvCreateMat(2, 3, CV_32FC1);

        //Define Mid Point
        CvPoint2D32f centerPoint = new CvPoint2D32f();
        centerPoint.x(copy.width() / 2);
        centerPoint.y(copy.height() / 2);

        //Get Rotational Matrix
        cv2DRotationMatrix(centerPoint, angle, 1.0, mapMatrix);

        //Rotate the Image
        cvWarpAffine(copy, rotatedImage, mapMatrix, CV_INTER_CUBIC + CV_WARP_FILL_OUTLIERS, cvScalarAll(170));
        cvReleaseImage(copy);
        cvReleaseMat(mapMatrix);

    I have tried doing

        double angleTemp = angle;

        angleTemp= ((angleTemp / 90)%4)*90;      
        final int number = (int) Math.abs(angleTemp/90);

        for(int i = 0; i != number; ++i){            
            cvTranspose(rotatedImage, rotatedImage);
            cvFlip(rotatedImage, rotatedImage, 0);          
        }

    Ends up in throwing exception saying that source and destination doesn’t match with number of columns and rows.

    Update :

    Video is recorded in this way.

    IplImage newImage = null;
    if(cameraSelection == CameraInfo.CAMERA_FACING_FRONT){
       newImage = videoRecorder.rotate(yuvIplImage, 180);
       videoRecorder.record(newImage);
    }
    else
       videoRecorder.record(yuvIplImage);  

    Rotation is done in this way :

       IplImage img = IplImage.create(image.height(), image.width(),
               image.depth(), image.nChannels());

       for (int i = 0; i < 180; i++) {
           cvTranspose(image, img);
           cvFlip(img, img, 0);
       }

    Can anyone point out what is wrong here if you have experienced this before ?

  • How to record/trim/combine audio seamlessly in a React/Node web app

    16 mai 2021, par Rayhan Memon

    I've developed a digital audio workstation for the browser that you can check out here. Essentially it helps authors narrate their own audiobooks themselves at home.

    


    I'm looking to dramatically improve the speed at which audio files are combined or trimmed.

    


    Right now, the user records some variable amount of audio (a line, paragraph, or entire passage). When the user stops recording, this clip is added to the main audio file for the section using ffmpeg.wasm like so :

    


            if (duration === 0) {
            //concatenate the two files (they should already be written to memory)
            await ffmpeg.run('-i', 'concat:fullAudio.mp3|clip.mp3', '-c', 'copy', 'fullAudio.mp3');

        } else {
            //Set the insert time to wherever the user's cursor is positioned
            let insertTime = duration;
            if (selectedObj) {
                insertTime = selectedObj.endTime;
            }

            //split the audio file into two parts at the point we want to insert the audio
            await ffmpeg.run('-i', 'fullAudio.mp3', '-t', `${insertTime}`, '-c', 'copy', 'part1.mp3', '-ss',  `${insertTime}`, '-codec', 'copy', 'part2.mp3');

            //concatenate the three files
            await ffmpeg.run('-i', 'concat:part1.mp3|clip.mp3', '-acodec', 'copy', 'intermediate.mp3');
            await ffmpeg.run('-i', 'concat:intermediate.mp3|part2.mp3', '-acodec', 'copy', 'fullAudio.mp3');
        }

        //Read the result from memory
        const data = ffmpeg.FS('readFile', 'fullAudio.mp3');

        //Create URL so it can be used in the browser
        const url = URL.createObjectURL(new Blob([data.buffer], { type: 'audio/mp3' }));
        globalDispatch({ type: "setFullAudioURL", payload: url });


    


    After every recorded clip, the user is forced to wait a few seconds for this concatenation process to finish up - and the longer the main file or recorded clip gets, the longer the user has to wait. Looking at other browser-based audio editors such as AudioMass, it clearly seems possible to make a seamless recording and editing experience with zero wait time, but I can't seem to figure out how to do the same within my react app.

    


    Is it possible to seamlessly combine or trim audio data within a React app ? Is FFMPEG the best way to go about it, or are there simpler ways using pure javascript ?

    


  • How to start and stop saving video frames according to a trigger with OpenCV VideoWriter

    11 août 2021, par Jacob nighFor

    I am building an app that records frames from IP camera through RTSP.

    



    My engine is in charge to save a video in mp4 with Opencv VideoWriter working well.
What I am looking for is to create a startRecord and a stopRecord class method that will respectively start and stop recording according to a trigger (it could be an argument that I pass to the thread).
Is anyone know what the best way to do that kind of stuff ?

    



    Here is my class :

    



    from threading import Thread
import cv2
import time
import multiprocessing
import threading
class RTSPVideoWriterObject(object):
    def __init__(self, src=0):
        # Create a VideoCapture object
        self.capture = cv2.VideoCapture(src)

        # Start the thread to read frames from the video stream
        self.thread = Thread(target=self.update, args=())
        self.thread.daemon = True
        self.thread.start()

    def update(self):
        # Read the next frame from the stream in a different thread
        while True:
            if self.capture.isOpened():
                (self.status, self.frame) = self.capture.read()

    def endRecord(self):
        self.capture.release()
        self.output_video.release()
        exit(1)

    def startRecord(self,endRec):

        self.frame_width = int(self.capture.get(3))
        self.frame_height = int(self.capture.get(4))
        self.codec = cv2.VideoWriter_fourcc(*'mp4v')
        self.output_video = cv2.VideoWriter('fileOutput.mp4', self.codec, 30, (self.frame_width, self.frame_height))
        while True:          
            try:
                self.output_video.write(self.frame)
                if endRec:
                    self.endRecord()
            except AttributeError:
                pass




if __name__ == '__main__':

    rtsp_stream_link = 'rtsp://foo:192.5545....'
    video_stream_widget = RTSPVideoWriterObject(rtsp_stream_link)

    stop_threads = False
    t1 = threading.Thread(target = video_stream_widget.startRecord, args =[stop_threads]) 
    t1.start() 
    time.sleep(15)
    stop_threads = True



    



    As you can see in the main I reading frames and store them in a separate thread. Then I am starting to record (record method is with an infinite loop so blocking) and then after 15 sec, I am trying to pass a 'stop_record' argument to stop recording properly.

    



    A part of the code comes from Storing RTSP stream as video file with OpenCV VideoWriter

    



    Is someone have an idea ?
I read a lot that OpenCV can be very tricky for multithreading

    



    N.