Linux Commands

## Create empty vhd image

 

dd if=/dev/zero of=name_of_img.img bs=1M count=1024 status=progress

 

dd 

if=/dev/zero input file, this case is /dev/zero, fill the image with 0(empty)

of=name_of_img.img output file

bs=1M block size, 1M should fine for general usb

count=1024 img size, 1024 x 1M = 1024Mb = 1Gb

status=progress show progress when running dd

 

## ffmpeg

ffmpeg -codecs

ffmpeg -formats

 

ffmpeg

-i input file absolute path

-c:v video encoder [copy == same as source]

 

H.264

  • ffmpeg -i input -c:v libx264 -preset slow -crf 22 -c:a copy output.mkv
  • ffmpeg -i input -c:v libx264 -preset ultrafast -qp 0 output.mkv
  • ffmpeg -i input -c:v libx264 -preset veryslow -qp 0 output.mkv

-crf {0-51} 8bit: 0==lossless, default = 23, suggested = 17-28.

-qp 0 10bit lossless

-preset {ultrafast|superfast|veryfast|faster|fast|medium|slow|slower|veryslow|help}

-Tune

-profile:v {baseline|main|high|high10|high422|high444}

 

-c:a audio encoder [copy == same as source] extra link acc

# Lossy formats

libopus > libvorbis >= libfdk_aac > libmp3lame >= eac3/ac3 > aac > libtwolame > vorbis > mp2 > wmav2/wmav1
-b:a {128-320k} bit rate