An Introduction to Ffmpeg, Timelapse and Fulldome Video Production
Total Page:16
File Type:pdf, Size:1020Kb
An Introduction to FFmpeg, Timelapse and Fulldome Video Production, Color Grading, Audio Processing, Panasonic LUMIX GH5S, Image Processing and Astronomy Software by Michael Koch, [email protected] Version from March 14, 2020 1 Contents 1 Introduction to FFmpeg .............................................................................. 5 2.28 Combine multiple videos with concat demuxer ........................... 39 1.1 What can be done with FFmpeg? ...................................................... 7 2.29 Combine multiple videos with concat filter .................................. 40 1.2 If FFmpeg has no graphical user interface, how do we use it? ...... 8 2.30 Switch between two cameras, using audio from camera1 .......... 41 1.3 The first example ................................................................................ 9 2.31 Stack videos side by side (or on top of each other) ................... 42 1.4 Using variables ................................................................................. 10 2.32 Horizontal and vertical flipping ..................................................... 42 2 FFmpeg in detail ....................................................................................... 11 2.33 Stack four videos to a 2x2 mosaic ............................................... 43 2.1 Convert from one video format to another video format ............... 11 2.34 Blink comparator ............................................................................ 44 2.2 Fit timelapse length to music length ............................................... 12 2.35 Animated GIF ................................................................................... 45 2.3 Timelapse or slideshow from many images, with crossfading .... 13 2.36 Replace one frame in a video by another ..................................... 46 2.4 Slideshow with different durations ................................................ 14 2.37 Blend filter ....................................................................................... 47 2.5 Extract many images from a video .................................................. 15 2.38 Subtracting a darkframe ................................................................. 48 2.6 Extract the last frame from a video ................................................. 15 2.39 Gradation curves and vignetting ................................................... 49 2.7 Modify brightness, contrast, saturation, gamma and hue ............ 16 2.40 Color grading with color look-up tables, full workflow ............... 50 2.8 Strong contrast enhancement ......................................................... 17 2.41 Color grading with color look-up tables, simplified workflow .... 52 2.9 Inverting a video or image (make a negative) ................................ 18 2.42 Size of color-look-up tables ........................................................... 53 2.10 Correcting the color channels ....................................................... 19 2.43 Histogram ........................................................................................ 53 2.11 Colorhold ......................................................................................... 20 2.44 Lagfun filter ..................................................................................... 54 2.12 Atmospheric dispersion correction .............................................. 21 2.45 Deblock filter ................................................................................... 55 2.13 Amplify filfer .................................................................................... 21 2.46 Gradfun filter ................................................................................... 55 2.14 Extract a time segment from a video ............................................ 22 2.47 Dilation filter .................................................................................... 55 2.15 Trim filter ......................................................................................... 23 2.48 V360 filter for rotation of equirectangular 360° videos ................ 56 2.16 Tpad filter, add a few seconds black at the beginning or end .... 23 2.49 Equirectangular images of the night sky ...................................... 58 2.17 Extract the last 30 seconds of a video .......................................... 24 2.50 Remap a fisheye video to an equirectangular video ................... 59 2.18 Fade-in and fade-out ...................................................................... 25 2.51 Remap an equirectangular video to a fisheye video ................... 63 2.19 Crossfading ..................................................................................... 26 2.52 Remap an equirectangular video to a "Little planet" video ........ 64 2.20 Crop a video .................................................................................... 27 2.53 Remap an equirectangular video to a "Mirror sphere" video ..... 66 2.21 Changing the speed, slow motion and timelapse ........................ 28 2.54 Shift the viewing direction in a fisheye image or video ............... 68 2.22 Slow motion or timelapse only for a segment of the video ......... 29 2.55 Stitching together double-fisheye videos ..................................... 71 2.23 Time Remapping ............................................................................. 30 2.56 Remove vertical stitching artefacts .............................................. 73 2.24 Insert a text which is visible for the whole duration .................... 32 2.57 Preprocessing a flat video for fulldome projection ..................... 76 2.25 Slowly fade a text in and out .......................................................... 32 2.58 Rotating earth or planet ................................................................. 78 2.26 Show a running clock in the video ................................................ 34 2.59 Black hole simulation with remap filter ........................................ 79 2.27 Generation of curved text for fulldome projection ..................... 36 2.60 Wormhole simulation ..................................................................... 87 2 2.61 Simulation of a moving wormhole ................................................ 90 3.3 Replace a segment of the audio stream by silence ..................... 144 2.62 Sendcmd and commands .............................................................. 93 3.4 Stereo --> mix into one mono channel .......................................... 145 2.63 Remap Video-in-Video with perspective filter .............................. 95 3.5 Check if both stereo channels are equal ...................................... 145 2.64 Image warping with displace filter ................................................ 97 3.6 Extract one mono channel from stereo ........................................ 145 2.65 Noise reduction ............................................................................. 102 3.7 Stereo --> two mono channels ....................................................... 145 2.66 Time delay within a filter chain .................................................... 103 3.8 Mono --> stereo ............................................................................... 146 2.67 -filter_complex_script .................................................................. 103 3.9 Two mono channels --> stereo ...................................................... 146 2.68 Chroma subsampling, pixel format of images or videos .......... 104 3.10 Mix two stereo channels to one stereo channel ........................ 146 2.69 Video Codecs ................................................................................ 106 3.11 How to choose the correct audio volume level .......................... 146 2.70 Metadata ........................................................................................ 107 3.12 Make a video from an audio file ................................................... 147 2.71 Video filters "copy" and "null" .................................................... 107 3.13 Remove low frequencies (wind noise) from an audio track ...... 147 2.72 Re-numbering images .................................................................. 108 3.14 Convert ultrasound to the audible range, e.g. to hear bats ...... 148 2.73 Filenames for images ................................................................... 109 3.15 Record sound with the computer's built-in microphone ........... 150 2.74 Make many JPG test images ........................................................ 110 3.16 Record a "Voice-Over" audio track ............................................. 151 2.75 Make a chessboard video ............................................................. 110 3.17 Passing the FFmpeg output to FFplay ........................................ 153 2.76 Make a test video with audio ........................................................ 110 3.18 Record sound and pass the output to FFplay ........................... 153 2.77 Find an object in a video and hide it ........................................... 110 3.19 Live ultrasound conversion ......................................................... 154 2.78 Image formats ................................................................................ 111 3.20 Extract the audio from a video .................................................... 156 2.79 Video sizes ...................................................................................