Video Creation: Difference between revisions

From wikiluntti
 
(28 intermediate revisions by the same user not shown)
Line 2: Line 2:


Some ideas to create better videos.
Some ideas to create better videos.
ETH Zurich: https://ethz.ch/en/the-eth-zurich/education/innovation/video-in-teaching.html. Eight different uses of videos
# Personalising and cooperation
# Access to people and special locations
# Manipulate time and space
# Story-telling
# Historical film material
# Demonstrations
# Counteracting of misconceptions
# Explanatory videos: Content and animations
More detailed instructions about videos are available at the link.


Ubuntu 20.04: Key-Mon need a repositoru Ubuntu: [https://www.thregr.org/~wavexx/software/screenkey/ Screenkey] (apt-get install screenkey installs an old version).
Ubuntu 20.04: Key-Mon need a repositoru Ubuntu: [https://www.thregr.org/~wavexx/software/screenkey/ Screenkey] (apt-get install screenkey installs an old version).
Dramatic structure:
* Exposition
* Rising action
* Climax
* Falling action
* Denoemenement
Attenborough Style of presentation: Get into this mindset: your main job is to be an entertainer, not a scientist
*Tell a story; don’t simply talk about your methods and results.
*A solid scientific narrative is critical for easy comprehension, and easy comprehension is critical for the D.A. style!
*Practice your transitions between slides and subjects.
*Kill clutter. Remove text. Complete sentences are to be banished from your talk.
**Exception: A single sentence (or sentence fragment) at the top of each slide that capture’s that slide’s main point is a good idea.
*Only show as much of the slide as people need to understand the point you are making at that precise moment. I
*Be excited.
*Be engaged
*Jokes are tricky, you probably have more to lose than to gain
*Try not to use a laser pointer
HOW TO STRUCTURE YOUR TALK
*Phase 1. Setting up the talk.
**Big picture context
**Key questions you are investigating (zoom in from the big picture).
**Don’t bury the lede. Get quickly to your main result in broad brush strokes, and then move on.
*Phase 2. Methods and Results
**Keep methods brief.
**Answer the questions you raised earlier.
*Phase 3. Concluding the talk.
**Briefly recap the answers to the questions laid out in the intro.
**Provide context for why your results are important in the big picture. See the symmetry? We start with the big picture, and end with the big picture and how your results affect the way we think about the big picture.
*Some final tips for crafting your talk:
**Know your audience
**Anticipate questions and put the answers after your acknowledgements
**Don’t bury your conclusions in acknowledgements
Ted talk https://www.fastcompany.com/3022070/the-7-steps-to-delivering-a-mind-blowing-ted-talk
# Clear Can listeners repeat your big idea word for word?
# Compelling. predictable is boring. "Hmmm. That’s interesting. Tell me more.”
# Current
# Congruent run it by your gut.  Your point of view, not someone else’s.
# Commercially Viable
# Consistent
# Competitive Edge


== Theory ==
== Theory ==
Line 14: Line 71:
* Effect -> Truncate Silence 0.2 s + 0.2 s
* Effect -> Truncate Silence 0.2 s + 0.2 s
* Normalize
* Normalize
* Normalize
* Compress
https://blog.audioacrobat.com/2013/01/audacity-trim-peaks-to-boost-loudness-without-clipping/
https://www.instructables.com/How-to-Improve-Vocal-Quality-in-Audacity
=== Audio: External soundcard ===
Roland Rubix22 Analog Stereo works directly with Linux. Set Rubix22 Analog Stereo as Input Device, and apply default Input device in Audacity. Should work perfectly but does not.
[[File:Audacity split stereotomono.png|thumb]]
Audacity clips the mic on 0.5 (-6 dB) instead of 1 on Audacity waveform window while recording on one channel. This is expected behavior because of mono/ stereo. However, to prevent clipping at 0.5 use stereo recording (two channels) and remove the quiet channel by pressing the back arrow next to "Audio 1".
Some microphones I tested:
* AKG Perception live P5, dynamic with wind shield yields good sound quality. Bit low but amplify using Audacity. No need for noise reduction.
*
Dynamic Microphone positioning
* at least 3 (three) fingers between you and the mic. Maybe a fist.
* The further away, the more room tone.
* Off-axis. Don't speak directly to mic. No blouses.
* Headphones.
=== OBS tips ===
https://www.youtube.com/c/YoramSolomon/videos
=== Manim package ===
See manim at
[[Short introduction to Manim]].
=== Remove similar frames: FFMPEG ===
Remove similar frames
<code>
ffmpeg -i input.mp4 -vf mpdecimate,setpts=N/FRAME_RATE/TB out.mp4
</code>
see more info at https://stackoverflow.com/questions/37088517/remove-sequentially-duplicate-frames-when-using-ffmpeg
=== Background image ===
Add a background image using mogrify as a batch job:
<pre>
mogrify -path ../gyro0_bg/ -format png -draw 'image Dst_Over 0,0 0,0 "../bg.png"' *.png
</pre>
=== Video to GIF ===
Convert video to frames
<code>
ffmpeg -i input.mkv -f image2 image-%07d.png
</code>
Frames to video
<code>
ffmpeg -i image-%07d.png -vf fps=20,scale=720:-1 logo.gif
</code>
The smaller palette reduces the size remarkably. Create a palette with 16 colors:
<code>
ffmpeg -i image-0001111.png -vf palettegen=16 palette.png
</code>
and use that to generate with an animated gif 5 fps:
<code>
ffmpeg -i image-%07d.png -i palette.png -filter_complex "fps=5,scale=720:-1:flags=lanczos[x];[x][1:v]paletteuse" logo5_palette.gif
</code>
Optimize the gif using gifsicle
<syntaxhighlight lang="bash">
gifsicle -i input.gif -O3 --colors 16 -o outputt_opt.gif
</syntaxhighlight>
=== Light Board ===
See [https://lightboard.info/home/faq.html lightboard.info] for great examples, ideas and tutorials.
=== Reduce flickering ===
Light sources are interfering with the camera.
https://video.stackexchange.com/questions/23384/remove-flickering-due-to-artificial-light-with-ffmpeg
<code>ffmpeg -fflags +genpts -i flickering.mp4 -fflags +genpts -i flickering.mp4 -filter_complex "[0:v]setpts=PTS-STARTPTS[top]; [1:v]setpts=PTS-STARTPTS+.033/TB, format=yuva420p, colorchannelmixer=aa=0.5[bottom]; [top][bottom]overlay=shortest=1" -c:v libx264 -crf 26 -an NOFLICKER.mp4</code>
The idea here is it's blending the brightness of consecutive frames. That will fix flickering at the framerate, but will all produce ghosting for fast-moving objects.
Duplicate the clip, move one frame and change the opacity to 50%. Needs more than 24fps. You could try also with three clips, 30-60-100. The motion blur is bad if fps is too small.
FFMPEG
* deflicker https://ffmpeg.org/ffmpeg-filters.html#deflicker
* hqdn3d https://ffmpeg.org/ffmpeg-filters.html#hqdn3d-1
*
=== Mouse Effects: Linux ===
Ubuntu: Screenkey (apt-get install screenkey).  https://www.thregr.org/~wavexx/software/screenkey/#installation-and-basic-usage
Screen2:
<code>
screenkey -M -p fixed -g 20%x10%+135%-10% -t 0.5
</code>
Screen2 + upwards:
<code>
screenkey -M -p fixed -g 20%x10%+135%-20% -t 0.5
</code>
<code>
./screenkey -M -p fixed -g 20%x10%+45%-10% -t 0.5
</code>


=== Mouse Effects ===
=== Mouse Effects ===
Line 100: Line 276:
</syntaxhighlight>
</syntaxhighlight>
</div>
</div>
</div>
Ubuntu: Screenkey (apt-get install screenkey).  https://www.thregr.org/~wavexx/software/screenkey/#installation-and-basic-usage
=== Window Resize ===
<code>
wmctrl -r ':SELECT:' -e 0,0,0,607,1080
</code>


Ubuntu: Screenkey (apt-get install screenkey).
Korkeampi, joka kadottaa yläpalkin:  
<code>
wmctrl -r ':SELECT:' -e 100,0,0,607,1200
</code>


=== For beginners ===
=== For beginners ===

Latest revision as of 17:46, 7 August 2024

Introduction

Some ideas to create better videos.

ETH Zurich: https://ethz.ch/en/the-eth-zurich/education/innovation/video-in-teaching.html. Eight different uses of videos

  1. Personalising and cooperation
  2. Access to people and special locations
  3. Manipulate time and space
  4. Story-telling
  5. Historical film material
  6. Demonstrations
  7. Counteracting of misconceptions
  8. Explanatory videos: Content and animations

More detailed instructions about videos are available at the link.

Ubuntu 20.04: Key-Mon need a repositoru Ubuntu: Screenkey (apt-get install screenkey installs an old version).


Dramatic structure:

  • Exposition
  • Rising action
  • Climax
  • Falling action
  • Denoemenement

Attenborough Style of presentation: Get into this mindset: your main job is to be an entertainer, not a scientist

  • Tell a story; don’t simply talk about your methods and results.
  • A solid scientific narrative is critical for easy comprehension, and easy comprehension is critical for the D.A. style!
  • Practice your transitions between slides and subjects.
  • Kill clutter. Remove text. Complete sentences are to be banished from your talk.
    • Exception: A single sentence (or sentence fragment) at the top of each slide that capture’s that slide’s main point is a good idea.
  • Only show as much of the slide as people need to understand the point you are making at that precise moment. I
  • Be excited.
  • Be engaged
  • Jokes are tricky, you probably have more to lose than to gain
  • Try not to use a laser pointer

HOW TO STRUCTURE YOUR TALK

  • Phase 1. Setting up the talk.

**Big picture context **Key questions you are investigating (zoom in from the big picture). **Don’t bury the lede. Get quickly to your main result in broad brush strokes, and then move on.

  • Phase 2. Methods and Results

**Keep methods brief. **Answer the questions you raised earlier.

  • Phase 3. Concluding the talk.

**Briefly recap the answers to the questions laid out in the intro. **Provide context for why your results are important in the big picture. See the symmetry? We start with the big picture, and end with the big picture and how your results affect the way we think about the big picture.

  • Some final tips for crafting your talk:

**Know your audience **Anticipate questions and put the answers after your acknowledgements **Don’t bury your conclusions in acknowledgements

Ted talk https://www.fastcompany.com/3022070/the-7-steps-to-delivering-a-mind-blowing-ted-talk # Clear Can listeners repeat your big idea word for word? # Compelling. predictable is boring. "Hmmm. That’s interesting. Tell me more.” # Current # Congruent run it by your gut. Your point of view, not someone else’s. # Commercially Viable # Consistent # Competitive Edge

Theory

Audio: Audacity

  • Record Volume: 0.97 for my setup.
  • Effect -> Noise removal
  • Effect -> Bass boost/ Discant boost
  • Effect -> Truncate Silence 0.2 s + 0.2 s
  • Normalize
  • Normalize
  • Compress


https://blog.audioacrobat.com/2013/01/audacity-trim-peaks-to-boost-loudness-without-clipping/

https://www.instructables.com/How-to-Improve-Vocal-Quality-in-Audacity

Audio: External soundcard

Roland Rubix22 Analog Stereo works directly with Linux. Set Rubix22 Analog Stereo as Input Device, and apply default Input device in Audacity. Should work perfectly but does not.

Audacity clips the mic on 0.5 (-6 dB) instead of 1 on Audacity waveform window while recording on one channel. This is expected behavior because of mono/ stereo. However, to prevent clipping at 0.5 use stereo recording (two channels) and remove the quiet channel by pressing the back arrow next to "Audio 1".

Some microphones I tested:

  • AKG Perception live P5, dynamic with wind shield yields good sound quality. Bit low but amplify using Audacity. No need for noise reduction.

Dynamic Microphone positioning

  • at least 3 (three) fingers between you and the mic. Maybe a fist.
  • The further away, the more room tone.
  • Off-axis. Don't speak directly to mic. No blouses.
  • Headphones.

OBS tips

https://www.youtube.com/c/YoramSolomon/videos

Manim package

See manim at

Short introduction to Manim.

Remove similar frames: FFMPEG

Remove similar frames

ffmpeg -i input.mp4 -vf mpdecimate,setpts=N/FRAME_RATE/TB out.mp4

see more info at https://stackoverflow.com/questions/37088517/remove-sequentially-duplicate-frames-when-using-ffmpeg

Background image

Add a background image using mogrify as a batch job:

mogrify -path ../gyro0_bg/ -format png -draw 'image Dst_Over 0,0 0,0 "../bg.png"' *.png

Video to GIF

Convert video to frames

ffmpeg -i input.mkv -f image2 image-%07d.png

Frames to video

ffmpeg -i image-%07d.png -vf fps=20,scale=720:-1 logo.gif

The smaller palette reduces the size remarkably. Create a palette with 16 colors: ffmpeg -i image-0001111.png -vf palettegen=16 palette.png

and use that to generate with an animated gif 5 fps:

ffmpeg -i image-%07d.png -i palette.png -filter_complex "fps=5,scale=720:-1:flags=lanczos[x];[x][1:v]paletteuse" logo5_palette.gif

Optimize the gif using gifsicle

gifsicle -i input.gif -O3 --colors 16 -o outputt_opt.gif

Light Board

See lightboard.info for great examples, ideas and tutorials.

Reduce flickering

Light sources are interfering with the camera.

https://video.stackexchange.com/questions/23384/remove-flickering-due-to-artificial-light-with-ffmpeg

ffmpeg -fflags +genpts -i flickering.mp4 -fflags +genpts -i flickering.mp4 -filter_complex "[0:v]setpts=PTS-STARTPTS[top]; [1:v]setpts=PTS-STARTPTS+.033/TB, format=yuva420p, colorchannelmixer=aa=0.5[bottom]; [top][bottom]overlay=shortest=1" -c:v libx264 -crf 26 -an NOFLICKER.mp4

The idea here is it's blending the brightness of consecutive frames. That will fix flickering at the framerate, but will all produce ghosting for fast-moving objects.


Duplicate the clip, move one frame and change the opacity to 50%. Needs more than 24fps. You could try also with three clips, 30-60-100. The motion blur is bad if fps is too small.

FFMPEG

Mouse Effects: Linux

Ubuntu: Screenkey (apt-get install screenkey). https://www.thregr.org/~wavexx/software/screenkey/#installation-and-basic-usage

Screen2: screenkey -M -p fixed -g 20%x10%+135%-10% -t 0.5

Screen2 + upwards: screenkey -M -p fixed -g 20%x10%+135%-20% -t 0.5

./screenkey -M -p fixed -g 20%x10%+45%-10% -t 0.5

Mouse Effects

Windows: Keypose, F9, shows keys and mouse.

clickII.ahk by Traycerb shows mouse:

ClickII.ahk
;Visualize mouse clicks by showing radiating concentric circles on mouse click
;Author: traycerb
;Date/Version: 01-31-2018
;
;Source:
;https://superuser.com/questions/106815/how-do-you-add-a-visual-effect-to-a-mouse-click-from-within-windows
;https://autohotkey.com/board/topic/77380-mouse-click-special-effects-for-presentationsdemos/

;Dynamically switch on the Windows accessibility feature to show the mouse when the control key is pressed
;when the script is executed, then switch off afterwards
;Windows settings > Mouse > Pointer Options tab > Visibility group > Show location of pointer when I press CTRL key



;Window's SystemParametersInfo function, retrieves or sets the value of one of the 
;system-wide parameters.  AHK DllCall fxn with SystemParameterInfo parameter is used to access
;this Windows API.
;https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947(v=vs.85).aspx
;BOOL WINAPI SystemParametersInfo(
;  _In_    UINT  uiAction,
;  _In_    UINT  uiParam,
;  _Inout_ PVOID pvParam,
;  _In_    UINT  fWinIni
;);

;uiParam [in]
;Type: UINT
;
;A parameter whose usage and format depends on the system parameter being queried or set. 
;For more information about system-wide parameters, see the uiAction parameter. 
;If not otherwise indicated, you must specify zero for this parameter.

;pvParam [in, out]
;Type: PVOID
;
;A parameter whose usage and format depends on the system parameter being queried or set. 
;For more information about system-wide parameters, see the uiAction parameter. 
;If not otherwise indicated, you must specify NULL for this parameter. 
;For information on the PVOID datatype, see Windows Data Types.

;fWinIni [in]
;Type: UINT
;
;If a system parameter is being set, specifies whether the user profile is to be updated, 
;and if so, whether the WM_SETTINGCHANGE message is to be broadcast to all top-level 
;windows to notify them of the change.

;This parameter can be zero if you do not want to update the user profile 
;or broadcast the WM_SETTINGCHANGE message or it can be set to the following [...]

;Accessibility parameter    
;S0x101D PI_SETMOUSESONAR
;Turns the Sonar accessibility feature on or off. This feature briefly 
;shows several concentric circles around the mouse pointer when the user 
;presses and releases the CTRL key. 
;The pvParam parameter specifies TRUE for on and FALSE for off. 

;Press the control button each time mouse button is pressed, showing location of mouse pointer.
~LButton::
{
  DllCall("user32\SystemParametersInfo", UInt, 0x101D, UInt, 0, UInt, 1, UInt, 0) 
  Send {Ctrl}
  DllCall("user32\SystemParametersInfo", UInt, 0x101D, UInt, 0, UInt, 0, UInt, 0) 
  return
}

~RButton::
{
  DllCall("user32\SystemParametersInfo", UInt, 0x101D, UInt, 0, UInt, 1, UInt, 0) 
  Send {Ctrl}
  DllCall("user32\SystemParametersInfo", UInt, 0x101D, UInt, 0, UInt, 0, UInt, 0) 
  return
}

Ubuntu: Screenkey (apt-get install screenkey). https://www.thregr.org/~wavexx/software/screenkey/#installation-and-basic-usage

Window Resize

wmctrl -r ':SELECT:' -e 0,0,0,607,1080

Korkeampi, joka kadottaa yläpalkin: wmctrl -r ':SELECT:' -e 100,0,0,607,1200

For beginners

High End

Theory