
Recherche avancée
Autres articles (19)
-
Qualité du média après traitement
21 juin 2013, parLe bon réglage du logiciel qui traite les média est important pour un équilibre entre les partis ( bande passante de l’hébergeur, qualité du média pour le rédacteur et le visiteur, accessibilité pour le visiteur ). Comment régler la qualité de son média ?
Plus la qualité du média est importante, plus la bande passante sera utilisée. Le visiteur avec une connexion internet à petit débit devra attendre plus longtemps. Inversement plus, la qualité du média est pauvre et donc le média devient dégradé voire (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (5100)
-
Anomalie #4374 : Sauvegarde au format SQLite impossible avec les dernières version de MariaDB
7 novembre 2020, par b bUn truc comme ça @marcimat ?
- <span class="CodeRay"><span class="line comment">diff --git a/ecrire/req/sqlite_generique.php b/ecrire/req/sqlite_generique.php</span>
- <span class="line comment">index 8ed38dc0a5..00d61660ee 100644</span>
- <span class="line head"><span class="head">--- </span><span class="filename">a/ecrire/req/sqlite_generique.php</span></span>
- <span class="line head"><span class="head">+++ </span><span class="filename">b/ecrire/req/sqlite_generique.php</span></span>
- <span class="change"><span class="change">@@</span> -2429,6 +2429,7 <span class="change">@@</span></span> <span class="keyword">function</span> <span class="function">_sqlite_remplacements_definitions_table</span>(<span class="local-variable">$query</span>, <span class="local-variable">$autoinc</span> = <span class="predefined-constant">false</span>) {
- <span class="string"><span class="delimiter">'</span><span class="content">/((char|varchar)</span><span class="delimiter">'</span></span> . <span class="local-variable">$num</span> . <span class="string"><span class="delimiter">'</span><span class="content">\s</span><span class="content">+not</span><span class="content">\s</span><span class="content">+null(</span><span class="content">\s</span><span class="content">+collate</span><span class="content">\s</span><span class="content">+</span><span class="content">\w</span><span class="content">+)?)</span><span class="content">\s</span><span class="content">*$/is</span><span class="delimiter">'</span></span> => <span class="string"><span class="delimiter">"</span><span class="char">\\</span><span class="content">1 DEFAULT ''</span><span class="delimiter">"</span></span>,
- <span class="string"><span class="delimiter">'</span><span class="content">/(datetime</span><span class="content">\s</span><span class="content">+not</span><span class="content">\s</span><span class="content">+null)</span><span class="content">\s</span><span class="content">*$/is</span><span class="delimiter">'</span></span> => <span class="string"><span class="delimiter">"</span><span class="char">\\</span><span class="content">1 DEFAULT '0000-00-00 00:00:00'</span><span class="delimiter">"</span></span>,
- <span class="string"><span class="delimiter">'</span><span class="content">/(date</span><span class="content">\s</span><span class="content">+not</span><span class="content">\s</span><span class="content">+null)</span><span class="content">\s</span><span class="content">*$/is</span><span class="delimiter">'</span></span> => <span class="string"><span class="delimiter">"</span><span class="char">\\</span><span class="content">1 DEFAULT '0000-00-00'</span><span class="delimiter">"</span></span>,
- <span class="line insert"><span class="insert">+</span> <span class="string"><span class="delimiter">'</span><span class="content">/current_timestamp</span><span class="content">\(</span><span class="content">\)</span><span class="content">/</span><span class="delimiter">'</span></span> => <span class="string"><span class="delimiter">'</span><span class="content">CURRENT_TIMESTAMP</span><span class="delimiter">'</span></span></span>
- );
- <span class="comment">// pour l'autoincrement, il faut des INTEGER NOT NULL PRIMARY KEY</span>
- </span>
-
NodeJS stream MKV as MP4 video
29 mars 2024, par SirMissAlotI'm trying to stream MKV video as MP4 on the fly with out saving the converted file


first I've tried without conversion :


public async streamById(req: Request, res: Response) {
 const movieId = req.params.id;
 const movie = await MovieModel.findById(movieId);
 if (!movie) {
 return res.status(404).send({ message: 'Movie not found' });
 }

 const filePath = movie.path;

 const stat = fs.statSync(filePath);
 const fileSize = stat.size;
 const range = req.headers.range;

 if (range) {
 const parts = range.replace(/bytes=/, '').split('-');
 const start = parseInt(parts[0], 10);
 const end = parts[1] ? parseInt(parts[1], 10) : fileSize - 1;

 const chunksize = end - start + 1;
 const file = fs.createReadStream(filePath, { start, end });
 const head = {
 'Content-Range': `bytes ${start}-${end}/${fileSize}`,
 'Accept-Ranges': 'bytes',
 'Content-Length': chunksize,
 'Content-Type': 'video/mp4',
 };

 res.writeHead(206, head);
 file.pipe(res);
 } else {
 const head = {
 'Content-Length': fileSize,
 'Content-Type': 'video/mp4',
 };
 res.writeHead(200, head);
 fs.createReadStream(filePath).pipe(res);
 }
 }



which is working but without audio


With ffmpeg I'm getting error : "Error during conversion : Output stream closed"


const command = ffmpeg(file)
 .format('mp4')
 .audioCodec('aac')
 .videoCodec('libx264')
 .outputOptions('-movflags frag_keyframe+empty_moov')
 .outputOptions('-preset veryfast')
 .on('error', (err: any) => {
 console.error('Error during conversion:', err.message);
 res.end();
 })
 .on('end', () => {
 console.log('Conversion complete ');
 res.end();
 });

 // Pipe ffmpeg output directly to the response
 command.pipe(res, { end: true });



-
avcodec/cbs_mpeg2 : Simplify splitting fragment
4 février 2022, par Andreas Rheinhardtavcodec/cbs_mpeg2 : Simplify splitting fragment
avpriv_find_start_code() supports non-contiguous buffers
by maintaining a state that allows to find start codes
that span across multiple buffers ; a consequence thereof
is that avpriv_find_start_code() is given a zero-sized
buffer, it does not modify this state, so that it appears
as if a start code was found if the state contained a start code.This can e.g. happen with Sequence End units in MPEG-2 and
to counter this, cbs_mpeg2_split_fragment() reset the state
when it has already encountered the end of the fragment
in order to add the last unit (if it is only of the form 00 00 01 xy)
only once ; it also used a flag to set whether this is the final unit.Yet this can be improved by simply resetting state unconditionally
(thereby avoiding a branch) ; the flag can be removed by just checking
whether we have a valid start code (of the next unit to add)
at the end.Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>