Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • ffmpeg - how to set max frame rate

    20 février 2017, par user19283043

    I'm using ffmpeg to convert video and I would like to set max framerate. For example, I have a video which is 46 framerate, but I want to set this to 40.

    This is my code below:

    var cmd = ffmpeg()
          .input(data.img_path)
          .format('mp4')
          .videoCodec('libx264')
          .audioBitrate('192k')
          .audioChannels(2)
          .outputOptions('-movflags', 'frag_keyframe')
          ....
    
  • Convert ismv to mpeg-dash with node js

    20 février 2017, par MBajor13

    I'm trying stream live video from ip camera to HTML 5 video teg.
    I encoding stream with ffmpeg. The comand is.

    $ ffmpeg -rtsp_transport tcp -an -i "rtsp://192.168.1.10:554/user=admin&password=&channel=1&stream=0.sdp" -f mp4 -reset_timestamps 1 -movflags isml+empty_moov+default_base_moof -g 30 -probesize 200000 "http://localhost:1313/mediasourse.isml/stream1"

    Then I resive the date in node.js server and send them to users whith WebSocket.
    The issue is that the search bar in video teg remain on the same plase.

    I notice that mp4box except "moof" and "mdat" atoms adds "styp" and "sidx" atoms in each segment. "moov" atom is also different. But I don't know what exactly I nead to edite.

    Thanks.

  • Text on video ffmpeg

    20 février 2017, par Jesper Madsen

    How can I add text overlay on my video in ffmpeg?

    i.e. given a video "video1.flv", how can I add "StackOverflow" text during the whole video, positioned in the middle of the screen, with white text and a border?

  • Raw Audio from NAudio

    20 février 2017, par Ken

    I want to record raw audio from WASAPI loopback by NAudio and pipe to FFmpeg for streaming via memory stream. As from this document, FFmpeg can get input as Raw However, I got result speed at 8~10x! Here is my code:

    waveInput = new WasapiLoopbackCapture();
    waveInput.DataAvailable += new EventHandler((object sender, WaveInEventArgs e) => 
    {
        lock (e.Buffer)
        {
            if (waveInput == null)
                return;
            try
            {
                using (System.IO.MemoryStream memoryStream = new System.IO.MemoryStream())
                {
                    memoryStream.Write(e.Buffer, 0, e.Buffer.Length);
                    memoryStream.WriteTo(ffmpeg.StandardInput.BaseStream);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
    });
    waveInput.StartRecording();
    

    FFmpeg Arguments:

    ffmpegProcess.StartInfo.Arguments = String.Format("-f s16le -i pipe:0 -y output.wav");
    

    1. Can someone please explain this situation and give me a solution?
    2. Should I add Wav header to the Memory Stream then pipe to FFmpeg as Wav format?

    The Working Solution

    waveInput = new WasapiLoopbackCapture();
    waveInput.DataAvailable += new EventHandler((object sender, WaveInEventArgs e) => 
    {
        lock (e.Buffer)
        {
            if (waveInput == null)
                return;
            try
            {
                using (System.IO.MemoryStream memoryStream = new System.IO.MemoryStream())
                {
                    memoryStream.Write(e.Buffer, 0, e.BytesRecorded);
                    memoryStream.WriteTo(ffmpeg.StandardInput.BaseStream);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
    });
    waveInput.StartRecording();
    

    FFMpeg Arguments:

    ffmpegProcess.StartInfo.Arguments = string.Format("-f f32le -ac 2 -ar 44.1k -i pipe:0 -c:a copy -y output.wav");
    
  • best approach for extract / extracting images / image sequence from videos / video file in Java

    20 février 2017, par Daniel Ruf

    Well, there is FFMPEG and some Java bindings and wrappers for it but I need to distribute for each specific platform the right binary file of FFMPEG.

    Isnt there any plain Java solution or library without any dependencies like FFMPEG for converting a video fle to an image sequence?

    Solutions like FFMPEG, XUGGLER or JMF (abandoned) are not suitable. Is there really no pure Java solution for this?

    Maybe for specific video codecs / files at least?

    I just want to extract the images from the video file to jpeg / png files and save them to the disk