Recherche avancée

Médias (1)

Mot : - Tags -/ogv

Autres articles (41)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • 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

Sur d’autres sites (6967)

  • python - record and preview webcam at the same time, using e.g. ffmpeg

    18 décembre 2024, par Jan Oechsler

    I want to record webcam with sound using python. After tryng multiple different methods, ffmpeg with the python wrapper showed the best results.

    


    Recording works, but how can I preview the webcam at the same time, so I know where I am pointing the cam at ?

    


    I've seen this post, but I dont understand how I could implement this in python, using the wrapper.

    


    Any ideas on how to do this ? Or if there is another, easier, solution to record webcam video with sound and preview it simultaneously from within a python (Qt) application ?

    


    This is my code so far :

    


    import ffmpeg
import time

process = (
    ffmpeg
    .input('video=Integrated Camera:audio=Microphone Array (Realtek(R) Audio)', format='dshow')
    .output('out.mp4', pix_fmt='yuv420p')
    .overwrite_output()
    .run_async(pipe_stdin=True, pipe_stderr=True, quiet=True)
)

# This is just to simulate some time-
time.sleep(10)

process.stdin.write('q'.encode())
process.communicate()
process.wait()

print('done')


    


  • Flv stream to sockets with ffmpeg, node.js and socket.io

    7 août 2015, par Dan-Levi Tømta

    so i am having some problems with understanding how to pull this off. I know that streaming video is a topic that is hard, and that there is a lot to take account off, but anyway here we go to start of learning how to stream video.

    I am using SocketIoClientDotNet as the node.js client for the c# application.

    I am sending byte arrays of the video to node which are creating a temporary file and appending the buffer to it. I have tried to set the source of the video element to that file but it doesnt read it as video and are all black. I have tried to download a copy of the file since it did not work and it turns out vlc cant play it either. Ok to the code :

    C#

    bool ffWorkerIsWorking = false;
    private void btnFFMpeg_Click(object sender, RoutedEventArgs e)
    {
       BackgroundWorker ffWorker = new BackgroundWorker();
       ffWorker.WorkerSupportsCancellation = true;
       ffWorker.DoWork += ((ffWorkerObj,ffWorkerEventArgs) =>
       {
           ffWorkerIsWorking = true;
           using (var FFProcess = new Process())
           {
               var processStartInfo = new ProcessStartInfo
               {
                   FileName = "ffmpeg.exe",
                   RedirectStandardInput = true,
                   RedirectStandardOutput = true,
                   UseShellExecute = false,
                   CreateNoWindow = true,
                   Arguments = " -loglevel panic -hide_banner -y -f gdigrab -draw_mouse 1 -i desktop -f flv -"
               };
               FFProcess.StartInfo = processStartInfo;
               FFProcess.Start();
               byte[] buffer = new byte[32768];
               using (MemoryStream ms = new MemoryStream())
               {
                   while (!FFProcess.HasExited)
                   {
                       int read = FFProcess.StandardOutput.BaseStream.Read(buffer, 0, buffer.Length);
                       if (read <= 0)
                           break;
                       ms.Write(buffer, 0, read);
                       clientSocket.Emit("video", ms.ToArray());
                       ms.Flush();
                       if (!ffWorkerIsWorking)
                       {
                           ffWorker.CancelAsync();
                           break;
                       }
                   }
               }
           }
       });
       ffWorker.RunWorkerAsync();
    }

    JS (server)

    var buffer = new Buffer(32768);
    var isBuffering = false;
    var wstream;
    socket.on('video', function(data) {
       if(!isBuffering){
           wstream = fs.createWriteStream('fooTest.flv');
           isBuffering = true;
       }
       buffer = Buffer.concat([buffer, data]);
       fs.appendFile('public/fooTest.flv', buffer, function (err) {
         if (err) throw err;
         console.log('The "data to append" was appended to file!');
       });
    });

    What am i doing wrong here ?

  • ffmpeg—chrome could not load mp4 after server processed

    26 juin 2018, par Yan Ge

    I’m using C# to write the server-side along with ffmpeg to deal with some video files.After I load the video file from client and write the stream to a new file, I couldn’t use ffmpeg to extract some part of the original file, code like below

    string cmd = "-ss " + string.Format("{0:F}", startTime) + " -t " + string.Format("{0:F}", endTime - startTime) + " -i " + filePath + " -vcodec copy -acodec copy " + filePath + " -y";

    it shows the error [mov,mp4,m4a,3gp,3g2,mj2 @ 000002336e7da340] stream 1, offset 0x8fab : partial file ;Invalid data found when processing input

    after investigated, I found that the file which I mentioned as filePath(server side) maybe occupied by windows command(I used the Process to deal with ffmpeg)

    Process myPro = new Process();
           myPro.StartInfo.FileName = WebConfigurationManager.AppSettings["FFMPEGPath"];
           myPro.StartInfo.UseShellExecute = false;
           myPro.StartInfo.RedirectStandardInput = true;
           myPro.StartInfo.RedirectStandardOutput = true;
           myPro.StartInfo.RedirectStandardError = true;
           myPro.StartInfo.CreateNoWindow = true;
           myPro.Start();
           myPro.StandardInput.AutoFlush = true;
           myPro.WaitForExit();
           myPro.Close();
           myPro.Dispose();
           return output;

    I decided to create a new file to perform the extract operation and it works.

    string cmd = "-ss " + string.Format("{0:F}", startTime) + " -t " + string.Format("{0:F}", endTime - startTime) +
    " -i " + filePath + " -vcodec copy -acodec copy " + filePathfull + " -y";

    But when I tried to post back the file name by ajax to client and use video tag in html, it couldn’t load the mp4 file, I think, maybe the mp4 file which generated by ffmpeg is still occupied by system thread, have you ever met such situation ? How could it been fixed ? thanks a lot !