Last active
August 29, 2025 10:08
-
-
Save robinfang/1d765e4a60145ac0aeea50145aa1c4e2 to your computer and use it in GitHub Desktop.
ffmpeg压缩视频,调用显卡
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ffmpeg -hwaccel cuvid -i meeting.mp4 -c:v h264_nvenc -crf 24 meeting_compressed.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ffmpeg -y -vsync 0 -hwaccel cuvid -i a.MOV -c:v h264_nvenc -b:v 2M -vf scale_cuda=format=yuv420p a.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ffmpeg -i input.m4v -map_metadata 0 -metadata:s:v rotate="180" -codec copy output.m4v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| pushd "%~dp0" | |
| for %%I in (%*) do ( | |
| ffmpeg -y -hwaccel cuvid -i "%%~fI" -c:v h264_nvenc -b:v 2M -vf scale_cuda=-2:720:format=yuv420p,fps=30 "%%~dpnI_c.mp4" | |
| ) | |
| pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| pushd "%~dp0" | |
| for %%I in (%*) do ( | |
| ffmpeg -y -hwaccel qsv -i "%%~fI" -c:v h264_qsv -b:v 3M "%%~dpnI_c.mp4" | |
| ) | |
| pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| pushd "%~dp0" | |
| for %%I in (%*) do ( | |
| ffmpeg -y -hwaccel cuvid -hwaccel_output_format cuda -noautorotate -i "%%~fI" -c:v h264_nvenc -b:v 4M -vf scale_cuda=format=yuv420p "%%~dpnI_c.mp4" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| pushd "%~dp0" | |
| for %%I in (%*) do ( | |
| ffmpeg -y -vsync 0 -hwaccel cuvid -i "%%~fI" -c:v h264_nvenc -b:v 3M -vf scale_cuda=format=yuv420p "%%~dpnI_c.mp4" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| pushd "%~dp0" | |
| for %%I in (%*) do ( | |
| ffmpeg -y -vsync 0 -hwaccel cuvid -hwaccel_output_format cuda -noautorotate -i "%%~fI" -c:v h264_nvenc -b:v 3M -vf scale_cuda=format=yuv420p -filter:v fps=30 "%%~dpnI_c.mp4" | |
| ) |
Author
Author
ffmpeg下载(建议下载master full版本):
https://www.gyan.dev/ffmpeg/builds/
另外需要一块NVIDIA显卡,升级到最新驱动
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://superuser.com/questions/1663872/cant-convert-with-ffmpeg-using-nvenc-10-bit-encode-not-supported
解决 Provided device doesn't support required NVENC features