
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (36)
-
Ajouter notes et légendes aux images
7 février 2011, parPour 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, parLa 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 2011Contrairement à 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 user21338683The 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 DargahI’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 10000CustomLog -
File /tmp/feed1.ffm
FileMaxSize 1G
ACL allow 127.0.0.1Format webm
Feed feed1.ffmVideo 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_headerStreaming settings
PreRoll 10
StartSendOnKeyAudio 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 tealsI 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() {
 char const* outfile = filePath.c_str();

 // open output format context
 int ret = avformat_alloc_output_context2(&ofctx, nullptr, nullptr, outfile);
 if (ret < 0) {
 std::cerr << "fail to avformat_alloc_output_context2(" << outfile << "): ret=" << ret;
 return false;
 }

 // create new video stream
 const AVCodec* codec = avcodec_find_encoder_by_name(encoderName.c_str());
 vstrm = avformat_new_stream(ofctx, codec);
 if (!vstrm) {
 std::cerr << "fail to avformat_new_stream";
 return false;
 }

 // open video encoder
 cctx = avcodec_alloc_context3(codec);
 if (!vstrm) {
 std::cerr << "fail to avcodec_alloc_context3";
 return false;
 }
 const AVRational dst_fps = {fps, 1};
 cctx->width = width;
 cctx->height = height;
 if(pixel_format != AV_PIX_FMT_NONE) {
 cctx->pix_fmt = pixel_format;
 }
 else {
 cctx->pix_fmt = codec->pix_fmts[0];
 }
 cctx->time_base = av_inv_q(dst_fps);
 cctx->framerate = dst_fps;
 cctx->bit_rate = bitrate * 1000000;


 AVDictionary* options = nullptr;
 if(gpu_id >= 0) {
 av_dict_set_int(&options, "gpu", gpu_id, 0);
 }

 
 if (ofctx->oformat->flags & AVFMT_GLOBALHEADER)
 cctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
 ret = avcodec_open2(cctx, codec, &options);
 if (ret < 0) {
 std::cerr << "fail to avcodec_open2: ret=" << ret;
 return false;
 }
 avcodec_parameters_from_context(vstrm->codecpar, cctx);

 //For mac/quicktime we need to add hvc1 tag.
 if (encoderName.find("hevc") != std::string::npos) {
 vstrm->codecpar->codec_tag = MKTAG('h', 'v', 'c', '1');
 }

 /*
 std::cout
 << "outfile: " << outfile << "\n"
 << "format: " << ofctx->oformat->name << "\n"
 << "vcodec: " << codec->name << "\n"
 << "size: " << width << 'x' << height << "\n"
 << "fps: " << av_q2d(cctx->framerate) << "\n"
 << "pixfmt: " << av_get_pix_fmt_name(cctx->pix_fmt) << "\n"
 << std::flush;*/

 // initialize sample scaler
 swsCtx = sws_getContext(
 width, height, AV_PIX_FMT_BGR24,
 width, height, cctx->pix_fmt,
 SWS_BILINEAR, nullptr, nullptr, nullptr);
 if (!swsCtx) {
 std::cerr << "fail to sws_getContext";
 return false;
 }

 // allocate frame buffer for encoding
 frame = av_frame_alloc();
 frame->width = width;
 frame->height = height;
 frame->format = static_cast<int>(cctx->pix_fmt);
 ret = av_frame_get_buffer(frame, 32);
 if (ret < 0) {
 std::cerr << "fail to av_frame_get_buffer: ret=" << ret;
 return false;
 }

 // allocate packet to retrive encoded frame
 pkt = av_packet_alloc();
 // open output IO context
 ret = avio_open2(&ofctx->pb, outfile, AVIO_FLAG_WRITE, nullptr, nullptr);
 if (ret < 0) {
 std::cerr << "fail to avio_open2: ret=" << ret;
 return false;
 }

 // write media container header (if any)
 ret = avformat_write_header(ofctx, nullptr);
 if (ret < 0) {
 std::cerr << "fail to avformat_write_header: ret=" << ret;
 return false;
 }

 return true;
}
</int>