Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (43)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (8425)

  • C# .net mvc Process return encoding progress (FFMpeg) to client initiated with ajax

    19 décembre 2014, par user1585895

    I am using FFMpeg to encode wav to mp3s, and on completion download the final .zip to the client.

    All works great, and I can Debug.WriteLine the progress of the encoding, but I would like to return _percentage back to the client to do some UI updates based on the value of _percentage and if all encoding is done, Im not sure how to approach this.

    My thinking is as follows :

    • ajax post to CreateAndDownloadAlbum(List trackIds, int productId)
    • loop through List and create a new Process, run
      — parse StdError to get encoding percentage in myProcess_ErrorData(object source, DataReceivedEventArgs e)
      — send _percentage value at timed intervals back to CreateAndDownloadAlbum
      — update UI based on value of _percentage, when all is complete break and call public ActionResult SendFileDownload()

    Any input would be great.

    Thanks !

    front end AJAX call to post list of file Ids to download

    var data = $('#downloadAlbum').serialize();
    $.ajax({
       url: "/Admin/CreateAndDownloadAlbum",
       method: "POST",
       data: data,
       dataType: 'json',
       success: function(result) {
            // wait here for _percentage
            // if not 100, call again to get new _percentage value
            // if 100, update UI, move to next file being encoded
            // if all encoding is complete, call SendFileDownload() in controller
       }
    });

    then the controller code

    [HttpPost]
       public void CreateAndDownloadAlbum(List<trackstodownload> trackIds, int productId)
       {
           _numTracksToDownload = trackIds.Count;
           var product = _productRepository.GetProductById(productId);
           var artist = _artistRepository.GetArtistById(product.ArtistId);

           var folderGuid = Guid.NewGuid();
           _zipFolder = string.Concat(artist.ArtistName.ToUpper().Replace(" ", "_"), "[", product.ProductName.ToUpper().Replace(" ", "_"), "].zip");
           _mp3FolderPath = Server.MapPath("/Files/" + productId + "/" + folderGuid);
           _zipDownloadPath = Server.MapPath("/Delivery/" + _zipFolder);

           if (!Directory.Exists(Server.MapPath("/Files/" + productId + "/" + folderGuid)))
           {
               Directory.CreateDirectory(Server.MapPath("/Files/" + productId + "/" + folderGuid));
           }

           foreach (var z in trackIds)
           {
               var track = _trackRepository.GetTrackById(z.TrackId);
               var process = new Process();
               var startInfo = new ProcessStartInfo
               {
                   WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden,
                   FileName = "F:\\Development\\ffmpeg\\ffmpeg.exe",
                   RedirectStandardOutput = true,
                   RedirectStandardError = true,
                   UseShellExecute = false
               };
               var startFile = Path.Combine("F:\\Development","Files", track.ProductId.ToString(), track.TrackFileName);
               var endFile = Path.Combine("F:\\Development", "Files", track.ProductId.ToString(), folderGuid.ToString(), track.TrackFileName.Replace(".wav", ".mp3"));

               startInfo.Arguments = "-i " + startFile + " -b:a 320k " + endFile + " -stats";
               process.StartInfo = startInfo;
               process.EnableRaisingEvents = true;
               process.Exited += myProcess_exited;
               process.OutputDataReceived += myProcess_OutputData;
               process.ErrorDataReceived += myProcess_ErrorData;

               try
               {
                   process.Start();
                   process.BeginOutputReadLine();
                   process.BeginErrorReadLine();

                   if (process.HasExited == false)
                   {
                       process.WaitForExit();
                   }
               }
               catch (Exception)
               {

                   throw;
               }
           }

           SendFileDownload();

       }

       public ActionResult SendFileDownload()
       {
           // zip and move to delivery folder
           using (var zip = new ZipFile())
           {
               zip.AddDirectory(_mp3FolderPath, _zipFolder);
               zip.Save(_zipDownloadPath);
           }

           // delete items in temp guid folder
           var downloadedMessageInfo = new DirectoryInfo(_mp3FolderPath);
           foreach (var f in downloadedMessageInfo.GetFiles())
           {
               f.Delete();
           }

           // delete temp folder
           Directory.Delete(_mp3FolderPath);

           // download file
           string file = _zipDownloadPath;
           return File(file, "application/force-download", Path.GetFileName(file));

       }

       public void myProcess_exited(Object source, EventArgs e)
       {
           Debug.WriteLine("myProcess_exited ===================================");
           _duration = new TimeSpan(0, 0, 0);
           _frameTime = new TimeSpan(0, 0, 0);
           _percentage = 0;
           _numEncodedTracks++; // using this to tell me if all tracks have been encoded
       }

       public void myProcess_OutputData(object source, DataReceivedEventArgs e)
       {
       }

       public void myProcess_ErrorData(object source, DataReceivedEventArgs e)
       {
           string strMessage = e.Data;

           if (!string.IsNullOrEmpty(strMessage) &amp;&amp; (strMessage.Contains("Duration: ") || strMessage.Contains("size=")))
           {
               if (_duration != null)
               {
                   if (strMessage.Contains("Duration: "))
                   {
                       _strDuration = strMessage.Substring(strMessage.IndexOf("Duration: ") + ("Duration: ").Length,
                           ("00:00:00.00").Length);

                       char[] d_delHrMn = new char[] { ':' };
                       string[] d_tempHrMn = _strDuration.Split(d_delHrMn, StringSplitOptions.RemoveEmptyEntries);

                       char[] d_delSec = new char[] { '.' };
                       string[] d_tempSec = d_tempHrMn[2].Split(d_delSec, StringSplitOptions.RemoveEmptyEntries);

                       var d_hour = d_tempHrMn[0] == "0" ? 0 : Convert.ToInt32(d_tempHrMn[0]);
                       var d_min = d_tempHrMn[1] == "0" ? 0 : Convert.ToInt32(d_tempHrMn[1]);
                       var d_sec = d_tempSec[0] == "0" ? 0 : Convert.ToInt32(d_tempSec[0]);

                       _duration = new TimeSpan(d_hour, d_min, d_sec);
                   }
               }

               if (strMessage.Contains("size="))
               {
                   _strFrameTime = strMessage.Substring(strMessage.IndexOf("time=") + ("time=").Length,
                       ("00:00:00.00").Length);

                   char[] f_delHrMn = new char[] { ':' };
                   string[] f_tempHrMn = _strFrameTime.Split(f_delHrMn, StringSplitOptions.RemoveEmptyEntries);

                   char[] f_delSec = new char[] { '.' };
                   string[] f_tempSec = f_tempHrMn[2].Split(f_delSec, StringSplitOptions.RemoveEmptyEntries);

                   var f_hour = f_tempHrMn[0] == "0" ? 0 : Convert.ToInt32(f_tempHrMn[0]);
                   var f_min = f_tempHrMn[1] == "0" ? 0 : Convert.ToInt32(f_tempHrMn[1]);
                   var f_sec = f_tempSec[0] == "0" ? 0 : Convert.ToInt32(f_tempSec[0]);

                   _frameTime = new TimeSpan(f_hour, f_min, f_sec);

               }

               if (_strDuration != "00:00:00.00" &amp;&amp; _strFrameTime != "00:00:00.00" &amp;&amp; _percentage &lt; 100)
               {
                   _percentage = _frameTime.TotalMilliseconds / _duration.TotalMilliseconds * 100;
                   Debug.WriteLine(_percentage + " || " + _frameTime + " " + _duration);
               }
           }
       }
    </trackstodownload>
  • Using Gstreamer or ffmpeg to create rtsp client on Android

    9 décembre 2014, par Pankaj Bansal

    I want to stream a rtsp stream on android and I finally have come to
    conclusion that I can’t use android API’s MediaPlayer,Videoview etc because
    latency is big issue for me. I need an latency of <500 ms. Now I am
    planning to use Gstreamer or ffmpeg to create an android rtsp client. I just have few
    doubts

    1. Will the Gstreamer or ffmpeg client be able to provide latency <500ms. I read there are
      some parameters which I can tweak to get very low latency. Just want to
      confirm. I have very good network bandwidth. The frame size is generally
      1920X1080.

    2. I read Gstreamer is one made one level above ffmpeg and uses ffmpeg
      codecs to work. I want to know which one is easier to work with for creating an android client. Working on Gstreamer or workig directly on ffmpeg.

    3. If I use Gstreamer android client, Will I have to use the Gstreamer server as well to stream the data ? Currently I am using Live555 RTSP server to stream data

  • ffmpeg can't stream to remote client

    4 septembre 2014, par KFL

    I’m building a simple ffmpeg command line on my laptop to stream from its camera. The command line reads (verbose output at the botton) :

    host1> ffmpeg -v verbose \
                 -f dshow \
                 -i video="Camera":audio="Microphone" \
                 -r 30 -g 0 -vcodec h264 -acodec libmp3lame \
                 -tune zerolatency \
                 -preset ultrafast \
                 -f mpegts udp://12.34.56.78:12345

    Firstly, it works locally. I.e., I can view the output by using ffplay on the same host :

    host1> ffplay -hide_banner -v udp://12.34.56.78:12345

    Now what is NOT working is when I do this from another machine in the same network. It shows a nan progress :

    host2> ffplay -hide_banner -v udp://12.34.56.78:12345
       nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0  

    I used ncat to dump the raw content. But there’s no output :

    host2>\ncat\ncat -v -u 12.34.56.78 12345
    Ncat: Version 5.59BETA1 ( http://nmap.org/ncat )
    Ncat: Connected to 12.34.56.78:12345.
    (...and nothing happen...)

    Note that I can exclude firewall issues as I used ncat to communicate with each other across the wire using the same port and protocol (UDP). This works and they can chat to each other :

    host1> ncat -l -u -p 12345
    host2> ncat -u 12.34.56.78 12345

    Any hint ?

    I’m using Windows x64 with FFMPEG 64bit installed from here. Below is the Output of my ffmpeg command :

    C:\ffmpeg\bin>ffmpeg -v verbose -f dshow -i video="Integrated Camera":audio="Microphone (Realtek High Definition Audio)" -r 30 -g 0 -vcodec h264 -acodec libmp3lame -tune zerolatency -preset ultrafast -f mpegts udp://12.34.56.78:12345
    ffmpeg version N-66012-g97b8809 Copyright (c) 2000-2014 the FFmpeg developers
     built on Sep  1 2014 00:21:15 with gcc 4.8.3 (GCC)
     configuration: --disable-static --enable-shared --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.  3.100 / 56.  3.100
     libavdevice    56.  0.100 / 56.  0.100
     libavfilter     5.  0.103 /  5.  0.103
     libswscale      3.  0.100 /  3.  0.100
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  0.100 / 53.  0.100
    Guessed Channel Layout for  Input Stream #0.1 : stereo
    Input #0, dshow, from 'video=Integrated Camera:audio=Microphone (Realtek High Definition Audio)':
     Duration: N/A, start: 171840.657000, bitrate: N/A
       Stream #0:0: Video: rawvideo, bgr24, 640x480, 30 fps, 30 tbr, 10000k tbn, 30 tbc
       Stream #0:1: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
    Matched encoder 'libx264' for codec 'h264'.
    [graph 0 input from stream 0:0 @ 0000000000470aa0] w:640 h:480 pixfmt:bgr24 tb:1/10000000 fr:10000000/333333 sar:0/1 sws_param:flags=2
    [auto-inserted scaler 0 @ 0000000004326d00] w:iw h:ih flags:'0x4' interl:0
    [format @ 0000000004325a00] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
    [auto-inserted scaler 0 @ 0000000004326d00] w:640 h:480 fmt:bgr24 sar:0/1 -> w:640 h:480 fmt:yuv444p sar:0/1 flags:0x4
    No pixel format specified, yuv444p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [graph 1 input from stream 0:1 @ 0000000000460c20] tb:1/44100 samplefmt:s16 samplerate:44100 chlayout:0x3
    [audio format for output stream 0:1 @ 00000000004601a0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'audio format for output stream 0:1'
    [auto-inserted resampler 0 @ 00000000004604a0] ch:2 chl:stereo fmt:s16 r:44100Hz -> ch:2 chl:stereo fmt:s16p r:44100Hz
    [libx264 @ 000000000081bb20] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 000000000081bb20] profile High 4:4:4 Intra, level 3.0, 4:4:4 8-bit
    [mpegts @ 000000000081abe0] muxrate VBR, pcr every 3 pkts, sdt every 200, pat/pmt every 40 pkts
    Output #0, mpegts, to 'udp://12.34.56.78:12345':
     Metadata:
       encoder         : Lavf56.3.100
       Stream #0:0: Video: h264 (libx264), yuv444p, 640x480, q=-1--1, 30 fps, 90k tbn, 30 tbc
       Metadata:
         encoder         : Lavc56.1.100 libx264
       Stream #0:1: Audio: mp3 (libmp3lame), 44100 Hz, stereo, s16p
       Metadata:
         encoder         : Lavc56.1.100 libmp3lame
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (pcm_s16le (native) -> mp3 (libmp3lame))
    Press [q] to stop, [?] for help
    *** 1 dup!
    frame=  241 fps= 31 q=28.0 Lsize=    3439kB time=00:00:08.03 bitrate=3506.4kbits/s dup=1 drop=0
    video:3035kB audio:125kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.791966%
    Input file #0 (video=Integrated Camera:audio=Microphone (Realtek High Definition Audio)):
     Input stream #0:0 (video): 240 packets read (221184000 bytes); 240 frames decoded;
     Input stream #0:1 (audio): 16 packets read (1411200 bytes); 16 frames decoded (352800 samples);
     Total: 256 packets (222595200 bytes) demuxed
    Output file #0 (udp://12.34.56.78:12345):
     Output stream #0:0 (video): 241 frames encoded; 241 packets muxed (3108187 bytes);
     Output stream #0:1 (audio): 306 frames encoded (352512 samples); 307 packets muxed (128313 bytes);
     Total: 548 packets (3236500 bytes) muxed
    [libx264 @ 000000000081bb20] frame I:241   Avg QP:27.97  size: 12897
    [libx264 @ 000000000081bb20] mb I  I16..4: 100.0%  0.0%  0.0%
    [libx264 @ 000000000081bb20] coded y,u,v intra: 26.3% 0.5% 0.0%
    [libx264 @ 000000000081bb20] i16 v,h,dc,p: 19% 28% 21% 31%
    [libx264 @ 000000000081bb20] kb/s:3095.29
    [dshow @ 0000000000467720] real-time buffer[Integrated Camera] too full (90% of size: 3041280)! frame dropped!
    Received signal 2: terminating. (I pressed CTRL-C)