Questions tagged [ffmpeg]

Media tool with support for multiple codecs, filters, and containers. Include your actual command and the complete console output when asking questions involving FFmpeg tools. An easy way to do this is by adding `-report` to your command and pasting the contents of the logfile generated. For help with CLI use only of ff* binaries - ffmpeg, ffprobe, ffplay. For help with API usage, post on Stack Overflow.

Filter by
Sorted by
Tagged with
651 votes
16 answers
616k views

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

I'm converting a video 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 ...
Kamil Hismatullin's user avatar
592 votes
9 answers
815k 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 ...
Neil's user avatar
  • 6,049
532 votes
6 answers
552k views

Remove audio from video file with FFmpeg

How can I strip the audio track out of a video file with FFmpeg?
TeAmEr's user avatar
  • 5,567
433 votes
8 answers
652k 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 ...
Sandy's user avatar
  • 4,889
307 votes
16 answers
208k views

Combine one image + one audio file to make one video using FFmpeg

This should be pretty trivial, but I can't find a way to get it to work. I want FFmpeg to take one JPEG image and an audio file as input and generate a video file of the same duration as the audio ...
matteo's user avatar
  • 4,339
291 votes
11 answers
320k views

How can I make ffmpeg be quieter/less verbose?

By default ffmpeg sends a whole lot of messages to stderr: when built, how it was built, codecs, etc, etc, etc. How can I make it quieter? I've tried -v 0 (and -v 10 since the documentation just ...
blahdiblah's user avatar
  • 5,113
279 votes
3 answers
431k views

How to resize a video to make it smaller with FFmpeg

How do I resize a video to make it smaller with FFmpeg? (e.g. from 1024x576 to 720x480.)
Alan's user avatar
  • 2,891
245 votes
6 answers
461k views

Cut part from video file from start position to end position with FFmpeg [duplicate]

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?
x74x61's user avatar
  • 2,841
234 votes
4 answers
382k 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 video....
user avatar
212 votes
6 answers
260k 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 ffmpeg?...
Jon Skarpeteig's user avatar
171 votes
2 answers
120k views

ffmpeg - replace audio in video

How to replace the audio in a video file using an audio file using ffmpeg? I imagine the command looks like: ffmpeg -i v.mp4 -i a.wav -MAGIC video-new.mp4 This is very similar to How to replace an ...
qubodup's user avatar
  • 8,794
160 votes
5 answers
112k 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 ...
Daniel Fischer's user avatar
145 votes
12 answers
294k views

How to get video duration in seconds?

How can I get video duration in seconds? What I've tried: ffmpeg -i file.flv 2>&1 | grep "Duration" Duration: 00:39:43.08, start: 0.040000, bitrate: 386 kb/s mediainfo file.flv | grep ...
user2783132's user avatar
  • 1,837
120 votes
7 answers
124k views

In ffmpeg, how to delay only the audio of a .mp4 video without converting the audio?

In my .mp4 file the audio delay is -3840 ms. I synced it in KMplayer, and I don't want to use MKVGUI to make a .mkv file. I just need to delay the audio by 3840 ms, everything else should be left ...
Alireza's user avatar
  • 1,201
119 votes
7 answers
163k views

FFMPEG: Convert m4a to mp3 without significant loss

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 ...
user3728501's user avatar
  • 2,714
116 votes
13 answers
306k views

How to create a video from images using FFmpeg?

Is it possible to use ffmpeg to 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, ..., ...
user avatar
113 votes
8 answers
244k views

How to extract one frame of a video every N seconds to an image?

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 ...
Liam's user avatar
  • 3,060
113 votes
9 answers
118k 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 ...
d33pika's user avatar
  • 1,891
112 votes
7 answers
92k views

How do I speed up a video by 60X in ffmpeg?

I found this example ffmpeg -i input.mkv -filter:v "setpts=0.5*PTS" output.mkv but I have a video I want to speed up by 60 times, not just 2X.
watercollider's user avatar
102 votes
8 answers
124k views

How can I rotate a video 180° with FFmpeg?

