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 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 ...................................................................................
Recommended publications
  • Factors to Consider in Improving the Flat Panel TV Display User's
    Universidad CEU San Pablo CEINDO – CEU Escuela Internacional de Doctorado PROGRAMA en COMUNICACIÓN SOCIAL Factors to consider in improving the flat panel TV display user’s experience on image quality terms TESIS DOCTORAL Presentada por: Dª Berta García Castiella Dirigida por: Dr. Luis Núñez Ladeveze and Dr. Damián Ruiz Coll MADRID 2020 ACKNOWLEDGEMENTS A Damián, por creer en mi proyecto y en su proyección. A Luis, por permitirme comenzar y ayudarme pese a las dificultades. A Lucas, por cada detalle, por cada apoyo, esta tesis es de ambos. A Natalia, por ayudarme sin cuestionarme. A Gonzalo, por poner orden en el caos. A mi madre, por darme todos los ánimos. A Teresa, por darme su tiempo, a pesar de no tener. A Roger, por sus palabras, que han sido muchas. A Belén y a Fredi, por cuidar a mi hijo con todo su cariño mientras yo investigaba. A mis amigos y familiares por estar ahí, a veces es lo que más se necesita. Y, por último, quería pedir disculpas. A mi hijo Max. Porque cada página de esta tesis son horas que no he estado a tu lado cuando tú me necesitabas, perdón de corazón. ABSTRACT In the constantly changing world of image technology, many new tools have emerged since flat panels appeared in the market in 1997. All those tools went straight to the TV sets without any verification from the filmmaking or advertising industry of their contribution to the improvement of the image quality. Adding to this situation the fact that each tool received a different name according to the manufacturer, this new outlook has become complex and worrisome to those industries that see their final products modified and have no option of action.
    [Show full text]
  • An Introduction to Ffmpeg, Davinci Resolve, Timelapse and Fulldome Video Production, Special Effects, Color Grading, Streaming
    An Introduction to FFmpeg, DaVinci Resolve, Timelapse and Fulldome Video Production, Special Effects, Color Grading, Streaming, Audio Processing, Canon 5D-MK4, Panasonic LUMIX GH5S, Kodak PIXPRO SP360 4K, Ricoh Theta V, Synthesizers, Image Processing and Astronomy Software by Michael Koch, [email protected] Version from October 7, 2021 1 Contents 1 Introduction to FFmpeg .............................................................................. 9 2.27 Sharpen or blur images .................................................................. 57 1.1 What can be done with FFmpeg? .................................................... 11 2.28 Extract a time segment from a video ............................................. 58 1.2 If FFmpeg has no graphical user interface, how do we use it? .... 12 2.29 Trim filter ......................................................................................... 59 1.3 The first example .............................................................................. 14 2.30 Tpad filter, add a few seconds black at the beginning or end .... 60 1.4 Using variables ................................................................................. 15 2.31 Extract the last 30 seconds of a video .......................................... 61 2 FFmpeg in detail ....................................................................................... 16 2.32 Fade-in and fade-out ....................................................................... 62 2.1 Convert from one video format to another video
    [Show full text]
  • Appendix a Estimating the AR Coefficients for the 3DAR Model
    Appendix A Estimating the AR Coefficients for the 3DAR Model This appendix presents the least squared solution (the Maximum Likelihood solution may be found in [149]) for the coefficients of the three dimensional autoregressive model as outlined in Chapter 2. The model is best discussed in its prediction mode. The prediction equation is as below where i (i, j, n) is the predicted value of the pixel at (i, j, n). N I(i, j, n) = L ak!(i + qk(x) + SXn,n+qk(n), j + qk(y) + SYn,n+qk(n), n + qk(n)) k=l (A.1) The task then becomes to choose the parameters in order to minimize some function of the error, or residual, t:(i,j,n) = I(i,j,n)- I(i,j,n) (A.2) The parameters of the model are both the AR coefficients a= [a 1 ,a2 ,a3 .. aN], and the displacement dk,l = [sxk,l SYk,l OJ. This section is concerned only with coefficient estimation given an estimate for the displacement. The coefficients are chosen to minimize the squared error, ;:(), above. This leads to the Normal equations [11, 32, 71]. The derivation is the same as the one dimensional case and the solution can be determined by invoking the prin­ ciple of orthogonality. E[t: 2 (i,j,n)] is minimized by making the error t:(i,j,n) orthogonal to the signal values used in its generation [71]. Therefore, E[t:(i, j, n)I(i + qm (x) + SXn,n+qm(n), j + qm(Y) + SYn,n+qm(n)' n + qm(n))] = 0 (A.3) 274 Appendix A.
    [Show full text]
  • Novel Source Coding Methods for Optimising Real Time Video Codecs
    NOVEL SOURCE CODING METHODS FOR OPTIMISING REAL TIME VIDEO CODECS A Thesis submitted for the degree of Doctor of Philosophy By Premkumar Elangovan Department of Computing and Advanced Technologies, Faculty of Enterprise and Innovation, Buckinghamshire New University Brunel University, West London July, 2009 ii Abstract The quality of the decoded video is affected by errors occurring in the various layers of the protocol stack. In this thesis, disjoint errors occurring in different layers of the protocol stack are investigated with the primary objective of demonstrating the flexibility of the source coding layer. In the first part of the thesis, the errors occurring in the editing layer, due to the coexistence of different video standards in the broadcast market, are addressed. The problems investigated are ‘Field Reversal’ and ‘Mixed Pulldown’. Field Reversal is caused when the interlaced video fields are not shown in the same order as they were captured. This results in a shaky video display, as the fields are not displayed in chronological order. Additionally, Mixed Pulldown occurs when the video frame-rate is up-sampled and down-sampled, when digitised film material is being standardised to suit standard televisions. Novel image processing algorithms are proposed to solve these problems from the source coding layer. In the second part of the thesis, the errors occurring in the transmission layer due to data corruption are addressed. The usage of block level source error-resilient methods over bit level channel coding methods are investigated and improvements are suggested. The secondary objective of the thesis is to optimise the proposed algorithm’s architecture for real-time implementation, since the problems are of a commercial nature.
    [Show full text]
  • Impacts of Internal HMD Playback Processing on Subjective Quality Perception
    https://doi.org/10.2352/ISSN.2470-1173.2019.12.HVEI-219 © 2019, Society for Imaging Science and Technology Impacts of internal HMD Playback Processing on Subjective Quality Perception Frank Hofmeyer, Stephan Fremerey, Thaden Cohrs, Alexander Raake Audiovisual Technology Group (AVT), Technische Universität Ilmenau, Ilmenau, Germany E-Mail: [frank.hofmeyer, stephan.fremerey, thaden.cohrs, alexander.raake]@tu-ilmenau.de Abstract processing in the end-to-end chain of a 360◦ video pipeline. Ad- In this paper, we conducted two different studies. Our first ditionally we investigated the HTC Vive Pro, which we also used study deals with measuring the flickering in HMDs using a self- in some of our conducted tests (cf. [3]). Usually, HMDs panels developed measurement tool. Therefore, we investigated several like e.g. Oculus Rift, HTC Vive and HTC Vive Pro have a refresh combinations of software 360◦ video players and framerates. We rate of 90 Hz. found out that only 90 fps content is leading to a ideal and smooth Regarding e.g. the human critical fusion frequency (cf. [5], playout without stuttering or black frame insertion. In addition, [2], [9]) this seems very beneficial but it is also very problematic it should be avoided to playout 360◦ content at lower framerates, because most of all 360◦ videos are not matching this framerate. especially 25 and 50 fps. In our second study we investigated the This is leading to the fact that software players and HMD systems influence of higher framerates of various 360◦ videos on the per- are required to compensate this framerate mismatch. ceived quality.
    [Show full text]