Recherche avancée

Médias (29)

Mot : - Tags -/Musique

Autres articles (76)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

  • 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

Sur d’autres sites (7909)

  • AVFrame and SDL2 for screen capture

    20 novembre 2017, par ar2015

    In that last question, I realized I cannot use both SDL and SDL2. Definitely I choose SDL2 over its precedent.

    I had written the following code to capture screen and convert it to an AVFrame for video creation :

    AVFrame *frame = av_frame_alloc();
    ...

    SDL_Surface *screen = SDL_SetVideoMode(width,height, 0, 0);
    SDL_Overlay *bmp = SDL_CreateYUVOverlay(width,height, SDL_YV12_OVERLAY, screen);


    if(av_frame_make_writable(frame) < 0)
       exit(1);


    SDL_LockYUVOverlay(bmp);
    memcpy(frame->data[0], bmp->pixels[0], bmp->pitches[0]);
    memcpy(frame->data[1], bmp->pixels[1], bmp->pitches[1]);
    memcpy(frame->data[2], bmp->pixels[2], bmp->pitches[2]);
    SDL_UnlockYUVOverlay(bmp);

    The problem is that SDL2 does not support SDL_Overlay. The alternative methods are good for playing a video not capturing it. How should I modify this code to replace SDL_Overlay and make it suitable for SDL2 ?

  • How can I mux H.264 RTP output into a container using FFMPEG ?

    23 septembre 2013, par Grad

    I am working on the effects of network losses in video transmission. In order to simulate the network losses I use a simple program which drops random RTP packets from the output of H.264 RTP encoding.

    I use Joint Model (JM) 14.2 in order to encode the video. However, I don't use AnnexB format as my output, instead I choose the output as RTP packets. The JM output is generated as RTP packets with RTP headers and payload as a sequence. After that, some of RTP packets are dropped by using a simple program. Then, I decode the output by using also JM and it's error concealment methods. That gives me a YUV file as output. The format of the output is as follows :

        ----------------------------------------------------------------------
        | RTP Header #1 | RTP Payload #1 | RTP Header #2 | RTP Payload #2 |...
        ----------------------------------------------------------------------

    I want to make a subjective test with these bitstreams and it's very inconvenient to crowdsource this subjective test with GBs of video data. So, I want to mux these bitstreams into a container (i.e. AVI) by using FFMPEG. I have tried to decode these bitstreams with FFMPEG and FFPLAY ; however, both of them didn't work. I also tried the following command and it didn't work, either.

       ffmpeg - f h264 -i  -vcodec copy -r 25 out.avi

    Which format or muxer should I use ? Do I need to convert these files to any other format ?

  • set MediaRecorder to record 1 frame every N seconds

    19 août 2022, par The Blind Hawk

    Summary

    


    I have a version of my code already working on Chrome and Edge, but I need some fixes for it to work on Safari.
    
My objective is to record around 25 minutes and download a timelapse version of the recording.
    
final product requirements :

    


    speed: 3fps
length: ~25s

(I need to record one frame every 20 seconds for 25 mins)


    


    this.secondStream settings :

    


    this.secondStream = await navigator.mediaDevices.getUserMedia({
    audio: false,
    video: {width: 430, height: 430, facingMode: "user"}
});


    


    My code for IOS so far :

    


            startIOSVideoRecording: function() {
            console.log("setting up recorder");
            var self = this;
            this.data = [];

            if (MediaRecorder.isTypeSupported('video/mp4')) {
                // IOS does not support webm, so I will be using mp4
                var options = {mimeType: 'video/mp4', videoBitsPerSecond : 1000000};
            } else {
                console.log("ERROR: mp4 is not supported, trying to default to webm");
                var options = {mimeType: 'video/webm'};
            }
            console.log("options settings:");
            console.log(options);

            this.recorder = new MediaRecorder(this.secondStream, options);

            this.recorder.ondataavailable = function(evt) {
                if (evt.data && evt.data.size > 0) {
                    self.data.push(evt.data);
                    console.log('chunk size: ' + evt.data.size);
                }
            }

            this.recorder.onstop = function(evt) {
                console.log('recorder stopping');
                var blob = new Blob(self.data, {type: "video/mp4"});
                self.download(blob, "mp4");
                self.sendMail(videoBlob);
            }

            console.log("finished setup, starting")
            this.recorder.start(1200);

            function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms));}

            async function looper() {
                // I am trying to pick one second every 20 more or less
                await sleep(500);
                self.recorder.pause();
                await sleep(18000);
                self.recorder.resume();
                looper();
            }
            looper();
        },


    


    Issues

    


    Only one call to getUserMedia()

    


    I am already using this.secondstream elsewhere, and I need the settings to stay as they are for the other functionality.
    
On Chrome and Edge, I could just call getUserMedia() again with different settings, and the issue would be solved, but on IOS calling getUserMedia() a second time kills the first stream.
    
The settings that I was planning to use (works for Chrome and Edge) :

    


    navigator.mediaDevices.getUserMedia({
    audio: false,
    video: { 
        width: 360, height: 240, facingMode: "user", 
        frameRate: { min:0, ideal: 0.05, max:0.1 } 
    },
}


    


    The timelapse library I am using does not support mp4 (ffmpeg as alternative ?)

    


    I am forced to use mp4 on IOS apparently, but this does not allow me to use the library I was relying on so I need an alternative.
    
I am thinking of using ffmpeg but cannot find any documentation to make it interact with the blob before the download.
    
I do not want to edit the video after downloading it, but I want to be able to download the already edited version, so no terminal commands.

    


    MediaRecorder pause and resume are not ideal

    


    On Chrome and Edge I would keep one frame every 20 seconds by setting the frameRate to 0.05, but this does not seem to work on IOS for two reasons.
    
First one is related to the first issue of not being able to change the settings of getUserMedia() without destroying the initial stream in the first place.
    
And even after changing the settings, It seems that setting the frame rate below 1 is not supported on IOS. Maybe I wrote something else wrong, but I was not able to open the downloaded file.
    
Therefore I tried relying on pausing and resuming the MediaRecorder, but this brings forth another two issues :
    
I am currently saving 1 second every 20 seconds and not 1 frame every 20 seconds, and I cannot find any workarounds.
    
Pause and Resume take a little bit of time, making the code unreliable, as I sometimes pick 2/20 seconds instead of 1/20, and I have no reliability that the loop is actually running every 20 seconds (might be 18 might be 25).