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
14
votes
2answers
39k 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 ...
25
votes
3answers
35k 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/...
4
votes
2answers
4k 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 ...
43
votes
2answers
95k 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 ...
24
votes
4answers
70k 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 ...
8
votes
1answer
21k 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 ...
2
votes
1answer
6k 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
1k 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 ...
5
votes
4answers
15k 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/...
241
votes
1answer
314k 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 ...
25
votes
2answers
133k 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 ...
28
votes
1answer
76k 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 ...
10
votes
1answer
13k 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
22k views

Convert mp4 to avi while keeping frame rate and quality and being able to play in QuickTime?

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 does not work with ...
10
votes
3answers
43k 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
4k 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
2k 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?
12
votes
1answer
12k views

Can I set the start number for image sequence output?

I am using ffmpeg to convert from video to an image sequence as follows: ffmpeg -i video.webm image-%03d.png The first image is labelled 001, but I want it to be labelled 098. Is it possible to set ...
6
votes
2answers
7k 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 ...
6
votes
1answer
5k 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 ...
3
votes
1answer
1k 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
2answers
8k views

Mux mkv and dts file, change default audio stream and language

I want to mux (combine) two files into one mkv file. The first one is an mkv file that contains a video and an audio stream in German. The second one is an English audio stream in dts format.I want ...
2
votes
1answer
787 views

Trim audio stream to video stream length

I have an mp4 file (converted from an mkv file) that has a longer audio than video stream. This file doesn't play back nicely in my media streaming app (or MPC-HC) when I reach the end of the file. ...
2
votes
1answer
1k views

replace black frames with previous frames

I have problematic footage from diving due to my camera/SD card - every 4th or so frame is just black, and I want to replace all those black frames with either an interpolation between the previous ...
0
votes
0answers
339 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

Removing MP4 encoding information

Is it possible to remove certain information form a MP4 file? Specifically things like tagging and encoding dates, Writing library and application, Encoding settings... No client needs to know when I ...
5
votes
2answers
1k 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
2k 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
190 views

Adding audio to picture: video too long even when using -shortest

I am trying to combine an audio (.wav) file and picture file (.png) into a video file. The video's length should be the same length as the input audio. Also, the output video should be youtube-...
3
votes
2answers
868 views

How to create “diagonal wipe” effect in FFmpeg?

Is it possible to create "diagonal wipe" effect in FFmpeg between two videos? An example: the first video is playing and after some time the second video is replacing the first video starting from the ...
3
votes
0answers
2k 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
943 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
3k 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
10k 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 ...
2
votes
2answers
6k views

ffmpeg Cut a media preserving all streams but also all metadata, timecodes and everything else

Today I wanted to obtain a ts file cut preserving everything, so I tried with this command: ffmpeg -i "original.ts" -map 0 -c copy -t 00:30:0.0 -threads 1 "cutted.ts" The resulting file have ...
1
vote
3answers
450 views

Replace all completely black frames with interpolated frames

Due to a bug with Nvidia Shadowplay, I have a bunch of videos that look like this. A bunch of random frames have been replaced with pure black frames. I'd like to fix one of these videos to remove ...
64
votes
4answers
151k 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 ...
23
votes
3answers
97k views

Fix bad files and streams with ffmpeg so VLC and other players would not crash

It happened me many times that I could end up in corrupted video files: video downloaded from official sources but with torrent and for some reason not all the pieces are there in .mkv, .ts or .mp4 ...
31
votes
5answers
43k 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, ...
27
votes
3answers
43k 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 ...
20
votes
4answers
44k 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 ...
12
votes
1answer
11k views

ffmpeg: add 3 seconds of black to video head and tail

Let's say I have a video, which can have any dimensions or codec (e.g. mp4), and I want to add 3 seconds of black frames to its head. I have seen other variants to this question which pertain to ...
19
votes
8answers
21k views

Is there a way to pause and resume FFmpeg encoding?

I record a few hours of video footage every day, which I set in queue for encoding with ffmpeg. I use the veryslow preset with x265, so a single hour of video may take up to 20 hours or more to encode....
13
votes
1answer
12k 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 ...
11
votes
1answer
5k 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 -...
10
votes
1answer
10k 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 ...
15
votes
2answers
24k 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 ...
5
votes
3answers
33k views

How to download and encode a video from a MPD manifest?

I can watch videos on a website with MPEG-DASH technology. I can obtain the video's manifest.mpd file from the website. (I am not sure whether the file contains any user credentials or not, so I am ...
16
votes
2answers
23k 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 ...
2
votes
2answers
12k 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 ...