Skip to content

Instantly share code, notes, and snippets.

@maoueh
Last active August 23, 2023 14:08
Show Gist options
  • Save maoueh/5bde742aadb69fd64d27427cb7fe3bb9 to your computer and use it in GitHub Desktop.
Save maoueh/5bde742aadb69fd64d27427cb7fe3bb9 to your computer and use it in GitHub Desktop.
Audio/Video CLI Instructions (ffmpeg cookbooks)

Get Streams Information

ffprobe -hide_banner -i <source_file>
  • Getting a testing sample output

    # Use `-t 120` for a 2 minutes sample
    ffmpeg -hide_banner -i <source_file> -t 120 <rest of arguments>...
  • Force overwrite of existing file

    # Use -y to automatically answer Yes
    ffmpeg -hide_banner -i <source_file> -y <dest_file>

Transcode 3D SBS .mkv into a "mono-eye" .mkv (left-eye)

Stereo3D documentation can be see at http://underpop.online.fr/f/ffmpeg/help/stereo3d.htm.gz.

ffmpeg -hide_banner -i <source_file> -vf stereo3d=sbsl:ml -c:a copy <dest_file>
Try all modes

The sbsl format doesn't work, try them all using output sample and check the one that fits better.

for in_mode in 'sbsl' 'sbsr' 'sbs2l' 'sbs2r' 'abl' 'abr' 'ab2l' 'ab2r' 'al' 'ar' 'irl' 'irr' 'icl' 'icr'; do ffmpeg -hide_banner -t 30 -i <source_file> -vf stereo3d="$in_mode:ml" -c:a copy -y "<dest_file>.$i.<ext>"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment