Skip to content

Instantly share code, notes, and snippets.

@MohamedKiouaz
MohamedKiouaz / convert.bat
Created December 30, 2019 15:12
Script to convert using HandbrakeCLI recursively.
for /R E:\ %%F in (*.avi) do (
echo "%%~dpF%%~nF_conv.mp4"
"D:\Downloads\HandBrakeCLI-1.3.0-win-x86_64\HandBrakeCLI.exe" -i "%%~fF" -o "%%~dpF%%~nF_conv.mp4"
if exist "%%~dpF%%~nF_conv.mp4" (
del "%%~fF"
)
)
# ENCODE
# AUDIO
# upmix stereo to 5.1
ffmpeg -i sound.opus -filter_complex "[0:a]pan=5.1(side)|FL=FL|FR=FR|LFE<FL+FR|FC<0.5*FR+0.5*FL|SL=FL|SR=FR[a]" -map 0 -map -0:a -map "[a]" -c copy -c:a flac output.flac
# convert any audio in current dir to mp3 in parallel
ls -1 --file-type | parallel --max-args 1 ffmpeg -i "{}" -vn -ar 44100 -ac 2 -b:a 192k "/path/{.}.mp3"
# VIDEO
# 4k h264/5, practical, small, ok
@SantoshSrinivas79
SantoshSrinivas79 / Using the command line on a terminal like a pro.md
Last active December 13, 2020 02:32
Using the command line on a terminal like a pro

Using the command line on a terminal like a pro

The terminal is extremely powerful and it is now my topmost choice in coding. Here are some useful commands for common tasks that will hopefully help appreciate the power of the command line!

  • List files sorted by time
    • ls -lt
  • List of files sorted by size
    • ls -alS
  • List of files from s3 ... only name:
  • s4cmd ls s3://tempbin/ | grep zerod_archive_ | awk '{print $NF}' | head