Questions tagged [ffmpeg]

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 program for transcoding multimedia files.

Filter by
Sorted by
Tagged with
16
votes
3answers
22k views

How to fade in/out a video/audio clip with unknown duration?

I'm working on a project where I'm using ffmpeg to batch convert some video files, and adding fade in/out effects at the head and tail of each clip. I've been using this bit of code to add the fade/...
11
votes
2answers
30k 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 ...
4
votes
1answer
3k views

Correct lens distortion with ffmpeg

It seems to be possible to correct lens distortion with ffmpeg. According to the manual you can adjust K1 and K2 values. What this means? How to use it correctly? Example still image - captured with ...
28
votes
1answer
65k views

Add an image overlay 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 ...
20
votes
4answers
55k 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 ...
7
votes
1answer
16k views

What CRF or settings I should choose for h265 in order to achieve a similiar quality of h264?

I'm doing some experiments with HEVC x265. I have a raw footage and the quality of details of h264 with same CRF setting looks better than h265. Shouldn't be the opposite? Maybe my setup isn't the ...
5
votes
1answer
4k views

ffmpeg - video with timer

I am currently working with the drawtext and drawbox filters to recreate a similar video appearance to what is shown below in the image. I am trying to see of a possible ways to add a count down timer ...
2
votes
1answer
4k views

How to concatenate multiple videos with ffmpeg?

Need to: concatenate 3 mpg4 video clips (each around 1 minute long, and 800x500 size) + background mp3 -> into a 1-minute long (1920x1080) video composed of the first 20 seconds from each of the 4 ...
5
votes
1answer
674 views

Bad quality encodes to Prores4444 with alpha from ffmpeg

EDIT: This bug has been fixed. If you're experiencing the problem below, try updating ffmpeg I need to supply video with alpha as a prores4444 encoded file. I've been trying to use ffmpeg, but for ...
4
votes
3answers
9k views

Batch conversion into a new folder with ffmpeg

