
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (33)
-
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...) -
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
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 (...)
Sur d’autres sites (2769)
-
Decode frame produced by ffmpeg lib using webcodecs
24 mars 2023, par mccatserver side extracting frame from video using ffmpeg library. Here is code :


AVFormatContext *pFormatContext = avformat_alloc_context();
 avformat_open_input(&pFormatContext, "VID_20230219_171331_300.mp4.mov", NULL, NULL);
 avformat_find_stream_info(pFormatContext, NULL);

 const AVCodec *pCodec = NULL;
 AVCodecParameters *pCodecParameters = NULL;
 int video_stream_index = -1;

 // loop though all the streams and print its main information
 for (int i = 0; i < pFormatContext->nb_streams; i++)
 {
 AVCodecParameters *pLocalCodecParameters = NULL;
 pLocalCodecParameters = pFormatContext->streams[i]->codecpar;
 const AVCodec *pLocalCodec = NULL;
 pLocalCodec = avcodec_find_decoder(pLocalCodecParameters->codec_id);

 if(pLocalCodec==NULL)
 continue;

 // when the stream is a video we store its index, codec parameters and codec
 if(pLocalCodecParameters->codec_type == AVMEDIA_TYPE_VIDEO)
 {
 if(video_stream_index == -1)
 {
 video_stream_index = i;
 pCodec = pLocalCodec;
 pCodecParameters = pLocalCodecParameters;

 const char *buffer = reinterpret_cast <const> (pFormatContext->streams[i]->codecpar->extradata);
 QFile file("extradata.txt"); //!!!!!!!!!!!!!!!! storing extradata for browser visualization
 file.open(QIODevice::WriteOnly);
 QDataStream out(&file);
 out.writeRawData(buffer, pFormatContext->streams[i]->codecpar->extradata_size);
 file.flush();
 file.close();
 }
 }
 }

 AVCodecContext *pCodecContext = avcodec_alloc_context3(pCodec);
 avcodec_parameters_to_context(pCodecContext, pCodecParameters);
 avcodec_open2(pCodecContext, pCodec, NULL);

 AVFrame *pFrame = av_frame_alloc();
 AVPacket *pPacket = av_packet_alloc();

 int response = 0;
 int how_many_packets_to_process = 800;

 int frame_c = 0, counter = 0;
 while(true)
 {
 frame_c = av_read_frame(pFormatContext, pPacket);

 if(frame_c < 0)
 break;

 if(pPacket->stream_index == video_stream_index)
 {
 const char *buffer = reinterpret_cast <const> (pPacket->data);
 response = decode_packet(pPacket, pCodecContext, pFrame);

 if(response < 0)
 break;

 counter++;
 if(--how_many_packets_to_process <= 0) break;

 if(counter > 1)
 {
 QFile file("frame.txt"); // !!!!!!!!!!!!!!!! storing single frame for browser visualization
 file.open(QIODevice::WriteOnly);
 QDataStream out(&file);
 out.writeRawData(buffer, arr.size());
 file.flush();
 file.close();
 break;
 }
 }

 av_packet_unref(pPacket);
 }
</const></const>


As the result i stored 2 txt files : 1 with extradata of codec and 2 with frame pixel data.
The next step is to decode this data in browser and display picture.
Here is how i try to do it :


<input type="file" />
<h3>Contents of the file:</h3>
<pre></pre>

<input type="file" />
<h3>Contents of the file:</h3>
<pre></pre>

<canvas width="720" height="1280">
Your browser does not support the HTML5 canvas tag.
</canvas>

<code class="echappe-js"><script>&#xA;&#xA;let pendingFrames = [];&#xA;let extraData = new Uint8Array;&#xA;&#xA;const init = {&#xA; output: handleFrame,&#xA; error: (e) => {&#xA; console.log(e.message);&#xA; },&#xA;};&#xA;&#xA;const config = {&#xA; codec: "avc1.64001E",&#xA; codedWidth: 720,&#xA; codedHeight: 1280,&#xA; description: extraData.buffer,&#xA;};&#xA;&#xA;function handleFrame(frame) {&#xA; const canvas = document.getElementById("myCanvas");&#xA; const ctx = canvas.getContext("2d");&#xA; ctx.drawImage(frame, 0, 0);&#xA; frame.close();&#xA;}&#xA;&#xA;function readSingleFile(e) {&#xA; var file = e.target.files[0];&#xA; if (!file) {&#xA; return;&#xA; }&#xA; var reader = new FileReader();&#xA; reader.onload = function(e) {&#xA; var contents = e.target.result;&#xA; displayContents(contents);&#xA; };&#xA; reader.readAsText(file);&#xA;} //end&#xA;&#xA;function displayContents(contents) {&#xA; var element = document.getElementById(&#x27;file-content&#x27;);&#xA; element.textContent = contents;&#xA;} // end&#xA;&#xA;const readFile = e => {&#xA; var file = e.target.files[0];&#xA; if (!file) {&#xA; return;&#xA; }&#xA;&#xA; let reader = new FileReader();&#xA;&#xA; reader.onload = function(e) {&#xA; let arrayBuffer = new Uint8Array(reader.result);&#xA; console.log(arrayBuffer);&#xA;&#xA; const decoder = new VideoDecoder(init);&#xA; decoder.configure(config);&#xA; &#xA; const chunk = new EncodedVideoChunk({&#xA; timestamp: 20,&#xA; type: "key",&#xA; data: arrayBuffer,&#xA; });&#xA;&#xA; decoder.decode(chunk);&#xA; }&#xA;&#xA; reader.readAsArrayBuffer(file);&#xA;} //end&#xA;&#xA;const readFile2 = e => {&#xA; var file = e.target.files[0];&#xA; if (!file) {&#xA; return;&#xA; }&#xA;&#xA; let reader = new FileReader();&#xA;&#xA; reader.onload = function(e) {&#xA; extraData = new Uint8Array(reader.result);&#xA; console.log(extraData);&#xA; }&#xA;&#xA; reader.readAsArrayBuffer(file);&#xA;} //end&#xA;&#xA;document.getElementById(&#x27;file-input&#x27;)&#xA; .addEventListener(&#x27;change&#x27;, readFile, false);&#xA;&#xA;document.getElementById(&#x27;file-input2&#x27;)&#xA; .addEventListener(&#x27;change&#x27;, readFile2, false);&#xA;&#xA;</script>



