Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (21)

  • 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 (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    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 (5625)

  • Ffmpeg only receives a piece of information from the pipe

    4 juillet 2017, par Maxim Fedorov

    First of all - my english is not very good, i`m sorry for that.

    I use ffmpeg from c# to convert images to video. To interact with ffmpeg, I use pipes.

    public async Task ExecuteCommand(
           string arguments,
           Action<namedpipeserverstream> sendDataUsingPipe)
       {
           var inStream = new NamedPipeServerStream(
               "from_ffmpeg",
               PipeDirection.In,
               1,
               PipeTransmissionMode.Byte,
               PipeOptions.Asynchronous,
               PipeBufferSize,
               PipeBufferSize);

           var outStream = new NamedPipeServerStream(
               "to_ffmpeg",
               PipeDirection.Out,
               1,
               PipeTransmissionMode.Byte,
               PipeOptions.Asynchronous,
               PipeBufferSize,
               PipeBufferSize);

           var waitInConnectionTask = inStream.WaitForConnectionAsync();
           var waitOutConnectionTask = outStream.WaitForConnectionAsync();

           byte[] byteData;

           using (inStream)
           using (outStream)
           using (var inStreamReader = new StreamReader(inStream))
           using (var process = new Process())
           {
               process.StartInfo = new ProcessStartInfo
               {
                   RedirectStandardOutput = true,
                   RedirectStandardError = true,
                   RedirectStandardInput = true,
                   FileName = PathToFfmpeg,
                   Arguments = arguments,
                   UseShellExecute = false,
                   CreateNoWindow = true
               };

               process.Start();

               await waitOutConnectionTask;

               sendDataUsingPipe.Invoke(outStream);

               outStream.Disconnect();
               outStream.Close();

               await waitInConnectionTask;

               var logTask = Task.Run(() => process.StandardError.ReadToEnd());
               var dataBuf = ReadAll(inStream);

               var shouldBeEmpty = inStreamReader.ReadToEnd();
               if (!string.IsNullOrEmpty(shouldBeEmpty))
                   throw new Exception();

               var processExitTask = Task.Run(() => process.WaitForExit());
               await Task.WhenAny(logTask, processExitTask);
               var log = logTask.Result;

               byteData = dataBuf;

               process.Close();
               inStream.Disconnect();
               inStream.Close();
           }

           return byteData;
       }
    </namedpipeserverstream>

    Action "sendDataUsingPipe" looks like

    Action<namedpipeserverstream> sendDataUsingPipe = stream =>
           {
               foreach (var imageBytes in data)
               {
                   using (var image = Image.FromStream(new MemoryStream(imageBytes)))
                   {
                       image.Save(stream, ImageFormat.Jpeg);
                   }
               }
           };
    </namedpipeserverstream>

    When I send 10/20/30 images (regardless of the size) ffmpeg processes everything.
    When I needed to transfer 600/700 / .. images, then in the ffmpeg log I see that it only received 189-192, and in the video there are also only 189-192 images.
    There are no errors in the logs or exceptions in the code.

    What could be the reason for this behavior ?

  • Java Xuggler Metadata List of Chapters MP4/M4V Video

    27 juin 2017, par MrSax

    I’m trying to use Xuggler like FFMPEG Metadata Wrapper (I just need the list of Chapters of MP4/M4V Video).

    So far I have not been able to find a solution.
    Can anyone help me ?

    I was only able to get the following information :

       final String filename = "...path...";
       IContainer container = IContainer.make();
       int result = container.open(filename, IContainer.Type.READ, null);
       if (result &lt; 0)
           throw new RuntimeException("Failed to open media file");
       int numStreams = container.getNumStreams();
       long duration = container.getDuration();
       long fileSize = container.getFileSize();
       long bitRate = container.getBitRate();
       System.out.println("Number of streams: " + numStreams);
       System.out.println("Duration (ms): " + duration);
       System.out.println("File Size (bytes): " + fileSize);
       System.out.println("Bit Rate: " + bitRate);
       for (int i = 0; i &lt; numStreams; i++) {
           IStream stream = container.getStream(i);
           IStreamCoder coder = stream.getStreamCoder();
           System.out.println("*** Start of Stream Info ***");
           System.out.printf("stream %d: ", i);
           System.out.printf("type: %s; ", coder.getCodecType());
           System.out.printf("codec: %s; ", coder.getCodecID());
           System.out.printf("duration: %s; ", stream.getDuration());
           System.out.printf("start time: %s; ", container.getStartTime());
           System.out.printf("timebase: %d/%d; ", stream.getTimeBase().getNumerator(),
                   stream.getTimeBase().getDenominator());
           System.out.printf("coder tb: %d/%d; ", coder.getTimeBase().getNumerator(),
                   coder.getTimeBase().getDenominator());
           System.out.println();
           if (coder.getCodecType() == ICodec.Type.CODEC_TYPE_AUDIO) {
               System.out.printf("sample rate: %d; ", coder.getSampleRate());
               System.out.printf("channels: %d; ", coder.getChannels());
               System.out.printf("format: %s", coder.getSampleFormat());
           } else if (coder.getCodecType() == ICodec.Type.CODEC_TYPE_VIDEO) {
               System.out.printf("width: %d; ", coder.getWidth());
               System.out.printf("height: %d; ", coder.getHeight());
               System.out.printf("format: %s; ", coder.getPixelType());
               System.out.printf("frame-rate: %5.2f; ", coder.getFrameRate().getDouble());
           }
           System.out.println();
           System.out.println("*** End of Stream Info ***");

    UPDATE 07.06.2017
    I just tried it with VLCJ, but still I can not get the list of chapters.

       File file = new File("ia_ISL_13_r720P.m4v");

       NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), "vlc64/");
       Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);

       MediaPlayerFactory mpf = new MediaPlayerFactory();
       EmbeddedMediaPlayer emp = mpf.newEmbeddedMediaPlayer();

       MediaMeta mediaMeta = mpf.getMediaMeta(file.getAbsolutePath(), true);
       MediaMetaData asMediaMetaData = mediaMeta.asMediaMetaData();
       System.out.println(asMediaMetaData.getAlbum());
       System.out.println(asMediaMetaData.getArtist());
       System.out.println(asMediaMetaData.getTitle());

       emp.prepareMedia(file.getAbsolutePath());
       emp.play();
       emp.nextChapter(); // -> GO NEXT CHAPTER - SUCCESS

       List> allChapterDescriptions = emp.getAllChapterDescriptions();

       for (List<string> list : allChapterDescriptions) {
           for (String string : list) {
               System.out.println(string);
           }
       }
    </string>
  • ValueError When Reading Video Frame

    28 juin 2017, par Bassie

    I am following this article, from where I got this code :

    FFMPEG_BIN ="Z:\ffmpeg\bin\ffmpeg.exe"

    import subprocess as sp
    command = [ FFMPEG_BIN,
               '-i', 'video.mp4',
               '-f', 'image2pipe',
               '-pix_fmt', 'rgb24',
               '-vcodec', 'rawvideo', '-']
    pipe = sp.Popen(command, stdout = sp.PIPE, bufsize=10**8, shell=True)

    import numpy
    # read 420*360*3 bytes (= 1 frame)
    raw_image = pipe.stdout.read(420*360*3)
    # transform the byte read into a numpy array
    image =  numpy.fromstring(raw_image, dtype='uint8')
    image = image.reshape((360,420,3))
    # throw away the data in the pipe's buffer.
    pipe.stdout.flush()

    When I run it I see this error :

    Traceback (most recent call last):
     File "Z:\py\ffmtest\test.py", line 16, in <module>
       image = image.reshape((360,420,3))
    ValueError: total size of new array must be unchanged
    </module>

    Where line 16 is image = image.reshape((360,420,3)). I think this error is produced by numpy, but probably because I am calculating the values for my video incorrectly.

    Output :

    raw_image : b’ ’

    len(raw_image) : 0

    image : [ ]

    len(image) : 0

    I am not sure whether I am passing in the correct values for read or reshape functions - any help at all is much appreciated !