FFmpeg is a free software project that produces libraries and programs for handling multimedia data. The most notable parts of FFmpeg are libavcodec, an audio/video codec library used by several other projects, libavformat, an audio/video container mux and demux library, and the ffmpeg command line ...

learn more… | top users | synonyms

51
votes
1answer
60k views

How can I crop a video with ffmpeg?

I have an MP4 file of a screen recording that I need to crop down. How can I accomplish this without using expensive tools like Adobe Premier or Final Cut? I prefer ffmpeg because I have used it ...
21
votes
3answers
17k views

Repeat/loop Input Video with ffmpeg?

I just want to loop a mp4 video with ffmpeg and keep the current settings and codec. For example if input.mp4 is 0:10 long, and I would want to loop it 4 times so output.mp4 is 0:40 long, how could I ...
11
votes
4answers
26k views

How to losslessly encode a jpg image sequence to a video in ffmpeg?

I have a large set of jpgs that I want to convert to a video losslessly (or, at the very least, very close to losslessly as long as the encoding time isn't much higher than otherwise). Naively, I ...
11
votes
4answers
17k views

How can I convert .MTS file (AVCHD) to .mp4 by ffmpeg without re-encoding H264 video stream?

Note: I posted same question to stackoverflow a short time before, when I have not found this comunity yet. I repost this since the question is more suitable to this community. 1. What I tried I ...
9
votes
1answer
24k views

How do I change frame size, preserving width (using ffmpeg)?

I'm new to this StackExchange site, and to using the ffmpeg encoder. I have a video that is 720x480 (3:2) that I would like to change to 720x406 (16:9) to match the other videos I have for a site. I ...
9
votes
4answers
8k views

How to get FFMPEG to join non-sequential image files? (skip by 3s)

I have a bunch of images, that follow this pattern. 0001.png 0004.png 0007.png 0010.png 0013.png 0016.png 0019.png ... They're in the correct order, but FFMPEG ignores anything after the first ...
8
votes
1answer
3k views

Can I use FFMPEG in a commercial product [closed]

Not sure if I am correct posting my question here and I will of course delete this question if appropriate. I have a c# desktop app using FFMPEG I have a web service using FFMPEG. I sell both ...
8
votes
0answers
1k views

Copying h.264 video from TS into MP4 changes frame rate and time

I have large MPEG-TS file that I am converting to MP4 using the below command. If I seek to the same time in the video in both the MP4 and the TS file, the MP4 will be a few frames behind the TS ...
7
votes
3answers
19k views

How can I use FFmpeg to lower the quality of H264 video but keep it in H264 format?

I'm a complete noob to video editing, so forgive me if I ask for something ridiculous. I'm getting video clips from a set top recorder box. The clips are AVI files: Resolution: 1920 x 1080 Frames ...
7
votes
3answers
2k views

OGV Format plays properly on my computer but transcoding drops (duplicate?) frames

I've made a set of screencasts using recordmydesktop on ubuntu 12.10. The output is an ogv file. When I watch the ogv file using the default movie player (totem) it looks fine - the audio and video ...
7
votes
1answer
954 views

Batch resize videos with “pan and scan” cropping

I am trying to prepare a collection of ~120 video clips to be played in VLC Player and projected on a low-res (1024x768) projector during a DIY electronic music event. The source clips are all super ...
7
votes
0answers
373 views

Is it possible in FFMPEG to change scale over time?

Ok, so using the overlay filter, one can change the x/y location of a video over time by using the "t" variable. For example, overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0 can be used to start ...
6
votes
2answers
7k views

How to concatenate clips from the same video with ffmpeg

I have a long video with different scenes in it. I want to extract and concatenate 2 scenes from the video (that do not start on an I-frame) using ffmpeg 2.1.4. For argument, say I want 5 seconds ...
6
votes
2answers
3k views

What is the difference between ffmpeg and ffmbc now?

Two years ago I've used ffmbc to encode videos to prores, but nowadays ffmpeg also supports prores and avchd. What is the difference between ffmpeg and ffmbc now?
6
votes
1answer
337 views

ffmpeg - specify channel layout flags

I have the below file which I am re-mapping the audio and trying to set the channel layout flags on a Quicktime Prores file, but can't seem to get it working. I can successfully re-map the audio (from ...
6
votes
0answers
196 views

Converting GIMP curves files to Photoshop (.acv) for ffmpeg

I've seen a number of scripts for converting Photoshop .asv .acv files to a GIMP friendly format. Does anyone know if such a tool exists to do the opposite, i.e. converting a GIMP curve file to .asv ...
5
votes
1answer
4k views

ffmpeg drawtext filter - create transparent background with text

I am currently working with the drawtext filter. So far I have only been successful with drawtext option configurations to use the right font and place the text horizontally centered. How could i get ...
5
votes
2answers
127 views

How do I move (rearrange) the orientation of a video? Using ffmpeg

I want to crop the video at some position and move the part next to the part that wasn't cropped. (See image, it explains better)
5
votes
1answer
3k views

Similar to “levels adjustment” brightness improvement with ffmpeg

I'm composing a video from set of 16bit tiff pictures. The pictures are very dark, and needs to be brightened. Currently I'm applying -vf "mp=eq2=1.0:1.0:0.3:1.0:1.0:1.0:1.0:1.0" filter to make ...
5
votes
1answer
748 views

How do I speedup encoding of a video that has just 1 static frame with ffmpeg and lib264 library?

I'm making mp4 (libx264 + aac) videos that have just one static image throughout the whole video. It's basically a narrated text with a nice background. The question I've is how could I speed up ...
5
votes
0answers
139 views

Trying to sync audio in mpeg2 video whose video freezes first 8 seconds in playback

So I have a handful of old mpeg2 (.mpg) files with the following profiles as provided by ffmpeg (the timecodes on each are different): Stream #0:0(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / ...
4
votes
2answers
4k views

How to use ffprobe to obtain certain information about mp4/h.264 files

I am but a lowly PHP developer that has been tasked with retrieving some basic information about 100's of thousands of video files. I've had some luck using ffmpeg extracting the video bitrate, video ...
4
votes
2answers
8k views

How to encode a video at 30 FPS from images taken at 7 FPS

I have no knowledge whatsoever about video encoding, I have an application written in OpenGL and I am saving the frames it generated into png images. The frames from my app are at 7 FPS and I am ...
4
votes
1answer
14k views

Add an image in front of video using ffmpeg

I have many videos and I need to put an image in front of them for about 5 seconds, but adding it manually and rendering it each time would take really long, so I am asking if it is possible to do so ...
4
votes
1answer
104 views

Top and tail GoPro video based on volume

I'm thinking of using ffmpeg to automate a simple video task. I have lots of action videos that go like this, quiet/boring -> loud/exciting -> quiet/boring. Allowing for a few seconds at the start ...
4
votes
2answers
4k views

Non-Monotonous DTS on concat (ffmpeg)

After running this command ffmpeg -f concat -i mylist.txt -c copy output.mp4 - I'm getting corrupted output.mp4 file and this message: ffmpeg -f concat -i mylist.txt -c copy output.mp4 ffmpeg version ...
4
votes
1answer
383 views

How to trim out black frames with ffmpeg on windows?

I have a short video and I'm trying to cut-out all the blank or near blank frames. This isn't a case where I care about the breaks in a video that could be dark. I literally want all near ...
4
votes
2answers
3k views

How to compile FFmpeg with libfdkaac into a single static binary?

My target is to build a single static FFmpeg binary with libfdkaac and x264 support for OSX and Linux. First, I tried to build one on OSX, I follow the instruction on FFmpeg web: ...
4
votes
1answer
3k views

Combine multiple videos as separate streams in one mkv file

So I have multiple videos of the same scenery from different angles. These are stored as separate files. Can I combine these as multiple video streams within one file? For example I know this is ...
4
votes
2answers
948 views

drop similar frames

I'd like to record a very long video from webcam which will be mostly the same. I'd like to drop intermediate frames that are very similar to each other to save on filesize and also make it easier to ...
4
votes
3answers
1k views

creating a lossless mp4 screencast

I'm trying to create a screencast for playback on the web. Would like to use h.264, webm, and ogg. The source files are in the Apple Animation codec, and they look perfectly accurate. However when I ...
4
votes
2answers
164 views

ffmpeg, first second of cut video part freezed

I use this to cut a part out of a mp4 file: ffmpeg -i input.mp4 -vcodec copy -acodec copy -ss 00:36:18 -to 00:39:50 output.mp4 It works good but the video image is always freezed in the beginning ...
4
votes
1answer
8k views

How to force ffmpeg to insert keyframe at first frame when downsampling a framerate of a video with x264 vcodec

I have a mpeg4 video at 25fps. This video contains just one static frame. I'm trying to downsample the frame rate to 1fps and convert the video to x246 (mp4). I ran the following ffmpeg command: ...
4
votes
1answer
304 views

ffmpeg: explicitly tag h.264 as bt.601, rather than leaving unspecified?

I want to tag video as explicitly bt.601, rather than "unspecified". I know players typically choose bt.601 as the default for videos less than 1280 pixels wide, but I want to make it explicit that ...
4
votes
1answer
120 views

4x resample videoframes using ffmpeg

I need to speed up video by a factor of 4x, but do not want to drop the frames and instead average them. I.e. each 4 frames are averaged, and produce 1 output frame. Target frame-rate stays the same, ...
4
votes
2answers
380 views

Moving Crop in Video

I have an HD video of a speaker giving a lecture. I would like to resize the video by cropping each frame, but the cropping rectangle needs to be centered on the speaker's head as he moves around the ...
4
votes
1answer
432 views

What is the ffmpeg filter equivalent of “Automatic levels” for colors?

Looking at the documentation about filters there seems to be a curve filter to manipulate color with the following presets: color_negative cross_process darker increase_contrast lighter ...
4
votes
1answer
3k views

How to trim a video with frame precision using ffmpeg?

I need to trim videos with a precise end frame, however, ffmpeg seems to cut the video at the nearest first key-frame. So I don't have enough control over the ending frame. I try to insert key-frame ...
4
votes
1answer
627 views

How to create a x264 (mp4) video with the smallest size using ffmpeg that has just 1 image through entire video?

I'm creating narrated mp4 (x264+aac) videos for books. Each video has just the book's cover as the background. I wonder what would be the most effective way to create such videos with ffmpeg? I've ...
4
votes
2answers
65 views

ffmpeg: preserve timecode when converting mp4 to mov

I have .mp4 files created by a Sony A7s camera. They're using the xavc-s codec. I'm converting them to .mov using the command below. The orignal files have a timecode but that is not present in the ...
4
votes
1answer
508 views

ffmpeg: overlay rotated video with transparency

I'm new to ffmpeg (video encoding in general). I have two videos one larger than the other. I want to rotate, resize and overlay the shorter video on the larger one at defined coordinates. So far, ...
4
votes
1answer
215 views

Video transitions and filters - how to create custom ones?

I am wondering if there is a possibility to do custom video transitions or filters. Like the video spiraling out, little squares appearing, circling out or something like that. Wiping the video out ...
4
votes
2answers
627 views

Convert .WMV using FFmpeg

I'd like to use FFmpeg on the Mac Terminal command line to convert a .WMV file. I'm familiar with the syntax: ffmpeg -i /path/OriginalMovieFile.wmv /path/NewMovieFile.??? However, my recent attempt ...
3
votes
4answers
857 views

Why isn't ffmpeg used in movie production or broadcasting tool chains?

Is the assumption in the title true? What is preventing the use of ffmpeg when producing a movie or broadcast quality material? Are there any prominent or well known users of ffmpeg? What is used ...
3
votes
3answers
237 views

Can I use h.264 codec inside .mp4 container for my website

I would like to use h.264 as the codec inside .mp4 container for my user uploaded videos for my website. But I saw somewhere that h.264 is non free. I am unsure whether I can use this technology or ...
3
votes
3answers
12k views

How do I specify baseline H264 profile using FFmbc?

I am using FFmbc (a FFmpeg derivative) to transcode some video files to H264 (in a mov wrapper). I want to specify baseline profile (to reduce CPU usage) but can't figure out how. There doesn't seem ...
3
votes
2answers
1k views

How do I remove audio from all files in a directory with ffmpeg?

I have a directory full of short video clips in .AVI format, and I want to remove the audio from all of them. I'm using Ubuntu 12.04. I tried this command: find -name '*.avi' -exec ffmpeg -i {} -an ...
3
votes
2answers
1k views

FFMpeg Encoding and Core Usage

We have developed an application to transcode source .mov files into .ogg, .mp4 and .webm output. It is currently running on AWS EC2 instance g2.8xlarge. It is working (yay!). My question: Even ...
3
votes
2answers
11k views

encoding 4:2:2 in 10-bit with libx264

I believe that libx264 is now capable of doing 10-bit 4:2:2 encodings, but I can't seem to get it to work. I'm using ffmpeg (info below), and I've also tried the x264 encoder directly. I've tried ...
3
votes
2answers
113 views

ffmpeg bgr vs rgb and other similiar pixel formats

I was wondering about the difference between rgb and bgr pixel formats available in many codecs. It reminds me in some way the Big Endian and Little Endian flavours of computer processors. While I ...