Questions tagged [ffmpeg]

Only questions about programmatic use of the FFmpeg libraries, API, or tools are on topic. Questions about interactive use of the command line tool should be asked on Super User or Video Production. FFmpeg is a free, open source project that produces libraries and programs for handling multimedia data.

Questions about interactive use of the ffmpeg command line tool are off-topic. Please ask them on the Super User or Video Production sites.

Questions here should relate to automating or integrating FFmpeg, or usage of the libav* libraries or API. See also: , , .

FFmpeg is a free, open source project that produces libraries and programs for handling multimedia data. The most notable components are:

  • libavcodec – an audio/video/subtitle codec library used by many other projects.
  • libavformat – an audio/video/subtitle container (de)muxing library.
  • ffmpeg – a command line program for transcoding multimedia files.
  • ffprobe – a command line program for viewing detailed information about multimedia files.
  • ffplay - a command line program for playing media files. It is mostly used as a testbed for the various FFmpeg APIs.

FFmpeg is published under the GNU Lesser General Public License 2.1+ or GNU General Public License 2+ (depending on which options are enabled).

See the FFmpeg documentation and FFmpeg Wiki for additional information.

22667 questions
159
votes
6 answers

What does 'Past duration X.XXX too large' mean?

When encoding H.264 using ffmpeg I get the following type of warnings en masse: Past duration 0.603386 too large Past duration 0.614372 too large Past duration 0.606377 too large What do they mean? I have not found anything clear online or in the…
Erik
  • 2,260
  • 2
  • 9
  • 21
157
votes
2 answers

ffmpeg override output file if exists

I am creating a clip from an audio file .FLAC with a start and end time, here is my command. ffmpeg -i /audio/191079007530_1_01.flac -t 51 -ss 69 /clips/44z274v23303t264y2z2s2s2746454t234_clip.mp3 2>&1 >>…
Reborn
  • 19,713
  • 8
  • 36
  • 61
157
votes
4 answers

What are all codecs and formats supported by FFmpeg?

I need a list of codecs and formats supported by FFmpeg. Where can I find it?
poobalan
  • 1,611
  • 2
  • 11
  • 3
150
votes
9 answers

Use ffmpeg to add text subtitles

I am trying to add text subtitles to an .mp4 container using ffmpeg: ffmpeg -i input.mp4 -i input.srt -map 0.0 -map 0.1 -map 1.0 output.mp4 When I am trying to run this line, it gives me an error : Nmber of stream maps must match number of output…
0-alpha
  • 2,421
  • 4
  • 17
  • 12
147
votes
8 answers

Fastest way to extract frames using ffmpeg?

Hi I need to extract frames from videos using ffmpeg.. Is there a faster way to do it than this: ffmpeg -i file.mpg -r 1/1 $filename%03d.jpg ?
Stpn
  • 5,346
  • 7
  • 43
  • 86
135
votes
15 answers

Fetch frame count with ffmpeg

Does anyone know how to fetch the number of total frames from a video file using ffmpeg? The render output of ffmpeg shows the current frame and I need the frame count to calculate the progress in percent.
Hansl
  • 1,351
  • 2
  • 9
  • 3
133
votes
2 answers

How to extract 1 screenshot for a video with ffmpeg at a given time?

There are many tutorials and stuff showing how to extract multiple screenshots from a video using ffmpeg. You set -r and you can even start a certain amount in. But I just want 1 screenshot at, say 01:23:45 in. Or 1 screenshot at 86% in. This is…
Peter Bengtsson
  • 6,067
  • 8
  • 39
  • 51
130
votes
2 answers

How can I extract a good quality JPEG image from a video file with ffmpeg?

Currently I am using this command to extract the images: ffmpeg -i input.mp4 output_%03d.jpeg But how can I improve the JPEG image quality?
Daniel Gartmann
  • 8,084
  • 11
  • 39
  • 53
126
votes
5 answers

FFmpeg C API documentation/tutorial

I am trying to find documentation to use the FFmpeg C API. It seems that only command line documentation is available. Is there any good documentation/tutorials/links available?
fvisticot
  • 6,499
  • 13
  • 43
  • 70
119
votes
4 answers

Get ffmpeg information in friendly way

Every time I try to get some information about my video files with ffmpeg, it pukes a lot of useless information mixed with good things. I'm using ffmpeg -i name_of_the_video.mpg. There are any possibilities to get that in a friendly way? I mean…
JBernardo
  • 28,886
  • 10
  • 78
  • 103
111
votes
13 answers

ffprobe or avprobe not found. Please install one

I want to add tags to mp3 converted by youtube-dl & ffmpeg: youtube-dl -o '/Output/qpgTC9MDx1o.mp3' qpgTC9MDx1o -f bestaudio --extract-audio --metadata-from-title "%(artist)s - %(title)s" 2>&1 I have this error in the output result: [youtube]…
Anass
  • 1,458
  • 2
  • 11
  • 18
107
votes
9 answers

FFmpeg: How to split video efficiently?

I wish to split a large avi video into two smaller consecutive videos. I am using ffmpeg. One way is to run ffmpeg two times: ffmpeg -i input.avi -vcodec copy -acodec copy -ss 00:00:00 -t 00:30:00 output1.avi ffmpeg -i input.avi -vcodec copy -acodec…
Antony
  • 1,210
  • 2
  • 9
  • 9
106
votes
8 answers

Crop MP3 to first 30 seconds

Original Question I want to be able to generate a new (fully valid) MP3 file from an existing MP3 file to be used as a preview -- try-before-you-buy style. The new file should only contain the first n seconds of the track. Now, I know I could just…
Cheekysoft
  • 32,898
  • 19
  • 70
  • 85
105
votes
1 answer

Creating a video from a single image for a specific duration in ffmpeg

How do I generate a movie using ffmpeg using a single image (image1.png) for a duration of 15 seconds with a specific resolution so when I play the video, the image will appear on screen for 15 seconds.
Dharmesh
  • 1,590
  • 2
  • 11
  • 12
100
votes
4 answers

ffmpeg concat: "Unsafe file name"

Trying to convert a bunch of mts-files into a big mp4-file: stephan@rechenmonster:/mnt/backupsystem/archive2/Videos/20151222/PRIVATE/AVCHD/BDMV$ ~/bin/ffmpeg-git-20160817-64bit-static/ffmpeg -v info -f concat -i <(find STREAM -name '*' -printf "file…
sers
  • 2,496
  • 2
  • 15
  • 23