Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (54)

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

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

Sur d’autres sites (5570)

  • ffmpeg c# asp.net video conversion error

    3 mai 2012, par Arun Kumar

    The following code shows error as "StandardOut has not been redirected or the process hasn't started yet." What is the problem in this code ? It requires any changes ? It always clear the process by catch exception.

    static void ExecuteAsync()
               {
                   if (File.Exists("Videos/output.flv"))
                   try
                   {
                       File.Delete("Videos/output.flv");
                   }
                   catch
                   {
                       return;
                   }

               try
               {
                   process = new Process();
                   ProcessStartInfo info = new ProcessStartInfo(@"e:\ffmpeg\bin\ffmpeg.exe", "-i cars1.flv -same_quant intermediate1.mpg");
                   info.CreateNoWindow = false;
                   info.UseShellExecute = false;
                   info.RedirectStandardError = true;
                   info.RedirectStandardOutput = true;
                   process.StartInfo = info;
                   process.EnableRaisingEvents = true;
                   process.ErrorDataReceived += new DataReceivedEventHandler(process_ErrorDataReceived);
                   process.OutputDataReceived += new DataReceivedEventHandler(process_OutputDataReceived);
                   process.Exited += new EventHandler(process_Exited);
                   process.Start();
                   process.BeginOutputReadLine();
                   process.BeginErrorReadLine();
               }
               catch (Exception ex)
               {
                   if (process != null) process.Dispose();
               }
           }
           static int lineCount = 0;
           static void process_ErrorDataReceived(object sender, DataReceivedEventArgs e)
           {
               Console.WriteLine("Input line: {0} ({1:m:s:fff})", lineCount++, DateTime.Now);
               Console.WriteLine(e.Data);
               Console.WriteLine();
           }

           static void process_OutputDataReceived(object sender, DataReceivedEventArgs e)
           {
               Console.WriteLine("Output Data Received.");
           }

           static void process_Exited(object sender, EventArgs e)
           {
               process.Dispose();
               Console.WriteLine("Bye bye!");
           }
       }
  • How to interact with process output ?

    14 mai, par 1ben99

    Ok so at the moment I have a program which runs FFmpeg using a process in VB.net. I send the process arguments in the startinfo as well as other things like the file location. When I run the code it sends the console output to the debug console ; this is probably because I have the .UseShellExecute = False and processInfo.RedirectStandardOutput = True

    



    My question is : How do I make something which can interpret the output ? Also with FFmpeg, the process is continuous so the process is always running for the most part and constantly adding more output lines in the debug console.

    



    The code I am using :

    



    Dim process As New Process
        Dim processInfo As New ProcessStartInfo
        processInfo.FileName = tempPath
        processInfo.Arguments = ("-r 1/.1 -i " + link + " -c copy " + saveLocation + "\" + streamerName + ".ts")
        processInfo.UseShellExecute = False
        processInfo.WindowStyle = ProcessWindowStyle.Hidden
        processInfo.CreateNoWindow = True
        processInfo.RedirectStandardOutput = True
        process.StartInfo = processInfo
        process.Start()


    



    I tried this with no luck.

    



    Dim output As String
        Using StreamReader As System.IO.StreamReader = process.StandardOutput
            output = StreamReader.ReadToEnd().ToString
        End Using


    



    Edit : I now have this code :

    



    Dim process As New Process
        AddHandler process.OutputDataReceived, AddressOf CallbackProcesoAsync
        AddHandler process.ErrorDataReceived, AddressOf ErrorDataReceivedAsync
        Dim processInfo As New ProcessStartInfo
        processInfo.FileName = tempPath
        processInfo.Arguments = ("-r 1/.1 -i " + link + " -c copy " + saveLocation + "\" + streamerName + ".ts")
        processInfo.UseShellExecute = False
        processInfo.WindowStyle = ProcessWindowStyle.Hidden
        processInfo.CreateNoWindow = False
        processInfo.RedirectStandardOutput = True
        processInfo.RedirectStandardError = True
        process.StartInfo = processInfo
        process.Start()
        processes.Add(Tuple.Create(tempPath, streamerName))
        Debug.WriteLine("Attempting to record " + streamerName)
        Dim output As String
        Using StreamReader As System.IO.StreamReader = process.StandardOutput
            output = StreamReader.ReadToEnd().ToString
        End Using
    End If
End Sub

Private Sub CallbackProcesoAsync(sender As Object, args As System.Diagnostics.DataReceivedEventArgs)
    If Not args.Data Is Nothing AndAlso Not String.IsNullOrEmpty(args.Data) Then
        RichTextBox1.Text = args.Data
    End If
End Sub

Private Sub ErrorDataReceivedAsync(sender As Object, args As System.Diagnostics.DataReceivedEventArgs)
    If Not args.Data Is Nothing AndAlso Not String.IsNullOrEmpty(args.Data) Then
        RichTextBox2.Text = args.Data
    End If
End Sub


    



    But I have not recieved any outputs to the richtextboxes ?

    



    I feel like it has something to do with the streamReader so I removed it and it still didn't work ? I don't have any more ideas what it could be.

    


  • ffmpeg video conversion problems ?

    22 septembre 2018, par Surya sasidhar

    I am using ffmpeg for video conversion, it is working fine in local.
    But when I upload the site in online it is not converting the videos. It is showing operation failed should I install the ffmpeg in server also.

    public void convertFile()

    {

       lblStatus.Visible = false;
       try
       {

           int i = sFile.LastIndexOf(".");
           thumb = sFile.Remove(i);
           thumb = thumb + ".jpg";
           video = Page.MapPath("../VideoOut/" + sFile);
           Image = Page.MapPath("../VideoSnapShots/" + thumb);
           ffmpeg = new Process();
           ffmpeg.StartInfo.Arguments = " -i \"" + video + "\"    -vframes 1 -ss 00:00:10 -s 150x150 -f image2 -vcodec mjpeg \"" + Image + "\""; // arguments !
           ffmpeg.StartInfo.FileName = Page.MapPath("FFMPEG\\ffmpeg.exe");
           ffmpeg.Start();
           Session["image"] = thumb;
           string mpg;
           string VideoOut;
           int j = sFile.LastIndexOf(".");
           mpg = sFile.Remove(j);
           mpg = mpg + ".flv";
           video = Page.MapPath("../VideoOut/" + sFile);
           VideoOut = Page.MapPath("../Videos/" + mpg);
           ffmpeg.EnableRaisingEvents = true;

           ffmpeg.StartInfo.Arguments = " -i \"" + video + "\" -ar 22050 \"" + VideoOut + "\"";
           ffmpeg.StartInfo.FileName = Page.MapPath("FFMPEG\\ffmpeg.exe");
           ffmpeg.Start();
           ffmpeg.StartInfo.UseShellExecute = false;
           ffmpeg.StartInfo.CreateNoWindow = false;
           ffmpeg.StartInfo.RedirectStandardError = true;
           ffmpeg.StartInfo.RedirectStandardOutput = false;
           ffmpeg.WaitForExit();
           ffmpeg.Close();
           Session["videosrc"] = mpg;

           InsertVideo();
           File.Delete(video);

       }
       catch (Exception ex)
       {
           lblStatus.Visible = true;
           lblStatus.Text = ex.Message;
       }

    }