Recherche avancée

Médias (91)

Autres articles (42)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

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

Sur d’autres sites (5652)

  • Working with FFMPEG and C#

    23 septembre 2016, par fauvent

    I have been trying to develop a C# app for a long time now which is intended to run on a server. It takes info from a data base and makes a video with it. I have been using libraries for that porpuse (Aforge). But now it looks like I HAVE to use FFMPEG to combine 5 mp4 in one. My question would be :

    1. Do I have to "execute" the exe file from the download to make it work ? Or I can simply use the dll like the other libraries (like Aforge) ?

    2. FFMPEG looks very complicated to me. I have been trying to use Splicer insted. There is a very nice and clean example that I would love to use. But I can’t get Splicer to work. I am using VS 13. How exaclty I get Splicer working ? Adding the dlls to the "debug folder" then just adding the reference ? If so which dlls ?

    This is my code so far. It does not show any errors but it does not do anything (I added the reference and the splicer.dll to my project)

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using Splicer;
    using Splicer.Renderer;
    using Splicer.Timeline;

    namespace MergeVideos
    {
       public partial class Form1 : Form
       {
           public Form1()
           {
               InitializeComponent();
           }

           private void Form1_Load(object sender, EventArgs e)
           {

               string firstVideoFilePath = @"C:\Users\Nicci\Desktop\santa\profile.mp4";
               string secondVideoFilePath = @"C:\Users\Nicci\Desktop\santa\santa_vid.mp4";
               string outputVideoPath = @"C:\Users\Nicci\Desktop\santa\output.mp4";

               using (ITimeline timeline = new DefaultTimeline())
               {
                   IGroup group = timeline.AddVideoGroup(32, 720, 576);

                   var firstVideoClip = group.AddTrack().AddVideo(firstVideoFilePath);
                   var secondVideoClip = group.AddTrack().AddVideo(secondVideoFilePath, firstVideoClip.Duration);

                   using (AviFileRenderer renderer = new AviFileRenderer(timeline, outputVideoPath))
                   {
                       renderer.Render();
                   }
               }

           }
       }
    }

    Thanks in advance !

  • Java/OpenCV - How to do a lossless h264 video writing in openCV ?

    15 août 2018, par JohnDoeAnon

    in the last time I had some struggle with the VideoWriter in openCV under java. I want to write a video file in a *.mp4 container with h.264 codec - but I see no option to toggle bitrate or quality in openCV VideoWriter. I did build openCV with ffmpeg as backend. I just want to write the video file in exact quality values as the original input video.
    I also have some code to do the job

    import org.opencv.core.Mat;
    import org.opencv.core.Size;
    import org.opencv.videoio.VideoWriter;
    import org.opencv.videoio.Videoio;

    public class VideoOutput
    {
        private final int H264_CODEC = 33;

        private VideoWriter writer;

        private String filename;

        public VideoOutput (String filename)
        {
           writer = null;

           this.filename = filename;
       }

       public void initialize(double framesPerSecond, int height, int width) throws Exception
       {

           this.writer = new VideoWriter();

           this.writer.open(filename, H264_CODEC, framesPerSecond, new Size(width, height));

           if(!writer.isOpened())
           {
                Logging.LOGGER.severe("Could not create video output file " + filename + "\n");

                throw new Exception("Could not create video output file " + filename + "\n");
           }
       }

       public void setFrame(VideoFrame videoFrame) throws Exception
       {
            if (writer.isOpened())
            {
                Mat frame = ImageUtil.imageToMat(videoFrame.getFrame());

                writer.write(frame);

                frame.release();
            }
       }

    I hoped the VideoWriter gives some options to do the job but it seems not the way.

    So is there an option or flag that I am missing for lossless h264 video writing under openCV and java OR maybe there is another way to do this ?
    Please help me - if you have done this already I really would appreciate some example code to get things done.

    UPDATE

    I do have now a solution that fits for my application, so here it is :

    String fps = Double.toString(this.config.getInputConfig().getFramesPerSecond());

    Runtime.getRuntime().exec(
           new String[] {
           "C:\\ffmpeg-3.4.2-win64-static\\bin\\ffmpeg.exe",
           "-framerate",
           fps,
           "-i",
           imageOutputPath + File.separator +  "%01d.jpg",
           "-c:v",
           "libx265",
           "-crf",
           "1",
           imageOutputPath + File.separator +  "ffmpeg.mp4"
           }
       );

    Credits to @Gyan who gave me the correct ffmpeg call in this post :

    Win/ffmpeg - How to generate a video from images under ffmpeg ?

    Greets

  • How to format string the ffmpeg arguments to pass the arguments to a textBox ?

    28 juin 2022, par Sharo SA

    I created this form :

    


    arguments

    


    I want to use the variable ffmpegArguments to pass the arguments from the textBox to the ffmpeg class arguments. the problem is that in the ffmpeg class i'm using the variables :

    


    FileName and Framerate so how can i format the input from the textBox to the ffmpeg arguments with the FileName and Framerate variables ?

    


    In the ffmpeg class :

    


    using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.IO.Pipes;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Capture_Screen
{
    internal class FFmpeg_Capture
    {
        public string workingDirectory;
        public string outputDirectory;
        public string ffmpegArguments;

        private Process process;

        public FFmpeg_Capture()
        {
            
        }

        public void Start(string FileName, int Framerate)
        {
            process = new Process();
            process.StartInfo.FileName = outputDirectory; // Change the directory where ffmpeg.exe is.  
            process.EnableRaisingEvents = false;
            process.StartInfo.WorkingDirectory = workingDirectory; // 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.RedirectStandardInput = true; //Redirect stdin
            process.StartInfo.CreateNoWindow = true;
            process.Start();
        }

        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();
            process.Dispose();
        }
    }
}