Hot answers tagged

74

You can do a simple image overlay using the following syntax: ffmpeg -i input.mp4 -i image.png \ -filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,20)'" \ -pix_fmt yuv420p -c:a copy \ output.mp4 overlay=25:25 means we want to position the image 25px to the right and 25px down, originating from the top left corner (0:0). enable='between(t,0,20)'...


60

You can use ffmpeg to create video from audio using several filters. ahistogram Convert input audio to a video output, displaying the volume histogram. ffmpeg ffmpeg -i input.flac -filter_complex \ "[0:a]ahistogram,format=yuv420p[v]" \ -map "[v]" -map 0:a output.mp4 ffplay ffplay -f lavfi "amovie=input.flac, asplit [a][out1]; [a] ahistogram [out0]" ...


40

FFmpeg has a reverse video filter and reverse audio filter. For video only: ffmpeg -i /storage/emulated/0/ffvid/frameCount.mp4 -vf reverse reversed.mp4 For audio and video: ffmpeg -i /storage/emulated/0/ffvid/frameCount.mp4 -vf reverse -af areverse reversed.mp4 This filter buffers the entire clip. For larger files, segment the file, reverse each segment ...


33

Just mux the images You can simply mux the JPG images to make a video: ffmpeg -framerate 30 -i input%03d.jpg -codec copy output.mkv Note that if you omit -framerate then a default of -framerate 25 will be applied to the input. Lossless optimization You can use jpegtran to perform lossless optimization on each frame which may provide significant file ...


27

The article you linked is not very good. Normally, single pass bitrate encodings convert your bitrate into a RF value with a maximum bitrate limit and takes it from there. x264's one-pass ABR ratecontrol is not implemented as CRF + limit. He's right that 2pass is by far the best way to hit a target bitrate, though. And he apparently doesn't realize that ...


24

Use drawbox for the box, and drawtext for the text. ffmpeg -i input.mp4 -vf \ "format=yuv444p, \ drawbox=y=ih/PHI:color=black@0.4:width=iw:height=48:t=fill, \ drawtext=fontfile=OpenSans-Regular.ttf:text='Title of this Video':fontcolor=white:fontsize=24:x=(w-tw)/2:y=(h/PHI)+th, \ format=yuv420p" \ -c:v libx264 -c:a copy -movflags +faststart output.mp4 ...


24

The image sequence muxer has a start number option, so ffmpeg -i video.webm -start_number 98 image-%03d.png


22

#1 To simultaneously fade the audio in/out: ffmpeg -i clip.mp4 -vf 'fade=in:0:30,fade=out:960:30' -af 'afade=in:st=0:d=1,afade=out:st=32:d=1' -c:v libx264 -crf 22 -preset veryfast fadeInOut.mp4 The afade times are in seconds. #2 Automatically? No. But see workaround below You can first run ffprobe to get duration. ffprobe -i ...


17

You can use ffmpeg, a free command-line tool, to do this. The basic command is ffmpeg -i input.mov -vf "setpts=(PTS-STARTPTS)/30" -crf 18 output.mov The 30 indicates the factor by which the video will be sped up.


16

The main advantage is cost. Historically, there were two main types of imaging sensors, CMOS and CCD. CMOS was historically used in digital cameras (because of the higher quality images it can capture, the lower cost, and the fact that digital cameras only have to capture a single moment). CCDs on the other hand were historically used in video cameras, ...


15

There was one, but it fell in to disuse and isn't used very often anymore, largely because of the lack of mobile support, but also due to security issues it created. It was called Flash.


15

The frames in your H.264 video are grouped into units called GOPs (Group Of Pictures). Inside these GOPs frames are classified into three types: I-frame: frame that stores the whole picture P-frame: frame that stores only the changes between the current picture and previous ones B-frame: frame that stores differences with previous or future pictures ...


14

I found that using Adobe Media Encoder is much easier when just cropping. Add the video to the queue and open the export settings. On the source tab you can crop the video and there you can also enter how many pixels to remove at each side. Remember to set the correct output size in the video tab on the right side. Here is a screenshot showing how i did it:


13

It's to leave room before first picture, for slates, countdowns, test signals etc, while still preserving an easy count of running time for the video. Yes, it traces historically to broadcast and in particular videotape. Many tape-based editing systems couldn't deal with 24-hour wraparound, so the next even hour became traditional 'time zero'. I suspect ...


13

