Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
How to set a video's duration in FFMPEG ?
1er novembre 2011, par user872387How 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 waxicalI'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 IngmanssonI 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.
-
"No accelerated colorspace conversion found from yuv420p to bgr24" when using OpenCV with FFMPEG on mac
31 octobre 2011, par Itay kWhen trying to acquire a frame from a video file (I've tried several video formats) I am getting an error message "No accelerated colorspace conversion found from yuv420p to bgr24". The exact same code ran perfectly fine on a windows machine and I couldn't get it to run on a mac even after I recompiled and installed FFMPEG and OpenCV. I am using lion for my OS. Any ideas?
-
How can you only extract 30 seconds of audio using ffmpeg
30 octobre 2011, par JagguI am using ffmpeg for audio conversion. I am using this command:
ffmpeg -i file.mp3 file.wav
This works fine. However I only want to my output file to contain maximum 1 minute of audio. How can I do that using ffmpeg?