12 April 2022

How to debug or test python scripts using inspect module and print and input?

At the top of your script, 
from inspect import currentframe, getframeinfo
At the spot where you want to print the value of a variable,
print(f'Line #{getframeinfo(currentframe()).lineno}:\nDescription:\n{varName}\nEnd of Description\n')
input()

05 April 2022

Is there an easier way to reselect the previous selection?

https://www.reddit.com/r/vim/comments/6v4i4u/is_there_an_easier_way_to_reselect_the_previous/

In normal mode, you can use gv to re-select the previous visual selection.

If you just want to re-issue an additional ex command over the same range, you can use * on the command line, as long as "*" isn't in your 'cpoptions' setting.

:'<,'>s/foo/bar/g
:*s/baz/bat/g
:help cpo-star
:help :*
:help v_:

27 March 2022

.dav video files | play | convert to .mp4 | concatenate .mp4 files

1. How to play .dav video files?

Wondershare UniConverter



2. How to convert .dav files into .mp4 files?

>ffmpeg -y -i input-file.dav -c:v libx264 -crf 24 output-file.mp4



3. How to concatenate .mp4 files?

For Linux:
$ cat mylist.txt
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'
    
$ ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4

For Windows:

(echo file 'first file.mp4' & echo file 'second file.mp4' )>list.txt
ffmpeg -safe 0 -f concat -i list.txt -c copy output.mp4