
Recherche avancée
Médias (1)
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
Autres articles (75)
-
Initialisation de MediaSPIP (préconfiguration)
20 février 2010, parLors de l’installation de MediaSPIP, celui-ci est préconfiguré pour les usages les plus fréquents.
Cette préconfiguration est réalisée par un plugin activé par défaut et non désactivable appelé MediaSPIP Init.
Ce plugin sert à préconfigurer de manière correcte chaque instance de MediaSPIP. Il doit donc être placé dans le dossier plugins-dist/ du site ou de la ferme pour être installé par défaut avant de pouvoir utiliser le site.
Dans un premier temps il active ou désactive des options de SPIP qui ne le (...) -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)
Sur d’autres sites (9758)
-
How to feed frames one by one and grab decoded frames using LibAV ?
15 septembre 2024, par Alvan RahimliI am integrating a third party system where I send a TCP packet to ask e.g. 5 frames from a live CCTV camera stream, and it sends those 5 frames one by one. Each package is h264 encoded frame, wrapped with some relevant data.


I need to write a code using Libav where I can :


- 

- Feed the frames one by one using AVIOContext (or smth similar).
- Grab decoded frame.
- Draw that to a window (Not relevant to the question, writing for context).








I've been doing the same with GStreamer by creating a pipeline like this :


AppSrc -> H264Parser -> H264Decoder -> FrameGrabber



The code below is what I was able to write so far :


using System.Runtime.InteropServices;
using FFmpeg.AutoGen;

namespace AvIoCtxExperiment;

public static unsafe class Program
{
 public static void Main()
 {
 ffmpeg.avdevice_register_all();
 Console.WriteLine($"FFmpeg v: {ffmpeg.av_version_info()}");

 // Generous buffer size for I frames (~43KB)
 const int bufferSize = 50 * 1024;

 var buff = (byte*)ffmpeg.av_malloc(bufferSize);
 if (buff == null)
 throw new Exception("Buffer is null");

 // A mock frame provider. Frames are stored in separate files and this reads & returns them one-by-one.
 var frameProvider = new FrameProvider(@"D:\Frames-1", 700);
 var gch = GCHandle.Alloc(frameProvider);

 var avioCtx = ffmpeg.avio_alloc_context(
 buffer: buff,
 buffer_size: bufferSize,
 write_flag: 0,
 opaque: (void*)GCHandle.ToIntPtr(gch),
 read_packet: new avio_alloc_context_read_packet(ReadFunc),
 write_packet: null,
 seek: null);

 var formatContext = ffmpeg.avformat_alloc_context();
 formatContext->pb = avioCtx;
 formatContext->flags |= ffmpeg.AVFMT_FLAG_CUSTOM_IO;

 var openResult = ffmpeg.avformat_open_input(&formatContext, null, null, null);
 if (openResult < 0)
 throw new Exception("Open Input Failed");

 if (ffmpeg.avformat_find_stream_info(formatContext, null) < 0)
 throw new Exception("Find StreamInfo Failed");

 AVPacket packet;
 while (ffmpeg.av_read_frame(formatContext, &packet) >= 0)
 {
 Console.WriteLine($"GRAB: {packet.buf->size}");
 ffmpeg.av_packet_unref(&packet);
 }
 }

 private static int ReadFunc(void* opaque, byte* buf, int bufSize)
 {
 var frameProvider = (FrameProvider?)GCHandle.FromIntPtr((IntPtr)opaque).Target;
 if (frameProvider == null)
 {
 return 0;
 }

 byte[] managedBuffer = new byte[bufSize];

 var fBuff = frameProvider.NextFrame();
 if (fBuff == null)
 {
 return ffmpeg.AVERROR_EOF;
 }

 int bytesRead = fBuff.Length;
 fBuff.CopyTo(managedBuffer, 0);

 if (bytesRead > 0)
 {
 Marshal.Copy(managedBuffer, 0, (IntPtr)buf, bytesRead);
 Console.WriteLine($"READ size: {fBuff.Length}");
 return bytesRead;
 }

 return ffmpeg.AVERROR_EOF;
 }
}



Second thing that confuses me is with AppSrc, I can feed frame of any size, but with LibAV, it asks for buffer size. With AppSrc, I am responsible of feeding frames into the pipeline. GStreamer notifies me when it is enough with signals. But with libav, it calls read_packet delegate itself.