This will output a lossless H.264 video where frames will use information from other frames ffmpeg -f image2 -r 30 -i %09d.jpg -vcodec libx264 -profile:v high444 -refs 16 -crf 0 -preset ultrafast a.mp4 Explanation of options: -f image2 - tells ffmpeg to select a group of images -r 30 - tells ffmpeg to encode at 30 frames (or images) per second (change ...


13

A videofilter in ffmpeg always has to modify pixel information hence the reason why you need to re-encode. It seems logical at first that you wouldn't have to do this when cropping but the way lossy video codecs work makes this pretty impossible without re-encoding everything. They usually don't see an array of pixel information but a much more complex ...


12

You can use ffmpeg, and you currently have a choice of four video filters that can blur: boxblur, sab, smartblur and unsharp. These filters can use the enable option for timeline support, so you can apply the blurring effect to a certain duration if desired. You can view what filters have timeline support with ffmpeg -filters. Example This example will ...


12

A while back I ran some introductory video editing workshops. I used to tell the participants about a particularly cool effect that I once found in Pinnacle; it was a pinhata that came swinging into the first video along with a stick that hit the second video out of it and it unfolded across the screen. The point of this anecdote is the following: Don't use ...


11

Yes, this is possible using ffmpeg and the mkv container. An example command sequence would be: ffmpeg -i input1 -i input2 -c copy -map 0 -map 1 output.mkv source Breaking down the command: -i input1 This selects the first input file. Could be something like my video_track1.mov. -i input2 Here you can specify the second input file. You can add another ...


11

2017 update: ffmpeg supports h264 and h265 NVENC GPU-accelerated video encoding. You can do 1-pass or 2-pass encoding at the quality that you choose, for either hevc_nvenc or h264_nvenc, or and even with an entry-level GPU it's much faster than non-accelerated encoding and Intel Quick Sync accelerated encoding. 2-pass high-quality encoding: ffmpeg -i in....


11

It's a terrible hack, but this might work if all you want to do is audio fade in/out but don't know exactly how long the clip is: ffmpeg -i input.mp4 -filter_complex "afade=d=0.5, areverse, afade=d=0.5, areverse" output.mp4 [edit 2019-07-24: Note that this solution is not good for streaming solutions since it requires the full track to be processed before ...


10

Use ffmpeg and the "transpose" filter as "poor" suggested. For example, if your files are mp4 and are in the current directory: mkdir -p rotated for f in *.mp4; do ffmpeg -i "$f" -vf transpose=2 -c:a copy -metadata:s:v rotate="" rotated/"$f"; done The transpose value can be "1" or "clock" for clockwise rotation, "2" or "cclock" for counter-clockwise ...


10

Using the latest ffmpeg General users should always use ffmpeg from the current git master branch (the latest code available): When encountering an issue the first thing to do is check to see if you are using a build from git master. It is considered stable. It will have more bug fixes and features. FFmpeg development is very active. If you want to get ...


10

This slows down one part of a video and keeps the rest as is. ffmpeg -i Soon.mp4 -filter_complex "[0:v]trim=0:2,setpts=PTS-STARTPTS[v1]; [0:v]trim=2:5,setpts=2*(PTS-STARTPTS)[v2]; [0:v]trim=5,setpts=PTS-STARTPTS[v3]; [0:a]atrim=0:2,asetpts=PTS-STARTPTS[a1]; [0:a]atrim=2:5,asetpts=PTS-STARTPTS,atempo=0.5[a2]; [0:a]atrim=5,...


10

Use ffmpeg -i in.mp4 -vf yadif,format=yuv420p -force_key_frames expr:gte(t\,n_forced/2) -c:v libx264 -crf 18 -bf 2 -c:a aac -q:a 1 -ac 2 -ar 48000 -use_editlist 0 -movflags +faststart out.mp4 -vf specifies video filters yadif will deinterlace videos if they're interlaced. format=yuv420p will produce pixel format with 4:2:0 chroma subsampling. -...


9

Shutter speed and focal length are completely independent parameters, focal length determines angle of view (how much scenery you get in your shot). Shutter speed determines how long each part of the image sensor is exposed for, and therefore it determines the brightness of the image, and how much blur is caused by moving objects. The quantity that most ...


9

I think I've found the easiest way! Just crop the area you want. Go to the Export window without worrying about the black margins showing. Set the final resolution and export settings as you would want. (THIS IS THE IMPORTANT ONE) On the top left of the Export Window, there are two tabs; SOURCE and OUTPUT. Go to the Source Tab. On the left-most side, find ...


9

MERGING VIDEO CLIPS To combine video clips there is something called Nested Sequence. A very powerful technique. When adding clips to a timeline you are working in what is called a sequence (normally named Sequence 01), drop your two clips into your timeline and rename your sequence 01 to something like 'My day trip to the market'. Select a different ...


9

This is possible but will require scripting. ffprobe will be used to determine the duration of the input, then the countdown and background box will be created by the drawtext filter. A 30 second input will start from 30 and count down to 0. Example: input=input.mp4 duration=$(ffprobe -loglevel error -show_entries format=duration -of default=nw=1:nk=1 "$...


9

Run ffmpeg -i titlefile.mp4 -vf setdar=16/9 -video_track_timescale 29971 -ac 1 newtitle.mp4 and then run concat with the new title video. Modern containers like MP4 have Presentation TimeStamps, which are denominated with reference to a timebase. So, if the timebase value is 1/500 and a frame's PTS is 200, then that tells the video player to show that ...


Only top voted, non community-wiki answers of a minimum length are eligible