Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (11)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (3408)

  • 2011 In Open Source Multimedia

    5 janvier 2012, par Multimedia Mike — Open Source Multimedia

    Sometimes I think that the pace of multimedia technology is slowing down. Obviously, I’m not paying close enough attention. I thought I would do a little 2011 year-end review of what happened in the world of open source multimedia, mainly for my own benefit. Let me know in the comments what I missed.

    The Split
    The biggest deal in open source multimedia was the matter of the project split. Where once stood one project (FFmpeg) there now stands two (also Libav). Where do things stand with the projects now ? Still very separate but similar. Both projects obsessively monitor each other’s git commits and prodigiously poach each other’s work, both projects being LGPL and all. Most features that land in one code base end up in the other. Thus, I refer to FFmpeg and Libav collectively as “the projects”.

    Some philosophical reasons for the split included project stagnation and development process friction. Curiously, these problems are fond memories now and the spirit of competition has pushed development forward at a blinding pace.

    People inside the project have strong opinions about the split ; that’s understandable. People outside the project have strong opinions about the split ; that’s somewhat less understandable, but whatever. After 5 years of working for Adobe on the Flash Player (a.k.a. the most hated software in all existence if internet nerds are to be believed on the matter), I’m so over internet nerd drama.

    For my part, I just try to maintain some appearance of neutrality since I manage some shared resources for the open source multimedia community (like the wiki and samples repo) and am trying to keep them from fracturing as well.

    Apple and Open Source
    It was big news that Apple magnanimously open sourced their lossless audio codec. That sets a great example and precedent.

    New Features
    I mined the 'git log' of the projects in order to pick out some features that were added during 2011.

    First off, Apple’s ProRes video codec was reverse engineered and incorporated into the multimedia libraries. And for some weird reason, this is an item that made the rounds in the geek press. I’m not entirely sure why, but it may have something to do with inter-project conflict. Anyway, here is the decoder in action, playing a video of some wild swine, one of the few samples we have :



    Other new video codecs included a reverse engineered Indeo 4 decoder. Gotta catch ‘em all ! That completes our collection of Indeo codecs. But that wasn’t enough– this year, we got a completely revised Indeo 3 decoder (the previous one, while functional, exhibited a lot of code artifacts betraying a direct ASM ->C translation). Oh, and many thanks to Kostya for this gem :



    That’s the new Origin Xan decoder (best known for Wing Commander IV cinematics) in action, something I first started reverse engineering back in 2002. Thanks to Kostya for picking up my slack yet again.

    Continuing with the codec section, there is a decoder for Adobe Flash Screen Video 2 — big congrats on this ! One of my jobs at Adobe was documenting this format to the outside world and I was afraid I could never quite make it clear enough to build a complete re-implementation. But the team came through.

    Let’s see, there are decoders for VBLE video, Ut Video, Windows Media Image (WMVP/WMP2), Bink audio version ‘b’, H.264 4:2:2 intra frames, and MxPEG video. There is a DPX image encoder, a Cirrus Logic AccuPak video encoder, and a v410 codec.

    How about some more game stuff ? The projects saw — at long last — an SMJPEG demuxer. This will finally allow usage and testing of the SMJPEG IMA ADPCM audio decoder I added about a decade ago. Funny story behind that– I was porting all of my decoders from xine which included the SMJPEG ADPCM. I just never quite got around to writing a corresponding demuxer. Thanks to Paul Mahol for taking care of that.

    Here’s a DFA playback system for a 1995 DOS CD-ROM title called Chronomaster. No format is too obscure, nor its encoded contents too cheesy :



    There’s now a demuxer for a format called XMV that was (is ?) prevalent on Xbox titles. Now the projects can handle FMV files from many Xbox games, such as Thrillville.



    The projects also gained the ability to play BMV files. I think this surfing wizard comes from Discworld II. It’s non-computer-generated animation at a strange resolution.



    More demuxers : xWMA, PlayStation Portable PMP format, and CRI ADX format ; muxer for OpenMG audio and LATM muxer/demuxer.

    One more thing : an AVX-optimized fast Fourier transform (FFT). If you have a machine that supports AVX, there’s no way you’ll even notice the speed increase of a few measly FFT calls for audio coding/decoding, but that’s hardly the point. The projects always use everything on offer for any CPU.

    Please make me aware of features that I missed in the list !

    Continuous Testing
    As a result of the split, each project has its own FATE server, one for FFmpeg and one for Libav. As of the new year, FFmpeg has just over 1000 tests while Libav had 965. This is one area where I’m obviously ecstatic to see competition. Some ad-hoc measurements on my part indicate that the total code coverage via the FATEs has not appreciably increased. But that’s a total percentage. Both the test count and the code count have been steadily rising.

    Google Summer of Code and Google Code-In
    Once again, the projects were allowed to participate in the Google Summer of Code as well as Google Code-In. I confess that I didn’t keep up with these too carefully (and Code-In is still in progress as of this writing). I do know that the project split occurred after FFmpeg had already been accepted for GSoC season 2011 and the admins were gracious enough to allow FFmpeg and Libav to allow both projects to participate in the same slot as long as they could both be mature about it.

    Happy New Year
    Let’s see what we can accomplish in 2012.

  • C# Bitmap to AVI / WMV with Compression

    5 juillet 2019, par Digitalsa1nt

    Prelude :

    I’m going to preface this with, I have been learning C# in my spare time at work, and that I have been staring at code for a solid two days trying to wrap my head around this problem. I am developing some software to be used with a visualiser that connects by USB to a standard Desktop PC, the software detects the capture device and loads frames into bitmap using a New Frame Event, this is then displayed in a ’picture box’ as a live video stream. The problem as it sits is trying to encorporate the ability to record the stream and save to file, preferably a WMV or a compressed AVI.

    What’s been tried :

    I have considered and looked into the following :

    SharpAVI - cant seem to get this to compress or save the frames properly as it appears to mainly look at existing AVI files.

    AForge.Video.VFW - AVI files can be created but are far too large to be used, due to restrictions on the user areas of the individuals who will be using this software.

    AForge.Video.FFMPEG - Again due to considerations of those using this software I can’t have unmanaged DLL’s sat in the output folder with the Executable file, and unfortunately this particular DLL cant be compiled properly using Costura Fody.

    AVIFile Library Wrapper (From Code Project) - Again can’t seem to get this to compress a stream correctly from Bitmaps from the New Frame Events.

    DirectShow - Appears to use C++ and unfortunately is beyond my skill level at this time.

    The Relevant Code Snippets :

    Current References :

    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Resources;
    using System.Drawing.Imaging;
    using System.IO;
    //Aforge Video DLL's
    using AForge.Video;
    using AForge.Video.VFW;
    using AForge.Video.DirectShow;
    //Aforge Image DLL's
    using AForge.Imaging;
    using AForge.Imaging.Formats;
    using AForge.Imaging.Filters;
    //AviLibrary
    using AviFile;

    Global Variables :

       #region Global Variables

       private FilterInfoCollection CaptureDevice; // list of available devices
       private VideoCaptureDevice videoSource;
       public System.Drawing.Image CapturedImage;

       bool toggleMic = false;

       bool toggleRec = false;
       //aforge
       AVIWriter aviWriter;
       Bitmap image;


       #endregion

    Code for Displaying Stream

       #region Displays the Stream

       void videoSource_NewFrame(object sender, NewFrameEventArgs eventArgs)
       {
           picBoxStream.SizeMode = PictureBoxSizeMode.Zoom;
           picBoxStream.Image = (Bitmap)eventArgs.Frame.Clone();// clones the bitmap


           if (toggleRec == true)
           {
               image = (Bitmap)eventArgs.Frame.Clone();
               aviWriter.AddFrame(image);
           }
       }

       #endregion

    Current Code for Recording Stream

       #region Record Button

       private void btnRecord_Click(object sender, EventArgs e)
       {
           if (toggleRec == false)
           {
               saveAVI = new SaveFileDialog();
               saveAVI.Filter = "AVI Files (*.avi)|*.avi";

               if (saveAVI.ShowDialog() == DialogResult.OK)
               {
                   aviWriter = new AVIWriter();
                   aviWriter.Open(saveAVI.FileName, 1280, 720);

                   toggleRec = true;
                   Label lblRec = new Label();
               }

           }
           else if (toggleRec == true)
           {
               aviWriter.Close();
               toggleRec = false;
           }
       }

       #endregion

    I apoligise if the above code doesn’t look quite right, I have been swapping, changing and recoding those three sections a lot in order to find a working combination. This means that it’s rather untidy but I didn’t see the point in cleaning it all up until I had the code working. That being said really any help that you can provide is greatfully recieved, even if it’s a case of what I want to do just cannot be done.

    Thank you in advance.

    EDIT : 2019 :

    It’s been awhile since I posted this and it still gets the odd bit of interest here and there. Back when I posted this I was teaching myself to code and I had this weird quirk that I didn’t like using 3rd party libraries if I could avoid it, I wanted to do my own work, since then I’ve learnt a lot and one of those things is that the open source world is immense, impressive and kind. So if there is a 3rd party library that does what you want just use it, it’ll save you time.

  • libav live transcode to SFML SoundStream, garbled and noise

    20 juin 2021, par William Lohan

    I'm so close to have this working but playing with the output sample format or codec context doesn't seem to solve and don't know where to go from here.

    


    #include <iostream>&#xA;#include <sfml></sfml>Audio.hpp>&#xA;#include "MyAudioStream.h"&#xA;&#xA;extern "C"&#xA;{&#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libavutil></libavutil>avutil.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>audio_fifo.h>&#xA;#include <libswresample></libswresample>swresample.h>&#xA;}&#xA;&#xA;void setupInput(AVFormatContext *input_format_context, AVCodecContext **input_codec_context, const char *streamURL)&#xA;{&#xA;  // av_find_input_format("mp3");&#xA;  avformat_open_input(&amp;input_format_context, streamURL, NULL, NULL);&#xA;  avformat_find_stream_info(input_format_context, NULL);&#xA;&#xA;  AVDictionary *metadata = input_format_context->metadata;&#xA;  AVDictionaryEntry *name = av_dict_get(metadata, "icy-name", NULL, 0);&#xA;  if (name != NULL)&#xA;  {&#xA;    std::cout &lt;&lt; name->value &lt;&lt; std::endl;&#xA;  }&#xA;  AVDictionaryEntry *title = av_dict_get(metadata, "StreamTitle", NULL, 0);&#xA;  if (title != NULL)&#xA;  {&#xA;    std::cout &lt;&lt; title->value &lt;&lt; std::endl;&#xA;  }&#xA;&#xA;  AVStream *stream = input_format_context->streams[0];&#xA;  AVCodecParameters *codec_params = stream->codecpar;&#xA;  AVCodec *codec = avcodec_find_decoder(codec_params->codec_id);&#xA;  *input_codec_context = avcodec_alloc_context3(codec);&#xA;&#xA;  avcodec_parameters_to_context(*input_codec_context, codec_params);&#xA;  avcodec_open2(*input_codec_context, codec, NULL);&#xA;}&#xA;&#xA;void setupOutput(AVCodecContext *input_codec_context, AVCodecContext **output_codec_context)&#xA;{&#xA;  AVCodec *output_codec = avcodec_find_encoder(AV_CODEC_ID_PCM_S16LE); // AV_CODEC_ID_PCM_S16LE ?? AV_CODEC_ID_PCM_S16BE&#xA;  *output_codec_context = avcodec_alloc_context3(output_codec);&#xA;  (*output_codec_context)->channels = 2;&#xA;  (*output_codec_context)->channel_layout = av_get_default_channel_layout(2);&#xA;  (*output_codec_context)->sample_rate = input_codec_context->sample_rate;&#xA;  (*output_codec_context)->sample_fmt = output_codec->sample_fmts[0]; // AV_SAMPLE_FMT_S16 ??&#xA;  avcodec_open2(*output_codec_context, output_codec, NULL);&#xA;}&#xA;&#xA;void setupResampler(AVCodecContext *input_codec_context, AVCodecContext *output_codec_context, SwrContext **resample_context)&#xA;{&#xA;  *resample_context = swr_alloc_set_opts(&#xA;      *resample_context,&#xA;      output_codec_context->channel_layout,&#xA;      output_codec_context->sample_fmt,&#xA;      output_codec_context->sample_rate,&#xA;      input_codec_context->channel_layout,&#xA;      input_codec_context->sample_fmt,&#xA;      input_codec_context->sample_rate,&#xA;      0, NULL);&#xA;  swr_init(*resample_context);&#xA;}&#xA;&#xA;MyAudioStream::MyAudioStream()&#xA;{&#xA;  input_format_context = avformat_alloc_context();&#xA;  resample_context = swr_alloc();&#xA;}&#xA;&#xA;MyAudioStream::~MyAudioStream()&#xA;{&#xA;  // clean up&#xA;  avformat_close_input(&amp;input_format_context);&#xA;  avformat_free_context(input_format_context);&#xA;}&#xA;&#xA;void MyAudioStream::load(const char *streamURL)&#xA;{&#xA;&#xA;  setupInput(input_format_context, &amp;input_codec_context, streamURL);&#xA;  setupOutput(input_codec_context, &amp;output_codec_context);&#xA;  setupResampler(input_codec_context, output_codec_context, &amp;resample_context);&#xA;&#xA;  initialize(output_codec_context->channels, output_codec_context->sample_rate);&#xA;}&#xA;&#xA;bool MyAudioStream::onGetData(Chunk &amp;data)&#xA;{&#xA;&#xA;  // init&#xA;  AVFrame *input_frame = av_frame_alloc();&#xA;  AVPacket *input_packet = av_packet_alloc();&#xA;  input_packet->data = NULL;&#xA;  input_packet->size = 0;&#xA;&#xA;  // read&#xA;  av_read_frame(input_format_context, input_packet);&#xA;  avcodec_send_packet(input_codec_context, input_packet);&#xA;  avcodec_receive_frame(input_codec_context, input_frame);&#xA;&#xA;  // convert&#xA;  uint8_t *converted_input_samples = (uint8_t *)calloc(output_codec_context->channels, sizeof(*converted_input_samples));&#xA;  av_samples_alloc(&amp;converted_input_samples, NULL, output_codec_context->channels, input_frame->nb_samples, output_codec_context->sample_fmt, 0);&#xA;  swr_convert(resample_context, &amp;converted_input_samples, input_frame->nb_samples, (const uint8_t **)input_frame->extended_data, input_frame->nb_samples);&#xA;&#xA;  data.sampleCount = input_frame->nb_samples;&#xA;  data.samples = (sf::Int16 *)converted_input_samples;&#xA;&#xA;  // av_freep(&amp;converted_input_samples[0]);&#xA;  // free(converted_input_samples);&#xA;  av_packet_free(&amp;input_packet);&#xA;  av_frame_free(&amp;input_frame);&#xA;&#xA;  return true;&#xA;}&#xA;&#xA;void MyAudioStream::onSeek(sf::Time timeOffset)&#xA;{&#xA;  // no op&#xA;}&#xA;&#xA;sf::Int64 MyAudioStream::onLoop()&#xA;{&#xA;  // no loop&#xA;  return -1;&#xA;}&#xA;&#xA;</iostream>

    &#xA;

    Called with

    &#xA;

    #include <iostream>&#xA;&#xA;#include "./MyAudioStream.h"&#xA;&#xA;extern "C"&#xA;{&#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libavutil></libavutil>avutil.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;}&#xA;&#xA;const char *streamURL = "http://s5radio.ponyvillelive.com:8026/stream.mp3";&#xA;&#xA;int main(int, char **)&#xA;{&#xA;&#xA;  MyAudioStream myStream;&#xA;&#xA;  myStream.load(streamURL);&#xA;&#xA;  std::cout &lt;&lt; "Hello, world!" &lt;&lt; std::endl;&#xA;&#xA;  myStream.play();&#xA;&#xA;  while (myStream.getStatus() == MyAudioStream::Playing)&#xA;  {&#xA;    sf::sleep(sf::seconds(0.1f));&#xA;  }&#xA;&#xA;  return 0;&#xA;}&#xA;</iostream>

    &#xA;