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.

26084 questions
94
votes
1 answer

How to add transparent watermark in center of a video with ffmpeg?

I am currently using these commands: Top left corner ffmpeg –i inputvideo.avi -vf "movie=watermarklogo.png [watermark]; [in][watermark] overlay=10:10 [out]" outputvideo.flv Top right corner ffmpeg –i inputvideo.avi -vf "movie=watermarklogo.png…
mirza
  • 5,685
  • 10
  • 43
  • 73
93
votes
10 answers

How can I get the resolution (width and height) for a video file from a linux command line?

I've been digging through the mplayer/mencoder and ffmpeg documentation and I can't seem to come up with anything. I'm not especially picky as to the output format as I can use a regular expression to pull it out, I just can't seem to get the data…
Jeremy Logan
  • 47,151
  • 38
  • 123
  • 143
88
votes
2 answers

ffmpeg.c what are pts and dts ? what does this code block do in ffmpeg.c?

In simple terms what are pts and dts values? Why are they important while transcoding [decode-encode] videos ? What does this code bit do in ffmpeg.c , what is its purpose? 01562 ist->next_pts = ist->pts = picture.best_effort_timestamp; 01563 …
Aditya P
  • 1,862
  • 5
  • 28
  • 39
87
votes
2 answers

Can ffmpeg convert audio to raw PCM? If so, how?

I'm currently using ffmpeg to convert FLV/Speex to WAV/pcm_s16le, successfully. However, I now need the output format to be RAW, that is, PCM signed 16-bit little endian, without the WAV header. I tried the following: ffmpeg -y -i input.flv -vn…
David van Geest
  • 1,957
  • 1
  • 20
  • 19
87
votes
4 answers

FFMPEG- Convert video to images

how can i convert a video to images using ffmpeg? Example am having a video with total duration 60 seconds. I want images between different set of duration like between 2-6 seconds, then between 15-24 seconds and so on. Is that possible using…
hack
  • 1,403
  • 2
  • 14
  • 20
86
votes
2 answers

Applying multiple filters at once with FFMPEG

I have the need to apply fadein and overlay filters to a video. Is it possible to apply 2 filters at once? I got: ffmpeg -i input.mpg -vf "movie=watermark.png [logo]; [in][logo] overlay=W-w-10:H-h-10 [out]" output.mpg I'm trying to add…
Parziphal
  • 6,222
  • 4
  • 34
  • 36
86
votes
4 answers

How to extract the 1st frame and restore as an image with ffmpeg?

Anyone knows the trick? And how to install ffmpeg ? yum install mpeg only returns this: ======================================================================================== Matched: mpeg…
lex
  • 1,139
  • 2
  • 10
  • 13
83
votes
1 answer

What is video timescale, timebase, or timestamp in ffmpeg?

There does not seem to be any explanation online as to what these are. People talk about them a lot. I just want to know what they are and why they are significant. Using -video_track_timescale, how would I determine a number for it? Is it random?…
Please Help
  • 929
  • 1
  • 8
  • 11
83
votes
5 answers

Use FFmpeg to resize image

Is it possible to resize an image using FFmpeg? I have this so far: ffmpeg. -i 1.jpg -vf scale=360:240 > 2.jpg I get the error message: At least one output file must be specified Is it possible?
Andrew Simpson
  • 6,883
  • 11
  • 79
  • 179
81
votes
18 answers

Can ffmpeg show a progress bar?

I am converting a .avi file to .flv file using ffmpeg. As it takes a long time to convert a file I would like to display a progress bar. Can someone please guide me on how to go about the same. I know that ffmpeg somehow has to output the progress…
Pawan Rao
  • 1,135
  • 2
  • 10
  • 11
81
votes
6 answers

Using ffmpeg to cut audio from/to position

I need to cut parts from an audio file from position to position. When I tried this command ffmpeg -ss 132 -t 139 -i original.mp3 new.mp3 it started at the second 132, and added the next 139 seconds to the new file. What I need is from second 132…
Mike
  • 2,051
  • 4
  • 28
  • 46
80
votes
5 answers

"The encoder 'aac' is experimental but experimental codecs are not enabled"

While converting flv to mp4 conversion using FFMPEG it's showing following error [aac @ 0x2b4b640] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.
Sandeep Nambiar
  • 1,656
  • 3
  • 22
  • 38
79
votes
3 answers

Unknown encoder 'libx264'

I installed ffmpeg 0.8.9 on ubuntu11 by ./configure --enable-gpl --enable-nonfree --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libx264 When I run it ffmpeg -y -i test.mp4 -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -vcodec…
why
  • 23,923
  • 29
  • 97
  • 142
79
votes
2 answers

How to crop a mp3 from x to x+n using ffmpeg?

Following this question I decided to use ffmpeg to crop MP3s. On another question I found this way of doing it: ffmpeg -t 30 -acodec copy -i inputfile.mp3 outputfile.mp3 The problem is that I don't want to crop the first 30 seconds, I want to crop…
marcgg
  • 65,020
  • 52
  • 178
  • 231
78
votes
6 answers

Generating movie from python without saving individual frames to files

I would like to create an h264 or divx movie from frames that I generate in a python script in matplotlib. There are about 100k frames in this movie. In examples on the web [eg. 1], I have only seen the method of saving each frame as a png and then…
Paul
  • 1,720
  • 2
  • 15
  • 20