I have a video that was rotated 180° when recorded. Is it possible to correct this with FFmpeg?
Louis Waweru's user avatar
  • 24.6k
99 votes
3 answers
102k 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 ...
floriank's user avatar
  • 1,434
98 votes
9 answers
186k views

Use ffmpeg copy codec to combine *.ts files into a single mp4

I've got a bunch of ts segments described by a single index.m3u8 file: index.m3u8 segment1_0_av.ts segment2_0_av.ts segment3_0_av.ts segment4_0_av.ts segment5_0_av.ts I know they are ...
Ana's user avatar
  • 1,651
98 votes
3 answers
234k views

Converting video from 1080p to 720p with smallest quality loss using ffmpeg

I stack with my high quality movie: 1080p with 60fps. The trouble is lags while playing. I tried to convert it to 720p with ffmpeg: ffmpeg -i MyMovie.mkv -r 60 -s hd720 MyMovie_720p.mkv But I ...
atomAltera's user avatar
  • 1,159
97 votes
6 answers
248k views

How many threads does ffmpeg use by default?

I see that there's a -threads <count> command line option in ffmpeg. What is the default value of this option?
Edward Dale's user avatar
  • 1,249
96 votes
3 answers
98k 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 a ...
Jamie Taylor's user avatar
  • 1,451
93 votes
10 answers
88k 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; ...
Matias's user avatar
  • 1,239
87 votes
7 answers
173k views

How to extract subtitle from video using ffmpeg?

I am trying to extract subtitle from video as .srt file, I used the following command: ffmpeg -i mytestmovie.mkv -vn -an -codec:s:0.1 srt sub.srt But, I got an error as Unrecognized option codec:s:0:...
vijay's user avatar
  • 881
87 votes
8 answers
104k views

Reduce background noise and optimize the speech from an audio clip using ffmpeg

I extract audio clips from a video file for speech recognition. These videos come from mobile/other handmade devices and hence contain a lot of noise. I want to reduce the background noise of the ...
Sudh's user avatar
  • 983
83 votes
7 answers
113k views

How do I use ffmpeg to get the video resolution?

I am trying to get resolution of the video with the following command: ffmpeg -i filename.mp4 I get a long output, but I need just the width and height for my bash script. How should I filter out ...
Vladimir Stazhilov's user avatar
83 votes
6 answers
129k views

Using desktop as fake webcam on linux

I want to make a live stream of (a window on) my linux desktop using a free streaming site, using the captured video as a fake webcam. There are many tools for this on windows. ffmpeg allows me to ...
bkconrad's user avatar
  • 961
78 votes
7 answers
104k views

Concatenate multiple WAV files using single command, without extra file

I want to concatenate multiple WAV files into a single WAV file using FFMPEG. I have used the following command and it generates the required file. Command: ffmpeg -f concat -i mylist.txt -c copy ...
Manu's user avatar
  • 1,003
78 votes
1 answer
125k views

Add audio to video using FFmpeg

I’m trying to add sound to a video using FFmpeg, but for some reason, when I play the resulting file, it doesn't have any sound. I also tried doing it with an aac audio file, as well as leaving out -...
Arlen Beiler's user avatar
  • 1,640
77 votes
4 answers
199k 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 ...
Mohammad Hossein Fattahizadeh's user avatar
77 votes
3 answers
92k 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 ...
Chris Weber's user avatar
  • 1,265
75 votes
13 answers
136k views

Properly downmix 5.1 to stereo using ffmpeg

I have a 5.1 audio track from a film where front left and front right contains music, and center contains dialogue. Playing the 5.1 track in VLC blends everything together nicely. I'm trying to ...
forthrin's user avatar
  • 2,037
73 votes
1 answer
262k views

How to specify audio and video bitrate

I have a mov file with the following media information: Stream 0 Type: Video Codec: H264-MPEG-4 AVC (part 10)avc1 Language: English Resolution: 1280x720 Frame rate: 24 Stream 1 Type: Audio Codec: ...
michael's user avatar
  • 5,945
72 votes
7 answers
125k views

What is the correct way to fix keyframes in FFmpeg for DASH?

When conditioning a stream for DASH playback, random access points must be at the exact same source stream time in all streams. The usual way to do this is to force a fixed frame rate and fixed GOP ...
Mark Gerolimatos's user avatar
70 votes
3 answers
150k views

Install FFmpeg on OS X

Is there a good place or bash script I can use (or at least a version I can build myself) for FFmpeg on OS X? I have Xcode installed as well as the CLI for Xcode (gcc etc). I have a version of ...
Shuyinsama's user avatar
70 votes
1 answer
8k views

Why does FFmpeg choose 10+20+20 ms instead of an even 16 ms for 60 fps GIF images?

I have a short 60 fps video which I'd like to turn into a GIF file. I run ffmpeg -i foo.flv foo.gif and it produces a GIF file. Great! The only problem is that the motion in the produced GIF video ...
Daniel Wagner's user avatar
69 votes
6 answers
142k 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 ...
Chad Whitaker's user avatar
68 votes
3 answers
67k views

Why does preset "veryfast" in FFmpeg generate the most compressed file compared to all other presets?

The FFmpeg wiki says that the best compression rate is by preset "veryslow". But when I am trying it with my video then preset veryfast provides the best compression in my case. The following is the ...
Faisal's user avatar
  • 791
65 votes
4 answers
210k views

Best settings for FFMpeg with NVENC

I'm using my FFMPEG with the suport of my GPU (NVENC) to convert files from my satelite receiver (SD, mpeg2 .TS-Files) into h264 .mp4-files Here is the line i'm using ffmpeg -i "e:\input.ts" -vcodec ...
Dr. Snail's user avatar
  • 697
63 votes
2 answers
128k views

How do I convert 10-bit H.265 / HEVC videos to H.264 without quality loss?

My laptop can't handle 10bit H.265 / HEVC videos, so I'm looking to convert them to 10bit H.264. How do I do this using, say, ffmpeg, with the least quality loss? And how can I convert 10-bit H.265 to ...
HappyFace's user avatar
  • 1,211
62 votes
3 answers
139k views

How to encode audio with Opus codec?

The Opus audio codec looks like the best codec so far for compressing audio. It has recently become supported in the latest ffmpeg and VLC players. However, there is no documentation I can find on how ...
MrDrMcCoy's user avatar
  • 997
62 votes
1 answer
100k views

Convert specific video and audio track only with ffmpeg

I have an MKV file (vidui.mkv) with 6 tracks in it. Track 1 - video - xvid - 1920x1080 Track 2 - video - xvid - 720x576 Track 3 - audio - AAC - 1240kbps - English Track 4 - audio - AAC - 648kbps - ...
hbelouf's user avatar
  • 751
61 votes
3 answers
100k views

What is -crf used for in FFmpeg?

When converting an array of JPEGs to a video file (Ogg format) I have been using the -crf option. What are the valid ranges for -crf? Currently I am using 23. I cannot find the bookmark I read to ...
Andrew Simpson's user avatar
61 votes
1 answer
189k views

Convert AVI (Xvid) to MP4 (H.264) 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 input....
user avatar
60 votes
3 answers
112k views

Extracting wav from mp4 while preserving the highest possible quality

I went through the documentation and I can extract a wav file from an mp4 file with the command: ffmpeg -i my_video.mp4 output_audio.wav However, how can I control the quality of the wav file? (e.g. ...
Amelio Vazquez-Reina's user avatar
59 votes
1 answer
135k views

Downloading m3u8 videos [closed]

I am trying to download video from a .m3u8 livestream video format. How can I download m3u8 videos using software on my personal computer such as ffmpeg, youtube-dl, VLC, etc? M3U is a computer file ...
FarouK's user avatar
  • 721
59 votes
3 answers
159k views

Convert mp3 to wav using FFmpeg for VBR

What command should I use to convert a mp3 file to wav whose bitrate is variable. Or better how would I know whether that source audio is fixed bitrate or variable?
Soham Dasgupta's user avatar

1
2 3 4 5
141