Recherche avancée

Médias (0)

Mot : - Tags -/api

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (50)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (5595)

  • .NET Process - Redirect stdin and stdout without causing deadlock

    21 juillet 2017, par user1150856

    I’m trying to encode a video file with FFmpeg from frames generated by my program and then redirect the output of FFmpeg back to my program to avoid having an intermediate video file.

    However, I’ve run into what seems to be a rather common problem when redirecting outputs in System.Diagnostic.Process, mentioned in the remarks of the documentation here, which is that it causes a deadlock if run synchronously.

    After tearing my hair out over this for a day, and trying several proposed solutions found online, I still cannot find a way to make it work. I get some data out, but the process always freezes before it finishes.


    Here is a code snippet that produces said problem :

    static void Main(string[] args)
       {

           Process proc = new Process();

           proc.StartInfo.FileName = @"ffmpeg.exe";
           proc.StartInfo.Arguments = String.Format("-f rawvideo -vcodec rawvideo -s {0}x{1} -pix_fmt rgb24 -r {2} -i - -an -codec:v libx264 -preset veryfast -f mp4 -movflags frag_keyframe+empty_moov -",
               16, 9, 30);
           proc.StartInfo.UseShellExecute = false;
           proc.StartInfo.RedirectStandardInput = true;
           proc.StartInfo.RedirectStandardOutput = true;

           FileStream fs = new FileStream(@"out.mp4", FileMode.Create, FileAccess.Write);

           //read output asynchronously
           using (AutoResetEvent outputWaitHandle = new AutoResetEvent(false))
           {
               proc.OutputDataReceived += (sender, e) =>
               {
                   if (e.Data == null)
                   {
                       outputWaitHandle.Set();
                   }
                   else
                   {
                       string str = e.Data;
                       byte[] bytes = new byte[str.Length * sizeof(char)];
                       System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
                       fs.Write(bytes, 0, bytes.Length);
                   }
               };
           }


           proc.Start();
           proc.BeginOutputReadLine();

           //Generate frames and write to stdin
           for (int i = 0; i < 30*60*60; i++)
           {
               byte[] myArray = Enumerable.Repeat((byte)Math.Min(i,255), 9*16*3).ToArray();
               proc.StandardInput.BaseStream.Write(myArray, 0, myArray.Length);
           }

           proc.WaitForExit();
           fs.Close();
           Console.WriteLine("Done!");
           Console.ReadKey();

       }

    Currently i’m trying to write the output to a file anyway for debugging purposes, but this is not how the data will eventually be used.

    If anyone knows a solution it would be very much appreciated.

  • Interesting behavior in Media Source Extensions

    28 mai 2020, par newtonian_fig

    I'm trying to build a fairly standard video player using Media Source Extensions ; however, I want the user to be able to control when the player moves on to a new video segment. For example, we might see the following behavior :

    



      

    1. Video player plays 1st segment
    2. 


    3. Source Buffer runs out of data causing the video to appear paused
    4. 


    5. When the user is ready, they click a button that adds the 2nd segment to the Source Buffer
    6. 


    7. The video continues by playing the 2nd segment
    8. 


    



    This works well, except that when the video appears paused during step 2 it doesn't stop at the last frame of the 1st segment. Instead, it stops two frames before the end of the 1st segment. Those last two frames aren't being dropped, they just get played after the user clicks the button to advance the video. This is an issue for my application, and I'm trying to figure out a way to make sure all of the frames from the 1st segment get played before the end of step 2.

    



    I suspect that these last two frames are getting held up in the video decoder buffer. Especially since calling endOfStream() on my Media Source after adding the 1st segment to the Source Buffer causes the 1st segment to play all the way through with no frames left behind.

    



    Additional Info

    



      

    • I created each video segment file from a series of PNGs using the following ffmpeg command
    • 


    



    ffmpeg -i %04d.png -movflags frag_keyframe+empty_moov+default_base_moof video_segment.mp4

    



      

    • Maybe this is a clue ? End of stream situations not handled correctly (last frames are dropped)
    • 


    • Another interesting thing to note is that if the video only has 2 frames or less, MSE doesn't play it at all.
    • 


    • The browser I'm using is Chrome. The code for my MSE player is just taken from the Google Developers example, but I'll post it here for completeness. This code only covers up to step 2 since that's where the issue is.
    • 


    



    <code class="echappe-js">&lt;script&gt;&amp;#xA;const mediaSource = new MediaSource();&amp;#xA;video.src = URL.createObjectURL(mediaSource);&amp;#xA;mediaSource.addEventListener(&amp;#x27;sourceopen&amp;#x27;, sourceOpen, { once: true });&amp;#xA;&amp;#xA;function sourceOpen() {&amp;#xA;  URL.revokeObjectURL(video.src);&amp;#xA;  const sourceBuffer = mediaSource.addSourceBuffer(&amp;#x27;video/mp4; codecs=&quot;avc1.64001f&quot;&amp;#x27;);&amp;#xA;  sourceBuffer.mode = &amp;#x27;sequence&amp;#x27;;&amp;#xA;&amp;#xA;  // Fetch the video and add it to the Source Buffer&amp;#xA;  fetch(&amp;#x27;https://s3.amazonaws.com/bucket_name/video_file.mp4&amp;#x27;)&amp;#xA;  .then(response =&gt; response.arrayBuffer())&amp;#xA;  .then(data =&gt; sourceBuffer.appendBuffer(data));&amp;#xA;}&amp;#xA;&amp;#xA;&lt;/code&gt;&lt;/pre&gt;&amp;#xA;
  • Evolution #2633 : Pouvoir modifier _DIR_RESTREINT_ABS

    10 juillet 2015, par jluc -

    Si on enlève les répertoires de tests, il ne reste plus grand chose :

    // normal
    spip.php:14:if (!defined(’_DIR_RESTREINT_ABS’)) define(’_DIR_RESTREINT_ABS’, ’ecrire/’) ;
    ecrire/inc_version.php:38 :    define(’_DIR_RESTREINT_ABS’, ’ecrire/’) ;
    

    // pb ecrire
    ecrire/public/debusquer.php:366 : if ($reg[1]==’ecrire/public’)

    // dist
    plugins-dist/forum/prive/modeles/forum-actions-moderer.html:2 :[(#SETretour,[(#REM|test_espace_prive| ?[(#VALecrire/|concat#SELF|replace’./’,’’)],#SELF|ancre_urlforum#ID_FORUM)])]

    // installation ’normale’
    config/ecran_securite.php:113 : OR @file_exists(’ecrire/inc_version.php’))
    config/ecran_securite.php:259:if (strpos($_SERVER[’REQUEST_URI’],"ecrire/") !==false)

    spip_loader.php:44:define(’_SPIP_LOADER_PLUGIN_RETOUR’, "ecrire/ ?exec=admin_plugin&voir=tous") ;
    spip_loader.php:923:if (@file_exists(’ecrire/inc_version.php’))
    spip_loader.php:924 : define(’_SPIP_LOADER_URL_RETOUR’, "ecrire/ ?exec=accueil") ;
    spip_loader.php:925 : include_once ’ecrire/inc_version.php’ ;
    spip_loader.php:933 :
    else define(’_SPIP_LOADER_URL_RETOUR’, "ecrire/ ?exec=install") ;