Recherche avancée

Médias (91)

Autres articles (12)

  • MediaSPIP Init et Diogène : types de publications de MediaSPIP

    11 novembre 2010, par

    À l’installation d’un site MediaSPIP, le plugin MediaSPIP Init réalise certaines opérations dont la principale consiste à créer quatre rubriques principales dans le site et de créer cinq templates de formulaire pour Diogène.
    Ces quatre rubriques principales (aussi appelées secteurs) sont : Medias ; Sites ; Editos ; Actualités ;
    Pour chacune de ces rubriques est créé un template de formulaire spécifique éponyme. Pour la rubrique "Medias" un second template "catégorie" est créé permettant d’ajouter (...)

  • MediaSPIP Player : les contrôles

    26 mai 2010, par

    Les contrôles à la souris du lecteur
    En plus des actions au click sur les boutons visibles de l’interface du lecteur, il est également possible d’effectuer d’autres actions grâce à la souris : Click : en cliquant sur la vidéo ou sur le logo du son, celui ci se mettra en lecture ou en pause en fonction de son état actuel ; Molette (roulement) : en plaçant la souris sur l’espace utilisé par le média (hover), la molette de la souris n’exerce plus l’effet habituel de scroll de la page, mais diminue ou (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (515)

  • How to capture desktop using ffmpeg ? getting error when stop recording : System.InvalidOperationException : 'StandardIn has not been redirected.'

    4 octobre 2023, par SharonHemed

    I want it to record the entire desktop then when stopping to save the file to the hard drive. and to hide without the console window of the ffmpeg.

    


    but getting this exception error. and i'm setting the RedirectStandardInput to true.
so i'm not sure why it's showing this error.

    


    The exception error is on the line

    


    process.StandardInput.BaseStream.Write(qKey, 0, 1);


    


    The full code

    


    using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using NAudio.CoreAudioApi;
using NAudio.Wave;

namespace Desktop_Recorder
{
    public partial class Form1 : Form
    {
        Process process;

        public Form1()
        {
            InitializeComponent();

            process = new Process();
            Start(@"d:\test.mp4", 30);
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            Stop();
        }

        public void Start(string FileName, int Framerate)
        {
            process.StartInfo.FileName = @"d:\ffmpeg\ffmpeg.exe"; // Change the directory where ffmpeg.exe is.  
            process.EnableRaisingEvents = false;
            process.StartInfo.WorkingDirectory = @"D:\"; // The output directory  
            process.StartInfo.Arguments = @"-y -f gdigrab -framerate " + Framerate +
                " -i desktop -preset ultrafast -pix_fmt yuv420p " + FileName;
            process.StartInfo.UseShellExecute = false;
            process.StartInfo.CreateNoWindow = false;
            process.StartInfo.RedirectStandardInput = true; //Redirect stdin
            process.StartInfo.RedirectStandardError = true;
            process.Start();
            System.Threading.Thread.Sleep(3000);  //Wait 3 seconds (for testing).
            Stop();
        }

        public void Stop()
        {
            byte[] qKey = Encoding.GetEncoding("gbk").GetBytes("q"); //Get encoding of 'q' key
            process.StandardInput.BaseStream.Write(qKey, 0, 1); //Write 'q' key to stdin of FFmpeg sub-processs
            process.StandardInput.BaseStream.Flush(); //Flush stdin (just in case).
            process.Close();
        }


        private void btnStartRecording_Click(object sender, EventArgs e)
        {

        }
    }
}


    


  • FFMPEG stream is corrupted on Exoplayer

    12 septembre 2023, par Musa Kavak

    I'm trying to stream my computer's screen with UDP to display in Android with Exoplayer.

    


    I started the stream with this line :

    


    ffmpeg -re -f x11grab  -i :0 -c:v libx264 -preset ultrafast -tune zerolatency  -f mpegts udp://192.168.1.107:40001`


    


    And received with the media3 Exoplayer :

    


      Surface {
                val exoPlayer = ExoPlayer.Builder(this@MainActivity).build().apply {
                    //Same result as setMediaSource()
                    setMediaItem(MediaItem.fromUri("udp://192.168.1.107:40001"))
                    prepare()
                }

                AndroidView(
                    factory = {
                        PlayerView(it).apply {
                            player = exoPlayer
                        }
                    }
                )
  }


    


    But the result is black screen with dots :

    


    Black video with dots

    


    I can see the stream with ffplay it's working perfectly.

    


    I tried to add audio to the stream because I thought a mpegts file without audio could cause the problem. I can hear the audio but video still the same.

    


    Then switch to Windows and tried with gdigrab and... Yes, still the same.

    


    Thank you for your time in advance.

    


  • using ffmpeg to capture the screen why it's not saving the output file to the folder and not saving the output file at all ?

    17 juillet 2023, par Shelly Ron

    at the top

    


    private bool recordFullScreen = true;
private Process ffmpegProcess;


    


    Load event

    


    private void Form1_Load(object sender, EventArgs e)
        {
            // Hide the FFmpeg console window
            var ffmpegStartInfo = new ProcessStartInfo
            {
                FileName = @"D:\Captured Videos\ffmpeg.exe",
                Arguments = "-hide_banner -loglevel panic",
                UseShellExecute = false,
                CreateNoWindow = true,
                RedirectStandardInput = true
            };

            ffmpegProcess = Process.Start(ffmpegStartInfo);
        }


    


    Closing event

    


    private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            // Terminate FFmpeg process before closing the application
            ffmpegProcess.StandardInput.WriteLine("q");
            ffmpegProcess.WaitForExit();
            ffmpegProcess.Close();
        }


    


    recording button click event

    


    private void btnRecord_Click(object sender, EventArgs e)
        {
            if (recordFullScreen)
            {
                // Record the whole screen
                RecordScreen();
            }
        }


    


    the method recordscreen

    


    private void RecordScreen()
        {
            // Set the output folder path
            string outputFolder = @"D:\Captured Videos\";

            // Generate a unique file name based on the current date and time
            string fileName = DateTime.Now.ToString("Screen_yyyyMMdd_HHmmss") + ".mp4";

            // Set the output file path
            string outputFile = Path.Combine(outputFolder, fileName);

            // FFmpeg command to record the whole screen
            string ffmpegCommand = $"-f gdigrab -framerate 24 -i desktop -preset ultrafast -pix_fmt yuv420p \"{outputFile}\"";

            StartFFmpeg(ffmpegCommand);
        }


    


    the method startffmpeg

    


    private void StartFFmpeg(string command)
        {
            // Send the FFmpeg command to the process for execution
            ffmpegProcess.StandardInput.WriteLine(command);
            ffmpegProcess.StandardInput.Flush();
        }


    


    but when running the application pressing the button to record after some seconds i click the form red X on the top right to close it but it's not saving the mp4 output file. not sure if it's even recording at all.