Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (53)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (6067)

  • Error using FFmpeg.wasm for audio files in react : "ffmpeg.FS('readFile', 'output.mp3') error. Check if the path exists"

    25 février 2021, par Rayhan Memon

    I'm currently building a browser-based audio editor and I'm using ffmpeg.wasm (a pure WebAssembly/JavaScript port of FFmpeg) to do it.

    


    I'm using this excellent example, which allows you to uploaded video file and convert it into a gif :

    


    import React, { useState, useEffect } from &#x27;react&#x27;;&#xA;import &#x27;./App.css&#x27;;&#xA;&#xA;import { createFFmpeg, fetchFile } from &#x27;@ffmpeg/ffmpeg&#x27;;&#xA;const ffmpeg = createFFmpeg({ log: true });&#xA;&#xA;function App() {&#xA;  const [ready, setReady] = useState(false);&#xA;  const [video, setVideo] = useState();&#xA;  const [gif, setGif] = useState();&#xA;&#xA;  const load = async () => {&#xA;    await ffmpeg.load();&#xA;    setReady(true);&#xA;  }&#xA;&#xA;  useEffect(() => {&#xA;    load();&#xA;  }, [])&#xA;&#xA;  const convertToGif = async () => {&#xA;    // Write the file to memory &#xA;    ffmpeg.FS(&#x27;writeFile&#x27;, &#x27;test.mp4&#x27;, await fetchFile(video));&#xA;&#xA;    // Run the FFMpeg command&#xA;    await ffmpeg.run(&#x27;-i&#x27;, &#x27;test.mp4&#x27;, &#x27;-t&#x27;, &#x27;2.5&#x27;, &#x27;-ss&#x27;, &#x27;2.0&#x27;, &#x27;-f&#x27;, &#x27;gif&#x27;, &#x27;out.gif&#x27;);&#xA;&#xA;    // Read the result&#xA;    const data = ffmpeg.FS(&#x27;readFile&#x27;, &#x27;out.gif&#x27;);&#xA;&#xA;    // Create a URL&#xA;    const url = URL.createObjectURL(new Blob([data.buffer], { type: &#x27;image/gif&#x27; }));&#xA;    setGif(url)&#xA;  }&#xA;&#xA;  return ready ? (&#xA;    &#xA;    <div classname="App">&#xA;      { video &amp;&amp; &#xA;&#xA;      }&#xA;&#xA;&#xA;      <input type="file" />> setVideo(e.target.files?.item(0))} />&#xA;&#xA;      <h3>Result</h3>&#xA;&#xA;      <button>Convert</button>&#xA;&#xA;      { gif &amp;&amp; <img src="http://stackoverflow.com/feeds/tag/{gif}" width="250" style='max-width: 300px; max-height: 300px' />}&#xA;&#xA;    </div>&#xA;  )&#xA;    :&#xA;    (&#xA;      <p>Loading...</p>&#xA;    );&#xA;}&#xA;&#xA;export default App;&#xA;

    &#xA;

    I've modified the above code to take an mp3 file recorded in the browser (recorded using the npm package 'mic-recorder-to-mp3' and passed to this component as a blobURL in the global state) and do something to it using ffmpeg.wasm :

    &#xA;

    import React, { useContext, useState, useEffect } from &#x27;react&#x27;;&#xA;import Context from &#x27;../../store/Context&#x27;;&#xA;import Toolbar from &#x27;../Toolbar/Toolbar&#x27;;&#xA;import AudioTranscript from &#x27;./AudioTranscript&#x27;;&#xA;&#xA;import { createFFmpeg, fetchFile } from &#x27;@ffmpeg/ffmpeg&#x27;;&#xA;&#xA;//Create ffmpeg instance and set &#x27;log&#x27; to true so we can see everything&#xA;//it does in the console&#xA;const ffmpeg = createFFmpeg({ log: true });&#xA;&#xA;const AudioEditor = () => {&#xA;    //Setup Global State and get most recent recording&#xA;    const { globalState } = useContext(Context);&#xA;    const { blobURL } = globalState;&#xA;&#xA;    //ready flag for when ffmpeg is loaded&#xA;    const [ready, setReady] = useState(false);&#xA;&#xA;    const [outputFileURL, setOutputFileURL] = useState(&#x27;&#x27;);&#xA;&#xA;    //Load FFmpeg asynchronously and set ready when it&#x27;s ready&#xA;    const load = async () => {&#xA;        await ffmpeg.load();&#xA;        setReady(true);&#xA;    }&#xA;&#xA;    //Use UseEffect to run the &#x27;load&#x27; function on mount&#xA;    useEffect(() => {&#xA;        load();&#xA;    }, []);&#xA;&#xA;    const ffmpegTest = async () => {&#xA;        //must first write file to memory as test.mp3&#xA;        ffmpeg.FS(&#x27;writeFile&#x27;, &#x27;test.mp3&#x27;, await fetchFile(blobURL));&#xA;&#xA;        //Run the FFmpeg command&#xA;        //in this case, trim file size down to 1.5s and save to memory as output.mp3&#xA;        ffmpeg.run(&#x27;-i&#x27;, &#x27;test.mp3&#x27;, &#x27;-t&#x27;, &#x27;1.5&#x27;, &#x27;output.mp3&#x27;);&#xA;&#xA;        //Read the result from memory&#xA;        const data = ffmpeg.FS(&#x27;readFile&#x27;, &#x27;output.mp3&#x27;);&#xA;&#xA;        //Create URL so it can be used in the browser&#xA;        const url = URL.createObjectURL(new Blob([data.buffer], { type: &#x27;audio/mp3&#x27; }));&#xA;        setOutputFileURL(url);&#xA;    }&#xA;&#xA;    return ready ? ( &#xA;        <div>&#xA;            <audiotranscript></audiotranscript>&#xA;            <toolbar></toolbar>&#xA;            <button>&#xA;                Edit&#xA;            </button>&#xA;            {outputFileURL &amp;&amp; &#xA;                &#xA;            }&#xA;        </div>&#xA;    ) : (&#xA;        <div>&#xA;            Loading...&#xA;        </div>&#xA;    )&#xA;}&#xA;&#xA;export default AudioEditor;&#xA;

    &#xA;

    This code returns the following error when I press the edit button to call the ffmpegTest function :&#xA;enter image description here

    &#xA;

    I've experimented, and when I tweak the culprit line of code to :

    &#xA;

    const data = ffmpeg.FS(&#x27;readFile&#x27;, &#x27;test.mp3&#x27;);&#xA;

    &#xA;

    the function runs without error, simply returning the input file. So I assume there must be something wrong with ffmpeg.run() line not storing 'output.mp3' in memory perhaps ? I can't for the life of me figure out what's going on...any help would be appreciated !

    &#xA;

  • ffmpeg - convert mxf to ts while maintaining "Text" tracks

    15 février 2021, par user3552454

    I have a .mxf file that has 608/708 captions. When I look at the MediaInfo of this file I see below Text information. My goal is to extract 608/708 captions from this file using ccextractor. To do that first I am converting this to a .ts file using below ffmpeg command as ffmpeg -i abc.mxf -c:v mpeg2video -s 160x90 -b:v 300k -map 0:v -map 0:d abc.ts. But when I check the MediaInfo of abc.ts file I don't see any of "@type:Text" tracks in the output.

    &#xA;

    I also tried with -copy_unknown but still, I am not able to see "@type:Text" in output .ts file MediaInfo.

    &#xA;

    Also in some file I see "MuxingMode": "Ancillary data / CDP" and some files I am seeing "MuxingMode": "A/53 / DTVCC Transport". What is the difference between these two ?

    &#xA;

    Request you to share your valuable feedback. Thank you.

    &#xA;

    [{&#xA;    "@type": "Text",&#xA;    "@typeorder": "1",&#xA;    "ID": "512-CC1",&#xA;    "Format": "EIA-608",&#xA;    "MuxingMode": "Ancillary data / CDP",&#xA;    "Duration": "2645.142",&#xA;    "BitRate_Mode": "CBR",&#xA;    "FrameRate": "29.970",&#xA;    "FrameCount": "79275",&#xA;    "Delay": "0.000",&#xA;    "Delay_DropFrame": "Yes",&#xA;    "Delay_Source": "Container",&#xA;    "StreamSize": "0",&#xA;    "extra": {&#xA;        "Delay_SDTI": "0",&#xA;        "CaptionServiceName": "CC1",&#xA;        "CaptionServiceDescriptor_IsPresent": "No",&#xA;        "cdp_length_Min": "73",&#xA;        "cdp_length_Max": "73"&#xA;    }&#xA;}, {&#xA;    "@type": "Text",&#xA;    "@typeorder": "2",&#xA;    "ID": "512-1",&#xA;    "Format": "EIA-708",&#xA;    "MuxingMode": "Ancillary data / CDP",&#xA;    "Duration": "2645.142",&#xA;    "BitRate_Mode": "CBR",&#xA;    "FrameRate": "29.970",&#xA;    "FrameCount": "79275",&#xA;    "StreamSize": "0",&#xA;    "extra": {&#xA;        "CaptionServiceName": "1",&#xA;        "CaptionServiceDescriptor_IsPresent": "No",&#xA;        "cdp_length_Min": "73",&#xA;        "cdp_length_Max": "73"&#xA;    }&#xA;}, {&#xA;    "@type": "Text",&#xA;    "@typeorder": "3",&#xA;    "ID": "512-2",&#xA;    "Format": "EIA-708",&#xA;    "MuxingMode": "Ancillary data / CDP",&#xA;    "Duration": "2645.142",&#xA;    "BitRate_Mode": "CBR",&#xA;    "FrameRate": "29.970",&#xA;    "FrameCount": "79275",&#xA;    "StreamSize": "0",&#xA;    "extra": {&#xA;        "CaptionServiceName": "2",&#xA;        "CaptionServiceDescriptor_IsPresent": "No",&#xA;        "cdp_length_Min": "73",&#xA;        "cdp_length_Max": "73"&#xA;    }&#xA;}, {&#xA;    "@type": "Text",&#xA;    "@typeorder": "4",&#xA;    "ID": "512-3",&#xA;    "Format": "EIA-708",&#xA;    "MuxingMode": "Ancillary data / CDP",&#xA;    "Duration": "2645.142",&#xA;    "BitRate_Mode": "CBR",&#xA;    "FrameRate": "29.970",&#xA;    "FrameCount": "79275",&#xA;    "StreamSize": "0",&#xA;    "extra": {&#xA;        "CaptionServiceName": "3",&#xA;        "CaptionServiceDescriptor_IsPresent": "No",&#xA;        "cdp_length_Min": "73",&#xA;        "cdp_length_Max": "73"&#xA;    }&#xA;}, {&#xA;    "@type": "Text",&#xA;    "@typeorder": "5",&#xA;    "ID": "512-4",&#xA;    "Format": "EIA-708",&#xA;    "MuxingMode": "Ancillary data / CDP",&#xA;    "Duration": "2645.142",&#xA;    "BitRate_Mode": "CBR",&#xA;    "FrameRate": "29.970",&#xA;    "FrameCount": "79275",&#xA;    "StreamSize": "0",&#xA;    "extra": {&#xA;        "CaptionServiceName": "4",&#xA;        "CaptionServiceDescriptor_IsPresent": "No",&#xA;        "cdp_length_Min": "73",&#xA;        "cdp_length_Max": "73"&#xA;    }&#xA;}]&#xA;

    &#xA;

  • FFMPEG, macOS Catalina : "ffmpeg stderr : /private/tmp/com.apple.launchd.ID/org.macosforge.xquartz:0 : Operation not supported on socket"

    11 février 2021, par Bogdan Slyusarenko

    I'm trying to record selenium test run with FFMPEG, for automation testing of web extensions (selenium+js/ts).&#xA;FFMPEG initiated by command :

    &#xA;

        const { spawn } = require("child_process");&#xA;        ffmpeg = spawn("ffmpeg", [&#xA;          "-x265-params",&#xA;          "-f",&#xA;          "xcbgrab", &#xA;          "-video_size",&#xA;          "1280x1024", &#xA;          "-i",&#xA;          process.env.DISPLAY, // "/private/tmp/com.apple.launchd.ID/org.macosforge.xquartz:0"&#xA;          "-loglevel",&#xA;          "debug", &#xA;          "-y", &#xA;          "-pix_fmt",&#xA;          "yuv420p",&#xA;          videoPath, &#xA;        ]);&#xA;

    &#xA;

    Return constantly error,related to process.DISPLAY, I'm not sure why it's so :

    &#xA;

        ffmpeg stderr: /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0: Operation not supported on socket&#xA;

    &#xA;

    Full debug login is :

    &#xA;

    ffmpeg stderr: ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers&#xA;ffmpeg stderr:   built with Apple clang version 12.0.0 (clang-1200.0.32.28)&#xA;ffmpeg stderr:   configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_9 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack&#xA;ffmpeg stderr: libavutil      56. 51.100 / 56. 51.100&#xA;ffmpeg stderr:   libavcodec     58. 91.100 / 58. 91.100&#xA;ffmpeg stderr:   libavformat    58. 45.100 / 58. 45.100&#xA;ffmpeg stderr:   libavdevice    58. 10.100 / 58. 10.100&#xA;ffmpeg stderr:   libavfilter     7. 85.100 /  7. 85.100&#xA;ffmpeg stderr:   libavresample   4.  0.  0 /  4.  0.  0&#xA;ffmpeg stderr:   libswscale      5.  7.100 /  5.  7.100&#xA;ffmpeg stderr:   libswresample   3.  7.100 /  3.  7.100&#xA;ffmpeg stderr:   libpostproc    55.  7.100 / 55.  7.100&#xA;ffmpeg stderr: Splitting the commandline.&#xA;ffmpeg stderr: Reading option &#x27;-x265-params&#x27; ...&#xA;ffmpeg stderr: matched as AVOption &#x27;x265-params&#x27; with argument &#x27;-f&#x27;.&#xA;ffmpeg stderr: Reading option &#x27;xcbgrab&#x27; ...&#xA;ffmpeg stderr: matched as output url.&#xA;ffmpeg stderr: Reading option &#x27;-video_size&#x27; ...&#xA;ffmpeg stderr: matched as AVOption &#x27;video_size&#x27; with argument &#x27;1280x1024&#x27;.&#xA;ffmpeg stderr: Reading option &#x27;-i&#x27; ... matched as input url with argument &#x27;/private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0&#x27;.&#xA;ffmpeg stderr: Reading option &#x27;-loglevel&#x27; ... matched as option &#x27;loglevel&#x27; (set logging level) with argument &#x27;debug&#x27;.&#xA;ffmpeg stderr: Reading option &#x27;-y&#x27; ...&#xA;ffmpeg stderr: matched as option &#x27;y&#x27; (overwrite output files) with argument &#x27;1&#x27;.&#xA;ffmpeg stderr: Reading option &#x27;-pix_fmt&#x27; ... matched as option &#x27;pix_fmt&#x27; (set pixel format) with argument &#x27;yuv420p&#x27;.&#xA;ffmpeg stderr: Reading option &#x27;/Volumes/MacHD2/Upprojects/TEST/log/Checkout-Google.com-Search-on-Google.mp4&#x27; ... matched as output url.&#xA;ffmpeg stderr: Finished splitting the commandline.&#xA;ffmpeg stderr: Parsing a group of options: global .&#xA;ffmpeg stderr: Applying option loglevel (set logging level) with argument debug.&#xA;ffmpeg stderr: Applying option y (overwrite output files) with argument 1.&#xA;ffmpeg stderr: Successfully parsed a group of options.&#xA;ffmpeg stderr: Parsing a group of options: input url /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0.&#xA;ffmpeg stderr: Successfully parsed a group of options.&#xA;ffmpeg stderr: Opening an input file: /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0.&#xA;ffmpeg stderr: [NULL @ 0x7fcf80016800] Opening &#x27;/private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0&#x27; for reading&#xA;ffmpeg stderr: [file @ 0x7fcf7f507a00] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;ffmpeg stderr: /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0: Operation not supported on socket&#xA;&#xA;

    &#xA;

    Any feedback appreciated

    &#xA;