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
362 votes
1 answer
495k 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 ...
  • 3,729
103 votes
6 answers
238k 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 ...
  • 1,141
68 votes
2 answers
153k 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 ...
  • 683
45 votes
3 answers
91k views

How to downsample 4k to 1080p using ffmpeg while maintaining the quality?

I have some 4K 3840x2160 footage in MP4 format that I need to bring down to 1080p. I tried running ffmpeg -i orig.mp4 -vf scale=1920:1080 smaller.mp4 but the result is very poor quality, with the ...
43 votes
3 answers
152k 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 ...
  • 1,494
43 votes
1 answer
48k 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 ...
42 votes
6 answers
50k views

How to prevent FFmpeg from dropping metadata?

When I am simply copying a.MOV (from my iPhone) to c.MOV, FFmpeg drops a lot of metadata, including the time and location of the video. I tried -metadata, but FFmpeg still drops the information. It ...
42 votes
3 answers
81k 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 ...
  • 1,563
39 votes
6 answers
56k 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, ...
  • 527
37 votes
4 answers
89k 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 ...
  • 471
36 votes
2 answers
46k views

How to use FFmpeg Command for Reverse Video?

i am use to FFmpeg library in android for reverse video. I can dump images from video but how to reverse all images and make video. See this link that from i am use to library in my gradle.. Library ...
36 votes
2 answers
231k 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 ...
  • 2,104
33 votes
6 answers
74k 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 ...
32 votes
3 answers
45k 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/...
  • 651
31 votes
5 answers
134k 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 ...
  • 413
31 votes
1 answer
90k 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 ...
  • 423
30 votes
1 answer
91k views

How to deinterlacing with ffmpeg?

I have the following VOB file: → ffmpeg -i input.vob output: ffmpeg version N-77455-g4707497 Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04) ...
  • 403
26 votes
2 answers
47k views

Convert mp4 to webm without quality loss with ffmpeg

What is the best way to convert a mp4 file to webm without quality loss (using vp8 or vp9) with ffmpeg? If I do ffmpeg -i in.mp4 out.webm the quality is very bad. I can specify a target bitrate via -...
  • 431
24 votes
9 answers
37k 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....
  • 1,563
22 votes
2 answers
78k 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 and extracting the video bitrate, ...
  • 312
20 votes
4 answers
47k 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 ...
  • 343
18 votes
2 answers
28k 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 ...
  • 183
18 votes
1 answer
23k 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 ...
18 votes
2 answers
18k views

cutting with ffmpeg results in few seconds of black screen, how do i fix this?

i'm using this command to cut a segment from a video from command line ffmpeg -i %1 -vcodec copy -acodec copy -ss %2 -t %3 %~n1_cut%~x1 and i call it like cut.bat video.mp4 001:23:45:678 10 and as ...
  • 181
17 votes
4 answers
12k views

How do the super resolution filters in FFmpeg work?

I need to incorporate a small amount of 1080p HD shots in a 2160p 4K composition. I'm not impressed by default upscaling techniques like lanczos/bicubic/trilinear; it seems like my television does a ...
  • 283
17 votes
2 answers
39k 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 ...
17 votes
5 answers
12k views

How to identify HDR video?

I need to validate if a video file (HEVC encoded) is or is not an HDR video. I know that there are many HDR standards, but I did not find a way to identify it using mediainfo or ffprobe. The need is ...
16 votes
4 answers
46k views

Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly

I am using below command to push the video to Wowza server, since we are pushing raw H.264 video, the RTP packet does not have the timestamp, and we could observe audio video sync issue while playing ...
  • 313
16 votes
1 answer
33k views

How to limit file size with ffmpeg?

I want to encode a video, that has a length of 60 seconds, to a target or maximum size of 10 MB. There are two approaches I know of. One is explained in the FFMPEG-Wiki, and the other one I found in ...
  • 263
15 votes
3 answers
20k views

What is KeyInt and min-keyint and no-scenecut

I am absolutely new to video processing, I am building a video streaming site and worked with ffmpeg to generate the formats I need for ShakaPackager. Sadly I don't understand some of the options ...
15 votes
1 answer
17k views

ffmpeg: how to add several subtitle streams

I tried to add 2 .srt subtitles to a video, but the resulting file has only the first subtitle. This is the command I used: ffmpeg -i $movie.mov -i $sub_en.srt -i $sub_de.srt \ -c:v copy -c:a copy \ -...
  • 547
15 votes
3 answers
57k 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 ...
  • 13.6k
14 votes
4 answers
10k views

ffmpeg: Create a black background video from audio, for Youtube upload

I have MP3 audio that I would like to turn into video, by joining the audio with a solid black background. I then want to upload the video to Youtube. Using ffmpeg, I have tried this command, and a ...
  • 1,563
14 votes
2 answers
45k 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 ...
14 votes
2 answers
10k 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 -...
  • 1,494
13 votes
4 answers
71k 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 ...
  • 231
13 votes
1 answer
16k 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 ...
  • 2,690
13 votes
2 answers
34k 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 though ...
13 votes
2 answers
17k 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 ...
  • 233
13 votes
1 answer
15k 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 ...
12 votes
1 answer
42k views

FFmpeg - dropping duplicate frames

FFmpeg knows about duplicate frames in the input video stream as it outputs a message like this: More than 1000 frames duplicated Is there some way to tell it: "Not include duplicates into the ...
  • 1,404
12 votes
1 answer
17k 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 ...
11 votes
3 answers
16k views

How to hold the last frame when using ffmpeg

I'm cutting/converting some videos with ffmpeg. What I'd really like is to be able to have the output hold the last frame for a few seconds (with silence for audio). Is such a thing possible? Or ...
  • 213
11 votes
1 answer
13k 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 ...
11 votes
2 answers
13k views

FFMPEG: Delete chapters

I have a video file, video.mp4. This file has 3 chapters, 'Beginning', 'Middle' and 'End'. I want to delete chapter 'Middle' (the actual video, not just the metadata) and combine chapters 'Beginning' ...
11 votes
3 answers
18k 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
  • 233
11 votes
1 answer
14k views

How to encode for YouTube with ffmpeg?

I just read Recommended upload encoding settings article from official google support. I think this is the best settings for encoding my youtube videos. Can you help me find out how to encode that ...
11 votes
1 answer
32k views

ffmpeg pixel format definitions

ffmpeg -pix_fmts lists many pixel formats. In my ffmpeg, there are 66 different pixel formats that start with yuv. A few of them are familiar to me (e.g., yuv422p), but most of them are not (e.g., ...
11 votes
4 answers
7k 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 ...
  • 161
11 votes
4 answers
6k 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 ...
  • 211

1
2 3 4 5
40