
Recherche avancée
Autres articles (66)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...) -
Sélection de projets utilisant MediaSPIP
29 avril 2011, parLes exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
Ferme MediaSPIP @ Infini
L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)
Sur d’autres sites (4097)
-
How to set AVCodecContext args with h264 correctly ?
15 juin 2017, par wzjingI’m doing a video transcoder demo with ffmpeg lib and libx264 lib. I already can transcode video successully, but the output video can only play by some powerful player like VLC. I need it can be played by the Win10 default player and the Android default player. I hava found the reason may be encode AVCodecContext args. I try to copy those args frome decode AVCodecContext, the output can be played by Win10 defualt player, but the video became totally black.
Here is my encode AVCodecContext args :encoder = avcodec_find_encoder(AV_CODEC_ID_H264);
if (!encoder) {
av_log(NULL, AV_LOG_FATAL, "Necessary encoder not found\n");
return AVERROR_INVALIDDATA;
}
enc_ctx = avcodec_alloc_context3(encoder);
enc_ctx->height = output_height;
enc_ctx->width = output_width;
enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio;
enc_ctx->bit_rate = 1000000;
/* take first format from list of supported formats */
if (encoder->pix_fmts)
enc_ctx->pix_fmt = AV_PIX_FMT_YUV420P;
else
enc_ctx->pix_fmt = dec_ctx->pix_fmt;
enc_ctx->time_base = av_inv_q(dec_ctx->framerate);
enc_ctx->gop_size = 12;
av_opt_set(enc_ctx->priv_data, "preset", "slow", 0);
av_opt_set(enc_ctx->priv_data, "tune", "zerolatency", 0);
enc_ctx->profile = FF_PROFILE_H264_HIGH;
enc_ctx->codec_type = AVMEDIA_TYPE_VIDEO;
enc_ctx->codec_tag = 0; -
Can not use the jsmpeg in react "Unexpected use of 'self'"
5 mai 2020, par Muhammad Anas Khancode that i want to convert in React




 
 <code class="echappe-js"><script type="text/javascript" src='http://stackoverflow.com/feeds/tag/jsmpeg.min.js'></script>


<script type="text/javascript">&#xA; var canvas = document.getElementById("videoCanvas");&#xA; console.log(document.location.hostname);&#xA; var url = "ws://localhost:9999/";&#xA; </script>

 




Can not change it to react format.When i try to convert it is giving jsmpeg error 
i.e



code that i tried but get an error



import React from 'react';
import ReactDOM from 'react-dom';
import "./jsmpeg.min.js"
const App =()=>{
 return(
 <h1>Hello</h1>
 )
}


ReactDOM.render(<app></app>,document.getElementById('root'));




Error



/src/jsmpeg.min.js
Line 606:9 : Unexpected use of 'self' no-restricted-globals
 Line 2771:13 : Expected an assignment or function call and instead saw an expression no-unused-expressions



Search for the keywords to learn more about each error.


-
FFMPEG rtmp stream slow and only works on chrome
18 juin 2023, par DrMeepsoI am trying to stream to twitch from a Node.js script for fun ! so far i have got it working but its slow and seemingly limited to 10-12 fps.


Here is my code, i am trying to stream a Node-Canvas to twitch so i can do stuff without the overhead of OBS and in a console :


import { createCanvas } from 'canvas';
import { spawn } from 'child_process'
import fs from 'fs';

const canvas = createCanvas(1920, 1080);
const ctx = canvas.getContext('2d');
// create a ffmpeg process that will stream the canvas to a rtmp server
const ffmpeg = spawn('ffmpeg', [
 '-re', // read input at native frame rate
 '-f', 'image2pipe', // tell ffmpeg to expect raw image stream
 '-vcodec', 'png', // tell ffmpeg to expect jpeg encoded images
 '-r', '10', // tell ffmpeg to expect 60 fps
 '-s', '1920x1080', // tell ffmpeg to expect size 1920x1080
 '-i', '-', // tell ffmpeg to expect input from stdin
 //'-c:v', 'h264_amf', // tell ffmpeg to encode in h264 codec AMD
 '-c:v', 'libx264', // tell ffmpeg to encode in h264 codec
 '-pix_fmt', 'yuv420p', // tell ffmpeg to encode in yuv420p format
 '-preset', 'ultrafast', // tell ffmpeg to use ultrafast encoding preset
 '-g', '20', // set the keyframe interval to 2 seconds so twitch will not reject the stream
 '-f', 'flv', // tell ffmpeg that we are going to stream flv video
 "rtmp://live.restream.io/live/"
]);

ffmpeg.on('close', (code, signal) => {
 console.log('FFmpeg child process closed, code ' + code + ', signal ' + signal);
})

ffmpeg.on('error', (err) => {
 console.log('FFmpeg child process error: ' + err.message);
})

ffmpeg.stderr.on('data', (data) => {
 //console.log('FFmpeg stderr: ' + data);
 //ParseFFPMPEGOutput(data.toString());
})

ffmpeg.stdout.on('data', (data) => {
 console.log('FFmpeg stdout: ' + data);
})

var DrawingCatagorys: string[] = []
fs.readFileSync('categories.txt').toString().split('\n').forEach(function (line) { DrawingCatagorys.push(line); })

function ParseFFPMPEGOutput(data: string) {

 if (data.includes('frame=')) {
 let frame = data.split('frame=')[1].split('fps')[0].trim();
 let fps = data.split('fps=')[1].split('q=')[0].trim();
 let size = data.split('size=')[1].split('time=')[0].trim();
 let time = data.split('time=')[1].split('bitrate=')[0].trim();
 let bitrate = data.split('bitrate=')[1].split('speed=')[0].trim();

 console.log(`Frame: ${frame} FPS: ${fps} Size: ${size} Time: ${time} Bitrate: ${bitrate}`);
 }

}

// create a png stream
setInterval(() => {
 // convert canvas to png
 const buffer = canvas.toBuffer('image/png');
 // write png stream to stdin of ffmpeg process
 ffmpeg.stdin.write(buffer);
}, 2);



Im thinking it has to do with Node-Canvas just being slow but i have no idea, also even on my gaming rig it cant pull 1x speed while streaming always sitting around 0.95 - 0.98 and about 9.2 fps. also it only works on chrome and not firefox ? i have no idea why probably a codec thing