
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (65)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
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
Sur d’autres sites (7140)
-
FFmpeg.AutoGen C# library Can't open Codec G726
8 septembre 2024, par Rushdi EskandarI am stuck with FFmpeg.AutoGen G726 Audio codec, it always shows error invalid argument.
Note that I Tried other codecs such as G722, G711 and it is working fine except for G726 codec. I also confirm that my binaries does support G726 codec using this command ffmpeg -formats. Please tell me what could be the reason, and if you know any other library for decoding G726 that would be better


public unsafe class AudioDecoder : IDisposable
 {
 private AVCodecContext* _codecContext;
 private AVCodec* _codec;
 private AVFrame* _frame;
 private AVPacket* _packet;

 public AudioDecoder()
 {
 // Find the G726 decoder
 _codec = ffmpeg.avcodec_find_decoder(AVCodecID.AV_CODEC_ID_ADPCM_G726);
 if (_codec == null)
 {
 throw new Exception("G726 codec not found.");
 }

 // Allocate codec context
 _codecContext = ffmpeg.avcodec_alloc_context3(_codec);
 if (_codecContext == null)
 {
 throw new Exception("Failed to allocate codec context.");
 }

 // Print supported sample formats
 Console.WriteLine("Supported sample formats for G726 codec:");
 AVSampleFormat* sample_fmts = _codec->sample_fmts;
 if (sample_fmts != null)
 {
 while (*sample_fmts != AVSampleFormat.AV_SAMPLE_FMT_NONE)
 {
 Console.WriteLine($"Sample format: {*sample_fmts}");
 sample_fmts++;
 }
 }

 // Set codec parameters
 _codecContext->sample_rate = 8000; // G726 typically uses 8000Hz
 if (_codec->sample_fmts != null)
 {
 _codecContext->sample_fmt = *_codec->sample_fmts; // Use the first supported sample format
 }
 else
 {
 _codecContext->sample_fmt = AVSampleFormat.AV_SAMPLE_FMT_S16; // Fallback to a common format
 }
 _codecContext->bit_rate = 32000; // Example bitrate for G726

 // Attempt to open the codec with detailed error logging
 int ret = ffmpeg.avcodec_open2(_codecContext, _codec, null);
 if (ret < 0)
 {
 byte[] errBuf = new byte[1024];
 fixed (byte* errPtr = errBuf)
 {
 ffmpeg.av_strerror(ret, errPtr, (ulong)errBuf.Length);
 }
 string errMessage = System.Text.Encoding.UTF8.GetString(errBuf);
 throw new Exception($"Failed to open codec (Error code: {ret}): {errMessage}");
 }

 // Allocate packet and frame
 _packet = ffmpeg.av_packet_alloc();
 _frame = ffmpeg.av_frame_alloc();
 if (_packet == null || _frame == null)
 {
 throw new Exception("Failed to allocate packet or frame.");
 }
 }
}



-
Convert video with FFMPEG Library in android
27 septembre 2012, par Sanat PandeyI have a problem that I received a video foile from the server which can not be played throgh video view from the app I am making. I don't know what the actaul problem is because all videos are played through same video view but the video received from the server side is not played. So, I think that I have to integrate FFMPEG in our android app, so I can play every video at a runtime conversion. For this I have read much more about FFMPEG Library integration with android through many sites as :
http://www.roman10.net/how-to-build-android-applications-based-on-ffmpeg-by-an-example/
Downloaded some projects from GitHUb
(https://github.com/appunite/AndroidFFmpeg)
but unable to succeed for building the Library through NDK. Some thing I missed and I am working on Windows machine, probably this might be a problem. I want the exact solution regarding this, means step by step solution for building the android project with FFMPEG Library. If you have some useful suggestion then please share with me.Thanks in advance.
-
Android - How can I pass camera stream to ffmpeg, using Camera2 library ?
29 mars 2021, par Juan José CetraroI am trying to create an app that shows the camera of the device on the screen, and also streams the camera by srt. To do this, I am using Camera2 library, and ffmpeg (in partucular I am using https://github.com/tanersener/mobile-ffmpeg, that is a ffmpeg wrapper for Android).


My plan is to get the camera stream using Camera2 (using the method onImageAvailable on ImageReader.OnImageAvailableListener class), and send this stream to udp ://localhost:1234. Then, I can use ffmpeg to get that stream by udp, and send it by srt.


I've already solved the part of sending the stream by srt using ffmpeg, and it works fine. In fact, if I set "android_camera" as the input of my ffmpeg command, my app works ok. The problem with this approach, is that if I do that, I block the access to the camera, so I can't show the camera on the screen with another library.


I also found a code that uses Camera2 to stream the camera by udp, and it works, but the problem with this code is that converts each frame to bitmap before sending it by udp, and it makes that it is not performant.


So, I need to know which is the best way to pass the data by udp to ffmpeg, so ffmpeg could process it and send it by srt ?


Camera2 let me to configure which format I want to receive the frames on my listener :


ImageReader.newInstance(1280, 720, ImageFormat.JPEG, /*maxImages*/2);



In this example I am setting JPEG as ImageFormat, but here I let you all the available formats I could use :


UNKNOWN, RGB_565, YV12, Y8, Y16, NV16, NV21, YUY2, JPEG, DEPTH_JPEG, YUV_420_888, YUV_422_888, YUV_444_888, FLEX_RGB_888, FLEX_RGBA_8888, RAW_SENSOR, RAW_PRIVATE, RAW10, RAW12, DEPTH16, DEPTH_POINT_CLOUD, RAW_DEPTH, PRIVATE, HEIC


This is the method where I am going to receive each frame, and what I need to know is what kind of transformation I have to do before sending the frame by udp to ffmpeg ? :


@Override
public void onImageAvailable(ImageReader reader) {

}



Thanks in advance for reading the question :)