Skip to content

Instantly share code, notes, and snippets.

@ojacques
Created December 20, 2021 22:13
Show Gist options
  • Save ojacques/687f7789e304b33fc4d1a36557e1cc5f to your computer and use it in GitHub Desktop.
Save ojacques/687f7789e304b33fc4d1a36557e1cc5f to your computer and use it in GitHub Desktop.
Batch encode GoPRO 4K H265 to H265 with ffmpeg

Use case

Filming with GoPro with H.265, but editing with software which does not support H.265 (like Magix FastCut). Let's convert all those files to H.264, leveraging GPU (like NVidia RTX 3070 -> ~2x speed at 4K->4K)

One liner

for f in *.MP4; do ffmpeg -hwaccel cuvid -i "$f" -map 0 -c copy -c:v h264_nvenc -qp 20 -tune hq -crf 25 -preset slow h264vids/"${f%.*}.mp4"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment