Skip to content

Instantly share code, notes, and snippets.

@6david9
Last active February 12, 2022 16:59
Show Gist options
  • Save 6david9/8d4b149822bb561f518a6e42720bdda7 to your computer and use it in GitHub Desktop.
Save 6david9/8d4b149822bb561f518a6e42720bdda7 to your computer and use it in GitHub Desktop.
transcoding video using nvidia gpu
# https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new
ffmpeg -c:v h264_cuvid -i "input.flv" -c:v h264_nvenc "output.mp4"
# add srt
ffmpeg -i infile.mp4 -i infile.srt -c copy -c:s mov_text outfile.mp4
ffmpeg -i infile.mkv -i infile.srt -c copy -c:s srt outfile.mkv
# resize
ffmpeg -i input.avi -filter:v scale=720:-1 -c:a copy output.mkv
ffmpeg -c:a ac3 -c:v hevc_cuvid -i "input.ts" -filter:v scale=-1:1080 -c:a aac -c:v hevc_nvenc "output.mp4"
# powershell
Powershell.exe -executionpolicy remotesigned -File convert.ps1
# ffprobe with output format json
ffprobe -v quiet -print_format json -show_format -show_streams input.mkv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment