Recherche avancée

Médias (1)

Mot : - Tags -/ipad

Autres articles (67)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (11645)

  • Catching ffmpeg stream in C# interrupts after a few seconds

    15 septembre 2017, par Chris

    I want to catch an ip-cam stream with ffmpeg in c# and send it with asp.net mvc web api to a client.
    As a client I use also ffmpeg to test the api call.

    In my api controller I call the ffmpeg.exe with the proper arguments.

    string argumentString = $"-i rtsp://{_user}:{_password}@{_ipAddress}/12 -nostdin -vcodec copy -f h264 pipe:1";
    ProcessStartInfo startinfo = new ProcessStartInfo(HostingEnvironment.MapPath("~/App_Data/ffmpeg.exe"), argumentString);

    As you can see I am ignoring the standard input (-nostdin) and use the standard output to output the data (pipe:1).

    But the client is always closing the connection after a few seconds (12-14).

    Here the error message on the server (ASP.NET) :

    enter image description here

    And here the error message on the client (ffmpeg)

    enter image description here

    I tried several ways to catch the ip-cam stream.

    Via the event OutputDataReceived :

    public HttpResponseMessage Get()
    {
       HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK)
       {
           Content = new PushStreamContent((stream, content, context) =>
           {
               Process ffmpeg = new Process();
               string argumentString = $"-i rtsp://{_user}:{_password}@{_ipAddress}/12 -nostdin -vcodec copy -f h264 pipe:1";
               ProcessStartInfo startinfo = new ProcessStartInfo(HostingEnvironment.MapPath("~/App_Data/ffmpeg.exe"), argumentString);
               startinfo.RedirectStandardError = true;
               startinfo.RedirectStandardOutput = true;
               startinfo.RedirectStandardInput = true;
               startinfo.UseShellExecute = false;
               startinfo.CreateNoWindow = true;

               ffmpeg.StartInfo = startinfo;
               ffmpeg.ErrorDataReceived += (s, e) =>
               {
                   Debug.WriteLine(e.Data);
               };

               StreamWriter writer = new StreamWriter(stream);                    
               ffmpeg.OutputDataReceived += (s, e) =>
               {
                   writer.Write(e.Data);
               };
               ffmpeg.Start();
               ffmpeg.BeginOutputReadLine();
               ffmpeg.BeginErrorReadLine();
               ffmpeg.WaitForExit();

           }, new MediaTypeHeaderValue("video/mp4")),
       };
       return result;
    }

    I also tried to do it without a StreamWriter, with every possible Encoding :

    ffmpeg.OutputDataReceived += (s, e) =>
    {
       byte[] toBytes = Encoding.BigEndianUnicode.GetBytes(e.Data);
       stream.Write(toBytes, 0, toBytes.Length);
       stream.Flush();
    };

    Via the underlying stream from StandardOutput :

    public HttpResponseMessage Get()
    {
       HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK)
       {
           Content = new PushStreamContent((stream, content, context) =>
           {
               Process ffmpeg = new Process();
               string argumentString = $"-i rtsp://{_user}:{_password}@{_ipAddress}/12 -nostdin -vcodec copy -f h264 pipe:1";
               ProcessStartInfo startinfo = new ProcessStartInfo(HostingEnvironment.MapPath("~/App_Data/ffmpeg.exe"), argumentString);
               startinfo.RedirectStandardError = true;
               startinfo.RedirectStandardOutput = true;
               startinfo.RedirectStandardInput = true;
               startinfo.UseShellExecute = false;
               startinfo.CreateNoWindow = true;

               ffmpeg.StartInfo = startinfo;
               ffmpeg.Start();

               byte[] buffer = new byte[512];
               int length = 0;
               while ((length = ffmpeg.StandardOutput.BaseStream.Read(buffer, 0, buffer.Length)) > 0)
               {
                   stream.Write(buffer, 0, length);
                   stream.Flush();
               }

           }, new MediaTypeHeaderValue("video/mp4")),
       };
       return result;
    }

    But the result is always the same.

    When I do not send the data to the client it is working fine :

    public HttpResponseMessage Get()
    {
       HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK)
       {
           Content = new PushStreamContent((stream, content, context) =>
           {
               Process ffmpeg = new Process();
               string argumentString = $"-i rtsp://{_user}:{_password}@{_ipAddress}/12 -nostdin -vcodec copy -f h264 pipe:1";
               ProcessStartInfo startinfo = new ProcessStartInfo(HostingEnvironment.MapPath("~/App_Data/ffmpeg.exe"), argumentString);
               startinfo.RedirectStandardError = true;
               startinfo.RedirectStandardOutput = true;
               startinfo.RedirectStandardInput = true;
               startinfo.UseShellExecute = false;
               startinfo.CreateNoWindow = true;

               ffmpeg.StartInfo = startinfo;
               ffmpeg.Start();

               byte[] buffer = new byte[512];
               int length = 0;
               while ((length = ffmpeg.StandardOutput.BaseStream.Read(buffer, 0, buffer.Length)) > 0)
               {
                   //stream.Write(buffer, 0, length);
                   //stream.Flush();
               }

           }, new MediaTypeHeaderValue("video/mp4")),
       };
       return result;
    }

    So what is wrong with my code ?

  • Anomalie #3055 (Nouveau) : Autorisation sur les listes d’objets

    13 septembre 2013, par Maïeul Rouquette

    Sous SPIP 3 il y a dans inc/autoriser.php

    function autoriser_auteurs_menu_dist($faire, $type, $id, $qui, $opt){return true;}
    function autoriser_articles_menu_dist($faire, $type, $id, $qui, $opt){return true;}
    function autoriser_rubriques_menu_dist($faire, $type, $id, $qui, $opt){return true;}

    ce qui permet de dire qu’on autorise pas à voir le menu menant à la liste des auteurs / des articles / des rubriques.

    Mais ! si on se rend sur (par exemple) ?exec=auteurs il n’y a aucune manière de ne pas autoriser à voir cette page.

    Je vois trois solutions
    a) dans prive/squelettes/contenu/auteurs.html mettre un test #AUTORISATIONauteurs,menu (ou équivalent, je ne me rappel plus la syntaxe exactes) et ainsi de suite sur toute les pages.
    b) la même chose, mais avec #AUTORISATIONvoir,auteurs. Le pb c’est qu’on arrive sur autoriser_auteur_voir ... ce qui entraîne confusion entre voir les auteurs et voir UN auteurs particulier
    c) considérer que pour chaque page ?exec on teste automatiquemnt l’autorisation sur le menu correspondant.

    Ps : ceci fait suite à ce message http://comments.gmane.org/gmane.comp.web.spip.user/184403 et ma tentative d’intégrer le besoin d’en autorité

  • How to merge two videos ?

    1er mai 2016, par Alexander

    I use https://github.com/Zulko/moviepy library for merge two videos with python. It merged successfully but sound of videos is not exists in merged.mp4.

    The python code :

    clip1 = VideoFileClip("2.mp4",audio=True)
    clip2 = VideoFileClip("1.mp4",audio=True)
    final_clip = concatenate_videoclips([clip1,clip2],method="compose")
    final_clip.write_videofile("merged.mp4")

    I also tried with ffmpeg

    ffmpeg -i 'concat:1.mp4|2.mp4' -codec copy merged.mp4

    ffmpeg couldn’t merge videos. It create merged.mp4 which has only 1.mp4

    How can I merge two videos with python or another way ?