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
668
votes
9 answers

Cutting the videos based on start and end time using ffmpeg

I tried to cut the video using the start and end time of the video by using the following command ffmpeg -ss 00:00:03 -t 00:00:08 -i movie.mp4 -acodec copy -vcodec copy -async 1 cut.mp4 By using the above command i want to cut the video from…
Kalai
  • 9,097
  • 8
  • 27
  • 47
619
votes
22 answers

How to concatenate two MP4 files using FFmpeg?

I'm trying to concatenate two mp4 files using ffmpeg. I need this to be an automatic process hence why I chose ffmpeg. I'm converting the two files into .ts files and then concatenating them and then trying to encode that concatenated .ts file. …
Mark L
  • 9,035
  • 3
  • 25
  • 38
467
votes
14 answers

Rotating videos with FFmpeg

I have been trying to figure out how to rotate videos with FFmpeg. I am working with iPhone videos taken in portrait mode. I know how to determine the current degrees of rotation using MediaInfo (excellent library, btw) but I'm stuck on FFmpeg…
jocull
  • 17,542
  • 18
  • 95
  • 139
368
votes
13 answers

How can I extract audio from video with ffmpeg?

I tried the following command to extract audio from video: ffmpeg -i Sample.avi -vn -ar 44100 -ac 2 -ab 192k -f mp3 Sample.mp3 but I get the following output libavutil 50.15. 1 / 50.15. 1 libavcodec 52.72. 2 / 52.72. 2 libavformat 52.64. 2…
user1269669
  • 3,697
  • 3
  • 12
  • 5
251
votes
1 answer

What are the differences and similarities between ffmpeg, libav, and avconv?

When I run ffmpeg on Ubuntu, it shows: $ ffmpeg ffmpeg version v0.8, Copyright (c) 2000-2011 the Libav developers built on Feb 28 2012 13:27:36 with gcc 4.6.1 This program is not developed anymore and is only provided for compatibility. Use…
why
  • 21,267
  • 27
  • 91
  • 134
251
votes
27 answers

How do you convert an entire directory with ffmpeg?

How do you convert an entire directory/folder with ffmpeg via command line or with a batch script?
Eugene
  • 9,015
  • 18
  • 58
  • 86
239
votes
16 answers

How to install and run phpize

I have been meaning to install ffmpeg as an extension to my PHP setup. So before I can install it, I need to phpize it. I installed php5-dev by sudo apt-get install php5-dev. But now when I run phpize I get the following error : phpize Cannot find…
Hrishikesh Choudhari
  • 9,809
  • 17
  • 58
  • 73
234
votes
7 answers

FFMPEG (libx264) "height not divisible by 2"

I am trying to encode a .mp4 video from a set of frames using FFMPEG using the libx264 codec. This is the command I am running: /usr/local/bin/ffmpeg -r 24 -i frame_%05d.jpg -vcodec libx264 -y -an video.mp4 I sometimes get the following…
Andy Hin
  • 25,283
  • 37
  • 95
  • 135
222
votes
5 answers

How to create a video from images with FFmpeg?

ffmpeg -r 1/5 -start_number 2 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4 This line worked fine but I want to create a video file from images in another folder. Image names in my folder are: img001.jpg img002.jpg img003.jpg ... How…
user3877422
  • 2,287
  • 3
  • 10
  • 6
217
votes
9 answers

Best approach to real time http streaming to HTML5 video client

I'm really stuck trying to understand the best way to stream real time output of ffmpeg to a HTML5 client using node.js, as there are a number of variables at play and I don't have a lot of experience in this space, having spent many hours trying…
deandob
  • 4,508
  • 5
  • 22
  • 32
212
votes
10 answers

FFmpeg on Android

I have got FFmpeg compiled (libffmpeg.so) on Android. Now I have to build either an application like RockPlayer or use existing Android multimedia framework to invoke FFmpeg. Do you have steps / procedures / code / example on integrating FFmpeg on…
Jag
  • 2,121
  • 3
  • 13
  • 5
203
votes
12 answers

Convert audio files to mp3 using ffmpeg

I need to convert audio files to mp3 using ffmpeg. When I write the command as ffmpeg -i audio.ogg -acodec mp3 newfile.mp3, I get the error: FFmpeg version 0.5.2, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: libavutil …
Hrishikesh Choudhari
  • 9,809
  • 17
  • 58
  • 73
193
votes
1 answer

Meaning of ffmpeg output (tbc, tbn, tbr)

I am using ffmpeg to tell me video info. Specifically: ffmpeg -i video.ext I get the output: Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 704x576 [PAR 12:11 DAR 4:3], 9578 kb/s, 25 tbr, 90k tbn, 50 tbc Does anyone know what tbr, tbn and tbc are…
user7289
  • 25,989
  • 27
  • 64
  • 86
167
votes
1 answer

ffmpeg - Converting MOV files to MP4

I have just installed ffmpeg and I am trying to encode all my uploaded videos to .mp4 file. Most of the users currently upload .mov and I want to convert every video to .mp4. I am running the command as follows: ffmpeg -i movie.mov -vcodec copy…
user1503606
  • 2,818
  • 10
  • 36
  • 69
165
votes
7 answers

How to add a new audio (not mixing) into a video using ffmpeg?

I used a command like: ffmpeg -i video.avi -i audio.mp3 -vcodec codec -acodec codec output_video.avi -newaudio in latest version for adding new audio track to video (not mix). But I updated the ffmpeg to the newest version (ffmpeg version…
Vetalll
  • 2,826
  • 5
  • 22
  • 31
1
2 3
99 100