Skip to content

Instantly share code, notes, and snippets.

@s-steephan
Last active November 18, 2021 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s-steephan/b88cd74a1d50b7cd17ec107371ea9377 to your computer and use it in GitHub Desktop.
Save s-steephan/b88cd74a1d50b7cd17ec107371ea9377 to your computer and use it in GitHub Desktop.
important terminal comments

ffmpeg Convert Comments

for i in *.asf; do ffmpeg -i $i -bsf:v h264_mp4toannexb -c:v copy $i.mp4; done

ffmpeg -ss 00:00:00 -i NVR_ch1_main_20180712001236_20180712005603.dav.mp4 -t 00:21:00 -vcodec copy -acodec copy newfile.mp4

Partial mysql dump

mysqldump -u root -p violet --ignore-table=violet.challan --where='1 limit 100'> all.sql 
mysqldump -u root -p violet challan --where='1 limit 100' > challan.sql

To apply mask to all images

# replace mask.png with your mask file name.

for i in *.png; do convert $i  mask.png -gravity center -composite $i; done 

To record screen using ffmpeg in windows

C:
cd \Users\vignesh\Desktop\meet\
set dt=%DATE:~6,4%_%DATE:~3,2%_%DATE:~0,2%_%TIME:~0,2%_%TIME:~3,2%_%TIME:~6,2%
set dt=%dt: =0%
.\ffmpeg -f dshow -i audio="Stereo Mix (Realtek(R) Audio)" -f dshow -i audio="@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{F7C38127-0E67-4EF9-A663-42F46311483A}" -f gdigrab -itsoffset 00:00:0.6 -framerate 25 -video_size 1920x1080 -draw_mouse 1 -i desktop -filter_complex "[0:a][1:a]amerge=inputs=2[a]" -map 2 -map "[a]" Recordings/%dt%.avi



.\bin\ffmpeg -f dshow -i audio="Stereo Mix (Realtek(R) Audio)" -f dshow -i audio="@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{F7C38127-0E67-4EF9-A663-42F46311483A}" -f gdigrab -itsoffset 00:00:0.6 -framerate 60 -video_size 1920x1080 -draw_mouse 1 -i desktop -filter_complex "[0:a][1:a]amerge=inputs=2[a]" -map 2 -map "[a]" -qscale:v 1.2 Recordings/%dt%.avi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment