Skip to main content

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
664 votes
16 answers
638k 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
97 votes
3 answers
100k 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,461
146 votes
12 answers
302k 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,847
48 votes
2 answers
52k views

Create video with 5 images with fadeIn/out effect in ffmpeg

With 5 images I have to create a video of 60 seconds in ffmpeg, each image has to display for 15 seconds. after 15 seconds, first image has to fade out and 2nd image has to fade in, after that 2nd ...
user384847's user avatar
31 votes
1 answer
22k 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?
slhck's user avatar
  • 230k
599 votes
9 answers
832k 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,119
213 votes
7 answers
268k 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
79 votes
4 answers
206k 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
440 votes
8 answers
671k 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,959
97 votes
10 answers
89k 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,279
247 votes
6 answers
470k 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,871
113 votes
9 answers
120k 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,911
104 votes
8 answers
126k 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.8k
45 votes
7 answers
65k views

crossfade between 2 videos using ffmpeg

I've been trying to achieve a crossfade transition between 2 video clips using ffmpeg but have failed so far. I'm new to ffmpeg and am mostly relying on tweaking what I can find in the documentation ...
user avatar
30 votes
5 answers
33k views

How to get time stamp of closest keyframe before a given timestamp with FFmpeg?

I want a FFmpeg seeking command that fast and accurate. I found this. The solution is that we apply -ss for both input (fast seeking) and output (accurate seeking). But: If the input seeking is not ...
jackode's user avatar
  • 427
12 votes
2 answers
16k views

What parameters should I be looking at to reduce the size of a .MOV file?

My Canon 60D creates .MOV files when recording video and I've found out that the .MOV container has an H264 video stream and a PCM audio stream. I've used ffmpeg and GSpot to look at some of my ...
Ward - Trying Codidact's user avatar
313 votes
16 answers
214k 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,419
58 votes
4 answers
164k views

How to cut at exact frames using ffmpeg?

I'm trying to use ffmpeg to cut video files at precise times. The ffmpeg help shows an option -timecode_frame_start to specify the starting frame but I am unable to get this command to work. The ...
curmil's user avatar
  • 1,065
13 votes
1 answer
5k views

Video produced from images only plays in VLC but no other players

Within my folder with bunch of 13MP bmp images named 0001.bmp, 0002.bmp,... I run the following commands from command line. Crop images to 4K ffmpeg -i %4d.bmp -vf "crop=3840:2160:184:240" croped%4d....
Krcevina's user avatar
  • 153
34 votes
2 answers
80k 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 -...
Soham Dasgupta's user avatar
14 votes
1 answer
12k 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 ...
John Baber-Lucero's user avatar
7 votes
2 answers
3k views

'while read' loop through lines in text file losing characters in Bash script. is FFmpeg line to blame?

