https://ostechnix.com/youtube-dl-tutorial-with-examples-for-beginners/

https://ostechnix.com/20-ffmpeg-commands-beginners/

------------------------------------------------------------------------
ffmpeg
------------------------------------------------------------------------
note: options always apply to the next file 

	#display file information
$ ffmeg -i infile.mp4
$ ffmpeg -i infile.mp4 -hide_banner  #succinct display
	#formats supported by ffmepg
$ ffmpeg -formats

	#extracting portion of a video stream
	# -ss start time (hh:mm:ss)
	# -t duration (seconds or hh:mm:ss)
        # -to end time (hh:mm:ss)

$ ffmpeg -i infile.mp4 -sameq -ss 00:10:15 outfile.mp4   #start at 00:10:15 and go to the end
$ ffmpeg -i infile.mp4 -sameq -t 00:10:15 outfile.mp4    #start at 00:00:00 and end at 00:10:15
$ ffmpeg -ss 00:01:00 -to 00:03:30 -i infile.mp4 -c copy outfile.mp4 #from 01:00 to 03:30

	#convert from one format to the other format
$ ffmpeg -i infile.fmt1 outfile.fmt2   
$ ffmpeg -i infile.avi outfile.mpg  #convert .avi to .mpg   #example
$ ffmepg -i infile.avi -sameeq outfile.mpg  #the output has same quality as infile

	#extracting images from video
$ ffmpeg -i input.mp4 -r 1 -f image2 image-%2d.png
	# -r frame rate or images per second, default is 25
	# -f output format which is "image"
	# image_%2d.png which means first image is image_01.png and so on

	#speeding up or slowing down video files
$ ffmpeg -i input.mp4 -filter:v "setpts=xx*PTF" output.mp4
        Set fac>1 to slow down and fac<1 to speed up.
        eg. "setpts=0.5*PTS" or "setpts=4.0*PTS" 
        here PTS=presentation time stamp (and acts like sampling interval)

	#compressing video files
$ ffmpeg -i input.mp4 -vf scale=1280:-1 -c:v libx264 -preset veryslow -crf 24 output.mp4
	#crf controls the compression. if 24 is too agressive try 23 and so on
References:
http://keycorner.org/pub/text/doc/ffmpeg-tutorial.htm