Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • FFMPEG - Drawtext or drawbox or overlay on single frame

    2 novembre 2011, par waxical

    I'm using the avfilters on FFMPEG to drawtext and drawbox. Two of the most poorly documented functions known to man.

    I'm struggling to work out how and if I can use this on a single frame. I.e. appear drawtext on frame 22.

    Current command:-

    ffmpeg -i /home/vtest/test.wmv -y -b 800000 -f flv -vcodec libx264 -vpre default -s 768x432 -g 250 -vf drawtext="fontfile=/home/Cyberbit.ttf:fontsize=24:text=testical:fontcolor=green:x=100:y=200" -qscale 8 -acodec libfaac -sn -vstats  /home/testout.flv
    

    Two elements mention here in the documentation are n and t - however I only seem to be able to use them in x and y. Not in text or even as other parameters.

    Any help or ffmpeg guidance would be gratefully received.

  • Xuggler encoding images to video FPS issue

    1er novembre 2011, par Chris Robinson

    I've been experimenting with encoding a video from a series of images using CaptureScreenToFile.java as a basis. My output is to be an MP4 file. From 26 images, using the code as is (taking the images from a directory instead of from a screen capture obviously), the encoding video is ~11s. However, if I change the framerate variable to:

    frameRate = IRational.make(1, 24);
    

    which I believe should result in a video of 24FPS. It does not however, (no change from the original video in fact). I experimented with changing the timeStamp variable in encodeImage() method to:

    long timeStamp = (firstTimeStamp*1000)+(i*40);
    

    where 0 < i < 25 to see if that would help but it doesn't. Can anyone explain to me how to encode a directory of images to a video with a framerate that I can set?

  • How to set a video's duration in FFMPEG ?

    1er novembre 2011, par user872387

    How to limit the video duration for a given video.For example,if we are uploading one video that should not exceed more than 5 minutes,I need a metadata in FFMPEG.Can you please find out the answer.

  • FFMPEG - No longer writing logs incrementally ?

    1er novembre 2011, par waxical

    I've had a script parsing the logs of FFMPEG (the -vstats_file), which in my previous version would be appended with each line as it was encoding.

    This script was to get progress.

    I've just updated the version 0.8.5 and it seems to now create the file at beginning of encode and append it with the log data on completion. So, obviously my script can no longer follow progress.

    Has anyone experienced this? Anyone running a recent version found this NOT to be the case?

  • Using FFMpeg with Runtime.exec() to do a simple transcoding

    1er novembre 2011, par Adam Ingmansson

    I know there are many questions touching this subject, but none have helped me solve my issue.

    Purpose:

    Transcoding a video taken,from a queue, from .mov to h.264 (for now only that)

    Solution:

    Building a java application that gets the next in the queue, transcodes it then repeat

    Problem:

    Running ffmpeg using Runtime.exec() is not working. Im using the StreamGobbler from this tutorial to capturing the output from the process.

    This code shows how i start my process:

    String[] command = new String[]{"./ffmpeg/ffmpeg","-i",videoFile.getPath(),"-vcodec","libx264","-fpre",preset,folder + recID + ".flv"};
    System.out.println("Running command..");
    Process p = r.exec(command);
    
     // any error message?
    StreamGobbler errorGobbler = new 
    StreamGobbler(p.getErrorStream(), "ERROR");            
    
    // any output?
    StreamGobbler outputGobbler = new 
    StreamGobbler(p.getInputStream(), "OUT");
    
    // kick them off
    errorGobbler.start();
    outputGobbler.start();
    
    //logProcessOutputAndErrors(p);
    
    int res = p.waitFor();
    if (res != 0) {
        throw new Exception("Encoding error: "+String.valueOf(res));
    }
    

    and this is the current modified version of StreamGobbler (the important part)

    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line=null;
    int c = 0;
    StringBuilder str = new StringBuilder();
    
    while (true) {
        c = br.read();
    }
    

    Sometimes ffmpeg just stalls, maybe waiting for my input (although there is no indication on screen).

    Sometimes it just ends.

    Sometimes (when I added the line "System.out.print((char) c);" in the while-loop above) i got loads of "¿¿ï" repeated over and over again, wich might be the actual encoding of the video wich I managed to capture instead of to a file.

    For those who wonders why i dont just go with a commandline or maybe even php:

    The purpose is an application that will run 24/7 transcoding anything and everything from a queue. The files are pretty large to begin with and takes about 15 min to transcode.