Some practical applications of ffmpeg

Creating a blank video source ffmpeg -f lavfi -i color=c=black:s=1366×768:r=25/1 -f lavfi -i anullsrc=cl=mono:r=48000 -c:v h264 -c:a pcm_s16be -t 3 out.mov -y -c:v copy video -c:a copy audio for mp4 remove ‘-c:a pcm_s16be’ Because of Error Could not find tag for codec pcm_s16be ffmpeg -f lavfi -i color=c=black:s=1366×768:r=25/1 -f lavfi -i anullsrc=cl=mono:r=48000 -c:v h264 -t…

Solving common Issues with ffmpeg

Solving common Issues with ffmpeg Painfully slow file operations on ogg and opus files issue Whatsapp recorded files is saved as .ogg When downloaded to windows, it slows windows explorer Solution is Open Cmd go to downloads folder (C:\Users\user\Downloads) convert it to mp3 via ffmpeg delete original ogg file eg: cd downloads ffmpeg -i What.ogg…

AJAX with ‘fetch’

‘fetch’ is a feature added since ES6 GET fetch('http://example.com/movies.json') .then(response => response.json()) .then(data => console.log(data)); POST Old Version var url = 'YOUR URL HERE' var xhr = new XMLHttpRequest() const form = document.getElementById("form-id"); var formData = new FormData(form);// it could be new FormData() also xhr.open('POST', url, true); xhr.addEventListener('readystatechange', function(e) { if (xhr.readyState == 4 &&…

PHPMD PHP Mess Detecter

PHPMD – PHP Mess Detector Git tutorial composer global require "phpmd/phpmd=@stable" ./vendor/bin/phpmd "./vendor/bin/phpmd" "E:/projects/PMUtilities/workflowChart/krithikumarWorkFlowChart/dynamic4Doxygen" html “./vendor/bin/phpmd” ./ html unusedcode –reportfile phpmd.html –exclude vendor,doxyComments if installation is global phpmd classWorkFlow.php html unusedcode –reportfile phpmd.html –exclude vendor,doxyComments phpmd ./ html unusedcode –reportfile phpmd.html –exclude vendor,doxyComments

PHPCS PHP Code Sniffer

PHP_CodeSniffer for PSR 12 full usage composer global require "squizlabs/php_codesniffer=*" phpcs /path/to/code/myfile.php “./vendor/bin/phpcs” classWorkFlow.php –report=summary –report-summary=phpcs.txt “./vendor/bin/phpcs” classWorkFlow.php –report=full –report-full=phpcsPSR12.txt –standard=PSR12 “./vendor/bin/phpcbf” classWorkFlow.php –report=diff -vv –standard=PSR12 “./vendor/bin/phpcs” classWorkFlow.php –report=full –report-full=phpcs.txt if installation is global phpcs classWorkFlow.php –report=full –report-full=phpcs.txt –standard=PSR12 ### To fix automatically use ‘phpcbf’ phpcbf classWorkFlow.php –report=diff -vv –standard=PSR12 $ phpcs /path/to/code-directory $ phpcs…

Crons to backup

To backup Database once in a week Minute Hour Day Month Weekday Command 0 0 * * Sat /usr/bin/mysqldump -u<usernam> -p<password> <dbname> | bzip2 -9 -c ><full path to save>/<output file name>$(date +"\%d_\%m_\%Y-\%H:\%M:\%S").sql.bz2 To delete files older than 2 weeks 26 11 * * 6 find <full path to save>/<output file name>*.sql.bz2 -mtime +8 -exec…