I am looping through a text file, using 'while read'. I read three variables from each line - two filenames and a decimal number. I know that this works in a vanilla setup (loop, read line, echo line, ...
Dilgreen's user avatar
299 votes
11 answers
332k 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,203
83 votes
6 answers
131k 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
66 votes
4 answers
218k 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
  • 707
57 votes
1 answer
50k 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. ...
Michael's user avatar
  • 2,754
46 votes
4 answers
41k views

FFmpeg - Apply blur over face

I'm trying to blur a portion of a video using FFmpeg (specifically to blur a face). I have been trying to use a combination of timeline editing and the various bluring filters, but I cannot find a ...
occvtech's user avatar
  • 1,840
16 votes
5 answers
12k views

Automatically split large .mov video files into smaller files at black frames (scene changes)?

I have 65 .mov video files named tape_01.mov, tape_02.mov, ..., tape_65.mov. Each is about 2.5 hours long and takes up many gigabytes. They are digital copies of what were VHS tapes (my family's "...
Ryan's user avatar
  • 1,976
5 votes
1 answer
8k views

Making ffmpeg process first audio stream differently than all others

I'm trying to write a command such that ffmpeg executes a given instruction for the first audio stream in a file and a different instruction for any and all others. In the test case below, for ...
Wally Walters's user avatar
4 votes
1 answer
2k views

ffmpeg is not even cutting this and other mp4s to the nearest second [duplicate]

I have a file Other - Analogue Clock-JEJqy1Wlovw.mp4 which is just a download from https://www.youtube.com/watch?v=JEJqy1Wlovw It's 2 minutes 13 seconds long. I had some issues cutting it to the ...
barlop's user avatar
  • 24.2k
116 votes
13 answers
309k 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
72 votes
7 answers
127k 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
61 votes
1 answer
190k 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
33 votes
5 answers
54k views

Change framerate in ffmpeg without reencoding

I have a mkv (h264) video that is 23.976 fps (24000/1001) but I want to convert it to 25fps without reencoding and loosing quality. I know mkvmerge can do it ( with option --default-duration '0:25fps')...
phate89's user avatar
  • 445
28 votes
3 answers
48k views

FFMPEG / libx264: How to specify a variable frame rate but with a maximum?

Instead of providing a fixed frame rate to FFMPEG/libx264 (-r/-framerate), I would like to specify a variable frame rate with a MAXIMUM value, and allow libx264 to down the frame rate as it sees fit. ...
Mark Gerolimatos's user avatar
17 votes
4 answers
34k views

Which codecs are most suitable for playback with Windows Media Player on Windows XP?

I need to encode a short video in a format that can be played with windows media player on windows xp without installing any additional codecs. For the recoding process I'm using ffmpeg. I've already ...
ThiefMaster's user avatar
  • 6,306
13 votes
1 answer
48k views

How do I extract the timestamps associated with frames ffmpeg extracts from a video with the -r option?

ffmpeg -i myvid.mp4 -r 25 -t 100 image-%d.jpeg Is the command I'm using to extract frames and it's working just like I expected. However I'd also like to look at the timestamps of the frames. ...
Srini's user avatar
  • 235
11 votes
1 answer
12k views

ffmpeg: smooth zoompan with no jiggle

I'm trying to create a basic 5 second zoompan to the center of an image (from the example on the ffmpeg.org website). The command below works, but jitters more than my hands after 5 cups of coffee: ...
Timbo White's user avatar
6 votes
1 answer
6k views

What lossy audio formats are more (or less) "efficient"?

This question is related to the answers I got to this question. The bitrate-efficient format (see the question's most voted answers and their comments thereunder) would be one that assures a good ...
user avatar
1 vote
1 answer
12k views

Convert ffmpeg encoding from libx264 to h264_nvenc

The video hosting website LBRY suggests users try the following command to compress their uploads: ffmpeg -i input.avi -c:v libx264 -crf 21 -preset faster -pix_fmt yuv420p -maxrate 5000K -bufsize ...
Iain's user avatar
  • 4,768
125 votes
7 answers
127k 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,251
117 votes
7 answers
99k 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
91 votes
7 answers
181k 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
  • 921
80 votes
3 answers
94k 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,305
79 votes
1 answer
128k 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,650
55 votes
1 answer
157k views

Explanation of x264 tune

Running this command: ffmpeg -i xr.mp4 -tune ya zu.mp4 reveals the possible tune values for x264 and in turn FFmpeg: [libx264 @ 0000000002167100] Possible tunes: film animation grain stillimage ...
Zombo's user avatar
  • 1
47 votes
2 answers
92k views

deprecated pixel format used, make sure you did set range correctly

Why am I getting this warning and how to fix it? Essentially, I want to convert a video to a jpg every 4th frame with the same resolution as original video. [jalal@goku vid2]$ ffmpeg -i debate_vid2....
Mona Jalal's user avatar
43 votes
4 answers
163k 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
wim's user avatar
  • 3,197
41 votes
5 answers
68k views

Using ffmpeg to copy metadata from one file to another

I want to use ffmpeg to copy all meta data not associated with core aspects of a video (frame rate, resolution) from one video to another. Is there a simple way to do this with a single command?
David's user avatar
  • 605
40 votes
9 answers
118k views

How to install FFmpeg on Debian?

How do I install FFmpeg on Debian?
user avatar

1
2 3 4 5
13