Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (36)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (12440)

  • JavaScript Audio Decoder Library or Way to Decode Browser Unsupported Audio Formats ?

    20 mars 2023, par user21338683

    The issue :

    


    I've spent a week trying to figure out how I can play or decode ALAC files in my Electron application.

    


    Libraries I have tried or looked at :

    


      

    • Aurora - Github issues have been stale for years. Last updates were in 2016. It doesn't work when I install it with npm.

      


    • 


    • Audio Decode - Doesn't support ALAC.

      


    • 


    • WASM Audio Decoders - Doesn't support ALAC.

      


    • 


    • Web Audio API from AudioJS - Depends on Aurora. Same issue where it fails to load coffee files.

      


    • 


    • FFmpeg.JS from Kagami - Has a memory leak then crashes.

      


    • 


    • FFmpeg.wasm - I went down a very deep rabbit hole trying to figure out if this was the tool I needed. More on that later.

      


    • 


    • A few backend audio players for NodeJS - I don't remember their names but they're all unmaintained.

      


    • 


    • HowlerJS - I don't know what formats they support, but it looks like it's the same as the browser, which would mean no ALAC. Still unsure.

      


    • 


    


    Things I've tried :

    


    Web Audio API | MSE

    


    I have tried looking into the Web Audio API and MSE and left disappointed in their lack of support for a variety of audio formats.

    


    FFmpeg.wasm

    


    I got it to convert an ALAC file into a format the Electron browser (which is Chrome) would accept, however, it can take several seconds to convert the whole file which is not acceptable to wait that long after you click play.

    


    I tried reading a file stream and converting chunks, however, I was limited by what I could pass through the IPC as it's not possible to pass functions or things that can't be stringified.

    


    Ultimately I would need to coordinate when to fetch the chunks and then play them, which sounded like a job for MSE until I read the formats it supported were even less than the Web Audio API and HTML audio tag.

    


    I tried to set it up anyway by converting chunks in FFmpeg and reading from its memory, then passing that to an AudioContext originally, but it never played as the source was invalid. I then tried converting to a supported MSE format but that required getting the MIME type and codecs. I now needed a library for that or read the bytes myself... I used Google and the only results I get are for video decoding. Not what I need. Mux.JS is ESM based, won't work on Electron aside from its scope looking more like it's used for videos. Same for MP4Box, I just don't know yet if they will work for audio.

    


    I got something to play using MSE by lying and saying the MIME type would be audio/mpeg. That's not scalable, not to mention MP3 is lossy and the audio tag already plays it. I don't want to convert a FLAC (which MSE doesn't support) to an MP3 just to play it when the audio tag already plays FLAC natively. That would also degrade the quality of the audio.

    


    I also tried writing to a specific decode file and reading it while it was being written to (no idea if that could work). I didn't get the results I was looking for. Basically the file wasn't valid when it was accessed and it never got re-queried once it finished being decoded. And again, I can't pass a callback through the IPC to run once it finishes because that doesn't work. IPC doesn't pass functions.

    


    My Next Steps

    


    I'm reaching out here on StackOverflow to see if there is anything I can do, or try, or think of, or use. Something tells me there is a way to get this to work.

    


    If you need extra info I can provide it. If I asked my question wrong I apologize, I'm new here. I have done some searching for existing issues, which is how I found the libraries I listed as well as browser support for different audio formats. However, the ones I found didn't dive deeper into the issue. They issues simply ended with links to browser support specs or giving the author libraries to check out. FFmpeg.wasm seems to be the most promising one, I still have it installed and trying to use it.

    


  • ffserver webm streaming issue with Firefox browser

    1er septembre 2015, par Venkatesh Babu Dargah

    I’m attempting to cast my desktop screen to an ffserver and stream it as a webm. I’m using the following ffserver configuration :

    HTTPPort 8091
    MaxHTTPConnections 20000
    MaxClients 10000
    MaxBandwidth 10000

    CustomLog -

    File /tmp/feed1.ffm
    FileMaxSize 1G
    ACL allow 127.0.0.1

    Format webm
    Feed feed1.ffm

    Video settings

    VideoCodec libvpx
    VideoFrameRate 30
       VideoBitRate 512
    VideoSize 320x240
       MaxTime 0
       AVOptionVideo me_range 16
       AVOptionVideo qdiff 4
       AVOptionVideo qmin 4
       AVOptionVideo qmax 40
       AVOptionVideo quality good
       AVOptionVideo flags +global_header

    Streaming settings

       PreRoll 10
       StartSendOnKey

    Audio settings

       AudioCodec libopus
       AudioBitRate 128
       AudioSampleRate 48000
       AVOptionAudio flags +global_header
       Metadata author "author"
       Metadata copyright "copyright"
       Metadata title "Web app name"
       Metadata comment "comment"

    I am using ffmpgeg to capture video from my desktop using
    ffmpeg -f v4l2 -s 320x240 -r 25 -i /dev/video0 -f alsa -ac 2 -i hw:0 http://localhost:8091/feed1.ffm/

    i am able to see this stream in chrome.
    but Firefox is showing message as MIME type not supported and not able to decode.
    but if I run the same webm video from static file it is playing in firefox
    but if I try to access via http://localhost:8091/live1.webm i am getting MIME type error,
    please let me know what additional settings need to be done in Firefox to play webm videos from my server address and port.
    Again I am reiterating that this is playing ok in chrome but not in Firefox.

    Please reply.

    hi all,

    i am able to play in firefox also after i changed audiocodecs to libvorbis and removing AudioChannels parameter from ffserver config file.

    thanks for your attention

  • FFMpeg C++ encoder fails with hardware acceleration quick sync intel

    28 août 2022, par teals

    I am trying to debug an issue I have with a simple C++ encoder using FFMmpeg. The following code below works correctly on these other hardware acceleration systems/platforms :

    


      

    • Mac/VideoToolbox,
    • 


    • Cuda/NVEnc
    • 


    • Raspberry pi/h264_v4l2m2m.
    • 


    


    It fails on intel quick sync at avcodec_open2. I'm using Ubuntu 22.04. I built FFMpeg from source with the Intel Media SDK installed and configured. I verified that the QuickSync install works. I also have a corresponding decoder implementation that works correctly using intel quick sync. So I know everything properly installed. I am also running this on an 11th Gen Intel CPU.

    


    [hevc_qsv @ 0x564b0d34f0c0] Low power mode is unsupported (This sometimes shows up)
[hevc_qsv @ 0x563691234000] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height


    


    This is the only error that I get and I haven't found any helpful resources. I tried playing around with different parameters but nothing seems to work. Any help or insight would be extremely helpful.

    


    bool VideoEncoder::create() {&#xA;    char const* outfile = filePath.c_str();&#xA;&#xA;     // open output format context&#xA;    int ret = avformat_alloc_output_context2(&amp;ofctx, nullptr, nullptr, outfile);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to avformat_alloc_output_context2(" &lt;&lt; outfile &lt;&lt; "): ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;&#xA;    // create new video stream&#xA;    const AVCodec* codec = avcodec_find_encoder_by_name(encoderName.c_str());&#xA;    vstrm = avformat_new_stream(ofctx, codec);&#xA;    if (!vstrm) {&#xA;        std::cerr &lt;&lt; "fail to avformat_new_stream";&#xA;        return false;&#xA;    }&#xA;&#xA;    // open video encoder&#xA;    cctx = avcodec_alloc_context3(codec);&#xA;    if (!vstrm) {&#xA;        std::cerr &lt;&lt; "fail to avcodec_alloc_context3";&#xA;        return false;&#xA;    }&#xA;    const AVRational dst_fps = {fps, 1};&#xA;    cctx->width = width;&#xA;    cctx->height = height;&#xA;    if(pixel_format != AV_PIX_FMT_NONE) {&#xA;        cctx->pix_fmt = pixel_format;&#xA;    }&#xA;    else {&#xA;        cctx->pix_fmt = codec->pix_fmts[0];&#xA;    }&#xA;    cctx->time_base = av_inv_q(dst_fps);&#xA;    cctx->framerate = dst_fps;&#xA;    cctx->bit_rate = bitrate * 1000000;&#xA;&#xA;&#xA;    AVDictionary* options = nullptr;&#xA;    if(gpu_id >= 0) {&#xA;        av_dict_set_int(&amp;options, "gpu", gpu_id, 0);&#xA;    }&#xA;&#xA;    &#xA;    if (ofctx->oformat->flags &amp; AVFMT_GLOBALHEADER)&#xA;        cctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;&#xA;    ret = avcodec_open2(cctx, codec, &amp;options);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to avcodec_open2: ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;    avcodec_parameters_from_context(vstrm->codecpar, cctx);&#xA;&#xA;    //For mac/quicktime we need to add hvc1 tag.&#xA;    if (encoderName.find("hevc") != std::string::npos) {&#xA;        vstrm->codecpar->codec_tag = MKTAG(&#x27;h&#x27;, &#x27;v&#x27;, &#x27;c&#x27;, &#x27;1&#x27;);&#xA;    }&#xA;&#xA;    /*&#xA;    std::cout&#xA;        &lt;&lt; "outfile: " &lt;&lt; outfile &lt;&lt; "\n"&#xA;        &lt;&lt; "format:  " &lt;&lt; ofctx->oformat->name &lt;&lt; "\n"&#xA;        &lt;&lt; "vcodec:  " &lt;&lt; codec->name &lt;&lt; "\n"&#xA;        &lt;&lt; "size:    " &lt;&lt; width &lt;&lt; &#x27;x&#x27; &lt;&lt; height &lt;&lt; "\n"&#xA;        &lt;&lt; "fps:     " &lt;&lt; av_q2d(cctx->framerate) &lt;&lt; "\n"&#xA;        &lt;&lt; "pixfmt:  " &lt;&lt; av_get_pix_fmt_name(cctx->pix_fmt) &lt;&lt; "\n"&#xA;        &lt;&lt; std::flush;*/&#xA;&#xA;    // initialize sample scaler&#xA;    swsCtx = sws_getContext(&#xA;        width, height, AV_PIX_FMT_BGR24,&#xA;        width, height, cctx->pix_fmt,&#xA;        SWS_BILINEAR, nullptr, nullptr, nullptr);&#xA;    if (!swsCtx) {&#xA;        std::cerr &lt;&lt; "fail to sws_getContext";&#xA;        return false;&#xA;    }&#xA;&#xA;    // allocate frame buffer for encoding&#xA;    frame = av_frame_alloc();&#xA;    frame->width = width;&#xA;    frame->height = height;&#xA;    frame->format = static_cast<int>(cctx->pix_fmt);&#xA;    ret = av_frame_get_buffer(frame, 32);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to av_frame_get_buffer: ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;&#xA;    // allocate packet to retrive encoded frame&#xA;    pkt = av_packet_alloc();&#xA;    // open output IO context&#xA;    ret = avio_open2(&amp;ofctx->pb, outfile, AVIO_FLAG_WRITE, nullptr, nullptr);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to avio_open2: ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;&#xA;    // write media container header (if any)&#xA;    ret = avformat_write_header(ofctx, nullptr);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to avformat_write_header: ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;&#xA;    return true;&#xA;}&#xA;</int>

    &#xA;