Any help is much appreciated. Thanks.


P.S. I'm writing a C# app, but sample code in C is fine, I can adapt the code myself.


-
How to feed frames one by one and grab decoded frames using LibAV ?
22 septembre 2024, par Alvan RahimliI am integrating a third party system where I send a TCP packet to ask e.g. 5 frames from a live CCTV camera stream, and it sends those 5 frames one by one. Each package is h264 encoded frame, wrapped with some relevant data.


I need to write a code using Libav where I can :


- 

- Feed the frames one by one using AVIOContext (or smth similar).
- Grab decoded frame.
- Draw that to a window (Not relevant to the question, writing for context).








I've been doing the same with GStreamer by creating a pipeline like this :


AppSrc -> H264Parser -> H264Decoder -> FrameGrabber



The code below is what I was able to write so far :


using System.Runtime.InteropServices;
using FFmpeg.AutoGen;

namespace AvIoCtxExperiment;

public static unsafe class Program
{
 public static void Main()
 {
 ffmpeg.avdevice_register_all();
 Console.WriteLine($"FFmpeg v: {ffmpeg.av_version_info()}");

 // Generous buffer size for I frames (~43KB)
 const int bufferSize = 50 * 1024;

 var buff = (byte*)ffmpeg.av_malloc(bufferSize);
 if (buff == null)
 throw new Exception("Buffer is null");

 // A mock frame provider. Frames are stored in separate files and this reads & returns them one-by-one.
 var frameProvider = new FrameProvider(@"D:\Frames-1", 700);
 var gch = GCHandle.Alloc(frameProvider);

 var avioCtx = ffmpeg.avio_alloc_context(
 buffer: buff,
 buffer_size: bufferSize,
 write_flag: 0,
 opaque: (void*)GCHandle.ToIntPtr(gch),
 read_packet: new avio_alloc_context_read_packet(ReadFunc),
 write_packet: null,
 seek: null);

 var formatContext = ffmpeg.avformat_alloc_context();
 formatContext->pb = avioCtx;
 formatContext->flags |= ffmpeg.AVFMT_FLAG_CUSTOM_IO;

 var openResult = ffmpeg.avformat_open_input(&formatContext, null, null, null);
 if (openResult < 0)
 throw new Exception("Open Input Failed");

 if (ffmpeg.avformat_find_stream_info(formatContext, null) < 0)
 throw new Exception("Find StreamInfo Failed");

 AVPacket packet;
 while (ffmpeg.av_read_frame(formatContext, &packet) >= 0)
 {
 Console.WriteLine($"GRAB: {packet.buf->size}");
 ffmpeg.av_packet_unref(&packet);
 }
 }

 private static int ReadFunc(void* opaque, byte* buf, int bufSize)
 {
 var frameProvider = (FrameProvider?)GCHandle.FromIntPtr((IntPtr)opaque).Target;
 if (frameProvider == null)
 {
 return 0;
 }

 byte[] managedBuffer = new byte[bufSize];

 var fBuff = frameProvider.NextFrame();
 if (fBuff == null)
 {
 return ffmpeg.AVERROR_EOF;
 }

 int bytesRead = fBuff.Length;
 fBuff.CopyTo(managedBuffer, 0);

 if (bytesRead > 0)
 {
 Marshal.Copy(managedBuffer, 0, (IntPtr)buf, bytesRead);
 Console.WriteLine($"READ size: {fBuff.Length}");
 return bytesRead;
 }

 return ffmpeg.AVERROR_EOF;
 }
}



Second thing that confuses me is with AppSrc, I can feed frame of any size, but with LibAV, it asks for buffer size. With AppSrc, I am responsible of feeding frames into the pipeline. GStreamer notifies me when it is enough with signals. But with libav, it calls read_packet delegate itself.


Any help is much appreciated. Thanks.


P.S. I'm writing a C# app, but sample code in C is fine, I can adapt the code myself.


-
configure : Don’t force _WIN32_WINNT to an older version if targeting winphone/winrt
24 juillet 2015, par Martin Storsjöconfigure : Don’t force _WIN32_WINNT to an older version if targeting winphone/winrt
This avoids having to manually set _WIN32_WINNT in —extra-cflags
when targeting these API families, which only was necessary to
work around configure setting _WIN32_WINNT to an older version
by default.Signed-off-by : Martin Storsjö <martin@martin.st>