Recherche avancée

Médias (91)

Autres articles (98)

  • 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 ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

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

  • Recording audio with MediaRecorder on iPhone with Safari and Chrome only 1 second long ? Mimetype and FFMPEG problem ?

    9 mai 2023, par Avatar

    I am using MediaRecorder to record the Microphone audio on a website.

    


    Javascript :

    


    var blob;
var blob_url;
var stream;
var recorder;
var chunks;

var media = {
    tag: 'audio',
    type: 'audio/ogg',
    ext: '.ogg',
    gUM: {audio: true}
};

navigator.mediaDevices.getUserMedia(media.gUM).then(_stream => 
{
    stream = _stream;

    recorder = new MediaRecorder(stream);

    recorder.ondataavailable = e => 
    {
        // push data to chunks
        chunks.push(e.data);

        // recording has been stopped
        if(recorder.state == 'inactive') 
        {
            // audio data available
            blob = new Blob(chunks, {type: media.type });
            blob_url = URL.createObjectURL(blob);
            
            // send data to server
            uploadfile_audio();
        }
    };

    if(typeof(recorder)=='undefined')
    {
        alert('No microphone access');
        return;
    }

    chunks = [];
    recorder.start();
}


// when stop button is clicked
recorder.stop();
stream.getTracks().forEach( track => track.stop() );


    


    The audio stream (ogg format) is sent to the server.

    


    Since iPad/iPhone do not play ogg files, the recording file is converted to "mp3" using FFMPEG.

    


    This file is stored on the server.

    

    


    This works on Windows and MAC (Chrome and Safari), also on iPad (Safari) but not properly on iPhone (Chrome/Safari). Version : iPhone iOS 15.1.

    


    On iPhone the recording file is only 0:01 min in length. Size is always 17277 Bytes.

    


    What could be the issue ? (I cannot debug because I don't have a Mac.)

    


    Does the stream get interrupted ? Is the recording stopped after 1 second ?

    


    Update 1 :

    


    I have checked the incoming filesize of the browser-recorded file serverside. It seems to be coming in properly, because there are different sizes such as 184 kB.

    


    My guess is now that FFMPEG cannot handle the incoming file correctly. Which might have the wrong mimetype set in Javascript with type: 'audio/ogg',. Is another format needed ?

    


    The conversion code serverside :

    


    PHP

    


    $mp3file = shell_exec("ffmpeg -i ".$file_locationtmp." -vn -ar 44100 -ac 2 -b:a 128k ".$file_locationtmp.".mp3");


    


    I would need to find out the audio recording format used by iPhone but I couldn't.

    


    I tried to find the supporting mimetypes using https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/isTypeSupported - however, it shows that NO mimetypes are supported on iPhone (neither in Chrome nor Safari).

    


    Update 2 :

    


    I used ffprobe to get the recording file information. It says Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 2234 kb/s (default)

    


    Update 3 :

    


    It seems to be a problem with FFMPEG. See my new question How to convert AAC/MP4A to MP3 using FFMPEG in full length ? Audio file gets cut off after 1 second

    


  • How to concatenate two MP4 files, which require http basic Authorization : Bearer , using ffmpeg ?

    8 juillet 2023, par Jeff Strongman

    Hello dear ffmpeg experts ! 🧠 🎯

    


    I ran the following command, which worked perfectly :

    


    ffmpeg -protocol_whitelist https,concat,tls,tcp -i "concat :https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps_1280x720_4000k/bbb_30fps_1280x720_4000k_0.m4v|https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps_1280x720_4000k/bbb_30fps_1280x720_4000k_1.m4v|https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps_1280x720_4000k/bbb_30fps_1280x720_4000k_2.m4v" -c:v copy -vframes 180 -y Movie_of_6_seconds.mp4

    


    I followed the recommended solution of the following post :
How to concatenate two MP4 files using FFmpeg ?

    


    You can execute the command on your local computer and see that it should run just fine...

    


    I used 3. concat protocol, which does indeed concat init + progressive segments

    


    However... when every segment on a server I refer to, is password protected, it fails with 401 Unauthorized, even though I added the following line :
-headers "Authorization : Bearer bas64user:password" , before specifying the -i "concat :...".

    


    It seems to me... that the headers don't pass to the concat command inside of the input of ffmpeg... and it simply ignores them. When I used the same -headers command, on a single file, without concat, it passed the authorization successfully

    


    Notes :

    


      

    • Even though every segment has a length of 120 frames (So in maximum, I could have generated 2*120 = 240 frames... I wanted a movie of 6 seconds and not 8... And by this way, to test that ffmpeg is smart enough to stop processing the whole input). To do that, I used -vframes 180, where 180 / 30 (FPS) = 6 seconds
    • 


    • I used -c:v copy, to get without re-encoding, only the video part (No audio !)
    • 


    • I used -y to override existing file...
    • 


    • 0.m4v, is the init file ! it is a small file, that has metadata of the original video which was produced with mpeg-dash
    • 


    • 1.m4v and 2.m4v, are the progressive segments
    • 


    


    Is there a way, to pass the http basic headers (Authorization : Bearer) to all of the chained files ?

    


    Like :

    


      

    • Via a json content type on the ffmpeg request
    • 


    • Or user:password@video_segment (Although... it seems to me it's not a header ?)
    • 


    • Somehow specify header inside the concat command ?
    • 


    


    I don't want to first download all files and then get rid of the password protected... as it both takes ridiculous time & other resources... and I would like to record from a segment that is "endless", meaning a camera that keeps streaming data.

    


    Thanks in advance 🙏🏻,

    


    FFmpeg noobie 🙈

    


  • libvpx 0.9.1 and FFmpeg 0.6

    18 juin 2010, par Multimedia Mike — VP8

    Great news : Hot on the heels of FFmpeg’s 0.6 release, the WebM project released version 0.9.1 of their libvpx. I can finally obsolete my last set of instructions on getting FFmpeg-svn working with libvpx 0.9.

    Building libvpx 0.9.1
    Do this to build libvpx 0.9.1 on Unix-like systems :

    libvpx’s build system has been firmed up a bit since version 0.9. It’s now smart enough to install when said target is invoked and it also builds the assembly language optimizations. Be advised that on 32- and 64-bit x86 machines, Yasm must be present (install either from source or through your package manager).

    Building FFmpeg 0.6
    To build the newly-released FFmpeg 0.6 :

    • Install Vorbis through your package manager if you care to encode WebM files with audio ; e.g., ’libvorbis-dev’ is the package you want on Ubuntu
    • Download FFmpeg 0.6 from the project’s download page
    • Configure FFmpeg with at least these options : ./configure --enable-libvpx --enable-libvorbis --enable-pthreads ; the final link step still seems to fail on Linux if the pthreads option is disabled
    • ’make’

    Verifying
    Check this out :

    $ ./ffmpeg -formats 2> /dev/null | grep WebM
      E webm            WebM file format
    

    $ ./ffmpeg -codecs 2> /dev/null | grep libvpx
    DEV libvpx libvpx VP8

    That means that this FFmpeg binary can mux a WebM file and can both decode and encode VP8 video via libvpx. If you’re wondering why the WebM format does not list a ’D’ indicating the ability to demux a WebM file, that’s because demuxing WebM is handled by the general Matroska demuxer.

    Doing Work
    Encode a WebM file :

    ffmpeg -i <input_file> <output_file.webm>

    FFmpeg just does the right thing when it seems that .webm extension on the output file. It’s almost magical.

    For instant gratification that the encoded file is valid, you can view it immediately using ’ffplay’, if that binary was built (done by default if the right support libraries are present). If ffplay is not present, you can always execute this command line to see some decode operation :

    ffmpeg -i <output_file.webm> -f framecrc -