Recherche avancée

Médias (91)

Autres articles (97)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

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

  • Installation en mode standalone

    4 février 2011, par

    L’installation de la distribution MediaSPIP se fait en plusieurs étapes : la récupération des fichiers nécessaires. À ce moment là deux méthodes sont possibles : en installant l’archive ZIP contenant l’ensemble de la distribution ; via SVN en récupérant les sources de chaque modules séparément ; la préconfiguration ; l’installation définitive ;
    [mediaspip_zip]Installation de l’archive ZIP de MediaSPIP
    Ce mode d’installation est la méthode la plus simple afin d’installer l’ensemble de la distribution (...)

Sur d’autres sites (7583)

  • ffmpeg : How can a MOV with transparent background be created ?

    25 mars 2017, par Mat

    I’m trying - with no success at all - to convert the green pixels of a background into transparent ones and output the result as clip with ffmpeg. N.b. I do not want to lay the clip over anything ; I’m not having a problem with that. What I want is a clip with transparent background for the OpenShot video editor (the chromakey filter of which doesn’t work satisfyingly).

    What I have tried (amongst 1 zillion other things over the last 15 hrs.) was

    ffmpeg.exe -i in.mov -vf chromakey=0x008001:0.115:0.0 -c:v qtrle out.mov

    but the pixels simply would not be transparent. Seemingly, nothing happens. I reckon the filter is ok, because it works fine in a complex chain (overlaying a background image).

    The output of ffprompt -show_stream -show_format of out.mov is as follows :

    [STREAM]
    index=0
    codec_name=qtrle
    codec_long_name=QuickTime Animation (RLE) video
    profile=unknown
    codec_type=video
    codec_time_base=1/30
    codec_tag_string=rle
    codec_tag=0x20656c72
    width=1920
    height=1080
    coded_width=1920
    coded_height=1080
    has_b_frames=0
    sample_aspect_ratio=1:1
    display_aspect_ratio=16:9
    pix_fmt=bgra
    level=-99
    color_range=N/A
    color_space=unknown
    color_transfer=unknown
    color_primaries=unknown
    chroma_location=unspecified
    field_order=progressive
    timecode=N/A
    refs=1
    id=N/A
    r_frame_rate=30/1
    avg_frame_rate=30/1
    time_base=1/15360
    start_pts=0
    start_time=0.000000
    duration_ts=54789
    duration=3.566992
    bit_rate=822383192
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=107
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:language=eng
    TAG:handler_name=DataHandler
    TAG:encoder=Lavc57.64.101 qtrle
    [/STREAM]
    [STREAM]
    index=1
    codec_name=aac
    codec_long_name=AAC (Advanced Audio Coding)
    profile=LC
    codec_type=audio
    codec_time_base=1/44100
    codec_tag_string=mp4a
    codec_tag=0x6134706d
    sample_fmt=fltp
    sample_rate=44100
    channels=2
    channel_layout=stereo
    bits_per_sample=0
    id=N/A
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=1/44100
    start_pts=926
    start_time=0.020998
    duration_ts=157481
    duration=3.570998
    bit_rate=132103
    max_bit_rate=132103
    bits_per_raw_sample=N/A
    nb_frames=153
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:language=eng
    TAG:handler_name=DataHandler
    [/STREAM]
    [FORMAT]
    filename=out.mov
    nb_streams=2
    nb_programs=0
    format_name=mov,mp4,m4a,3gp,3g2,mj2
    format_long_name=QuickTime / MOV
    start_time=0.000000
    duration=3.567000
    size=366708874
    bit_rate=822447712
    probe_score=100
    TAG:major_brand=qt
    TAG:minor_version=512
    TAG:compatible_brands=qt
    TAG:encoder=Lavf57.56.101
    [/FORMAT]

    I have a "sample" clip which shows the behaviour I want, with the following stream and information :

    [STREAM]
    index=0
    codec_name=qtrle
    codec_long_name=QuickTime Animation (RLE) video
    profile=unknown
    codec_type=video
    codec_time_base=1/24
    codec_tag_string=rle
    codec_tag=0x20656c72
    width=1920
    height=1080
    coded_width=1920
    coded_height=1080
    has_b_frames=0
    sample_aspect_ratio=0:1
    display_aspect_ratio=0:1
    pix_fmt=bgra
    level=-99
    color_range=N/A
    color_space=unknown
    color_transfer=unknown
    color_primaries=unknown
    chroma_location=unspecified
    field_order=progressive
    timecode=N/A
    refs=1
    id=N/A
    r_frame_rate=24/1
    avg_frame_rate=24/1
    time_base=1/12288
    start_pts=0
    start_time=0.000000
    duration_ts=74760
    duration=6.083984
    bit_rate=49226848
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=146
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:language=eng
    TAG:handler_name=DataHandler
    TAG:encoder=Lavc57.24.102 qtrle
    [/STREAM]
    [STREAM]
    index=1
    codec_name=aac
    codec_long_name=AAC (Advanced Audio Coding)
    profile=LC
    codec_type=audio
    codec_time_base=1/48000
    codec_tag_string=mp4a
    codec_tag=0x6134706d
    sample_fmt=fltp
    sample_rate=48000
    channels=2
    channel_layout=stereo
    bits_per_sample=0
    id=N/A
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=1/48000
    start_pts=0
    start_time=0.000000
    duration_ts=293856
    duration=6.122000
    bit_rate=53537
    max_bit_rate=128000
    bits_per_raw_sample=N/A
    nb_frames=288
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:language=eng
    TAG:handler_name=DataHandler
    [/STREAM]
    [FORMAT]
    filename=templateOK.mov
    nb_streams=2
    nb_programs=0
    format_name=mov,mp4,m4a,3gp,3g2,mj2
    format_long_name=QuickTime / MOV
    start_time=0.000000
    duration=6.144000
    size=37478506
    bit_rate=48800138
    probe_score=100
    TAG:major_brand=qt
    TAG:minor_version=512
    TAG:compatible_brands=qt
    TAG:encoder=Lavf57.25.100
    [/FORMAT]

    and I simply am not able to spot the relevant difference.

    The input, output and the working template can be found here.

    (The security issue you might see when clicking the link comes from the server certificate being self-signed. You can accept a temporal exception. Btw : The ridiculous file size of the output file will be the next nut to crack. Probably something about compression.)

  • fluent ffmpeg size output option not working

    19 janvier 2017, par Ashbury

    Summary : I’m trying to limit output to 3mb, .outputOptions('-fs 3000000') isn’t working for me, the file is coming back with a size of 119260428 or 119mb.

    Here is the code to try for yourself, all you need is a test.mp3 large enough that the resulting testoutput.ogg is > 3mb :

    var ffmpeg = require("fluent-ffmpeg");
    var command = ffmpeg();

    var convertToOGG = function(){
     var fileName = 'test.mp3'

     ffmpeg.ffprobe(fileName, function(err, metadata) {
       command
         .input(fileName)
         .inputFormat("mp3")
         .audioChannels(1)
         .outputOptions('-fs', 3000000)
         .output('testoutput.ogg')
         .on("progress", function(progress) {
           console.log("Processing: " + progress.timemark);
         })
         .on("error", function(err, stdout, stderr) {
           console.log("Cannot process video: " + err.message);
         })
         .on("end", function(stdout, stderr) {
           ffmpeg.ffprobe('testoutput.ogg', function(err,metadata){
             if(metadata.format.size >= 3000000){

               console.log("didn't work")
             }
           })
         })
       .run();
     });
    };

    convertToOGG();

    Per the fluent-ffmpeg documentation you should be able to use a ffmpeg command in an output option : outputOption()

    This method allows passing any output-related option to ffmpeg. You can call it with a single argument to pass a single option, optionnaly
    with a space-separated parameter :

    /* Single option */
    ffmpeg('/path/to/file.avi').outputOptions('-someOption');

    and in FFMPEG’s documentation :

    -fs limit_size (output) Set the file size limit, expressed in bytes. No further chunk of bytes is written after the limit is exceeded. The
    size of the output file is slightly more than the requested file size.

    It’s giving me no errors, just seemingly ignoring the file size limit of 99mb and outputting a 119.3mb file.

    Edit - Looks like -fs 3000000 is working for mp3 to wav, but still wont do mp3 to ogg. This is the output from running the command in terminal :

    ✗ ffmpeg -i test.mp3 -fs 3000000 testoutput.ogg
    ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
     built with Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
     libavutil      55. 34.100 / 55. 34.100
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.100 / 57. 56.100
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libavresample   3.  1.  0 /  3.  1.  0
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    [mp3 @ 0x7fc6a4000000] Estimating duration from bitrate, this may be inaccurate
    Input #0, mp3, from 'test.mp3':
     Metadata:
       lyrics-eng      : xxx
       title           : xxx
       artist          : xxx
       album_artist    : xxx
       album           : xxx
       genre           : xxx
     Duration: 03:27:28.74, start: 0.000000, bitrate: 128 kb/s
       Stream #0:0: Audio: mp3, 44100 Hz, mono, s16p, 128 kb/s
       Stream #0:1: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 540x360, 90k tbr, 90k tbn, 90k tbc
       Metadata:
         title           : Array
         comment         : Cover (front)
    [swscaler @ 0x7fc6a4808800] deprecated pixel format used, make sure you did set range correctly
    [ogg @ 0x7fc6a3815800] Frame rate very high for a muxer not efficiently supporting it.
    Please consider specifying a lower framerate, a different muxer or -vsync 2
    Output #0, ogg, to 'testoutput.ogg':
     Metadata:
       lyrics-eng      : xxx
       title           : xxx
       artist          : xxx
       album_artist    : xxx
       album           : xxx
       genre           : xxx
       encoder         : Lavf57.56.100
       Stream #0:0: Video: theora (libtheora), yuv444p, 540x360, q=2-31, 200 kb/s, 90k fps, 90k tbn, 90k tbc
       Metadata:
         title           : Array
         DESCRIPTION     : Cover (front)
         encoder         : Lavc57.64.101 libtheora
         lyrics-eng      : xxx
         artist          : xxx
         ALBUMARTIST     : xxx
         album           : xxx
         genre           : xxx
       Stream #0:1: Audio: vorbis (libvorbis), 44100 Hz, mono, fltp
       Metadata:
         encoder         : Lavc57.64.101 libvorbis
         lyrics-eng      : xxx
         title           : xxx
         artist          : xxx
         ALBUMARTIST     : xxx
         album           : xxx
         genre           : xxx
    Stream mapping:
     Stream #0:1 -> #0:0 (mjpeg (native) -> theora (libtheora))
     Stream #0:0 -> #0:1 (mp3 (native) -> vorbis (libvorbis))
    Press [q] to stop, [?] for help
    frame=    1 fps=0.0 q=-0.0 Lsize=  116465kB time=03:27:28.71 bitrate=  76.6kbits/s speed=61.2x
    video:9kB audio:114907kB subtitle:0kB other streams:0kB global headers:6kB muxing overhead: 1.347787%
  • Audio recorded with MediaRecorder on Chrome missing duration

    27 octobre 2016, par suppp111

    I am recording audio (oga/vorbis) files with MediaRecorder. When I record these file through Chrome I get problems : I cannot edit the files on ffmpeg and when I try to play them on Firefox it says they are corrupt (they do play fine on Chrome though).

    Looking at their metadata on ffmpeg I get this :

    Input #0, matroska,webm, from '91.oga':
     Metadata:
       encoder         : Chrome
     Duration: N/A, start: 0.000000, bitrate: N/A
       Stream #0:0(eng): Audio: opus, 48000 Hz, mono, fltp (default)
    [STREAM]
    index=0
    codec_name=opus
    codec_long_name=Opus (Opus Interactive Audio Codec)
    profile=unknown
    codec_type=audio
    codec_time_base=1/48000
    codec_tag_string=[0][0][0][0]
    codec_tag=0x0000
    sample_fmt=fltp
    sample_rate=48000
    channels=1
    channel_layout=mono
    bits_per_sample=0
    id=N/A
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=1/1000
    start_pts=0
    start_time=0.000000
    duration_ts=N/A
    duration=N/A
    bit_rate=N/A
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=N/A
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    TAG:language=eng
    [/STREAM]
    [FORMAT]
    filename=91.oga
    nb_streams=1
    nb_programs=0
    format_name=matroska,webm
    format_long_name=Matroska / WebM
    start_time=0.000000
    duration=N/A
    size=7195
    bit_rate=N/A
    probe_score=100
    TAG:encoder=Chrome

    As you can see there are problems with the duration. I have looked at posts like this :
    How can I add predefined length to audio recorded from MediaRecorder in Chrome ?

    But even trying that, I got errors when trying to chop and merge files.For example when running :

    ffmpeg -f concat  -i 89_inputs.txt -c copy final.oga

    I get a lot of this :

    [oga @ 00000000006789c0] Non-monotonous DTS in output stream 0:0; previous: 57612, current: 1980; changing to 57613. This may result in incorrect timestamps in the output file.
    [oga @ 00000000006789c0] Non-monotonous DTS in output stream 0:0; previous: 57613, current: 2041; changing to 57614. This may result in incorrect timestamps in the output file.
    DTS -442721849179034176, next:42521 st:0 invalid dropping
    PTS -442721849179034176, next:42521 invalid dropping st:0
    [oga @ 00000000006789c0] Non-monotonous DTS in output stream 0:0; previous: 57614, current: 2041; changing to 57615. This may result in incorrect timestamps in the output file.
    [oga @ 00000000006789c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
    DTS -442721849179031296, next:42521 st:0 invalid dropping
    PTS -442721849179031296, next:42521 invalid dropping st:0

    Does anyone know what we need to do to audio files recorded from Chrome for them to be useful ? Or is there a problem with my setup ?

    Recorder js :

    if (navigator.getUserMedia) {
     console.log('getUserMedia supported.');

     var constraints = { audio: true };
     var chunks = [];

     var onSuccess = function(stream) {
       var mediaRecorder = new MediaRecorder(stream);

       record.onclick = function() {
         mediaRecorder.start();
         console.log(mediaRecorder.state);
         console.log("recorder started");
         record.style.background = "red";

         stop.disabled = false;
         record.disabled = true;

         var aud = document.getElementById("audioClip");
         start = aud.currentTime;
       }

       stop.onclick = function() {
         console.log(mediaRecorder.state);
         console.log("Recording request sent.");
         mediaRecorder.stop();
       }

       mediaRecorder.onstop = function(e) {
         console.log("data available after MediaRecorder.stop() called.");

         var audio = document.createElement('audio');
         audio.setAttribute('controls', '');
         audio.setAttribute('id', 'audioClip');

         audio.controls = true;
         var blob = new Blob(chunks, { 'type' : 'audio/ogg; codecs="vorbis"' });
         chunks = [];
         var audioURL = window.URL.createObjectURL(blob);
         audio.src = audioURL;

         sendRecToPost(blob);   // this just send the audio blob to the server by post
         console.log("recorder stopped");

       }