
Recherche avancée
Autres articles (48)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (7031)
-
Converting an audio file from .oga format to .mp3 using ffmpeg package on nodeJs produces a max of 3 seconds output file no matter the input duration
15 janvier 2024, par JnrLouisI am downloading an audio file in
.oga
format and saving it. Then I am trying to convert the file to.mp3
format, but the issue is the output file is always truncated and a maximum of 3 seconds. I have gone through the fluent-ffmpeg library and I can't seem to find what I'm doing wrong.

I have ffmpeg installed and I'm using the fluent-ffmpeg library. The downloaded .oga file doesn't seem to have any issues, the issue is after it gets converted to .mp3.


I also tried converting to .wav, and I faced the same issue.


Below is my current code :


const fs = require("fs");
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffmpeg = require('fluent-ffmpeg');
ffmpeg.setFfmpegPath(ffmpegPath);
const axios = require("axios");

const inputPath = __dirname + '/audio/input.oga';
const outputPath = __dirname + '/audio/output.mp3';

const saveVoiceMessage = async (url) => {
 try {
 const response = await axios({
 method: 'GET',
 url: url,
 responseType: 'stream'
 });
 const inStream = fs.createWriteStream(inputPath);
 await response.data.pipe(inStream);
 } catch (error) {
 console.error(error);
 }
}

const convertToMp3 = async () => {
 try {
 const outStream = fs.createWriteStream(outputPath);
 const inStream = fs.createReadStream(inputPath);
 // I also tried using the inputPath directly, still didn't work
 ffmpeg(inStream)
 .toFormat("mp3")
 .on('error', error => console.log(`Encoding Error: ${error.message}`))
 .on('exit', () => console.log('Audio recorder exited'))
 .on('close', () => console.log('Audio recorder closed'))
 .on('end', () => console.log('Audio Transcoding succeeded !'))
 .pipe(outStream, { end: true })
 } catch (error) {
 console.error(error);
 }
}

const saveAndConvertToMp3 = async (url) => {
 try {
 await saveVoiceMessage(url);
 await convertToMp3();
 }

 } catch (error) {
 console.error(error);
 }
}



-
Subtitles in ffmpeg/libavfilter
15 juin 2021, par Captain JackI have a C program to read video/audio with libav/ffmpeg libraries and decode it.



I am playing with some filters and most work just fine. I can draw text, overlay logos, flip and invert video colours. However, I am having big issues overlaying subtitles.



My filter is very simple.



const char *vfilter_descr = "[in]subtitles=subs.srt[out]";




On the console I get this :



[Parsed_subtitles_0 @ 0x7fe76c703240] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 2.4.0 (COMPLEX)
[Parsed_subtitles_0 @ 0x7fe76c703240] Using font provider coretext
[Parsed_subtitles_0 @ 0x7fe76c703240] fontselect: (Arial, 400, 0) -> /Library/Fonts/Microsoft/Arial.ttf, -1, ArialMT
[Parsed_subtitles_0 @ 0x7fe76c703240] fontselect: (Arial, 400, 100) -> /Library/Fonts/Microsoft/Arial Italic.ttf, -1, Arial-ItalicMT




...which somewhat confirms that subtitles are loading, though I am not sure why there are two fonts being loaded ?



However, they are not showing at all - almost as if they never loaded. I tried several different files, including ASS ones but no luck.



ffmpeg version is the latest one.



$ ffmpeg -v
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
 built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.3_1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-11.0.2.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --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-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
 libavutil 56. 22.100 / 56. 22.100
 libavcodec 58. 35.100 / 58. 35.100
 libavformat 58. 20.100 / 58. 20.100
 libavdevice 58. 5.100 / 58. 5.100
 libavfilter 7. 40.101 / 7. 40.101
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 3.100 / 5. 3.100
 libswresample 3. 3.100 / 3. 3.100
 libpostproc 55. 3.100 / 55. 3.100




Any ideas ?


-
How to burn subtitles into video with FFMPEG.wasm ?
22 août 2023, par JimIn a react project, with node v.16+, and
@ffmpeg/ffmpeg
v0.10.1 and@ffmpeg/core
v0.10.0

Im trying to burn subtitles into an .mp4, in-browser.


the command used was :


await ffmpeg.current.run('-i', 'test-input.mp4', '-vf', `subtitles=testSRT.srt`, 'test-output-2.mp4');


the ffmpeg configuration info is




configuration : —target-os=none —arch=x86_32 —enable-cross-compile
—disable-x86asm —disable-inline-asm —disable-stripping —disable-programs —disable-doc —disable-debug —disable-runtime-cpudetect —disable-autodetect —extra-cflags='-s USE_PTHREADS=1 -I/src/build/include -O3 —closure 1'
—extra-cxxflags='-s USE_PTHREADS=1 -I/src/build/include -O3 —closure 1' —extra-ldflags='-s USE_PTHREADS=1 -I/src/build/include -O3
—closure 1 -L/src/build/lib' —pkg-config-flags=—static —nm=llvm-nm —ar=emar —ranlib=emranlib —cc=emcc —cxx=em++ —objcc=emcc —dep-cc=emcc —enable-gpl —enable-nonfree —enable-zlib —enable-libx264 —enable-libx265 —enable-libvpx —enable-libwavpack —enable-libmp3lame —enable-libfdk-aac —enable-libtheora —enable-libvorbis —enable-libfreetype —enable-libopus —enable-libwebp —enable-libass —enable-libfribidi




the way i set the core package is like so :


ffmpeg.current = createFFmpeg({
 corePath: 'https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js',
 log: true
})



so this build is configured with
libass
as you can see in the config info, so it shouldnt have a problem with subtitling. but im getting an error related to the font, which i never explicitly set. this is the only error output related to subtitling

[Parsed_subtitles_0 @ 0x2134b80] can't find selected font provider


[Parsed_subtitles_0 @ 0x3764100] fontselect: failed to find any fallback for font: (Arial, 400, 0)


so the video is output to the set location, but theres no subtitles on the video. i assume because there was some error with the font, even though none was set. one other thing i tried to do was add a .ttf file to the project in
assets/fonts/
and explicitly set thefontsdir
value in the filter, but it seemed to have the same issues as well, heres that example :

await ffmpeg.current.run('-i', 'test-input.mp4', '-vf', `subtitles=testSRT.srt: fontsdir=../assets/fonts: force_style='Arial'`, 'test-output-2.mp4');