Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP

Autres articles (19)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

Sur d’autres sites (5558)

  • avcodec/nvdec : More effort to make vp8 compile with gcc 4.6

    27 novembre 2017, par Philip Langdale
    avcodec/nvdec : More effort to make vp8 compile with gcc < 4.6
    

    I'm told my prefix work-around wasn't enough to make it compile,
    although I'm not sure why ; I did some basic testing and that
    approach appeared to work, but I'm not in a position to do a
    full compile on CentOS 6 so I can't be sure of anything.

    I have had it confirmed that the additional change to not use
    named initialisers is enough to make it compile, so let's
    throw that into the mix too.

    • [DH] libavcodec/nvdec_vp8.c
  • Transcoding audio using xuggler

    15 novembre 2017, par amd

    I am trying to convert an audio file with the header

    Opening audio decoder: [pcm] Uncompressed PCM audio decoder
    AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
    Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)

    I want to transcode this file to mp3 format. I have following code snippet but its not working well. I have written it using XUGGLER code snippet for transcoding audio and video.

    Audio decoder is

       audioDecoder = IStreamCoder.make(IStreamCoder.Direction.DECODING, ICodec.findDecodingCodec(ICodec.ID.CODEC_ID_PCM_S16LE));
       audioDecoder.setSampleRate(44100);
       audioDecoder.setBitRate(176400);
       audioDecoder.setChannels(2);
       audioDecoder.setTimeBase(IRational.make(1,1000));
       if (audioDecoder.open(IMetaData.make(), IMetaData.make()) &lt; 0)
           return false;
       return true;

    Audio encoder is

       outContainer = IContainer.make();
       outContainerFormat = IContainerFormat.make();
       outContainerFormat.setOutputFormat("mp3", urlOut, null);
       int retVal = outContainer.open(urlOut, IContainer.Type.WRITE, outContainerFormat);
       if (retVal &lt; 0) {
           System.out.println("Could not open output container");
           return false;
       }
       outAudioCoder = IStreamCoder.make(IStreamCoder.Direction.ENCODING, ICodec.findEncodingCodec(ICodec.ID.CODEC_ID_MP3));
       outAudioStream = outContainer.addNewStream(outAudioCoder);
       outAudioCoder.setSampleRate(new Integer(44100));
       outAudioCoder.setChannels(2);
       retVal = outAudioCoder.open(IMetaData.make(), IMetaData.make());
       if (retVal &lt; 0) {
           System.out.println("Could not open audio coder");
           return false;
       }
       retVal = outContainer.writeHeader();
       if (retVal &lt; 0) {
           System.out.println("Could not write output FLV header: ");
           return false;
       }
       return true;

    And here is encode method where i send packets of 32 byte to transcode

    public void encode(byte[] audioFrame){
       //duration of 1 video frame
       long lastVideoPts = 0;

       IPacket packet_out = IPacket.make();
       int lastPos = 0;
       int lastPos_out = 0;

       IAudioSamples audioSamples = IAudioSamples.make(48000, audioDecoder.getChannels());
       IAudioSamples audioSamples_resampled = IAudioSamples.make(48000, audioDecoder.getChannels());

       //we always have 32 bytes/sample
       int pos = 0;
       int audioFrameLength = audioFrame.length;
       int audioFrameCnt = 1;
       iBuffer = IBuffer.make(null, audioFrame, 0, audioFrameLength);
       IPacket packet = IPacket.make(iBuffer);
       //packet.setKeyPacket(true);
       packet.setTimeBase(IRational.make(1,1000));
       packet.setDuration(20);
       packet.setDts(audioFrameCnt*20);
       packet.setPts(audioFrameCnt*20);
       packet.setStreamIndex(1);
       packet.setPosition(lastPos);
       lastPos+=audioFrameLength;
       int pksz = packet.getSize();
       packet.setComplete(true, pksz);
       /*
       * A packet can actually contain multiple samples
       */
       int offset = 0;
       int retVal;
       while(offset &lt; packet.getSize())
       {
           int bytesDecoded = audioDecoder.decodeAudio(audioSamples, packet, offset);
           if (bytesDecoded &lt; 0)
               throw new RuntimeException("got error decoding audio ");
           offset += bytesDecoded;
           if (audioSamples.isComplete())
           {
               int samplesConsumed = 0;
               while (samplesConsumed &lt; audioSamples.getNumSamples()) {
                   retVal = outAudioCoder.encodeAudio(packet_out, audioSamples, samplesConsumed);
                   if (retVal &lt;= 0)
                       throw new RuntimeException("Could not encode audio");
                   samplesConsumed += retVal;
                   if (packet_out.isComplete()) {
                       packet_out.setPosition(lastPos_out);
                       packet_out.setStreamIndex(1);
                       lastPos_out+=packet_out.getSize();
                       retVal = outContainer.writePacket(packet_out);
                       if(retVal &lt; 0){
                           throw new RuntimeException("Could not write data packet");
                       }
                   }
               }
           }

       }

    }

    I get an output file but it doesnt get played. I have very little experience of audio encoding and sampling. Thanks in advance.

  • converting mp4 file to zero KB .png file : FFmpeg

    6 novembre 2017, par muskan

    Used below command for converting 2,981kb of file1.mp4 to file1.png :

    "ffmpeg.exe -i file1.mp4 -ss 00:00:10.00 -s "315"x"210"-f image2 -vframes 1 file1.png"

    using following code to execute the command :

    public int ProcessRun(string filename, string arguments, int waitTimeSeconds)
    {
       if (!System.IO.File.Exists(filename))
       {
           var Message = $"Converter file not found.";
           DialogResult result = DisplayError(Message);
       }
       int returnVal = 0;
       try
       {
           using (Process process = new Process())
           {
               process.StartInfo.FileName = filename;
               process.StartInfo.Arguments = arguments;
               process.StartInfo.UseShellExecute = false;
               process.StartInfo.RedirectStandardOutput = true;
               process.StartInfo.RedirectStandardError = true;

               StringBuilder output = new StringBuilder();
               StringBuilder error = new StringBuilder();

               using (AutoResetEvent outputWaitHandle = new AutoResetEvent(false))
               using (AutoResetEvent errorWaitHandle = new AutoResetEvent(false))
               {
                   process.OutputDataReceived += (sender, e) =>
                   {
                       if (e.Data == null)
                       {
                           outputWaitHandle.Set();
                       }
                       else
                       {
                           output.AppendLine(e.Data);
                       }
                   };
                   process.ErrorDataReceived += (sender, e) =>
                   {
                       if (e.Data == null)
                       {
                           errorWaitHandle.Set();
                       }
                       else
                       {
                           error.AppendLine(e.Data);
                       }
                   };

                   process.Start();

                   process.BeginOutputReadLine();
                   process.BeginErrorReadLine();

                   if (process.WaitForExit((int)TimeSpan.FromSeconds(waitTimeSeconds).TotalMilliseconds) &amp;&amp;
                        outputWaitHandle.WaitOne((int)TimeSpan.FromSeconds(waitTimeSeconds).TotalMilliseconds) &amp;&amp;
                        errorWaitHandle.WaitOne((int)TimeSpan.FromSeconds(waitTimeSeconds).TotalMilliseconds))
                   {
                      returnVal = process.ExitCode;
                   }
                   returnVal = process.ExitCode;
               }
           }
       }
       catch (Exception ex)
       {
           throw ex;
       }
       finally { }
       return returnVal;
    }

    where filename is filepath of my "ffmpeg.exe"
    arguments is "-i file1.mp4 -ss 00:00:10.00 -s "315"x"210"-f image2 -vframes 1 file1.png"
    waittimeseconds 60000

    But this always return me the file1.png of size 0kb.
    Getting following errorlog :

    ffmpeg version N-66289-gb76d613 Copyright (c) 2000-2014 the FFmpeg developers
    built on Sep 15 2014 22:02:10 with gcc 4.8.3 (GCC)
    configuration : —enable-gpl —enable-version3 —disable-w32threads —enable-avisynth —enable-bzlib —enable-fontconfig —enable-frei0r —enable-gnutls —enable-iconv —enable-libass —enable-libbluray —enable-libbs2b —enable-libcaca —enable-libfreetype —enable-libgme —enable-libgsm —enable-libilbc —enable-libmodplug —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libopenjpeg —enable-libopus —enable-librtmp —enable-libschroedinger —enable-libsoxr —enable-libspeex —enable-libtheora —enable-libtwolame —enable-libvidstab —enable-libvo-aacenc —enable-libvo-amrwbenc —enable-libvorbis —enable-libvpx —enable-libwavpack —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxavs —enable-libxvid —enable-decklink —enable-zlib
    libavutil 54. 7.100 / 54. 7.100
    libavcodec 56. 1.100 / 56. 1.100
    libavformat 56. 4.101 / 56. 4.101
    libavdevice 56. 0.100 / 56. 0.100
    libavfilter 5. 1.100 / 5. 1.100
    libswscale 3. 0.100 / 3. 0.100
    libswresample 1. 1.100 / 1. 1.100
    libpostproc 53. 0.100 / 53. 0.100
    file1.mp4 : Permission denied

    How can I fix it ?