file-input2 - is for extradata and file-input - for frame data.


After i run this code in browser i got following error message :
---> Failed to execute 'configure' on 'VideoDecoder' : description is detached.
Also i had another type of error messages such as something wrong with codec config (codec description)


Please help to find what im doing wrong =)
Thanks in advance.


-
FFMPEG how to use https dynamic url as input for amovie filter
2 juillet 2020, par Johny SharmaBasically what i am trying to do is to calling a dynamic php url which is generating a audio file for me and just want to use that file as an input for amovie filter.
I hope you have understand my question.


What i have done so far ?


I have a FFMPEG code which is :


ffmpeg-y -i 'bg-file.mp3' -c copy -map 0:0 -map 1:0 -filter_complex "amovie='/auth.php?input=string&l=hi&f.mp3':loop=999[sc][mix];[0:a][sc]sidechaincompress=threshold=0.100:ratio=20,volume=10dB:precision=fixed[bg], [bg][mix]amix=duration=first" -c:a libmp3lame -ac 2 "save.mp3"



This line is calling my dynamic url for generating the required song.


"amovie='/auth.php?input=string&l=hi&f.mp3'



Everything is working if i check them apart. but when i use them together the ffmpeg is giving the following error.


[22] => [Parsed_amovie_0 @ 0x1378140] Failed to avformat_open_input '/auth.php?input=string&l=hi&f.mp3':loop=999'
[23] => [AVFilterGraph @ 0x1368ca0] Error initializing filter 'amovie' with args '/auth.php?input=string&l=hi&f.mp3':loop=999'
[24] => Error initializing complex filters.
[25] => No such file or directory



I dont know is it possible to put a dynamically generated url as an input for amovie filter or not ?
if i open my dynamic url in browser its works like a mp3 file and play similar to any mp3 file.


using this code to play that mp3 :


header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($path));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
ob_clean();
flush();
readfile($path);
exit;



This one looks similar to my query but slightly different and that's why i am still looking for a solution


How to use https input with ffmpeg "amovie" filter ?


-
Java - send command to FFMPEG process to stop
2 septembre 2022, par Varun BaliI am trying to integrate FFMPEG for screen capture in my program & when the time comes to stop the capture I have to pass 'q' in the commandline to stop the render & save the capture in MP4 file. Unfortunately I am not able to stop FFMPEG & it continues to run in the background. The screenshot below shows FFMPEG running when executed manually via terminal or CMD that q key needs to be passed to halt it.




Below is my code so far :


public static void main(String[] args) throws IOException
{
 var processBuilder = new ProcessBuilder();
 var file = new File("D:\\ffmpeg-5.1-essentials_build\\bin");
 processBuilder.directory(file);
 processBuilder.command("CMD", "/C", "ffmpeg.exe -f gdigrab -i desktop -c:v libx264 -b:v 6000K -minrate 6000K -maxrate 6000K -bufsize 6000K -pix_fmt yuv420p -r 60 -profile:v main -crf 12 -x264-params scenecut=0:open_gop=0:min-keyint=72:keyint=72 -y " +
 "D:\\Users\\vabali\\Documents\\Workspace\\Captures\\output.mp4");
 var process = processBuilder.start();
 Awaitility.await().atMost(Duration.ofSeconds(5)).until(() -> process.descendants().toList().size() > 1);
 System.out.println("FFMPEG PID = " + process.descendants().toList().get(1).pid());
 var output = process.getOutputStream();
 output.write(KeyEvent.VK_Q);
 output.flush();
 System.out.println(process.descendants().toList().get(1).isAlive());



}


I have tried output.write('q'), output.write("q".getBytes()) but nothing has worked so far. Using the destroy method terminates ffmpeg but abnormal termination corrupts the MP4 making it useless. The program has stop graciously. Can someone help me to figure out how to pass q to console to stop the render ?