Media tool with support for multiple codecs, filters, and containers. Include the full, uncut console output if you have problems with an FFmpeg command.

learn more… | top users | synonyms

74
votes
5answers
90k views

Using ffmpeg to cut up video

I am using ffmpeg to cut out a section of a large file like this: ffmpeg -i input.wmv -ss 60 -t 60 -acodec copy -vcodec copy output.wmv The -ss part works fine but the -t is ignored. It correctly ...
61
votes
6answers
35k views

How do I convert a video to GIF using ffmpeg, with reasonable quality?

I'm converting .flv movie to .gif file with ffmpeg. ffmpeg -i input.flv -ss 00:00:00.000 -pix_fmt rgb24 -r 10 -s 320x240 -t 00:00:10.000 output.gif It works great, but output gif file has a very ...
49
votes
3answers
76k views

How can I convert MP4 video to MP3 audio with FFmpeg?

I need to extract an MP3 audio track from an MP4 video with ffmpeg. I can do this for .flv -> mp3, but I don't know the command line parameters for mp4->mp3. For example, flv -> mp3: ffmpeg -i ...
44
votes
8answers
50k views

ffmpeg: create a video from images

Is it possible to use ffmpeg create a video from a set of sequences, where the number does not start from zero? For example, I have some images [test_100.jpg, test_101.jpg, test_102.jpg, ..., ...
42
votes
2answers
20k views

How can I get ffmpeg to convert a .mov to a .gif?

I'm trying to convert a .mov to a .gif and I'm not having success. Here's the error: ffmpeg -pix_fmt rgb24 -i yesbuddy.mov output.gif ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg ...
32
votes
3answers
16k views

Meaningful thumbnails for a Video using FFmpeg

FFmpeg can capture images from videos that can be used as thumbnails to represent the video. Most common ways of doing that are captured in the FFmpeg Wiki. But, I don't want to pick random frames at ...
30
votes
3answers
31k views

Remove audio from video file with FFmpeg

How can I strip the audio track out of a video file with FFmpeg?
30
votes
1answer
31k views

How can I normalize audio using ffmpeg?

I want the loudest peak sound in a movie clip to be as loud as the codec allows, then have every other sound amplified accordingly. What's a practical example in order to accomplish this using ...
30
votes
4answers
26k views

How can I make ffmpeg be quieter/less verbose?

By default ffmpeg sends a whole lotta messages to stderr: when built, how built, codecs, etc, etc, etc. How can I make it quieter? I've tried -v 0 (and -v 10 since the documentation just coyly says ...
26
votes
6answers
38k views

Cut part from video file from start position to end position with FFmpeg

I have a video file of 30 minutes, but I want to extract a video from 00:09:23 to 00:25:33. I can define the startposition with -ss, but I couldn't find one for the end position. Any help please?
26
votes
1answer
19k views

FFMPEG Splitting MP4 with Same Quality

I have one large MP4 file. I am attempting to split it into smaller files. ffmpeg -i largefile.mp4 -sameq -ss 00:00:00 -t 00:50:00 smallfile.mp4 I thought using -sameq would keep the same quality ...
25
votes
1answer
2k views

Why are my MP3 files the same size, even when I change the bitrate with ffmpeg?

I converted an audio stream into 3 different settings using essentially the same format. They ended up being exactly the same size. Why is this? ffmpeg -i "Likoonl-Q1-All.mp4" -c:v copy -c:a ...
24
votes
5answers
25k views

How to flip a video 180° (vertical/upside down) with FFmpeg?

I have a video that was recorded upside down. Is it possible to correct this with FFmpeg?
23
votes
3answers
36k views

Why would I choose Libav over FFmpeg, or is there even a difference?

From what I've seen it looks to me like Libav's avconv is thought to become a successor of ffmpeg — is that correct? If that's true, why is that so? What exactly is libav doing better and why would ...
23
votes
6answers
26k views

FFMPEG convert flv to mp4 without losing quality [duplicate]

Currently I'm converting .flv flash files to .webm and .mp4 files to be used with an HTML5 video player. _ I use this ffmpeg command for WEBM: ffmpeg -i filename.flv -vcodec libvpx -acodec libvorbis ...
21
votes
8answers
44k views

How to convert video to images?

How can I convert a video file to a sequence of images, for example one frame every N seconds. Can mplayer or ffmpeg do this? I have used MPlayer to grab screenshots manually but I would like to ...
21
votes
1answer
11k views

What is the “sameq” or “same_quant” option in FFmpeg? Does it mean “same quality”?

Often, I've seen FFmpeg commands using the sameq option, for example ffmpeg -i input.mp4 -sameq output.avi What does this mean? Does it mean "same quality"? If not, what should I use instead?
20
votes
6answers
40k views

How to merge audio and video file in ffmpeg

I want to merge an audio file (.wav or .au format) with a video file (.mp4 format). Please suggest me how to achieve this. I want to merge these file to new .mp4 video file. An ffmpeg command would ...
20
votes
1answer
28k views

How to resize a video to make it smaller with FFmpeg

Is it possible to resize my videos to make them smaller with FFmpeg? I have an original video dimensions of 1024x576, now I want to resize the video to 720x480 to meet the requirement. How can I do ...
20
votes
3answers
14k views

Improve quality of ffmpeg created jpgs

I'm using ffmpeg to take a mjpeg feed from an IP camera and convert it into a series of still jpeg images. Here's the command I'm using: ffmpeg -i http://xxx:xxx@xx.xx.xx.xx/vid.mjpg -f image2 ...
19
votes
1answer
39k views

Converting FLV to MP4 Using FFMPEG and Preserving the Quality

Im trying to use ffmpeg to convert my flv files to mp4 to play them on iOS devices but the converted video has a much worse quality than the original one. Here is the command i use: ffmpeg -i ...
19
votes
4answers
8k views

Creating video with audio and still image for YouTube

I'm running the following command: ffmpeg -i audio.mp3 -ar 44100 -f image2 -i logo.jpg -r 15 -b 1800 -s 640x480 foo.mov Which successfully outputs a video with my recorded audio and an image on it. ...
18
votes
8answers
7k views

Program to convert flac to mp3? [closed]

I'm looking for a program to convert flac files to mp3, while preserving the embedded metadata (including album art). I'm pretty sure this is possible with ffmpeg, but I don't know the command . . . ...
17
votes
2answers
17k views

Resizing videos with ffmpeg/avconv to fit into static sized player

I have a html 5 video player which is 700px wide, 400px high. I'm trying to use avconv to use ffmpeg to resize (while retaining the aspect ratio) and making sure it fits into my player. Input can be ...
16
votes
7answers
9k views

Get MP3 Length in Linux / FreeBSD

I have a bunch of mp3 files with various length. I want to cut it down to 50%-60% length. Says, from 1 minute down to 30 seconds. It should be trivial using ffmpeg. But, I don't know how to determine ...
15
votes
3answers
14k views

How to create an uncompressed AVI from a series of 1000's of PNG images using FFMPEG

How can I create an uncompressed AVI from a series of 1000's of PNG images using FFMPEG? I used this command to convert an input.avi file to a series of PNG frames: ffmpeg -y -i input.avi -an ...
15
votes
3answers
10k views

Resize videos with different widths to a fixed height preserving aspect ratio with ffmpeg

I'd like to convert a lot of video files to flash video for our company's website. I have a requirement that all of the videos must be in 360p format, so their size would be Nx360. FFMpeg uses -s ...
14
votes
1answer
14k views

Converting video to WebM with ffmpeg/avconv

While trying to optimize the size of my home videos I converted some of them to WebM as a test, using Pitivi on Xubuntu. The size difference is significant. The resulting webm-file is only around 10% ...
13
votes
1answer
14k views

Explanation of x264 tune

Running this command ffmpeg -i a.mp4 -tune b c.mp4 reveals the possible tune values for x264 and in turn FFmpeg [libx264 @ 0000000002167100] Possible tunes: film animation grain stillimage ...
13
votes
4answers
37k views

How to convert an MKV to AVI with minimal loss

To convert an MKV to AVI, I do two things. The first thing I do is this: ffmpeg -i filename.mkv -vcodec copy -acodec copy output.avi or this: ffmpeg -i filename.mkv -sameq -acodec copy output.avi ...
13
votes
2answers
7k views

FFMPEG - Non-monotonous DTS

When I use FFMPEG to convert a video from MP4 to M3U8, using the following command, ffmpeg -i op.mp4 -b:v 128k -flags -global_header -map 0:0 -map 0:1 -f segment -segment_time 4 -segment_list_size 0 ...
12
votes
2answers
46k views

Convert AVI to MP4 keeping the same quality

I want to compress an AVI file to MP4 using an h.264 codec. I could not get the same quality. How can I compress it? Original Video: Original Video Screen: FFmpeg console output (ffmpeg -i ...
12
votes
4answers
5k views

How can I remove multiple segments from a video using FFmpeg?

I am trying to delete a few sections of a video using FFmpeg. For example, imagine if you recorded a show on television and wanted to cut out the commercials. This is simple with a GUI video-editor; ...
12
votes
1answer
8k views

Streaming mp4 with ffmpeg

I need to create a feed that has two streams - webm and mp4 - so that it can be compatible on all HTML5 video players. The webm stream works perfectly. However, when trying to access the mp4 stream, ...
11
votes
1answer
20k views

FFmpeg command to convert MP3 to AAC

I can issue this command: ffmpeg -i input.mp3 -acodec alac -ab 128k -ar 48000 -ac 2 -y output.m4a to create a m4a file. But when I issue this command ffmpeg -i input.mp3 -acodec alac -ab 128k ...
11
votes
4answers
24k views

How can I pipe output of ffmpeg to ffplay?

How can I pipe the output of ffmpeg to ffplay? At the moment I use a workaround in bash : mkfifo spam (ffplay spam 2> /dev/null &) ; capture /dev/stdout | ffmpeg -i - spam
11
votes
2answers
19k views

Strip metadata from all formats with FFmpeg

How can I remove all metadata from all formats via FFmpeg? I can just set special metadata for each format per man ffmpeg. Any option or method to clear all metadata and strip media from all metadata ...
11
votes
2answers
8k views

How to get length of video file from console?

Suppose we have video file some_video. How to get length of it from a shell script (with mplayer/transcode/gstreamer/vlc/ffmpeg/whatever)? VIDEO_LENGTH_IN_SECONDS=`ffmpeg .... -i some_video ... | ...
11
votes
4answers
16k views

How to strip audio streams from an MKV file?

I've been trying to remove unneeded audio streams from an MKV (Matroska) file. The reason why I want to do this is to avoid having to manually select the wanted stream in Windows Media Player. The ...
11
votes
1answer
3k views

Why can't Quicktime play a movie file encoded by FFmpeg? [duplicate]

When I try to open a movie I just created with the command: ffmpeg -pattern_type glob -i '*.JPG' -s 640x480 movie.mp4 I get an error from QuickTime: The document “movie.mp4” could not be opened. ...
11
votes
3answers
8k views

How to concatenate two flv files?

I want to concatenate two flv files(downloaded from Youtube.com) by linux command line tools. The ffmpeg tutorial is too complicated, so I tried the mencode tutorial. But I get a empty output. I don't ...
10
votes
4answers
38k views

How to install libmp3lame for ffmpeg

I already have ffMpeg running on my test server. I would want to convert all possible audio files to mp3. I get the error 'codec not found'. here's what i typed: /var/www/i/uploads$ sudo ...
10
votes
2answers
8k views

Using FFmpeg to locate moov atom

I have a library of videos, all of which should have been adjusted for web-streaming by putting the moov atom ahead of the rest of the video. This allows playback to begin before the client has ...
10
votes
3answers
29k views

Creating MP4 videos ready for HTTP streaming

How can I convert some.flv or some.avi or some.wmv with FFmpeg to be sure that this video will be playable and seekable in JW Player?
10
votes
3answers
4k views

Speedup a Video on linux

I dont want to use player like vlc to speedup the playback. I want to actually speedup playback in the original file. Its like I want video to be played 2 times faster.
10
votes
1answer
8k views

FFMPEG: Convert m4a files to mp3 without significant loss of information / quality. Automated bitrate

I have a load of audio files (about 1000) which I want to convert from m4a to mp3 so I can use play them on a CD player which has a USB port. I tried doing something simple like: ffmpeg -i FILE.m4a ...
10
votes
3answers
24k views

How can I re-encode H.264 video with minimal quality loss?

I have a lot of MPEG-TS files (.TS container but H.264 video) and playback is fine except that when you skip forward/backward or fast forward it's very sluggish and gets pixelated, etc. I've been ...
10
votes
2answers
2k views

converting a static file to a h264/mp4 stream produces sped up video

I'm building a NodeJS application that converts a static videofile to a streamable video which is being sent to a client (iPad or browser) on the fly (using the fluent-ffmpeg module). Everything is ...
9
votes
3answers
23k views

How to generate an MP4 with H.265 codec using FFmpeg?

I want to encode a video file to H.265. The last version of ffmpeg should be support H.265 (Source). However, I could not find any information about the exact command. I do not know, which library I ...
9
votes
1answer
3k views

What bunch of ffmpeg scripts do I need to get HTML5-compatible “Video for everybody”?

What list of commands should I do in ffmpeg/mencoder/some_other_CLI_app to get a video in all the right formats to use Video for Everybody? i.e. Is there a subtlety that prevents there being a ...