
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (111)
-
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 (...) -
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 -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...)
Sur d’autres sites (10882)
-
Matomo Further Invests in Security by Doubling Bug Bounty Rewards
7 janvier 2022, par erin — Community, Press Releases -
how to send the input data to FFMPEG from a C# program
18 octobre 2020, par jstuardoI need to send a binary stream to FFMPEG so that it sends to an RTMP server.


I did it in a nodejs script using socket.io library and in Linux. It works perfectly.


I need to do the same, but in a Windows Forms application using C#.


This is how I run the ffmpeg.exe application :


_currentProcess = new Process();
 _currentProcess.StartInfo.FileName = _ffmpegExe;
 _currentProcess.StartInfo.Arguments = BuildOptions(framesPerSecond, audioBitRate, audioEncoding, rtmpServer);
 _currentProcess.StartInfo.UseShellExecute = false;
 _currentProcess.StartInfo.CreateNoWindow = true;
 _currentProcess.StartInfo.RedirectStandardInput = true;
 _currentProcess.StartInfo.RedirectStandardError = true;
 _currentProcess.ErrorDataReceived += CurrentProcess_ErrorDataReceived;
 _currentProcess.Start();
 _currentProcess.BeginErrorReadLine();



BuildOptions
method is defined this way :

private string BuildOptions(int framesPerSecond, int audioBitRate, string audioEncoding, string rtmpServer)
 {
 string options;
 if (framesPerSecond == 1)
 {
 options = $"-i - -c:v libx264 -preset ultrafast -tune zerolatency -r 1 -g 2 -keyint_min 2 -x264opts keyint=2 -crf 25 -pix_fmt yuv420p -profile:v baseline -level 3 -c:a aac -b:a {audioEncoding} -ar {audioBitRate}-f flv {rtmpServer}";
 }
 else if (framesPerSecond == 15)
 {
 options = $"-i - -c:v libx264 -preset ultrafast -tune zerolatency max_muxing_queue_size 1000 -bufsize 5000 -r 15 -g 30 -keyint_min 30 -x264opts keyint=30 -crf 25 -pix_fmt yuv420p -profile:v baseline -level 3 -c:a aac -b:a {audioEncoding} -ar {audioBitRate} -f flv {rtmpServer}";
 }
 else
 {
 options = $"-i - -c:v libx264 -preset ultrafast -tune zerolatency -c:a aac -ar {audioBitRate} -b:a {audioEncoding} -bufsize 5000 -f flv {rtmpServer}";
 }

 return options;
 }



I am sending the data to the standard input this way :


public void EncodeAndSend(byte[] data)
 {
 if (_currentProcess != null)
 {
 var streamWriter = _currentProcess.StandardInput;
 streamWriter.Write(Encoding.GetEncoding("ISO-8859-1").GetChars(data));
 }
 }



And finally, this method is for receiving the standard error which receives the result from ffmpeg.exe :


private void CurrentProcess_ErrorDataReceived(object sender, DataReceivedEventArgs e)
 {
 Console.WriteLine(e.Data);
 }



When I run the application, this is shown in the console :


ffmpeg version 4.3.1-2020-10-01-essentials_build-www.gyan.dev Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 10.2.0 (Rev3, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
pipe:: Invalid data found when processing input



If I change the
EncodeAndSend
method to be :

public void EncodeAndSend(byte[] data)
 {
 if (_currentProcess != null)
 {
 var streamWriter = _currentProcess.StandardInput;
 streamWriter.Write(data);
 }
 }



pipe:: Invalid data found when processing input
error is not produced, but no more outputs are shown so it seems it is not working.

What is wrong with this ? how can I send the data to the FFMPEG process ?


Finally, I tell you that the binary stream comes from the camera by mean of MediaRecorder in a web page (the same used for my program in nodejs server, so that it is not the issue here)


-
Attempting to compile FFmpeg 4.2.3 statically for Windows 10 (x86_64), but binaries asks for missing DLLs
29 mai 2020, par ExpectatorI am using Msys MinGW (x86_64) and pulled a snapshot of the latest major release of FFmpeg off of their website. Here is my
./configure
options. I plan to use the binaries on both the computer that I compiled it on, and other Windows computers that I own.


./configure --enable-libaom --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --enable-libgme --enable-libmfx --enable-libkvazaar --enable-libmp3lame --enable-libilbc --enable-libvpx --enable-libmodplug --enable-version3 --enable-nonfree --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libfdk-aac --enable-libopenh264 --enable-libopenjpeg --enable-nvenc --enable-nvdec --enable-cuda --enable-cuvid --enable-libtwolame --enable-vapoursynth --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxavs2 --enable-gpl --enable-static --disable-shared




Output of configure script (pastebin)



Output of
uname -a
(in Msys)


MINGW64_NT-10.0-18362 <scrubbed> 3.1.4-340.x86_64 2020-05-22 08:28 UTC x86_64 Msys
</scrubbed>



The issue that I'm facing is that despite passing the options
--enable-static
and--disable-shared
, the executables generated still requirelibchromaprint.dll
,libfdk-aac-2.dll
, andlibgme.dll
to run. What I expected was that FFmpeg would execute independently of any DLL files since I passed those options to./configure
.