I'm trying to batch encode 45 video files, and copy the encoded files into an existing subfolder called "encode" I've used the suggested code from this question (https://stackoverflow.com/questions/...
166
votes
1answer
225k 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 ...
19
votes
1answer
65k 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 ...
13
votes
1answer
76k views

How do I set up and use ffmpeg in Windows?

I understand that ffmpeg is a powerful tool for video file conversions. I see online in many places people suggesting it for solutions or getting help in how to use it. The problem is I don't even ...
9
votes
3answers
35k 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 ...
8
votes
0answers
3k views

How to produce a zoom animation of a video source with ffmpeg?

I'd like to create a zoom-in animation over numerous frames of a video clip. I've tried a couple of approaches without much luck. ffmpeg -i test-10s.mp4 -vf "zoompan=z='zoom+0.001'" zoompan-10s.mp4 ...
4
votes
1answer
12k views

What's the best way to convert mp4 to avi?

I'm trying to convert an mp4 file to avi. I've tried this basic ffmpeg script: ffmpeg -i inputFile.mp4 outputFile.avi It works, but the encoded avi file is very pixelated and does not work with ...
0
votes
0answers
229 views

Check first then enforce and match various broadcaster requests with ffmpeg

This question is a spin-off of a previous one focused mostly on Premiere Pro: How match this broadcast standards with Premiere and ffmpeg My goal in this one is learn as much as possible to handle ...
6
votes
2answers
6k views

what graphics card features effect NVIDIA NVENC hardware encoding speed?

I have a web project I am working on that requires transcoding of multiple short video clips (6-10 seconds) uploaded by users into a web friendly H.264 format on my linux server. I have been able to ...
5
votes
2answers
746 views

FFmpeg graph2dot tool

In FFmpeg Filters Documentation is the section 3 graph2dot is this about graph2dot program: The graph2dot program included in the FFmpeg tools directory can be used to parse a filtergraph ...
4
votes
2answers
1k views

How match this broadcast standards with Premiere and ffmpeg

I have to export an MXF file for a program that have certain limitations: Conform to SMPTE 274M, “1920 x 1080 Scanning with no visible video impairment such as blocking errors or pixelization ...
3
votes
1answer
1k views

Convert video to 10 bit images

I have a video with these info: Format : MKV Codec : HEVC (h.265) Bit depth : 10 bits How can I get 10-bit frame grabs from it using ffmpeg?
2
votes
1answer
743 views

Why can't my video play from where I drag the playback bar?

I am stuck and really do not know how to explain it in correct manner. Thus I put it in the layman details. I have two 30~ second length mp4 videos saved in cloud storage. video1 is generated by ...
3
votes
0answers
1k views

How to use ffmpeg to send video stream to another server that gives exactly same quality as manually copying the file to that server?

I tried doing this ffmpeg -i tcp://192.168.1.41:5000?listen -c copy out.avi and have another client publish to this server using ffmpeg -i 1.avi -map 0 -c copy -f mjpeg tcp://192.168.1.41:5000 ...
3
votes
1answer
654 views

How can encode video with images like these (overlay a video over a fixed image) with ffmpeg?

How can encode video with images like these help me ffmpeg ?
2
votes
1answer
2k views

Can I run this in one command line (ffmpeg)

I used this command ffmpeg -i thevideo.mp4 -c:a copy -vf 'drawbox= : x=0 : y=0 : color=invert:enable=between(t\,11\,39)' output.mp4 but it runs very slow. So, I took another approach, I copy first ...
2
votes
2answers
6k views

How to change output filename in ffmpeg batch?

I'm using windows and ffmpeg to convert video mp4 into audio mp3. I've come up with the following batch line that will do the job: for %f in (*.mp4); do ffmpeg -i %f -vn -ar 44100 -ac 1 -b:a 32k -f ...
49
votes
4answers
107k 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 ...
27
votes
5answers
33k 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 file, ...
18
votes
4answers
39k 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 ...
11
votes
1answer
9k 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 ...
18
votes
2answers
25k views

ffmpeg Color Correction: Gamma, Brightness and Saturation

How is ffmpeg used with a video filter circa 2017 to adjust gamma/contrast, brightness and saturation? Stack Exchange resources that are a few years old point to the filter mp=eq2=, but it seems to ...
9
votes
1answer
9k 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 ...
14
votes
2answers
18k 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 ...
10
votes
1answer
2k views

Using h264 in loseless mode brings small unexpected results

I got curious on ffmpeg screen capture capabilities and started messing around with a simple realtime capture test in h264. ffmpeg -f dshow -i video="screen-capture-recorder" -video_size 1920x1080 -...
7
votes
1answer
9k views

Video converted by FFMPEG has a different duration, why?

I convert videos using FFMPEG. My goal is to convert them to the MP4 container format (MPEG-4 Part 14) with AAC-encoded audio stream and MPEG-4 part 10-encoded video stream. I use the following line ...
10
votes
1answer
15k views

Is it possible to speed up a video using handbrake?

Is it possible to speed up a video using handbrake ? I am looking for a software like handbrake to convert videos for faster playback. It should speed up the video up to 30x. Is it possible with ...
7
votes
3answers
3k 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 ...
6
votes
2answers
6k views

How to convert a 3D movie to 2D using ffmpeg

I am looking for a way to convert a 3d movie to a 2d movie. I found a reference on this forum. http://www.ffmpeg-archive.org/How-to-re-encode-3d-video-to-2d-video-td4676271.html
3
votes
2answers
8k views

How do I recover truncated AVI/DV video?

Short version: I believe I have truncated but otherwise valid AVI/DV files that won't play in any player I've tried (Adobe Premiere, MPC HC, VLC). I assume the stream data is intact but truncated, and ...
2
votes
2answers
7k views

Infinite Video Loop in Ffmpeg?

Is there a way to infinitely loop a video in ffmpeg for a livestream? I've been looking around and can see it was possible to use "loop 1" but it appears that is no longer working. This is what I'm ...
2
votes
1answer
7k views

green screen to transparent with ffmpeg

ffmpeg does a very good job of getting rid of a green screen, with a command like this: ffmpeg -f lavfi -i color=c=black:s=606x1080 -i input.mp4 -filter_complex "[1:v]...
1
vote
1answer
2k views

Add transparent background to ffmpeg with text over it

How to correctly add expression to transparent background like on this question ffmpeg drawtext filter - create transparent background with text for my case (where there are 3 lines in bottom right ...
16
votes
5answers
33k 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 ...
10
votes
1answer
5k 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 ...
9
votes
2answers
9k 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?
7
votes
1answer
6k 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 ...
7
votes
2answers
5k views

Add image under the video with ffmepg

I want to extend basic usage of watermark and put it under the video. That means. I have input video 720x480 and image 720x20. On output i want to have video 720x500 where video aspect is preserved ...
5
votes
1answer
1k 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 ...
5
votes
3answers
2k 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
1answer
6k views

ffmpeg: how to convert to DNxHR in Windows 10?

I have installed ffmpeg version 3.2.2 from the ffmpeg.org download page. When I enter ffmpeg formats, I see dnxhd but not dnxhr. What do I need to do to be able to manipulate dnxhr? I have ...